MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / decode_beq

Function decode_beq

crates/virtual-machine/tests/vm_decoder.rs:138–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

136
137#[test]
138fn decode_beq() {
139 // Beq::new(rs1, rs2, offset)
140 let encoded = Beq::new(1, 2, 8).encode();
141 let decoded = decode(encoded).expect("should decode BEQ");
142 if let DecodedInsn::Branch { funct3, imm, .. } = decoded {
143 assert_eq!(funct3, 0, "BEQ funct3 must be 0");
144 assert_eq!(imm, 8, "BEQ immediate mismatch");
145 } else {
146 panic!("expected DecodedInsn::Branch, got {decoded:?}");
147 }
148}
149
150#[test]
151fn decode_ecall() {

Callers

nothing calls this directly

Calls 2

decodeFunction · 0.50
encodeMethod · 0.45

Tested by

no test coverage detected