Skip to content

[Feat] Revise Hazard Unit removing legacy code about load hazard logic#206

Merged
ChoiCube84 merged 1 commit intodevelopfrom
feat/hazard_unit
Dec 1, 2025
Merged

[Feat] Revise Hazard Unit removing legacy code about load hazard logic#206
ChoiCube84 merged 1 commit intodevelopfrom
feat/hazard_unit

Conversation

@T410N
Copy link
Copy Markdown
Member

@T410N T410N commented Dec 1, 2025

Let's say there is an LW instruction in EX stage, an ADDI instruction in ID stage.
ADDI instruction need forwarding only until the EX stage. At that time, LW is already in the MEM stage, and the forwarding logic for it has already been implemented.
The forward unit also operates OPCODE_LOAD through 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을 처음 설계하면서 개념을 이해하는 과정에 잘못 구상한 레거시코드 같다. 삭제했다.

Copy link
Copy Markdown
Collaborator

@ChoiCube84 ChoiCube84 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good.

@ChoiCube84 ChoiCube84 merged commit ebadae0 into develop Dec 1, 2025
@ChoiCube84 ChoiCube84 deleted the feat/hazard_unit branch December 1, 2025 15:58
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.

2 participants