forked from libre-chip/cpu
Compare commits
2 commits
b956a68724
...
e0dc5d486b
| Author | SHA1 | Date | |
|---|---|---|---|
| e0dc5d486b | |||
| fdf1e97e10 |
7 changed files with 23499 additions and 15 deletions
|
|
@ -99,6 +99,11 @@ impl<C: PhantomConstCpuConfig> RenameTable<C> {
|
|||
config,
|
||||
}
|
||||
}
|
||||
pub(crate) fn entries(
|
||||
&self,
|
||||
) -> &[SimValue<TraceAsString<RenameTableEntry<C>>>; 1 << MOpRegNum::WIDTH] {
|
||||
&self.entries
|
||||
}
|
||||
#[hdl]
|
||||
pub(crate) fn to_debug_state(&self) -> SimValue<RenameTableDebugState<C>> {
|
||||
let Self {
|
||||
|
|
@ -114,11 +119,6 @@ impl<C: PhantomConstCpuConfig> RenameTable<C> {
|
|||
config,
|
||||
}
|
||||
}
|
||||
pub(crate) fn entries(
|
||||
&self,
|
||||
) -> &[SimValue<TraceAsString<RenameTableEntry<C>>>; 1 << MOpRegNum::WIDTH] {
|
||||
&self.entries
|
||||
}
|
||||
#[hdl]
|
||||
pub(crate) fn l2_ref_counts(&self) -> &[usize] {
|
||||
let mut expected = vec![0usize; L2RegNum.l2_reg_count()];
|
||||
|
|
|
|||
|
|
@ -16,13 +16,13 @@ use fayalite::{
|
|||
prelude::*,
|
||||
ty::StaticType,
|
||||
};
|
||||
use std::collections::VecDeque;
|
||||
use std::{collections::VecDeque, mem};
|
||||
|
||||
#[hdl]
|
||||
type SimOnlyMOpInUnitState = SimOnly<MOpInUnitState>;
|
||||
|
||||
#[hdl(no_static)]
|
||||
pub(crate) struct RobEntryDebugState<C: PhantomConstGet<CpuConfig>> {
|
||||
struct RobEntryDebugState<C: PhantomConstGet<CpuConfig>> {
|
||||
/// See [`RobEntry::is_register_fence`]
|
||||
is_register_fence: Bool,
|
||||
/// See [`RobEntry::is_register_fence`]
|
||||
|
|
@ -101,20 +101,20 @@ impl<C: PhantomConstCpuConfig> RobEntry<C> {
|
|||
caused_cancel: None,
|
||||
}
|
||||
}
|
||||
pub(crate) fn dest_reg(&self) -> Option<&SimValue<PRegNum<C>>> {
|
||||
fn dest_reg(&self) -> Option<&SimValue<PRegNum<C>>> {
|
||||
let dest_reg = MOpTrait::dest_reg_sim_ref(self.mop.mop.inner());
|
||||
let unit_index = UnitNum::index_sim(&dest_reg.unit_num)?;
|
||||
assert_eq!(unit_index, self.unit_index);
|
||||
Some(dest_reg)
|
||||
}
|
||||
pub(crate) fn unit_out_reg(&self) -> Option<&SimValue<UnitOutRegNum<C>>> {
|
||||
fn unit_out_reg(&self) -> Option<&SimValue<UnitOutRegNum<C>>> {
|
||||
Some(&self.dest_reg()?.unit_out_reg)
|
||||
}
|
||||
pub(crate) fn unit_out_reg_index(&self) -> Option<usize> {
|
||||
Some(UnitOutRegNum::value_sim(self.unit_out_reg()?))
|
||||
}
|
||||
#[hdl]
|
||||
pub(crate) fn debug_state(&self, config: C) -> SimValue<RobEntryDebugState<C>> {
|
||||
fn debug_state(&self, config: C) -> SimValue<RobEntryDebugState<C>> {
|
||||
let Self {
|
||||
is_register_fence,
|
||||
done_waiting_for_register_fences,
|
||||
|
|
@ -393,10 +393,7 @@ impl<C: PhantomConstCpuConfig> ReorderBuffer<C> {
|
|||
.chain(incomplete_back_entry)
|
||||
.flat_map(|entries| &mut entries.renamed_entries)
|
||||
}
|
||||
pub(crate) fn try_renamed_by_id_mut(
|
||||
&mut self,
|
||||
id: &SimValue<MOpId>,
|
||||
) -> Option<&mut RobEntry<C>> {
|
||||
fn try_renamed_by_id_mut(&mut self, id: &SimValue<MOpId>) -> Option<&mut RobEntry<C>> {
|
||||
self.renamed_mut().find(|v| v.mop.id == *id)
|
||||
}
|
||||
pub(crate) fn renamed_by_id_mut(&mut self, id: &SimValue<MOpId>) -> &mut RobEntry<C> {
|
||||
|
|
@ -415,7 +412,7 @@ impl<C: PhantomConstCpuConfig> ReorderBuffer<C> {
|
|||
.as_int()
|
||||
.wrapping_add(1)
|
||||
.into_sim_value();
|
||||
renamed.mop.id = std::mem::replace(&mut self.next_renamed_mop_id, replacement_id);
|
||||
renamed.mop.id = mem::replace(&mut self.next_renamed_mop_id, replacement_id);
|
||||
println!("renamed_push_back_with_new_id: {:?}", renamed.mop);
|
||||
renamed.for_each_reg(
|
||||
(),
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
4614
crates/cpu/tests/expected/rename_execute_retire_head_n1.vcd
generated
4614
crates/cpu/tests/expected/rename_execute_retire_head_n1.vcd
generated
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue