PROC [design: Design, addressBits, addressDecoderBits, columnOcts, select, log2Select:
IF (cell ← FetchCell[design, name])=
NIL
THEN {
decoderLeft, decoderDriver, decoderLogicDriver, dataBuffer, dataBufferRight: CellInstance;
cell ← CreateRecordCell[design: design, name: name];
[] ← CreatePublicWire[design: design, on: cell, names: LIST["Vdd", "Gnd", "WriteB", "nWriteB", "ReadB", "nReadB"]];
[] ← CreatePublicWire[design: design, on: cell, name: "AddressB", type: CreateWireSequenceType[design: design, count: addressBits]];
[] ← CreatePublicWire[design: design, on: cell, name: "DataB", type: CreateWireSequenceType[design: design, count: columnOcts]];
[] ← CreatePublicWire[design: design, on: cell, names: LIST["AdrBit", "nAdrBit"], type: CreateWireSequenceType[design: design, count: addressDecoderBits]];
[] ← CreatePublicWire[design: design, on: cell, names: LIST["Bit", "nBit"], type: CreateWireSequenceType[design: design, count: select*columnOcts]];
[] ← CreateWire[design: design, in: cell, name: "Select", type: CreateWireSequenceType[design: design, count: select]];
decoderLeft ← CreateCellInstance[design: design, in: cell, type: CreateDecoderDriverLeft[design: design, log2Select: log2Select], bind: IO.PutFR["AddressB: AddressB[0..%g)", IO.int[log2Select]]];
decoderDriver ← CreateCellInstance[design: design, in: cell, type: CreateDecoderDriverSequence[design: design, driverPairCount: (addressBits-log2Select)/2, log2Select: log2Select], bind: IO.PutFR["LowAddressB: AddressB[0..%g), HighAddressB: AddressB[%g..%g)", IO.int[log2Select], IO.int[log2Select], IO.int[addressBits]]];
decoderLogicDriver ← CreateCellInstance[design: design, in: cell, type: CreateDecoderLogicDriver[design: design, select: select, log2Select: log2Select], bind: IO.PutFR["AddressB: AddressB[0..%g), AdrBit: AdrBit[%g], nAdrBit: nAdrBit[%g]", IO.int[log2Select], IO.int[addressDecoderBits-1], IO.int[addressDecoderBits-1]]];
dataBuffer ← CreateCellInstance[design: design, in: cell, type: CrossRAMDataBuffer.CreateDataBuffer[design: design, select: select, columnOcts: columnOcts]];
dataBufferRight ← CreateCellInstance[design: design, in: cell, type: CreateDataBufferRight[design: design]];
PutAttributeOnCell[design: design, on: cell, attribute: [$GenLayout, LIST[ $AbutX, decoderLeft, decoderDriver, decoderLogicDriver, dataBuffer, dataBufferRight]]];
};