47 int globalGuardLatency = 1;
48 gcu =
new ControlUnit(name, delaySlots, globalGuardLatency);
50 gcu->setAddressSpace(&asInstr);
53 pc =
new FUPort(
"pc", 32, *gcu,
true,
true,
true);
54 val =
new FUPort(
"value", 32, *gcu,
false,
false,
true);
59 raOut =
new Socket(
"abu_out0");
60 valIn =
new Socket(
"value");
66 ra->attachSocket(*raIn);
67 ra->attachSocket(*raOut);
68 pc->attachSocket(*pcIn);
69 val->attachSocket(*valIn);
72 const int busWidth = 32;
73 const int immWidth = 0;
75 Bus* raBus =
new Bus(
"ra_out_to_ra_in", busWidth, immWidth, busExt);
79 raIn->attachBus(*raBus);
80 raOut->attachBus(*raBus);
81 pcIn->attachBus(*raBus);
82 raOut->setDirection(Socket::Direction::OUTPUT);
85 gcu->setReturnAddressPort(*ra);
88 ops.push_back(CreateHWOp(
"bnz", 2));
89 ops.push_back(CreateHWOp(
"bz", 2));
90 ops.push_back(CreateHWOp(
"call", 1));
91 ops.push_back(CreateHWOp(
"jump", 1));
104 if (numOfOperands == 1) {
106 }
else if (numOfOperands == 2) {
114 "Trying to add a GCU operation with a different number of "
115 "operands than 1 or 2.");
128 if (numOfOperands < 2) {
148 BindPorts(op, numOfOperands);
149 ConfigurePipeline(op->
pipeline(), numOfOperands);