self.out_offs = dut.num_rows - feedback_width
for muxid in range(feedback_width):
muxid_in = muxid
- muxid_out = self.out_offs + muxid
+ muxid_out = muxid
self.di[muxid_in] = {}
self.do[muxid_out] = {}
self.sent[muxid_in] = []
# send = randint(0, send_range) != 0
def rcv(self, muxid):
- muxid = muxid + self.out_offs
rs = self.dut.p[muxid]
while True:
def runfp(dut, width, name, fpkls, fpop, single_op=False, n_vals=10,
- vals=None, opcode=None, cancel=False):
+ vals=None, opcode=None, cancel=False, feedback_width=None):
if not os.path.exists("sim_out"):
os.makedirs("sim_out")
vl = rtlil.convert(dut, ports=dut.ports())
test = MuxInOut(dut, width, fpkls, fpop, vals, single_op, opcode=opcode)
fns = []
- for i in range(dut.num_rows):
+ n_rows = dut.num_rows
+ if feedback_width is not None:
+ n_rows = feedback_width
+ for i in range(n_rows):
fns.append(test.rcv(i))
fns.append(test.send(i))
run_simulation(dut, {"sync": fns}, vcd_name="sim_out/%s.vcd" % name)