byucc.jhdl.netlisters.jhdl
Class JHDLNetlistWriter

java.lang.Object
  extended bybyucc.jhdl.netlisters.jhdl.JHDLNetlistWriter

public class JHDLNetlistWriter
extends java.lang.Object

Writes JHDL classes (i.e. netlists in Java) for 'Cell' objects that are currently instantiated. The cell object in memory is queried for necessary information, and then a class (.java) file is written in the standard JHDL format: cell_interface is declared, a constructor (with the proper wire parameters passed in, connect() calls for those wires, and child objects instantiated) is declared. This class is used in a test bench very similarly to any other netlister, i.e.:

  1. instantiate the object you want to netlist
      Cell my_obj = new MyClass(...);
     
  2. instantiate the netlister, passing the constructor the cell to netlist
      JHDLNetlistWriter my_netlister JHDLNetlistWriter(my_obj);
     
  3. call the method writeTree()
      my_netlister.writeTree();
     

Author:
Eric Roesler

Constructor Summary
JHDLNetlistWriter(Cell tp)
           
JHDLNetlistWriter(Cell tp, java.lang.String target)
           
JHDLNetlistWriter(Cell tp, java.lang.String target, java.lang.String filename)
           
 
Method Summary
protected  void addObjectProperties(Cell c)
          iterate through all of the CellProperties for a cell, and if any exist, write them out as an 'addProperty' JHDL call.
 void writeCell()
          Writes out JHDL source for the cell stored in the class variable 'c'.
 void writeTree()
          Using top as the new top of the tree (recusively speaking), get all of the children and visit them post-transversal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JHDLNetlistWriter

public JHDLNetlistWriter(Cell tp)

JHDLNetlistWriter

public JHDLNetlistWriter(Cell tp,
                         java.lang.String target)

JHDLNetlistWriter

public JHDLNetlistWriter(Cell tp,
                         java.lang.String target,
                         java.lang.String filename)
Method Detail

writeTree

public void writeTree()
Using top as the new top of the tree (recusively speaking), get all of the children and visit them post-transversal. If none exist, visit this cell by calling writeCell() on it, spitting out JHDL code for this cell.


writeCell

public void writeCell()
Writes out JHDL source for the cell stored in the class variable 'c'. Each part of a standard jhdl class is written out. Generally this method should not be called directly - use writeTree() to write out the source for the whole tree of objects.


addObjectProperties

protected void addObjectProperties(Cell c)
iterate through all of the CellProperties for a cell, and if any exist, write them out as an 'addProperty' JHDL call. This adds support for cell properties, so that they don't get filtered out when objects are written out as JHDL.

Parameters:
c - cell whose properties should be extracted


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