+ def get_ls_misaligned(self, ls, funct3, load_store_address_low_2):
+ return Case(funct3[:2],
+ { F3.sb: ls.eq(Constant(0)),
+ F3.sh: ls.eq(load_store_address_low_2[0] != 0),
+ F3.sw: ls.eq(load_store_address_low_2[0:2] != Constant(0, 2)),
+ "default": ls.eq(Constant(1))
+ })
+
+ def get_lsbm(self, decoder_funct3):
+ return Cat(Constant(1),
+ Mux((decoder_funct3[1] | decoder_funct3[0]),
+ Constant(1), Constant(0)),
+ Mux((decoder_funct3[1]),
+ Constant(0b11, 2), Constant(0, 2)))
+