Skip to main content

soft_core_alu

Function soft_core_alu 

Source
pub fn soft_core_alu(opcode: u8, a: i32, b: i32) -> i32
Expand description

The Rust model of alu.v (32-bit), mirroring emit_alu_datapath_verilog exactly (wrapping / signed). Div / ExactDiv / Mod / FloorDiv are NOT here — they route to soft_core_divider (mirroring the soft-core’s shared_divider). DivPow2 stays (a cheap arithmetic shift).