WIP linking next_pc stages together
This commit is contained in:
parent
231f5e72ec
commit
cfd04469ce
4 changed files with 862 additions and 208 deletions
|
|
@ -35,6 +35,7 @@ pub struct CpuConfig {
|
|||
pub out_reg_num_width: usize,
|
||||
pub fetch_width: NonZeroUsize,
|
||||
pub max_branches_per_fetch: NonZeroUsize,
|
||||
pub max_fetches_in_flight: NonZeroUsize,
|
||||
pub log2_fetch_width_in_bytes: u8,
|
||||
/// default value for [`UnitConfig::max_in_flight`]
|
||||
pub default_unit_max_in_flight: NonZeroUsize,
|
||||
|
|
@ -55,6 +56,12 @@ impl CpuConfig {
|
|||
};
|
||||
v
|
||||
};
|
||||
pub const DEFAULT_MAX_FETCHES_IN_FLIGHT: NonZeroUsize = {
|
||||
let Some(v) = NonZeroUsize::new(16) else {
|
||||
unreachable!();
|
||||
};
|
||||
v
|
||||
};
|
||||
pub const DEFAULT_LOG2_FETCH_WIDTH_IN_BYTES: u8 = 3;
|
||||
pub const DEFAULT_UNIT_MAX_IN_FLIGHT: NonZeroUsize = {
|
||||
let Some(v) = NonZeroUsize::new(8) else {
|
||||
|
|
@ -68,6 +75,7 @@ impl CpuConfig {
|
|||
out_reg_num_width: Self::DEFAULT_OUT_REG_NUM_WIDTH,
|
||||
fetch_width: Self::DEFAULT_FETCH_WIDTH,
|
||||
max_branches_per_fetch: Self::DEFAULT_MAX_BRANCHES_PER_FETCH,
|
||||
max_fetches_in_flight: Self::DEFAULT_MAX_FETCHES_IN_FLIGHT,
|
||||
log2_fetch_width_in_bytes: Self::DEFAULT_LOG2_FETCH_WIDTH_IN_BYTES,
|
||||
default_unit_max_in_flight: Self::DEFAULT_UNIT_MAX_IN_FLIGHT,
|
||||
rob_size,
|
||||
|
|
@ -138,11 +146,20 @@ impl CpuConfig {
|
|||
#[hdl(get(|c| c.fetch_width.get()))]
|
||||
pub type CpuConfigFetchWidth<C: PhantomConstGet<CpuConfig>> = DynSize;
|
||||
|
||||
#[hdl(get(|c| c.fetch_width.get() * 2))]
|
||||
pub type TwiceCpuConfigFetchWidth<C: PhantomConstGet<CpuConfig>> = DynSize;
|
||||
|
||||
#[hdl(get(|c| c.max_branches_per_fetch.get()))]
|
||||
pub type CpuConfigMaxBranchesPerFetch<C: PhantomConstGet<CpuConfig>> = DynSize;
|
||||
|
||||
#[hdl(get(|c| c.max_fetches_in_flight.get()))]
|
||||
pub type CpuConfigMaxFetchesInFlight<C: PhantomConstGet<CpuConfig>> = DynSize;
|
||||
|
||||
#[hdl(get(|c| c.log2_fetch_width_in_bytes.into()))]
|
||||
pub type CpuConfigLog2FetchWidthInBytes<C: PhantomConstGet<CpuConfig>> = DynSize;
|
||||
|
||||
#[hdl(get(|c| c.fetch_width_in_bytes()))]
|
||||
pub type CpuConfigFetchWidthInBytes<C: PhantomConstGet<CpuConfig>> = DynSize;
|
||||
|
||||
#[hdl(get(|c| c.rob_size.get()))]
|
||||
pub type CpuConfigRobSize<C: PhantomConstGet<CpuConfig>> = DynSize;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -16,10 +16,7 @@ stateDiagram-v2
|
|||
br_pred --> post_decode
|
||||
post_decode --> next_pc: cancel following
|
||||
|
||||
state "Rename\nDispatch\nExecute" as execute
|
||||
post_decode --> execute
|
||||
|
||||
state "Retire" as retire
|
||||
execute --> retire
|
||||
retire --> [*]
|
||||
retire --> next_pc: cancel following
|
||||
state "Execute/Retire" as execute_retire
|
||||
post_decode --> execute_retire
|
||||
execute_retire --> [*]
|
||||
execute_retire --> next_pc: cancel following
|
||||
|
|
@ -165,6 +165,9 @@ impl<T: Type, N: Size> ArrayVec<T, N> {
|
|||
Err(value)
|
||||
}
|
||||
}
|
||||
pub fn truncate_sim(this: &mut SimValue<Self>, len: usize) {
|
||||
*this.len = len.min(*this.len);
|
||||
}
|
||||
pub fn mapped_ty<U: Type>(self, new_element_ty: U) -> ArrayVec<U, N> {
|
||||
ArrayVec {
|
||||
elements: ArrayType[new_element_ty][N::from_usize(self.elements.len())],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue