Fix activation of cancel signal
authorCesar Strauss <cestrauss@gmail.com>
Tue, 17 Aug 2021 10:13:04 +0000 (07:13 -0300)
committerCesar Strauss <cestrauss@gmail.com>
Tue, 17 Aug 2021 10:13:04 +0000 (07:13 -0300)
As an active low signal, the conditions to cancel must be ANDed together.
Being active high, exc_o.happened must be inverted.

src/soc/experiment/compldst_multi.py

index d47572b4908c69ea4f4f68de26d0daca9d6a3569..d7fcb89b0ceb55ae3e13feec260bdbeefbd314ba 100644 (file)
@@ -455,8 +455,10 @@ class LDSTCompUnit(RegSpecAPI, Elaboratable):
         comb += self.adr_rel_o.eq(alu_valid & adr_l.q & busy_o)
 
         # the write/store (etc) all must be cancelled if an exception occurs
+        # note: cancel is active low, like shadown_i,
+        #       while exc_o.happpened is active high
         cancel = Signal(reset_less=True)
-        comb += cancel.eq(self.exc_o.happened | self.shadown_i)
+        comb += cancel.eq(~self.exc_o.happened & self.shadown_i)
 
         # store release when st ready *and* all operands read (and no shadow)
         comb += self.st.rel_o.eq(sto_l.q & busy_o & rd_done & op_is_st &