Skip to content

Commit

Permalink
[t1rocket] fix wrong quit check
Browse files Browse the repository at this point in the history
  • Loading branch information
Clo91eaf committed Aug 14, 2024
1 parent a800c2c commit df3ced8
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions t1rocketemu/online_dpi/src/drive.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::dpi::*;
use crate::{ get_t, EXIT_CODE, EXIT_POS };
use crate::svdpi::SvScope;
use crate::OfflineArgs;
use crate::{get_t, EXIT_CODE, EXIT_POS};

use anyhow::Context;
use common::MEM_SIZE;
Expand Down Expand Up @@ -336,17 +336,19 @@ impl Driver {
let data_hex = hex::encode(data);
self.last_commit_cycle = get_t();

// exit with code
if addr == EXIT_POS && data.len() == 4 && data == &EXIT_CODE.to_le_bytes() {
info!("exit successfully");
quit();
return;
}

trace!(
"[{}] axi_write_load_store (addr={addr:#x}, size={size}, data={data_hex})",
get_t()
);

// check exit with code
if addr == EXIT_POS {
let exit_data_slice = data[..4].try_into().expect("slice with incorrect length");
if u32::from_le_bytes(exit_data_slice) == EXIT_CODE {
info!("exit successfully");
quit()
}
}
}

pub(crate) fn axi_read_instruction_fetch(&mut self, addr: u32, arsize: u64) -> AxiReadPayload {
Expand Down

0 comments on commit df3ced8

Please sign in to comment.