diff options
| author | taitep <taitep@taitep.se> | 2025-12-30 20:18:23 +0100 |
|---|---|---|
| committer | taitep <taitep@taitep.se> | 2025-12-30 20:18:23 +0100 |
| commit | 5a383956c9ee27d50452aa237a9f34b7f75e8f7c (patch) | |
| tree | d49a782dfb068e3165825569084c23872ca9d83d /src/decode.rs | |
| parent | 6a0e5e63c13c4cb480233106d2043f2706bd5183 (diff) | |
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
Diffstat (limited to 'src/decode.rs')
| -rw-r--r-- | src/decode.rs | 8 |
1 files changed, 7 insertions, 1 deletions
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] |
