- # connect up instructions. only one is enabled at any given time
- for funame, fu in fus.items():
- fnunit = fu.fnunit.value
- enable = Signal(name="en_%s" % funame, reset_less=True)
- comb += enable.eq((dec2.e.do.fn_unit & fnunit).bool() & can_run)
-
- # run this FunctionUnit if enabled, except if the instruction
- # is "attn" in which case we HALT.
- with m.If(enable):
- with m.If(dec2.e.do.insn_type == InternalOp.OP_ATTN):
- # check for ATTN: halt if true
- m.d.sync += core_stopped.eq(1)
- with m.Else():
+ # check for ATTN: halt if true
+ with m.If(self.ivalid_i & (dec2.e.do.insn_type == InternalOp.OP_ATTN)):
+ m.d.sync += core_stopped.eq(1)
+
+ with m.Else():
+ # connect up instructions. only one is enabled at any given time
+ for funame, fu in fus.items():
+ fnunit = fu.fnunit.value
+ enable = Signal(name="en_%s" % funame, reset_less=True)
+ comb += enable.eq((dec2.e.do.fn_unit & fnunit).bool() & can_run)
+
+ # run this FunctionUnit if enabled, except if the instruction
+ # is "attn" in which case we HALT.
+ with m.If(enable):