DIRECTORY Boole, BooleCore, CoreCreate, EU2DPControl, EU2LeafUtils, EU2Utils, Ports, Rosemary; EU2DPControlImpl: CEDAR PROGRAM IMPORTS Boole, BooleCore, CoreCreate, EU2LeafUtils, EU2Utils EXPORTS EU2DPControl = BEGIN OPEN Boole, BooleCore, CoreCreate, EU2DPControl, EU2Utils; ExprProc: TYPE ~ PROC [i: NAT] RETURNS [Expression]; AppendInput: PROC [name: ROPE, public: Wire, inputD: Inputs] RETURNS [ins: Inputs]~ { wire: Wire _ FindWire[public, name]; inv: CellType _ EU2LeafUtils.AlpsExtract["InputDriver.sch"]; IF wire.size=0 THEN RETURN [CONS[[input: wire, driver: inv], inputD]]; ins _ inputD; FOR i: INT IN [0..wire.size) DO ins _ CONS[[input: Index[wire, i], driver: inv], ins]; ENDLOOP; }; AppendOutput: PROC [wire: WR, expr: Expression, clock: ROPE, outputDrivers: Outputs] RETURNS [Outputs] ~ { out: CellType _ EU2LeafUtils.AlpsExtract["ClockedOutputDriver.sch"]; RETURN [CONS[ [driver: out, pas: LIST[["Clock", clock]], output: wire, expr: expr], outputDrivers]]; }; CreateDPControl: PUBLIC PROC RETURNS [cellType: CellType] = { MakeSelExpr: PROC [reg: PipeRange, exprProc: ExprProc, clock: ROPE] ~ { FOR i: INT IN [0..sources[reg].sizeSel) DO outputDrivers _ AppendOutput[ wire: Index[sources[reg].nameSel, i], expr: exprProc[i], clock: clock, outputDrivers: outputDrivers]; ENDLOOP; }; inputDrivers: Inputs _ NIL; outputDrivers: Outputs _ NIL; public: Wire _ Union[ -- beware of the order! Wires["hold"], -- a hack for now!!! GenPGnEWires[], GenClockWires[], GenWiresCtrlToPads[], GenWiresPadsToCtrl[], GenWiresDBus[], GenWiresCtrlToRegs[], GenWiresCtrlToALU[], GenWiresCtrlToFU[], GenWiresDPToCtrl[]]; leftSrc: Wire _ FindWire[public, "leftSrc"]; rightSrc: Wire _ FindWire[public, "rightSrc"]; st2ASrc: Wire _ FindWire[public, "st2ASrc"]; aluOp: Wire _ FindWire[public, "aluOp"]; fd: Wire _ FindWire[public, "fd"]; insertFd: Wire _ FindWire[fd, "insertFd"]; maskFd: Wire _ FindWire[fd, "maskFd"]; shiftFd: Wire _ FindWire[fd, "shiftFd"]; reject: Expression _ WireVar[public, "reject"]; -- latched on PhB, simple driver!!! nReject: Expression _ Not[reject]; nHold: Expression _ Not[WireVar[public, "hold"]]; st3AisC: Expression _ WireVar[public, "st3AisC"]; fetch: Expression _ WireVar[public, "res3BisP"]; store: Expression _ WireVar[public, "writePBus"]; LeftExpr: ExprProc = {RETURN[And[nReject, nHold, EqualInt[public, leftSrc, i]]]}; -- selLeftSrc[i] _ PhA . (leftSrc=i) . ~reject . ~hold RightExpr: ExprProc = {RETURN[And[nReject, nHold, EqualInt[public, rightSrc, i]]]}; St2AExpr: ExprProc = {RETURN[And[nReject, nHold, EqualInt[public, st2ASrc, i]]]}; R3AExpr: ExprProc = {RETURN[And[nReject, nHold]]}; St3AExpr: ExprProc = {RETURN[ SELECT i FROM 0 => And[nReject, nHold, Not[st3AisC]], 1 => And[nReject, nHold, st3AisC], ENDCASE => ERROR]}; KRegExpr: ExprProc = {RETURN[nHold]}; R2BExpr: ExprProc = {RETURN[ SELECT i FROM 0 => And[nHold, Nor[ -- aluOut EqualInt[public, aluOp, FOP], -- neither FOP EqualInt[public, aluOp, BndChk]]], -- nor BndChk 1 => And[nHold, EqualInt[public, aluOp, FOP]], -- fuOut 2 => And[nHold, EqualInt[public, aluOp, BndChk]], -- left ENDCASE => ERROR]}; St2BExpr: ExprProc = {RETURN[nHold]}; R3BExpr: ExprProc = {RETURN[nHold]}; DataInExpr: ExprProc = {RETURN[nHold]}; CBusExpr: ExprProc = {RETURN[ -- use the non-latched reject and a simple driver, no clock!!! SELECT i FROM 0 => Nand[nReject, store, fetch], -- r3B 1 => And[nReject, nHold, fetch], -- dataIn ENDCASE => ERROR]}; InsertExpr: ExprProc = {RETURN[And[nHold, WireVar[public, "insertFd"]]]}; MaskExpr: ExprProc = {RETURN[ And[nHold, WireVar[public, Index["maskFd", i]]]]}; ShiftExpr: ExprProc = {RETURN[ And[nHold, WireVar[public, Index["shiftFd", i]]]]}; ShExpr: ExprProc = {RETURN[ And[nHold, EqualInt[public, shiftFd, i]]]}; CarryInExpr: ExprProc = {RETURN[true]}; OpExpr: ExprProc = {RETURN[true]}; MakeSelExpr[kReg, KRegExpr, "phB"]; MakeSelExpr[right, RightExpr, "phA"]; MakeSelExpr[left, LeftExpr, "phA"]; MakeSelExpr[st2A, St2AExpr, "phA"]; MakeSelExpr[r2B, R2BExpr, "phB"]; MakeSelExpr[st2B, St2BExpr, "phB"]; MakeSelExpr[st3A, St3AExpr, "phA"]; MakeSelExpr[r3A, R3AExpr, "phA"]; MakeSelExpr[r3B, R3BExpr, "phB"]; MakeSelExpr[cBus, CBusExpr, "none"]; MakeSelExpr[dataIn, DataInExpr, "phB"]; inputDrivers _ AppendInput["leftSrc", public, inputDrivers]; -- 2 inputDrivers _ AppendInput["rightSrc", public, inputDrivers]; -- 3 inputDrivers _ AppendInput["st2ASrc", public, inputDrivers]; -- 2 inputDrivers _ AppendInput["zero", public, inputDrivers]; -- 1 inputDrivers _ AppendInput["carryOut", public, inputDrivers]; -- 1 inputDrivers _ AppendInput["res", public, inputDrivers]; -- 8 inputDrivers _ AppendInput["opL", public, inputDrivers]; -- 3 inputDrivers _ AppendInput["opR", public, inputDrivers]; -- 3 inputDrivers _ AppendInput["fd", public, inputDrivers]; -- 13 inputDrivers _ AppendInput["st3AisC", public, inputDrivers]; -- 1 inputDrivers _ AppendInput["res3BisP", public, inputDrivers]; -- 1 inputDrivers _ AppendInput["writePBus", public, inputDrivers]; -- 1 inputDrivers _ AppendInput["reject", public, inputDrivers]; -- 1 inputDrivers _ AppendInput["aluOp", public, inputDrivers]; -- 4 inputDrivers _ AppendInput["condSel", public, inputDrivers]; -- 4 cellType _ NIL; }; END. leftSrc, rightSrc, st2ASrc, loadField, zero, -- form DP st3AisC, res3BisP, writePBus, reject, aluOp, condSel -- form pads -- aluLeft selLeftSrc[i] _ ClockedDriver[PhA, (leftSrc=i) AND ~reject] dReadLeft _ ClockedDriver[] -- aluRight selRightSrc[i] _ ClockedDriver[PhA, (rightSrc=i) AND ~reject] dReadRight _ ClockedDriver[] -- store2AB selSt2ASrc[i] _ ClockedDriver[PhA, (st2ASrc=i) AND ~reject] dReadSt2A _ ClockedDriver[] -- result3AB selRes3ABSrc _ ClockedDriver[PhA, ~reject] dReadRes3AB _ ClockedDriver[] -- store3AB selSt3ABSrc[cBus] _ ClockedDriver[PhA, st3AisC AND ~reject] selSt3ABSrc[s2Bus] _ ClockedDriver[PhA, ~st3AisC AND ~reject] dReadSt3AB _ ClockedDriver[] -- field selFieldSrc _ ClockedDriver[PhA, loadField AND ~reject] dReadField _ ClockedDriver[] -- ramAdr selRamAdr _ ClockedDriver[PhB, true] -- result2BA selRes2BASrc[aluBus] _ ClockedDriver[PhB, ~(aluOp=FOP)] selRes2BASrc[fuBus] _ ClockedDriver[PhB, (aluOp=FOP)] dReadRes2BA _ ClockedDriver[] -- cBusResult3BA selRes3BASrc[tBus] _ ClockedDriver[PhB, ] selRes3BASrc[dBus] _ ClockedDriver[PhB, ] dReadRes2BA _ ClockedDriver[] -- store2BA selSt2BASrc _ ClockedDriver[PhB, true] 1. PhA AND ~reject: drive PBus (send address to cache from adBus) 2. PhA AND reject: don't drive PBus (cache has latched the address) 3. PhB AND EUWriteToPBus3AB: drive PBus (send data for store from dBus, even if there is a reject) 4. PhB AND ~EUWriteToPBus3AB AND reject: nothing on PBus (copy faulty address to res3B) 5. PhB AND ~EUWriteToPBus3AB AND ~reject AND ~EURes3BisPBus3AB: nothing on PBus (copy faulty address to res3B) 6. PhB AND ~EUWriteToPBus3AB AND ~reject AND EURes3BisPBus3AB: read on PBus (get data from cache into res3B) Combining 4 and 5, and using a OR (~a AND b) = a OR b: 4.5. PhB AND ~EUWriteToPBus3AB AND (reject OR ~EURes3BisPBus3AB): nothing on PBus (copy faulty address to res3B) rEU2DPControlImpl.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Louis Monier March 25, 1986 5:31:15 pm PST -- Creates the control for the bottom of the Datapath, i.e. everything but the ram and the KBus pads -- composite wires to be interpreted as numbers -- expressions on one bit loadField: Expression _ WireVar[public, "loadField"]; -- PhA latches -- selRightSrc[i] _ PhA . (rightSrc=i) . ~reject . ~hold -- selSt2ASrc[i] _ PhA . (st2ASrc=i) . ~reject . ~hold FieldExpr: ExprProc = {RETURN[And[nReject, nHold, loadField]]}; -- selFieldSrc _ PhA . loadField . ~reject . ~hold -- selRes3ABSrc _ PhA . ~reject . ~hold -- selSt3ABSrc[st2B] _ PhA . ~st3AisC . ~reject . ~hold -- selSt3ABSrc[cBus] _ PhA . st3AisC . ~reject . ~hold -- PhB latches -- selKRegAdr _ PhB . ~hold -- selRes2BASrc[aluOut] _ PhB . ~hold . (aluOp=FOP) -- selRes2BASrc[fuOut] _ PhB . ~hold . (aluOp#FOP) -- selRes2BASrc[left] _ PhB . ~hold . (aluOp=BndChk) -- selSt2BASrc _ PhB . ~hold -- selRes3BASrc[tBus] _ PhB . ~hold -- selDataInSrc _ PhB . ~hold -- Special guys PDriverExpr: ExprProc = {RETURN[ SELECT i FROM 0 => nHold, -- st3A 1 => nHold, -- r2B ENDCASE => ERROR]}; -- selPDriverSrc[st3A] _ PhB . ~hold -- selPDriverSrc[r2B] _ PhA . ~hold (reject???) -- selCBusSrc[r3B] _ PhA . (reject + ~fetch + ~store) -- selCBusSrc[dataIn] _ PhA . ~reject . ~hold . fetch -- Field Unit -- insert _ ~hold . insertFd -- mask[i] _ ~hold . maskFd[i] -- shift[i] _ ~hold . shiftFd[i] -- mask[i] _ ~hold . (shiftFd=i) -- ALU -- carryIn _ a big mess!!! -- op[i] _ a big mess!!! -- Carry and condition -- Data path in order MakeSelExpr[field, FieldExpr, "phA"]; -- aluCtrl -- fuCtrl MakeSelExpr[pDriver, PDriverExpr, "none"]; -- To pad frame enWrtPBus _ PhA+PhB.writePBus enWrtIFU _ PhA.(cAdr=IFUAdr) -- in EU2RamControl condition _ -- Input Drivers for the signals coming from the Data Path -- Input Drivers for the (few) signals coming straight from the pads -- Generate the block Alps cellType _ AlpsCell[ name: "DPControl", public: public, inputs: inputDrivers, outputs: outputDrivers ]; -- Inputs to the Alps blocks -- PhA latches -- PhB latches -- PBus driver Κ  – "cedar" style˜codešœ™Kšœ Οmœ1™˜\šžœž˜ Kšœ#‘˜)Kšœ"‘ ˜+Kšžœžœ˜—Kšœ5™5Kš‘œ*‘œ™5—K™Kš’ ™ š  œžœ+˜IKš‘œ™—š œžœ˜Kšœ2˜2Kš‘œ™—š  œžœ˜Kšœ3˜3Kš‘œ™ —š œžœ˜Kšœ+˜+Kš‘œ™ —K™Kš’™š  œžœ˜'Kš‘œ™—š œžœ˜"Kš‘œ™—K™Kš’™K™K™š’™Kšœ#˜#Kšœ%˜%Kšœ%™%Kšœ#˜#Kšœ#˜#Kšœ ™ Kšœ!˜!Kšœ ™ Kšœ#˜#Kšœ#˜#Kšœ*™*Kšœ!˜!Kšœ!˜!Kšœ$˜$Kšœ'˜'—K˜™Kšœ™Kšœ1™1Kšœ ™ —K™™:Kšœ>‘˜BKšœ?‘˜CKšœ>‘˜BKšœ;‘˜?Kšœ?‘˜CKšœ:‘˜>Kšœ:‘˜>Kšœ:‘˜>Kšœ9‘˜>—™DKšœ>‘˜BKšœ?‘˜CKšœ?‘˜CKšœ=‘˜AKšœ<‘˜@Kšœ>‘˜B—K™Kš’™Kšœ žœ˜šœ™Kšœ™Kšœ™Kšœ™Kšœ™K™—Kšœ˜K˜—Kšžœ˜K˜™Kšœ/‘ ˜9Kšœ5‘ ˜AK˜—™Kš‘ ˜ Kšœ/žœ ˜;Kšœ˜K˜Kš‘ ˜ Kšœ1žœ ˜=Kšœ˜K˜Kš‘ ˜ Kšœ/žœ ˜;Kšœ˜K˜Kš‘ ˜ Kšœ*˜*Kšœ˜K˜Kš‘ ˜ Kšœ/žœ ˜;Kšœ1žœ ˜=Kšœ˜K˜Kš‘˜Kšœ+žœ ˜7Kšœ˜K˜—K™K™™Kš‘ ˜ Kšœ$˜$K˜Kš‘ ˜ Kšœ2žœ˜7Kšœ0žœ˜5Kšœ˜—˜Kš‘˜Kšœ)˜)Kšœ)˜)Kšœ˜—˜Kš‘ ˜ Kšœ&˜&K˜—K˜™šœžœ ˜Kšœ-˜-—šœžœ ˜Kšœ0˜0—K˜K˜šœžœ˜KšœE˜E—K˜šœžœžœ ˜)Kšœ.˜.—šœžœžœ žœ˜@Kšœ.˜.—šœžœžœ žœ˜?Kšœ-˜-K˜—Kšœžœžœžœ˜6šœ žœžœ žœ˜BKšœ.˜.—K˜——…—ή-π