Skip to content

Commit

Permalink
[t1rocket] fix scalar float reg write queue check
Browse files Browse the repository at this point in the history
  • Loading branch information
Clo91eaf committed Aug 25, 2024
1 parent e8c51b7 commit 8ad8ece
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion t1rocketemu/offline/src/json_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ impl JsonEventRunner for SpikeRunner {
);

// if instruction writes rd, it will retire in check_rd()
if count == se.vrf_access_record.retired_writes && !se.is_rd_written {
if count == se.vrf_access_record.retired_writes && !se.is_rd_written && !se.is_fd_written {
should_retire = Some(issue_idx);
}
// if all writes are committed, retire the se
Expand Down
10 changes: 5 additions & 5 deletions t1rocketemu/test_common/src/spike_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ pub struct SpikeRunner {
/// dependency, the vector instruction should be issued in order.
pub vector_queue: VecDeque<SpikeEvent>,

/// scalar queue to arrange the order of scalar reg / freg write instructions
/// scalar queue to arrange the order of scalar reg write instructions
pub scalar_queue: VecDeque<SpikeEvent>,

/// scalar queue to arrange the order of scalar reg / freg write instructions
/// float queue to arrange the order of scalar freg write instructions
pub float_queue: VecDeque<SpikeEvent>,

/// config for v extension
Expand Down Expand Up @@ -142,7 +142,7 @@ impl SpikeRunner {
let se = self.spike_step();
if se.is_scalar() && se.is_rd_written {
return se;
} else if se.is_fd_written {
} else if se.is_scalar() && se.is_fd_written {
self.float_queue.push_front(se.clone());
} else if se.is_v() {
self.vector_queue.push_front(se.clone());
Expand All @@ -161,7 +161,7 @@ impl SpikeRunner {
let se = self.spike_step();
if se.is_scalar() && se.is_rd_written {
self.scalar_queue.push_front(se.clone());
} else if se.is_fd_written {
} else if se.is_scalar() && se.is_fd_written {
return se;
} else if se.is_v() {
self.vector_queue.push_front(se.clone());
Expand All @@ -180,7 +180,7 @@ impl SpikeRunner {
let se = self.spike_step();
if se.is_scalar() && se.is_rd_written {
self.scalar_queue.push_front(se.clone());
} else if se.is_fd_written {
} else if se.is_scalar() && se.is_fd_written {
self.float_queue.push_front(se.clone());
} else if se.is_v() {
return se;
Expand Down

0 comments on commit 8ad8ece

Please sign in to comment.