byucc.jhdl.netlisters
Class Netlister

java.lang.Object
  extended bybyucc.jhdl.netlisters.Netlister
Direct Known Subclasses:
EDIFNetlister, OptNetlister, VHDLNetlister

public abstract class Netlister
extends java.lang.Object

This is the superclass for netlisters, classes that can convert from the internal representation of JHDL to file outputs of another format.

Author:
Eric Blake

Field Summary
protected  boolean flat_netlist
          Whether the netlist should be flat.
protected static JHDLOutput jout
          Where to print messages during the netlist
protected static boolean printTimestamp
          Whether or not to print a timestamp, if that makes sense.
protected  Cell topcell
          The root cell of the netlist
 
Constructor Summary
protected Netlister()
          Construct a Netlister that ignores the #flatNetlist flag.
protected Netlister(boolean flat_netlist)
          Construct a Netlister, with the given behavior of flat vs.
 
Method Summary
protected abstract  void expand(Cell c, NetlistWriter output)
          Given a cell, returns the text to go in the output file for cell expansion.
protected abstract  void footer(Cell c, NetlistWriter output)
          Given a cell, returns any concluding text to go in the output file after cell expansion
abstract  java.lang.String generateFilename(Cell c)
          Given a cell, generate the default file name to place its netlist in
 boolean getFlatNetlistFlag()
          Returns the current value of whether EDIF netlisting will be flat.
static boolean getPrintTimestamp()
          Returns whether the netlist will include a timestamp, if that makes sense.
protected abstract  void header(Cell c, NetlistWriter output)
          Given a cell, returns any initial text to go in the output file before cell expansion
 void netlist(Cell top)
          Netlists the given cell and its hierarchical subtree.
 void netlist(Cell top, boolean flat)
          Netlists the given cell and its hierarchical subtree
 void netlist(Cell top, boolean flat, NetlistWriter output)
          Netlists the given cell and its hierarchical subtree.
 void netlist(Cell top, boolean flat, java.lang.String filename)
          Netlists the given cell and its hierarchical subtree
 void netlist(Cell top, java.lang.String filename)
          Netlists the given cell and its hierarchical subtree
 boolean setFlatNetlistFlag(boolean flag)
          Sets whether the netlist should be flat (the contents of the top-level cell are netlisting primitives) or hierarchical (there can be intermediate cells between the top level and primitives).
static boolean setPrintTimestamp(boolean b)
          Sets whether the netlist will include a timestamp, if that makes sense.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jout

protected static JHDLOutput jout
Where to print messages during the netlist


topcell

protected Cell topcell
The root cell of the netlist


printTimestamp

protected static boolean printTimestamp
Whether or not to print a timestamp, if that makes sense. Default true


flat_netlist

protected boolean flat_netlist
Whether the netlist should be flat. Set by the constructor Netlister(boolean). If this does not make sense for a given netlister, it may be ignored.

Constructor Detail

Netlister

protected Netlister()
Construct a Netlister that ignores the #flatNetlist flag.


Netlister

protected Netlister(boolean flat_netlist)
Construct a Netlister, with the given behavior of flat vs. heirarchical

Parameters:
flat_netlist - whether the netlist should be flat (if that makes sense)
Method Detail

setPrintTimestamp

public static final boolean setPrintTimestamp(boolean b)
Sets whether the netlist will include a timestamp, if that makes sense.

Parameters:
b - the new value of the timestamp flag.
Returns:
the prior value

getPrintTimestamp

public static final boolean getPrintTimestamp()
Returns whether the netlist will include a timestamp, if that makes sense.

Returns:
the current value of the timestamp flag

setFlatNetlistFlag

public final boolean setFlatNetlistFlag(boolean flag)
Sets whether the netlist should be flat (the contents of the top-level cell are netlisting primitives) or hierarchical (there can be intermediate cells between the top level and primitives).

Parameters:
flag - the new value of the flag
Returns:
the prior value
See Also:
getFlatNetlistFlag()

getFlatNetlistFlag

public final boolean getFlatNetlistFlag()
Returns the current value of whether EDIF netlisting will be flat. Default false.

Returns:
the status of the flat netlisting flag

netlist

public final void netlist(Cell top)
Netlists the given cell and its hierarchical subtree. With no parameter for the file or NetlistWriter, a file will be created with a filenme generated from the cell name.

Parameters:
top - the cell to netlist
Throws:
NetlistException - if the netlist fails

netlist

public final void netlist(Cell top,
                          boolean flat)
Netlists the given cell and its hierarchical subtree

Parameters:
top - the cell to netlist
flat - whether the netlist should be flat (calls setFlatNetlistFlag(boolean))
Throws:
NetlistException - if the netlist fails

netlist

public final void netlist(Cell top,
                          boolean flat,
                          java.lang.String filename)
Netlists the given cell and its hierarchical subtree

Parameters:
top - the cell to netlist
flat - whether the netlist should be flat (calls setFlatNetlistFlag(boolean))
filename - the target file for the netlist
Throws:
NetlistException - if the netlist fails MJW: I think we should remove all netlist calls with a String parameter. It should be the callers responsibility (i.e. the TechMapper) to determine the destination of the data. It is very messy to deal with all these calls to netlist that have both String parameters and NetlistWriter parameters. I have left the netlist methods with String parameters for fear I will break something if I take it out.

netlist

public void netlist(Cell top,
                    boolean flat,
                    NetlistWriter output)
Netlists the given cell and its hierarchical subtree. This will write the netlist to the given NetlistWriter. By passing in a NetlistWriter, the caller has a lot of control on the actual location of the output.

Parameters:
top - the cell to netlist
output - the NetlistWriter to which the netlist will be written
Throws:
NetlistException - if the netlist fails

netlist

public void netlist(Cell top,
                    java.lang.String filename)
Netlists the given cell and its hierarchical subtree

Parameters:
top - the cell to netlist
filename - the target file for the netlist
Throws:
NetlistException - if the netlist fails MJW: I think we should remove all netlist calls with a String parameter. It should be the callers responsibility (i.e. the TechMapper) to determine the destination of the data. It is very messy to deal with all these calls to netlist that have both String parameters and NetlistWriter parameters. I have left the netlist methods with String parameters for fear I will break something if I take it out.

generateFilename

public abstract java.lang.String generateFilename(Cell c)
Given a cell, generate the default file name to place its netlist in

Parameters:
c - the cell to generate the filename for
Returns:
a String containing the filename

header

protected abstract void header(Cell c,
                               NetlistWriter output)
Given a cell, returns any initial text to go in the output file before cell expansion

Parameters:
c - the top-level cell for which the netlist is being generated
output - the NetlistWriter to print the netlist to

expand

protected abstract void expand(Cell c,
                               NetlistWriter output)
Given a cell, returns the text to go in the output file for cell expansion. Can be used recursively to expand an entire tree.

Parameters:
c - the cell to be expanded
output - the NetlistWriter to print the netlist to

footer

protected abstract void footer(Cell c,
                               NetlistWriter output)
Given a cell, returns any concluding text to go in the output file after cell expansion

Parameters:
c - the top-level cell for which the netlist is being generated
output - the NetlistWriter to print the netlist to


Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.