CreateCrossRAM: StructureProc = {
data: CoreClasses.RecordCellType;
PushInt[context: context, prop: $rowQuads, val: rowQuads];
PushInt[context: context, prop: $columnOcts, val: columnOcts];
PushInt[context: context, prop: $addressBits, val: addressBits];
PushInt[context: context, prop: $dataBits, val: dataBits];
PushInt[context: context, prop: $select, val: select];
PushInt[context: context, prop: $log2Select, val: log2Select];
PushInt[context: context, prop: $addressDecoderBits, val: addressDecoderBits];
cellType ← CreateRecordCell[
name: CrossRAM,
context: context,
public: CreateWires[context, "Vdd, Gnd, PadVdd, PadGnd, nPrecharge, Access, Write, Read, Address[seq: addressBits], Data[seq: dataBits]"],
onlyInternal: CreateWires[context, "nPrechargeB, AccessB, WriteB, nWriteB, ReadB, nReadB, AddressB[seq: addressBits], DataB[seq: dataBits]"]
,instances: LIST [
[type: CreateStructure[name: CrossRAMInner, context: context]],
[type: CreateStructure[name: CrossRamPadFrame, context: context]]]
];
Ports.InitPort[wire: cellType.public[Address], initType: c];
Ports.InitPort[wire: cellType.public[Data], initType: c];
cellType ← CreateRecordCell[
name: CrossRAM,
context: context,
public: CoreOps.WiresToWire[NIL],
onlyInternal: CreateWires[context, "Vdd, Gnd, nPrechargeB, AccessB, WriteB, nWriteB, ReadB, nReadB, AddressB[seq: addressBits], DataB[seq: dataBits]"],
instances: LIST [
[type: CreateStructure[name: CrossRAMInner, context: context]],
[type: CreateStructure[name: CrossRamPadFrame, context: context]]
]];
IF GetBool[context, $PWCore] THEN {
data ← NARROW [cellType.data];
lambda: INT = 2; -- to be changed for other technologies
params: Onion.LayersParameters ← NEW [Onion.LayersParametersRec ← [radialLayer: CMos.met, ringLayer: CMos.met2, ringWidth: Onion.RingWidthIs8, wireExtendProc: Onion.WireExtendMetToMet]];
inner, outer, all: CD.Object;
position: CD.Position;
inner ← PWCore.GateWay[data[0]];
outer ← PWCore.GateWay[data[1]];
inner ← Onion.MakeInner[NIL, inner];
position ← Onion.Center[inner, outer];
position.x ← 214; -- magic number! (Jeff) ; commented for small Crossrams, although it makes the Vdd and Gnd lines wrong when commented (BS)
position.y ← position.y + 5445; -- to help route small crossrams (BS)
position.y ← 46; -- another magic number! (Jeff) ; commented for small Crossrams (BS)
all ← Onion.LRSRoute[NIL, inner, outer, position, params].cell;
PWCore.SetLayout[cellType, all];
};
IF GetBool[context, $Sinix] THEN [] ← Sinix.Extract[PWCore.GetLayout[cellType]];
IF GetBool[context, $Rosemary] THEN Rosemary.Bind[cellType: cellType, roseClassName: CrossRAMRoseClass];
Rosemary.Bind[cellType: cellType, roseClassName: CrossRAMRoseClass];
};