Add m extension control and hazard - #261
Open
tandr3w wants to merge 3 commits into
Open
Conversation
DanielTaoHuang123
left a comment
Contributor
There was a problem hiding this comment.
connect is_div and is_mul to the feature flags; everything else seems OK
DanielTaoHuang123
left a comment
Contributor
There was a problem hiding this comment.
pretty good overall; fix the two commented lines and resolve conflict and I think it will be good to merge
| UTOSS_RISCV_CONFIG ?= RV32I | ||
| UTOSS_RISCV_ENABLE_MUL ?= $(if $(findstring M,$(UTOSS_RISCV_CONFIG)),1,0) | ||
| UTOSS_RISCV_ENABLE_DIV ?= $(if $(findstring M,$(UTOSS_RISCV_CONFIG)),1,0) | ||
| UTOSS_RISCV_ENABLE_M := $(if $(filter 1,$(UTOSS_RISCV_ENABLE_MUL) $(UTOSS_RISCV_ENABLE_DIV)),1,0) |
Contributor
There was a problem hiding this comment.
probably want to change this logic from OR to AND, since when running RV32M riscof test both mul and div are tested; if only one of them is enabled the other reports error
tandr3w
force-pushed
the
m_extension-control
branch
from
August 13, 2026 18:22
a05fa74 to
22fc75f
Compare
tandr3w
marked this pull request as ready for review
August 13, 2026 18:25
Contributor
Author
|
I fixed the two comments and rebased but we probably need to wait for the decoder and mul/div unit to be done before merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #245
Updated hazard unit to allow for DIV
Updated execute to select the MUL or DIV module instead of the ALU when needed
Added mul and div instructions to the interface between decode and execute
Note that I didn't actually use div_cancel since it wasn't in the diagram in the planning doc. Also, it seems unnececssary after thinking about it a little? Since a branch instruction should never be in ex at the same time as a div.
I also assumed that the modules would look like the diagrams, and I might've accidentally done some of the integration work as well since I didn't really know how to separate it