# connected to the FUReg and FUFU Matrices, to get them to reset
anydie = Signal(n_int_fus, reset_less=True)
allshadown = Signal(n_int_fus, reset_less=True)
+ shreset = Signal(n_int_fus, reset_less=True)
comb += allshadown.eq(shadows.shadown_o & bshadow.shadown_o)
comb += anydie.eq(shadows.go_die_o | bshadow.go_die_o)
+ comb += shreset.eq(bspec.match_g_o | bspec.match_f_o)
#---------
# connect fu-fu matrix
#---------
comb += shadows.issue_i.eq(fn_issue_o)
+ comb += shadows.reset_i[0:n_int_fus].eq(shreset[0:n_int_fus])
#---------
# NOTE; this setup is for the instruction order preservation...
# issue captures shadow_i (if enabled)
comb += bshadow.issue_i.eq(fn_issue_o)
+ comb += bshadow.reset_i[0:n_int_fus].eq(shreset[0:n_int_fus])
# instruction being issued (fn_issue_o) has a shadow cast by the branch
with m.If(self.branch_succ_i | self.branch_fail_i):
with m.If(cu.br1.issue_i):
sync += bspec.active_i.eq(1)
with m.If(self.branch_succ_i):
- comb += bspec.good_i.eq(fn_issue_o & 0xf)
+ comb += bspec.good_i.eq(fn_issue_o & 0x1f)
with m.If(self.branch_fail_i):
- comb += bspec.fail_i.eq(fn_issue_o & 0xf)
+ comb += bspec.fail_i.eq(fn_issue_o & 0x1f)
# branch is active (TODO: a better signal: this is over-using the
# go_write signal - actually the branch should not be "writing")
# create some instructions: branches create a tree
insts = create_random_ops(dut, 0, True)
+ #insts.append((6, 6, 1, 2, (0, 0)))
+ insts.append((4, 3, 3, 0, (0, 0)))
src1 = randint(1, dut.n_regs-1)
src2 = randint(1, dut.n_regs-1)
for ok, fl in zip(branch_ok, branch_fail):
instrs.append((ok[0], ok[1], ok[2], ok[3], (1, 0)))
instrs.append((fl[0], fl[1], fl[2], fl[3], (0, 1)))
- print ("instr %d: (%d, %d, %d, %d, %d, %d)" % \
+ print ("instr %d: (%d, %d, %d, %d, (%d, %d))" % \
(i, src1, src2, dest, op, shadow_on, shadow_off))
yield from int_instr(dut, op, src1, src2, dest,
shadow_on, shadow_off)
if shadow_wid:
# inputs
self.issue_i = Signal(reset_less=True)
+ self.reset_i = Signal(reset_less=True)
self.shadow_i = Signal(shadow_wid, reset_less=True)
self.s_fail_i = Signal(shadow_wid, reset_less=True)
self.s_good_i = Signal(shadow_wid, reset_less=True)
# shadow / recover (optional: shadow_wid > 0)
if self.shadow_wid:
i_l = []
+ d_l = []
fail_l = []
good_l = []
shi_l = []
# get list of latch signals. really must be a better way to do this
for l in s_latches:
i_l.append(l.issue_i)
+ d_l.append(l.reset_i)
shi_l.append(l.shadow_i)
fail_l.append(l.s_fail_i)
good_l.append(l.s_good_i)
sho_l.append(l.shadow_o)
rec_l.append(l.recover_o)
m.d.comb += Cat(*i_l).eq(Repl(self.issue_i, self.shadow_wid))
+ m.d.comb += Cat(*d_l).eq(Repl(self.reset_i, self.shadow_wid))
m.d.comb += Cat(*fail_l).eq(self.s_fail_i)
m.d.comb += Cat(*good_l).eq(self.s_good_i)
m.d.comb += Cat(*shi_l).eq(self.shadow_i)
def __iter__(self):
if self.shadow_wid:
+ yield self.reset_i
yield self.issue_i
yield self.shadow_i
yield self.s_fail_i
# inputs
self.issue_i = Signal(n_fus, reset_less=True)
+ self.reset_i = Signal(n_fus, reset_less=True)
self.shadow_i = Array(Signal(shadow_wid, name="sh_i", reset_less=True) \
for f in range(n_fus))
self.s_fail_i = Array(Signal(shadow_wid, name="fl_i", reset_less=True) \
# connect all shadow outputs and issue input
issue_l = []
+ reset_l = []
sho_l = []
rec_l = []
for l in shadows:
issue_l.append(l.issue_i)
+ reset_l.append(l.reset_i)
sho_l.append(l.shadown_o)
rec_l.append(l.go_die_o)
m.d.comb += Cat(*issue_l).eq(self.issue_i)
+ m.d.comb += Cat(*reset_l).eq(self.reset_i)
m.d.comb += self.shadown_o.eq(Cat(*sho_l))
m.d.comb += self.go_die_o.eq(Cat(*rec_l))
def __iter__(self):
yield self.issue_i
+ yield self.reset_i
yield from self.shadow_i
yield from self.s_fail_i
yield from self.s_good_i
# inputs
self.issue_i = Signal(reset_less=True)
self.shadow_i = Signal(reset_less=True)
+ self.reset_i = Signal(reset_less=True)
self.s_fail_i = Signal(reset_less=True)
self.s_good_i = Signal(reset_less=True)
m = Module()
m.submodules.sl = sl = SRLatch(sync=False)
- m.d.comb += sl.s.eq(self.shadow_i & self.issue_i & ~self.s_good_i)
- m.d.comb += sl.r.eq(self.s_good_i | (self.issue_i & ~self.shadow_i))
+ #reset_r = Signal()
+ #m.d.sync += reset_r.eq(self.s_good_i | self.s_fail_i)
+
+ m.d.comb += sl.s.eq(self.shadow_i & self.issue_i & \
+ ~self.s_good_i & ~self.reset_i)
+ m.d.comb += sl.r.eq(self.reset_i | self.s_good_i | \
+ (self.issue_i & ~self.shadow_i))
m.d.comb += self.recover_o.eq(sl.qlq & self.s_fail_i)
m.d.comb += self.shadow_o.eq(sl.qlq)
def __iter__(self):
yield self.issue_i
+ yield self.s_reset_i
yield self.shadow_i
yield self.s_fail_i
yield self.s_good_i