<> <> <> <<>> Directory Rope, DragOpsCross; Imports EUOps, BitOps, DragOpsCrossUtils; Open EUOps; <<>> Cedar ShiftLeft2DtoD: PROC[left, right: BitOps.BitDWord, index: CARDINAL] RETURNS[shiftout: BitOps.BitDWord] = BEGIN temp: BitOps.BitDWord; SELECT index FROM 0 => shiftout _ left; 32 => shiftout _ right; IN [1..32) => {temp _ BitOps.MDTD[right, 32, 0, index, temp, 32, 32-index, index]; shiftout _ BitOps.MDTD[left, 32, index, 32-index, temp, 32, 0, 32-index]}; ENDCASE => ERROR; END; ; FUFieldDescr: CELL [ <> cBus < INT[32], -- only for updating field ConstBus < INT[32], -- only for updating kBusAB <> EUAluOpAB < EnumType["Dragon.ALUOps"], writeFieldBA < BOOL, -- provided by the RAM <> insert > BOOL, fdshift > INT[6], -- actually between 0 and 32 fdmask > INT[6], -- actually between 0 and 32 <> rejectBA < BOOL, PhA, PhB> width < INT[6], <> mask > INT[32], <> PhA, PhB> mask _ BitOps.doubleMasks[width]; -- a cloud of zeros followed by "width" ones ENDCELL; FUShifter: CELL [ <> LeftOpBus < INT[32], RightOpBus < INT[32], <> fdshift < INT[6], <> shiftout > INT[32], <> PhA, PhB> mask1 < INT[32], mask2 < INT[32], shiftout < INT[32], RightOpBus < INT[32], <> insert < BOOL, <> sBus > INT[32], <> PhA, PhB (shiftout AND mask1) IF insert THEN { -- use compositemask to select between shiftout and OpRightBus compositemask _ BitOps.DXOR[mask1, mask2]; sBus _ BitOps.DOR[ BitOps.DAND[shiftout, compositemask], BitOps.DAND[RightOpBus, BitOps.DNOT[compositemask, 32]] ]; } ELSE { -- just mask shiftout compositemask _ mask1; sBus _ BitOps.DAND[shiftout, compositemask]; }; }; ENDCELL; EUField: CELL [ <> LeftOpBus < INT[32], RightOpBus < INT[32], cBus < INT[32], -- only for updating field ConstBus < INT[32], -- only for updating kBusAB sBus > INT[32], <> EUAluOpAB < EnumType["Dragon.ALUOps"], -- sent on 1A, used during 2B. Not latched by EU. writeFieldBA < BOOL, -- provided by the RAM <> rejectBA < BOOL, <> PhA, PhB> mask1: INT[32]; mask2: INT[32]; shiftout: INT[32]; insert: BOOL; fdshift: INT[6]; fdmask: INT[6]; <> FieldDescr: FUFieldDescr[]; MaskGen1: FUMaskGen[mask: mask1, width: fdmask]; MaskGen2: FUMaskGen[mask: mask2, width: fdshift]; shifter: FUShifter[]; merge: FUMerge[] ENDCELL <<>> <<>>