From 57694b11d33a3c5dff1de80baf810354c9ddfdda Mon Sep 17 00:00:00 2001 From: Clo91eaf Date: Sat, 8 Jun 2024 01:40:46 +0800 Subject: [PATCH] [difftest] float rf change should be fake?? wip --- .../src/difftest/spike/spike_event.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/difftest/t1-simulator/src/difftest/spike/spike_event.rs b/difftest/t1-simulator/src/difftest/spike/spike_event.rs index fb1bdde3b..d7d77a993 100644 --- a/difftest/t1-simulator/src/difftest/spike/spike_event.rs +++ b/difftest/t1-simulator/src/difftest/spike/spike_event.rs @@ -263,10 +263,9 @@ impl SpikeEvent { // xx0100 <- csr let reg_write_size = state.get_reg_write_size(); (0..reg_write_size).for_each(|idx| match idx & 0xf { - 0b0000 | 0b0001 => { + 0b0000 => { // scalar rf - let is_fp = idx & 0b1 != 0; - let data = state.get_reg(idx, is_fp); + let data = state.get_reg(idx, false); if data != self.rd_bits { trace!( "SpikeRegChange: idx={idx}, change_from={}, change_to={data}", @@ -276,6 +275,18 @@ impl SpikeEvent { self.is_rd_written = true; } } + 0b0001 => { + let data = state.get_reg(idx, true); + if data == self.rd_bits { + trace!( + "FloatRFChange: idx={idx}, change_from={}, change_to={data}", + self.rd_bits + ); + self.rd_bits = data; + self.is_rd_written = true; + } + + } _ => trace!("UnknownRegChange, idx={idx}, spike detect unknown reg change"), });