<> <> <> <> <<>> DIRECTORY CCDUtils, CD, CDBasics, CDCells, CDDirectory, CDRects, CDSymbolicObjects, Convert, Core, CoreBlock, CoreFrame, CoreLibrary, CoreName, CoreOps, CoreWire, CoreXform, HashTable, IFUCoreCells, IFUCoreData, CoreInstCell, IO, PW, PWC, Rope; IFUCoreDataImpl: CEDAR PROGRAM IMPORTS CCDUtils, CD, CDBasics, CDCells, CDDirectory, CDRects, CDSymbolicObjects, Convert, CoreBlock, CoreFrame, CoreLibrary, CoreName, CoreOps, CoreWire, CoreXform, HashTable, IFUCoreCells, IFUCoreData, CoreInstCell, IO, PW, PWC, Rope EXPORTS IFUCoreData = BEGIN ROPE: TYPE = Core.ROPE; NameLetterCode: TYPE = IFUCoreData.NameLetterCode; NameLetterCodeRec: TYPE = IFUCoreData.NameLetterCodeRec; NWMML: TYPE = PWC.NWMML; GND: ROPE _ CoreName.RopeNm["GND"]; VDD: ROPE _ CoreName.RopeNm["VDD"]; minus: ROPE _ CoreName.RopeNm["-"]; plus: ROPE _ CoreName.RopeNm["+"]; nil: ROPE _ CoreName.RopeNm["nil"]; pwrList: LIST OF REF _ LIST[GND, VDD]; Signal: SIGNAL = CODE; dpCellClass: PUBLIC Core.CellClass _ CoreOps.SetClassPrintProc[ NEW[Core.CellClassRec _ [name: "IFUCoreData", recast: NIL]], ClassPrintProc]; ClassPrintProc: CoreOps.PrintClassProc = { dpData: IFUCoreData.DpCellData _ NARROW[data]; IO.PutF[out, "Data Path Subclass: %g Type: \n", IO.rope[dpData.subClass] ]; CoreOps.PrintWire[dpData.type.w, out, 2] }; RegisterSubClassExpand: PUBLIC PROC [type: CoreFrame.ExpandType, subClass: ROPE, expand: CoreFrame.ExpandProc] = { IF type = soft THEN [ ] _ HashTable.Store[expandSoft, subClass, NEW[CoreFrame.ExpandProc_ expand]] ELSE [ ] _ HashTable.Store[expandHard,subClass, NEW[CoreFrame.ExpandProc_ expand]]}; expandHard: HashTable.Table _ HashTable.Create[equal: HashTable.RopeEqual, hash: HashTable.HashRope]; expandSoft: HashTable.Table _ HashTable.Create[equal: HashTable.RopeEqual, hash: HashTable.HashRope]; Sequencial48: PUBLIC CoreXform.Xform _ CoreXform.GenXform[LIST[ [4, 0], [8, 1] ]]; Interleaved48: PUBLIC CoreXform.Xform _ CoreXform.GenXform[LIST[ [4, 1], [8, 0] ]]; CellProc: PUBLIC PROC [ subClass: ROPE _ NIL, type: ROPE _ NIL, name: ROPE _ NIL, left: REF _ NIL, right: REF _ NIL, top: REF _ NIL, bot: REF _ NIL, in: REF _ NIL, out: REF _ NIL, data: REF _ NIL, channels: INT _ 6, xform: CoreXform.Xform _ IFUCoreData.Interleaved48 ] RETURNS [cellType: Core.CellType] = { ctx: CoreName.Context _ CoreName.NewContext[]; public: CoreWire.CWire; strucType: CoreWire.CWire; expandSoftProc: REF CoreFrame.ExpandProc; expandHardProc: REF CoreFrame.ExpandProc; xforms: CoreXform.Xforms _ CoreXform.GenXforms[xform]; public _ [CoreOps.CreateWire[LIST[ RdListOfXfrmWires[ctx, "top", top, xforms], RdListOfXfrmWires[ctx, "bot", bot, xforms], RdListOfXfrmWires[ctx, "in", in, xforms], RdListOfXfrmWires[ctx, "out", out, xforms], RdListOfXfrmWires[ctx, "right", right, NIL], -- if needed put xform on rope RdListOfXfrmWires[ctx, "left", left, NIL], -- if needed put xform on rope RdListOfXfrmWires[ctx, "pwr", pwrList, NIL] ]]]; ctx _ CoreName.KillContext[ctx]; ctx _ CoreName.NewContext[]; strucType _ [RdListOfXfrmWires[ctx, "type", LIST[type], xforms][0]]; ctx _ CoreName.KillContext[ctx]; DeleteGV[public.f["top"].w]; DeleteGV[public.f["bot"].w]; cellType _ CoreOps.SetCellTypeName[ NEW [ Core.CellTypeRec _ [ class: dpCellClass, public: public.w, data: NEW[IFUCoreData.DpCellDataRec _ [ subClass: subClass, type: strucType, data: data, channels: channels ] ], properties: NIL] ], name]; expandSoftProc _ NARROW[HashTable.Fetch[expandSoft, subClass].value]; expandHardProc _ NARROW[HashTable.Fetch[expandHard, subClass].value]; IF expandSoftProc=NIL THEN Signal[]; IF expandHardProc=NIL THEN Signal[]; CoreFrame.SetFrameExpandProc[soft, cellType, expandSoftProc ]; CoreFrame.SetFrameExpandProc[hard, cellType, expandHardProc ]}; <> <> RdListOfXfrmWires: PROC[ctx: CoreName.Context, name: ROPE, ref: REF, xforms: CoreXform.Xforms] RETURNS[wire: Core.Wire] = { new: CoreXform.Xforms; [ref, new] _ Parse[ref]; IF new#NIL THEN xforms _ new; IF ISTYPE[ref, LIST OF REF] THEN wire _ GenWireFmList[ctx, NARROW[ ref], xforms] ELSE wire _ GenWireFmItem[ctx, ref, xforms]; [ ] _ CoreName.WireNm[wire, name]; FOR jj: INT IN [0..wire.size) DO CoreXform.SetXform[wire[jj], CoreXform.GenXform[xforms]] ENDLOOP }; DeleteGV: PROC[top: Core.Wire] = { -- doesn't work for top node DeleteGVMain: PROC[wire: Core.Wire] RETURNS[new: Core.Wire] = { IF wire.size=0 THEN RETURN[SELECT CoreName.WireNm[wire].n FROM GND, VDD => CoreOps.CreateWires[0] ENDCASE => wire] ELSE FOR i: INT IN [0..wire.size) DO wire[i] _ DeleteGVMain[wire[i]] ENDLOOP; RETURN[wire]}; [] _ DeleteGVMain[top]}; <> <> <