Skip to content

Comments

refactor(prefetch): add a wrapper and parameterization#4443

Closed
Maxpicca-Li wants to merge 12 commits intokunminghu-v3from
refactor-pf
Closed

refactor(prefetch): add a wrapper and parameterization#4443
Maxpicca-Li wants to merge 12 commits intokunminghu-v3from
refactor-pf

Conversation

@Maxpicca-Li
Copy link
Member

No description provided.

@Maxpicca-Li Maxpicca-Li changed the base branch from master to kunminghu-v3 April 7, 2025 09:06
good-circle and others added 6 commits April 7, 2025 17:35
According to RISC-V specification, the least significant 1 or 2 bits
(depending on whether the C extension is enabled or not) are hardwired
to zero. Therefore, these bits can be pruned to save area.

This PR prunes almost all the addresses in the frontend, except those
related to the backend. The backend should also use `PrunedAddr` instead
of plain `UInt`. Some of these places have been labeled with FIXME or
TODO in the code.

Apart from this, there are several other things that need attention:
* Line 351 of SC.scala appears to have a historical that needs to be
fixed.
* `>>` of `PrunedAddr` should be removed to avoid confusion. This is
mostly used to calculate tags, which can be rewritten as selecting
corresponding bits.
* Implicit conversion of Scala has been attempted. However, the types of
`:=` are not decided until runtime, making `UInt` inevitable.
Considering potential confusion, this approach was abandoned. There
might be a better way of doing this, especially after backend
modifications are merged.
This PR completely refactors the commit mechanism from frontend to
backend, addressing the commit problem once and for all. Additionally,
these changes are expected to save noticeable area for frontend.

The backend now guarantees that every FTQ entry is committed on time,
rather than committing only a subset of instructions. To accomplish
this, each ROB entry can now compress a maximum of two FTQ entries. As a
result, the `commitStateQueue` is no longer needed in the FTQ.

During the refactoring process, some historical bugs were identified and
fixed.

**Attention**: Modifications in the FTQ may lead to a noticeable drop in
BP accuracy. Performance data should be checked before merging into
master.

---------

Co-authored-by: lewislzh <liuzehao19@mails.ucas.ac.cn>
Co-authored-by: chengguanghui <wissycgh@gmail.com>
kunminghu v3 does not have `isFused` field after commit mechanism is
refactored; use `fusionNum` instead
Re-opened from #4338 & rebased to kunminghu-v3

- move InstrUncache out of package ICache (as it is actually a submodule
of Ifu)
- each class in a separate file (except Bundles / Utils)
- module IO inside module class
- extract similar codes and define them as helper functions for reuse
- renames:
  - camel cases
  - unify bundle naming convention
  - re-organize IO

~~DO NOT MERGE: should be rebased to #4462~~ -> Done
~~DO NOT MERGE: should rebase `kunminghu-v3` to master to port #4423
#4468~~ -> Done
~~DO NOT MERGE: ... and rebase `refactor-icache` to `kunminghu-v3`
again~~ -> Done

Ready for review & merge
- each class in a separate file (except Bundles / Utils)
- module IO inside module class
- extract similar codes and define them as helper functions for reuse
- renames:
  - camel cases
  - unify bundle naming convention
  - re-organize IO
- add type annotations & `private` modifiers
- **(important) rewrite delimitation logic in `PreDecode`**, see
[`b7aa772`
(#4436)](b7aa772)
and [`893f4fb`
(#4436)](893f4fb)
- apply review suggestions in
#4461 (review)

~~DO NOT MERGE: Should be rebased to #4461~~ -> Done

Ready for review & merge

---------

Co-authored-by: my-mayfly <mayflyandtree@163.com>
@Maxpicca-Li Maxpicca-Li force-pushed the refactor-pf branch 2 times, most recently from 9864879 to 4b2ae9d Compare April 7, 2025 10:11
@Maxpicca-Li Maxpicca-Li force-pushed the refactor-pf branch 2 times, most recently from aea1e18 to 0c29850 Compare April 7, 2025 10:20
@Maxpicca-Li Maxpicca-Li marked this pull request as ready for review April 8, 2025 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants