byucc.edif
Class EdifEnvironment

java.lang.Object
  extended by byucc.edif.NamedPropertyObject
      extended by byucc.edif.EdifEnvironment
All Implemented Interfaces:
EdifOut, Nameable, Properties, java.io.Serializable

public class EdifEnvironment
extends NamedPropertyObject
implements EdifOut, java.io.Serializable

Represents a complete EdifEnvironment. This class contains a EdifLibraryManager (collection of Edif libraries) and a top-level design (EdifDesign).

Version:
$Id: EdifEnvironment.java,v 1.31 2005/08/03 19:29:55 nhr2 Exp $
Author:
Welson Sun, Mike Wirthlin, Tyler Anderson
See Also:
EdifDesign, EdifLibraryManager, Serialized Form

Field Summary
private  EdifLibraryManager _libraries
          The EdifLibrary objects of this file.
private  EdifDesign _topDesign
          The top-level design in the EdifEnvironment.
 
Constructor Summary
EdifEnvironment(EdifNameable name)
          Constructs an EdifEnvironment Object with the passed-in EdifNameable as its name Object.
EdifEnvironment(java.lang.String name)
          Constructs an EdifEnvironment Object with the passed-in string as its name.
 
Method Summary
 void addLibrary(EdifLibrary library)
          Adds the passed-in library to the appropriate position.
static EdifEnvironment deSerialize(java.lang.String filename)
          De-serializes and returns an EdifEnvironment object, along with each of its respective sub and super objects.
 EdifLibrary getLibrary(java.lang.String lib)
          Returns the library that matches the passed in string.
 EdifLibraryManager getLibraryManager()
          Returns the library manager.
 EdifCell getTopCell()
          Returns the top cell of the design.
 EdifCellInstance getTopCellInstance()
          Returns the top instance of the design.
 EdifDesign getTopDesign()
          Returns the top design.
static void serialize(java.lang.String filename, EdifEnvironment toWrite)
          Serializes the passed in EdifEnvironment, and writes it to the file specified by the given filename.
 void setTopDesign(EdifDesign design)
          Sets the top design.
 void tagLeafCellsAsPrimitives()
          Tags leaf cells as primitives.
 void tagPrimitives(EdifLibrary primitives)
          Tags all EdifCell objects that are found in the given library as a "primitive".
 void toEdif(EdifPrintWriter epw)
          Converts this Object to EDIF format and prints it to the passed in EdifPrintWriter.
 java.lang.String toString()
          Returns a String representation of this object.
 void trimToSize()
          Trims this object, and any other Trimmable Objects that it contains down to size.
 
Methods inherited from class byucc.edif.NamedPropertyObject
addProperty, addProperty, copyProperties, equals, equalsProperties, getEdifNameable, getName, getOldName, getProperty, getPropertyList, rename, rename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_libraries

private EdifLibraryManager _libraries
The EdifLibrary objects of this file. The key of this Map is the name of the library and the value is the EdifLibrary object.


_topDesign

private EdifDesign _topDesign
The top-level design in the EdifEnvironment.

Constructor Detail

EdifEnvironment

public EdifEnvironment(java.lang.String name)
Constructs an EdifEnvironment Object with the passed-in string as its name.

Parameters:
name - The name of the constructed EdifEnvironment Object

EdifEnvironment

public EdifEnvironment(EdifNameable name)
Constructs an EdifEnvironment Object with the passed-in EdifNameable as its name Object.

Parameters:
name - The EdifNameable name of the constructed EdifEnvironment Object
Method Detail

addLibrary

public void addLibrary(EdifLibrary library)
Adds the passed-in library to the appropriate position.

Parameters:
library - The library to add

getLibraryManager

public EdifLibraryManager getLibraryManager()
Returns the library manager.

Returns:
This EdifEnvironment's EdifLibraryManager

getLibrary

public EdifLibrary getLibrary(java.lang.String lib)
Returns the library that matches the passed in string.

Parameters:
lib - The String name to match for when fetching the library

getTopCellInstance

public EdifCellInstance getTopCellInstance()
Returns the top instance of the design.

Returns:
The top EdifCellInstance of this design

getTopCell

public EdifCell getTopCell()
Returns the top cell of the design.

Returns:
The top EdifCell of this design

getTopDesign

public EdifDesign getTopDesign()
Returns the top design.

Returns:
The top EdifDesign Object of this EdifEnvironment

deSerialize

public static EdifEnvironment deSerialize(java.lang.String filename)
De-serializes and returns an EdifEnvironment object, along with each of its respective sub and super objects. De-serializing takes the previously serialized EdifEnvironment from the specified file, leaving nothing out.

Parameters:
filename - The filename to de serialize and obtain a previously serialized EdifEnvironment Object
Returns:
A previously serialized EdifEnvironment Object

serialize

public static void serialize(java.lang.String filename,
                             EdifEnvironment toWrite)
Serializes the passed in EdifEnvironment, and writes it to the file specified by the given filename. This serialized EdifEnvironment Object can later be re-loaded using the deSerialize(String) method.

Parameters:
filename - The filename to store the serialized EdifEnvironment Object
toWrite - The EdifEnvironment Object to serialize and store at the given filename

setTopDesign

public void setTopDesign(EdifDesign design)
Sets the top design.

Parameters:
design - The object that will become the new design for this EdifEnvironment

tagLeafCellsAsPrimitives

public void tagLeafCellsAsPrimitives()
Tags leaf cells as primitives.

See Also:
EdifLibraryManager.tagLeafCellsAsPrimitives()

tagPrimitives

public void tagPrimitives(EdifLibrary primitives)
Tags all EdifCell objects that are found in the given library as a "primitive".

Parameters:
primitives - The library of primitives to compare cells to
See Also:
EdifLibraryManager.tagPrimitives(byucc.edif.EdifLibrary)

toEdif

public void toEdif(EdifPrintWriter epw)
Converts this Object to EDIF format and prints it to the passed in EdifPrintWriter.

Specified by:
toEdif in interface EdifOut
Parameters:
epw - The EdifPrintWriter that the EDIF data will be written to

toString

public java.lang.String toString()
Returns a String representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
A String representing the name and libraries contained in this EdifEnvironment Object

trimToSize

public void trimToSize()
Trims this object, and any other Trimmable Objects that it contains down to size.