Skip to content

Commit

Permalink
Allow imm b.
Browse files Browse the repository at this point in the history
  • Loading branch information
thealmarty committed Jan 9, 2024
1 parent 9523f6e commit 2dc88b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion alu_u32/src/lt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,12 @@ where
let mut imm: Option<Word<u8>> = None;
let read_addr_1 = (state.cpu().fp as i32 + ops.b()) as u32;
let write_addr = (state.cpu().fp as i32 + ops.a()) as u32;
let src1 = state.mem_mut().read(clk, read_addr_1, true, pc, opcode, 0, "");
let src1 = if ops.d() == 1 {
let b = (ops.b() as u32).into();
imm = Some(b);
b
} else {state.mem_mut().read(clk, read_addr_1, true, pc, opcode, 0, "")
};
let src2 = if ops.is_imm() == 1 {
let c = (ops.c() as u32).into();
imm = Some(c);
Expand Down

0 comments on commit 2dc88b5

Please sign in to comment.