Comments (4)
Hi @MicahDoo
So is the issue here not that there is a RAW hazard on the following?
addi a0, zero, 0
# if a0 = 0, branch => if no error, should branch
beq a0, x0, branch
It is exactly such a situation which a hazard unit is supposed to detect and then dynamically stall the pipeline to realize the 2-cycle bubble (as you indicate with the two nop
instructions).
The pipelined processors without hazard units are not supposed to execute a program correctly. They are meant as intermediate design points to be able to illustrate why hazard detection and resolution is required for a pipeline.
It should probably be more clear in the program/processor selection dialog that these processors aren't guaranteed to produce correct results..!
from ripes.
Hi, @mortbopet
Thank you for the response!
Don't worry, the description was clear enough. I was just wondering why, with the "hazard detection off, forwarding on" option, forwarding seems to be incomplete in that it is removed for branching instructions, while kept intact for ALU instructions. In my examples above, I didn't need any nop
for RAW with the second instruction being addi
as forwarding worked just fine for ALU. But I did need two of them with beq
.
And it shows on the datapath layout, too:
This is with hazard detection:
The ALU and Branch Comparator both take their inputs from the forwarding unit, as expected.
This is without hazard detection:
Here the Branch Comparator cannot receive write-back values coming through the two forwarding multiplexers because it doesn't receive inputs through them.
This threw me off a bit because, as far as I know, hazard detection happens in the control unit and is separate from forwarding, which is reflected on the datapath. I am curious as to why this configuration without hazard detection changes the forwarding functionality in the datapath in this way?
from ripes.
Looking this through, i think you're right that there is a bug here - the branch unit should indeed be connected to the forwarding registers (as it is in the 5-stage model with fw/hz).
Once time permits, i'll push a fix.
from ripes.
Got it. I'm glad that's cleared up. This is an awesome tool and has helped me a lot with understanding RISC-V. Thank you for making this possible. Keep up the good work!
from ripes.
Related Issues (20)
- Ripes crashes when hovering over the cache statistics chart HOT 1
- Ripes crashes when using 'Open' Syscall HOT 2
- Error reporting when running on centos7 HOT 2
- Missing virtual destructors in abstract classes
- Discussion on Github Actions HOT 1
- Add Cache Replacement Policy HOT 1
- Setting a register as the first instruction sometimes causes a runtime error in the single-cycle processors
- Using CLI without UI
- Use `magic_enum` to replace various enum<-> name maps and better-enums HOT 1
- M-extension issue (multiplication exceeds 64-bits)
- Division by zero crash in assembler constant expressions
- Adding options for branch strategies and branch delay HOT 1
- "Clock the circuit with the selected frequency" (F6) never stops HOT 5
- How to handle System Input in CLI? HOT 3
- Assembly source code execution highlight only works with default .text start address HOT 2
- Input Type always set to `Assembly` on startup
- Adding an option to change the direction of memory address growth
- .gitignore does not match files generated at configuration/compile time (?) HOT 1
- unreachable code for REMU in rv_alu.h HOT 1
- Unable to open Ripes v2.2.6 on mac
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ripes.