<> <> 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--; }; }.