byucc.edif.jhdl
Class Edi2JHDL

java.lang.Object
  extended bybyucc.edif.jhdl.Edi2JHDL

public class Edi2JHDL
extends java.lang.Object

Generates a JHDL circuit for the designated EdifCellInstance.

TO-DO:

  1. Add property support
  2. Modify according to coding standard

Version:
$Id: Edi2JHDL.java,v 1.61 2004/12/09 21:26:46 tsa6 Exp $
Author:
Welson Sun, Tyler Anderson

Field Summary
static java.lang.String EDIF_CELL_INSTANCE_PROPERTY
          The name of the JHDL Cell property to find the corresponding EdifCell, if needed.
private  java.lang.String technology
          the targeting technology name
 
Constructor Summary
Edi2JHDL(java.lang.String techName)
          Constructs an Edi2JHDL Object with the specified name.
 
Method Summary
protected  void addProperties(EdifCellInstance cellInst, byucc.jhdl.base.Cell cell)
          Add properties to the JHDL Cell according to the EdifCellInstance.
protected  void addProperties(EdifCellInstance cellInst, byucc.jhdl.base.Cell cell, boolean addEdifCellInstanceAsProperty)
           
private  boolean containsPortName(EdifCell cell, java.lang.String portName)
          Returns true if the EdifCell contains a port with named after the given String.
protected  byucc.jhdl.base.Cell createBlackBoxModel(byucc.jhdl.base.Cell parent, EdifCellInstance cellInstance, byucc.jhdl.base.Wire[] portWires)
          Create a black box for the EDIF cell that is not in the JHDL library.
protected  void createLeafCell(byucc.jhdl.base.Cell parent, EdifCellInstance leafCell, java.util.ArrayList wires)
           
protected  void createLeafCell(byucc.jhdl.base.Cell parent, EdifCellInstance leafCell, java.util.ArrayList wires, boolean addEdifCellInstanceAsProperty)
          Create the leaf cell as the sub cell of the parent cell.
protected  void createSubCellWires(EdifCellInstance subcell, EdifCellInstance parentCell, java.util.ArrayList wires, byucc.jhdl.base.Cell jhdlInstance, java.util.HashMap internalWires, java.util.Map instToMap)
          Creates an ArrayList of JHDL Wire Objects to connect with the ports of the sub cell.
static java.lang.String JHDL_ID(java.lang.String id)
          This method will change a name to a JHDL qualified name.
