perm = Signal(self.width, reset_less=True)
rb64 = [Signal(1, reset_less=True, name=f"rb64_{i}") for i in range(64)]
for i in range(64):
- m.d.comb += rb64[i].eq(self.rb[i])
+ m.d.comb += rb64[i].eq(self.rb[63-i])
rb64 = Array(rb64)
for i in range(8):
index = self.rs[8*i:8*i+8]
comb += o.ok.eq(1) # overridden if no op activates
+
+ m.submodules.bpermd = bpermd = Bpermd(64)
+
##########################
# main switch for logic ops AND, OR and XOR, cmpb, parity, and popcount
###### bpermd #######
with m.Case(InternalOp.OP_BPERM):
- m.submodules.bpermd = bpermd = Bpermd(64)
comb += bpermd.rs.eq(a)
- comb += bpermd.rb.eq(b)
+ comb += bpermd.rb.eq(self.i.b)
comb += o.data.eq(bpermd.ra)
with m.Default():