- with m.Else():
- # connect up instructions. only one is enabled at any given time
- for funame, fu in fus.items():
- enable = fu_bitdict[funame]
-
- # run this FunctionUnit if enabled, except if the instruction
- # is "attn" in which case we HALT.
- with m.If(enable):
- # route operand, issue, busy, read flags and mask to FU
- comb += fu.oper_i.eq_from_execute1(dec2.e)
- comb += fu.issue_i.eq(self.issue_i)
- comb += self.busy_o.eq(fu.busy_o)
- rdmask = dec2.rdflags(fu)
- comb += fu.rdmaskn.eq(~rdmask)
+ with m.If(can_run):
+ with m.Switch(dec2.e.do.insn_type):
+ # check for ATTN: halt if true
+ with m.Case(InternalOp.OP_ATTN):
+ m.d.sync += core_stopped.eq(1)
+
+ with m.Case(InternalOp.OP_NOP):
+ sync += counter.eq(2)
+ comb += self.busy_o.eq(1)
+
+ with m.Default():
+ # connect up instructions. only one enabled at a time
+ for funame, fu in fus.items():
+ enable = fu_bitdict[funame]
+
+ # run this FunctionUnit if enabled
+ with m.If(enable):
+ # route op, issue, busy, read flags and mask to FU
+ comb += fu.oper_i.eq_from_execute1(dec2.e)
+ comb += fu.issue_i.eq(self.issue_i)
+ comb += self.busy_o.eq(fu.busy_o)
+ rdmask = dec2.rdflags(fu)
+ comb += fu.rdmaskn.eq(~rdmask)