private static int parseMemDepth(java.lang.String name)
          Method used to parse the depth of the ram or rom (in ramMxN its the number associated with 'N'.
private static java.lang.String parseMemMxNPropertyLength(java.lang.String name)
          In ramMxN, this method returns the 'M' for ram or roms.
protected  java.lang.String portConnected(EdifPort port, int busMember, EdifCellInstance subCellInstance, java.util.Map instToMap)
          Get the connected net name that the port (can be a bus port member also) of the subCellInstance connects to in the nets of the parent CellInstance.
 byucc.jhdl.base.Cell toJHDLCircuit(byucc.jhdl.base.Cell parent, EdifCellInstance cellInstance, byucc.jhdl.base.Wire[] portWires)
           
 byucc.jhdl.base.Cell toJHDLCircuit(byucc.jhdl.base.Cell parent, EdifCellInstance cellInstance, byucc.jhdl.base.Wire[] portWires, boolean addEdifCellInstanceAsProperty)
          This method will create a JHDL Cell for an EdifCellInstance object, as a sub JHDL Cell of the "parent" JHDL Cell, and connect all the passed in JHDL Wires to the created JHDL Cell's ports, and finally, it will return this created JHDL Cell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EDIF_CELL_INSTANCE_PROPERTY

public static final java.lang.String EDIF_CELL_INSTANCE_PROPERTY
The name of the JHDL Cell property to find the corresponding EdifCell, if needed.

See Also:
Constant Field Values

technology

private java.lang.String technology
the targeting technology name

Constructor Detail

Edi2JHDL

public Edi2JHDL(java.lang.String techName)
Constructs an Edi2JHDL Object with the specified name.

Parameters:
techName - The technology for JHDL
Method Detail

addProperties

protected void addProperties(EdifCellInstance cellInst,
                             byucc.jhdl.base.Cell cell)
Add properties to the JHDL Cell according to the EdifCellInstance. It retrieves the properties from the EdifCellInstance and adds them to the JHDL Cell as well.

Parameters:
cellInst - Takes all of this EdifCell's Property Objects, and adds them to the JHDL Cell
cell - The JHDL Cell that will get all of the EdifCell's Properties

addProperties

protected void addProperties(EdifCellInstance cellInst,
                             byucc.jhdl.base.Cell cell,
                             boolean addEdifCellInstanceAsProperty)
Parameters:
addEdifCellInstanceAsProperty - If true, this flag adds a property to the JHDL cell whose key is held by the string EDIF_CELL_INSTANCE_PROPERTY, and whose value is an EdifCellInstance.

containsPortName

private boolean containsPortName(EdifCell cell,
                                 java.lang.String portName)
Returns true if the EdifCell contains a port with named after the given String.

Parameters:
cell - The cell whose EdifPort Objects will be checked
Returns:
True if the EdifCell contains a port named after the given String

createBlackBoxModel

protected byucc.jhdl.base.Cell createBlackBoxModel(byucc.jhdl.base.Cell parent,
                                                   EdifCellInstance cellInstance,
                                                   byucc.jhdl.base.Wire[] portWires)
Create a black box for the EDIF cell that is not in the JHDL library. This is done by Creating an empty JHDL Cell, EdifBlackBoxCell, inserting the ports, and connecting them to wires. On each clock, this black box cell will put 0s on each of it's out/inout wires.

Parameters:
parent - The parent cell to the black box cellInstance
cellInstance - The EdifCellInstance referring to a black box EdifCell
portWires - An ArrayList of Wire Objects
Returns:
A JHDL representation of the EdifCellInstance

createLeafCell

protected void createLeafCell(byucc.jhdl.base.Cell parent,
                              EdifCellInstance leafCell,
                              java.util.ArrayList wires)

createLeafCell

protected void createLeafCell(byucc.jhdl.base.Cell parent,
                              EdifCellInstance leafCell,
                              java.util.ArrayList wires,
                              boolean addEdifCellInstanceAsProperty)
Create the leaf cell as the sub cell of the parent cell. This is done by:
  1. Collecting initialization properties for block rams, flip flops luts, rams, and roms
  2. Retrieve the class to load
  3. Retrieve the class and object array for obtaining and initializing the constructor
  4. Retrieve the INIT and INIT_XX properties for the various memories
  5. Fill in the class and object arrays with the arguments to pass to the constructor for JHDL class initialization
  6. Finally, retrieve and initialize the JHDL class

Parameters:
parent - The parent of the created leaf cell
leafCell - The EdifCellInstance that represents the leafCell
wires - An ArrayList of Wire Objects

createSubCellWires

protected void createSubCellWires(EdifCellInstance subcell,
                                  EdifCellInstance parentCell,
                                  java.util.ArrayList wires,
                                  byucc.jhdl.base.Cell jhdlInstance,
                                  java.util.HashMap internalWires,
                                  java.util.Map instToMap)
Creates an ArrayList of JHDL Wire Objects to connect with the ports of the sub cell.

Parameters:
subcell - The subcell to the parentCell for creating wires
parentCell - The parent to the subcell
wires - The Collection that will contain the created Wire Objects
jhdlInstance - Used to create the JDHL Wire objects
internalWires - JHDL Wire Objects

JHDL_ID

public static java.lang.String JHDL_ID(java.lang.String id)
This method will change a name to a JHDL qualified name.

Parameters:
id - The String to make JHDL-valid
Returns:
A JHDL-valid String

parseMemDepth

private static int parseMemDepth(java.lang.String name)
Method used to parse the depth of the ram or rom (in ramMxN its the number associated with 'N'.

Parameters:
name - The name of the ram or rom
Returns:
The depth of the ram or rom

parseMemMxNPropertyLength

private static java.lang.String parseMemMxNPropertyLength(java.lang.String name)
In ramMxN, this method returns the 'M' for ram or roms.

Parameters:
name - The name of the class to parse
Returns:
The initialization String for this ram or rom

portConnected

protected java.lang.String portConnected(EdifPort port,
                                         int busMember,
                                         EdifCellInstance subCellInstance,
                                         java.util.Map instToMap)
Get the connected net name that the port (can be a bus port member also) of the subCellInstance connects to in the nets of the parent CellInstance.

Parameters:
port - The EdifPort Object owned by the subCellInstance
busMember - The bus member of the EdifPortRef
subCellInstance - The EdifCellInstance owning port

toJHDLCircuit

public byucc.jhdl.base.Cell toJHDLCircuit(byucc.jhdl.base.Cell parent,
                                          EdifCellInstance cellInstance,
                                          byucc.jhdl.base.Wire[] portWires)

toJHDLCircuit

public byucc.jhdl.base.Cell toJHDLCircuit(byucc.jhdl.base.Cell parent,
                                          EdifCellInstance cellInstance,
                                          byucc.jhdl.base.Wire[] portWires,
                                          boolean addEdifCellInstanceAsProperty)
This method will create a JHDL Cell for an EdifCellInstance object, as a sub JHDL Cell of the "parent" JHDL Cell, and connect all the passed in JHDL Wires to the created JHDL Cell's ports, and finally, it will return this created JHDL Cell.

Parameters:
parent - a Cell
cellInstance - an EdifCellInstance
portWires - a Wire[]
Returns:
a Cell