[Feat] Revise Hazard Unit removing legacy code about load hazard logic#206
Merged
ChoiCube84 merged 1 commit intodevelopfrom Dec 1, 2025
Merged
[Feat] Revise Hazard Unit removing legacy code about load hazard logic#206ChoiCube84 merged 1 commit intodevelopfrom
ChoiCube84 merged 1 commit intodevelopfrom
Conversation
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.
Let's say there is an
LWinstruction in EX stage, anADDIinstruction in ID stage.ADDIinstruction need forwarding only until the EX stage. At that time,LWis already in the MEM stage, and the forwarding logic for it has already been implemented.The forward unit also operates
OPCODE_LOADthrough a separate case (MEM_opcode).It seems like a legacy code that was misconceived in the process of understanding concepts while designing the Hazard Unit for the first time. I removed it.
EX단계에 있는 lw 명령어, ID 단계에 있는 ADDI 명령어가 있다고 하자.
ADDI 명령어는 결국 EX단계가 되어서야 포워딩이 필요하다. 그 때 lw는 이미 MEM 단계이고, 이에 대한 포워딩 로직은 이미 구현이 되어있다.
Forward Unit에서도 `OPCODE_LOAD를 별개로 case (MEM_opcode)를 통해 운용하고 있다.
아무래도 Hazard Unit을 처음 설계하면서 개념을 이해하는 과정에 잘못 구상한 레거시코드 같다. 삭제했다.