From 5a383956c9ee27d50452aa237a9f34b7f75e8f7c Mon Sep 17 00:00:00 2001 From: taitep Date: Tue, 30 Dec 2025 20:18:23 +0100 Subject: Improve exception dumps and general debug info, make the emulator capable of running the riscv ISA tests, and perform some general fixes i found while making it pass the tests for RV64I --- src/decode.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/decode.rs') diff --git a/src/decode.rs b/src/decode.rs index 616f7f7..7f58516 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -6,9 +6,15 @@ const MASK_REGISTER: u32 = 0x1f; -#[derive(Debug, Clone, Copy)] +#[derive(Clone, Copy)] pub struct Instruction(pub u32); +impl std::fmt::Debug for Instruction { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_fmt(format_args!("{:08x}", self.0)) + } +} + #[allow(dead_code)] impl Instruction { #[inline] -- cgit v1.2.3