EDIFSemanticsCAtomNameEqll.Mesa
Spreitzer, February 24, 1986 9:24:44 pm PST
DIRECTORY Atom, BasicTime, EDIFDataStructure, EDIFfing, EDIFGrammar, EDIFSemantics, HashTable, Rope;
EDIFSemanticsCell: CEDAR PROGRAM
IMPORTS Atom, EDIFGrammar, EDIFSemantics, HashTable
= {OPEN EDIFfing, EDIFDataStructure, EDIFGrammar, EDIFSemantics;
DefineEm: PROC = {
SS[DL[$Library, LIST[NameDef[], Opt[$Status], Opt[$Technology], Opt[$Rename], StarCh[LIST[$Cell, $Comment, $UserData]] ]],
[BeforeLibrary, AfterLibrary, SeeLibraryField]];
[] ← DL[$Technology, LIST[NameDef[], Opt[$NumberDefinition], StarCh[LIST[$Define, Oo[$Rename], $SimulationInfo, $SimulationMap, Oo[$GridMap], Oo[$FigureGroupDefault], $Comment, $UserData, $Level1Ctl, $Level2Ctl]] ]];
[] ← DL[$NumberDefinition, LIST[$UnitSystem, StarCh[LIST[$Scale, $Comment, $UserData]] ]];
[] ← DC[$UnitSystem, LIST["si", $Identifier]];
[] ← DL[$Scale, LIST[$UnitType, $Number, $Number]];
[] ← DC[$UnitType, LIST["capacitance", "current", "distance", "resistance", "termperature", "time", "voltage"]];
[] ← DL[$SimulationInfo, LIST[NameDef[], $SimulationValue, $Arbitrate, $Isolated, Opt[$Rename]]];
[] ← DL[$SimulationValue, LIST[Star[NameDef[]]]];
[] ← DL[$Arbitrate, LIST[$Pairwise]];
[] ← DL[$Pairwise, LIST[Star[NameRef[]]]];
[] ← DL[$Isolated, LIST[NameRef[]]];
[] ← DL[$SimulationMap, LIST[$Reference, $Reference, StarCh[LIST[$StateMap, $Comment, $UserData]] ]];
[] ← DL[$StateMap, LIST[Plus[NameRef[]]]];
[] ← DL[$GridMap, LIST[$Number, $Number]];
[] ← DL[$FigureGroupDefault, LIST[StarCh[LIST[$FigureGroupSpecification, $Comment, $UserData]] ]];
[] ← DL[$FigureGroupSpecification, LIST[NameRef[], StarCh[LIST[Oo[$Width], Oo[$PathType], Oo[$BorderPattern], Oo[$FillPattern], Oo[$Color], $Comment, $UserData]] ]];
[] ← DL[$Width, LIST[$Coordinate]];
[] ← DC[$Coordinate, LIST[$WholeNumber], 0, 0];
[] ← DC[$Coordinate, LIST[$Expression], 1];
[] ← DL[$PathType, LIST[$Style, $Style]];
[] ← DC[$Style, LIST["extend", "truncate", "round"]];
[] ← DL[$BorderPattern, LIST[$Integer, $String]];
[] ← DL[$FillPattern, LIST[$Integer, $Integer, $String]];
[] ← DL[$Color, LIST[$Integer, $Integer, $Integer]];
[] ← DL[$Define, LIST[$Direction, $Type, $DefineObjects, Opt[Limit[$Default, 1]], Star[$Rename]]];
[] ← DC[$Direction, LIST["local", "input", "inout", "output", "unspecified"]];
[] ← DC[$Type, LIST["figuregroup", "port", "signal", Limit["String", 1], Limit["Integer", 1], Limit["Number", 1], Limit["Boolean", 1], Limit["Point", 1], Limit[$UnitType, 1]]];
[] ← DQ[$DefineObjects, LIST[$Multiple, Star[$DefineObject]], $DefineObject];
[] ← DC[$DefineObject, LIST[NameDef[], $ArrayDefinition]];
[] ← DL[$ArrayDefinition, LIST[NameDef[], Star[$WholeNumber]]];
[] ← DL[$Default, LIST[Star[$PrimitiveData]], 1];
[] ← DC[$PrimitiveData, LIST[$Primitive, $True, $False]];
SS[DL[$Cell, LIST[NameDef[], Opt[$Status], Opt[$Rename], Opt[$ViewMap], StarCh[LIST[$View, $Comment, $UserData]] ]],
[BeforeCell, AfterCell, SeeCellField]];
[] ← DL[$ViewMap, LIST[StarCh[LIST[$PortMap, $InstanceMap, $Comment, $UserData, $Level2Ctl]] ]];
};
BeforeLibrary: Beforer = {
l: Library = NEW [LibraryPrivate ← [
cells: MakeRopeDict[]
]];
lc: LibraryConversion = NEW [LibraryConversionPrivate ← [l]];
context ← lc};
SeeLibraryField: SubResultConsumer = {
lc: LibraryConversion = NARROW[context];
l: Library = lc.l;
IF index = 1 THEN {
l.name.edif ← Atom.GetPName[NARROW[result]];
RETURN};
};
AfterLibrary: Afterer = {
ewc: EDIFWholeConversion = NARROW[parentContext];
ew: EDIFWhole = ewc.ew;
lc: LibraryConversion = NARROW[context];
l: Library = lc.l;
IF NOT ew.libraries.Insert[l.name.edif, l] THEN ERROR;
result ← l;
};
BeforeCell: Beforer = {
lc: LibraryConversion = NARROW[parentContext];
ctfe: CellTypeFromEDIF = NEW [CellTypeFromEDIFPrivate ← []];
ctg: CellTypeGen = NEW [CellTypeGenPrivate ← [
library: lc.l,
Apply: GenCellType,
data: ctfe]];
ctgc: CellTypeGenConversion = NEW [CellTypeGenConversionPrivate ← [ctg, ctfe]];
context ← ctgc};
SeeCellField: SubResultConsumer = {
ctgc: CellTypeGenConversion = NARROW[context];
IF index = 1 THEN ctgc.ctg.name.edif ← Atom.GetPName[NARROW[result]];
};
AfterCell: Afterer = {
ctgc: CellTypeGenConversion = NARROW[context];
IF NOT ctgc.ctg.library.cells.Insert[ctgc.ctg.name.edif, ctgc.ctg] THEN ERROR;
result ← ctgc.ctg;
};
GenCellType: PROC [args: LORA, data: REF ANY] RETURNS [cct: CellType] = {
ERROR --not yet implemented--;
};
}.