-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add non-combinational CPU model #87
base: master
Are you sure you want to change the base?
Conversation
Update master with new memory changes
This signal serves as a way for the pipeline to know whether the backing memory is ready for another request. This is required for the non-combinational memory to stall when the memory is not ready to continue. Previously, the 'good' signal served this purpose but is now used to write valid memory data to each stage's register.
This should cover all of the new changes I had in the previous pull request with a cleaner commit history and none of the previous polluting commits. So, right now I just need to change the hazard detection unit and CPU to use the |
No worries :).
…On Thu, Sep 19, 2019 at 5:19 PM Jared Barocsi ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/main/scala/components/hazardmemstall.scala
<#87 (comment)>:
> +
+ // branch flush
+ when (io.exmem_taken) {
+ io.pcwrite := 1.U // use the PC from mem stage
+ io.ifid_flush := true.B
+ io.idex_bubble := true.B
+ io.exmem_bubble := true.B
+ }
+
+ // mem stall
+ when (~(io.imem_good && io.dmem_good)) {
+ io.pcwrite := 2.U // freeze PC
+ io.idex_bubble := true.B
+ //io.exmem_bubble := true.B
+ }
+}
I noted the comment about my changes not having newlines at the end of
files. My IDE is currently configured to add newlines right now and indeed
my current copy of the repository has them. Maybe Git is stripping away the
newline? I would have to check.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#87?email_source=notifications&email_token=AAA2YHCEJQR3JXB73KYMZFTQKQJH3A5CNFSM4IYRIRN2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFLNREA#pullrequestreview-290904208>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAA2YHDH6PPEK5IMLKLF5DLQKQJH3ANCNFSM4IYRIRNQ>
.
--
Jason Lowe-Power (he/him/his)
Assistant Professor, Computer Science Department
University of California, Davis
3049 Kemper Hall
https://arch.cs.ucdavis.edu/
|
I'm having some trouble trying to get the non-combinational CPU to work with the signals; nothing I did before seems to work now. Could I perhaps talk with you about it on Wednesday? |
Issue with JAL: Methodology to reproduce:
|
This signal serves as a way for the pipeline to know whether the backing memory is ready for another request. This is required for the non-combinational memory to stall when the memory is not ready to continue. Previously, the 'good' signal served this purpose but is now used to write valid memory data to each stage's register.
This will probably be rebased so that it's merged in the commit that actually adds this class
Nothing new here, I'm just updating my branch with all the changes to master :) |
One minor comment about the base branch changes: Apparently, it is by design that a feature branch with merged-in master commits shows these old commits in a pull request. Obviously we do not want these in the pull request's history, so a workaround to remove these is to change the base of the PR from master to a temporary branch and change it back. |
b92342e
to
f14b973
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! What's the current state? Does the new design pass the tests?
* Output: exmem_disable, if true, explicitly prevent the EX/MEM register from being written to | ||
* | ||
* For more information, see Section 4.7 and beginning of 4.8 of Patterson and Hennessy | ||
* This follows the "Data hazards and stalls" section and the "Assume branch not taken" section |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this true or copied from somewhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new signals do not follow the pattern. Do you think I should move them beyond that note about the Patterson note and clarify that they are additionally added in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say just drop that part of the comment if it doesn't apply anymore. It's fine to go beyond the textbook :)
R-type and I-type tests work. Branching and jumps still don't work, and memory does not work. By extension the small applications tests also fails. I am working on the memory tests right now. |
BTW, Sorry if my recent commits cause any conflicts. However, if you rebase on master and update the file to work with the new single stepper printing system you should be able to debug more easily. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of small FYI's :)
@@ -15,7 +15,10 @@ class CPUFlatSpec extends FlatSpec with Matchers | |||
class CPUTesterDriver(cpuType: String, | |||
branchPredictor: String, | |||
binary: String, | |||
extraName: String = "") { | |||
extraName: String = "", | |||
forceDebug: Boolean = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
force debug was removed in master, fyi.
val cpustr = if (branchPredictor != "") { cpuType+"-bp" } else { cpuType } | ||
val driver = new CPUTesterDriver(cpustr, branchPredictor, testCase.binary, testCase.extraName) | ||
val driver = new CPUTesterDriver(cpustr, branchPredictor, testCase.binary, testCase.extraName, false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't need false here anymore.
Getting closer :) |
- Add dump function to the single stepper - Improve the instruction print function Still need to make the pipeline registers print nicely Closes jlpteaching#107 Closes jlpteaching#59 Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Closes jlpteaching#108 Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
5d45339
to
2c44599
Compare
Looking good! It looks like it's pretty close! |
Unfortunately this breaks branch instructions again.
ae38a50
to
018fecd
Compare
@powerjg All instruction unit tests pass, only the simple applications fail now. I won't be available for the next few days to look closer at what is happening, but could you perhaps give some insight onto specific architectural details each application is supposed to test? Or are they designed so that if every single unit test works, then the simple applications also should pass after? |
Well, the idea was that if you pass the instruction tests the full applications would work. However, in practice, it seems that there are some cases the instruction tests don't test well. We might be able to go back to Piazza from wq '19 and see what those cases were and develop some better tests :). IIRC, the cases that weren't covered had to do with JAL and JALR, but I could be mis-remembering. |
This pull request implements a modified CPU model that accounts for memory stalling. In particular a new PipelinedNonCombinCPU class is added containing the design of this CPU, as well as a new hazard detection unit with signals for stalling the pipeline when the memory is busy.
Likewise new functionality was implemented for the testing drivers to allow the tester driver to specify what type of memory and ports are required for the test. This is used primarily to perform the instruction tests and full application tests for the non combinational CPU.
All existing test cases should default to using the combinational memory and combinational ports and retain the previous testing behavior, at least from what I tested.