Skip to content
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

Implement a stage register module #92

Merged
merged 8 commits into from
Nov 14, 2019

Conversation

jardhu
Copy link
Collaborator

@jardhu jardhu commented Nov 2, 2019

This PR creates a StageReg module as specified in #91, and also changes both pipelined CPU models to utilize it.

One thing I wish to improve about the interface, though I do not know how, is to allow users to access the module's inner register in the same way as regular registers, like so:

val if_id = Module(new StageReg(new IFIDBundle))
if_id.pc := ... 
if_id.pcPlusFour := ...

The current interface exposes the register through io.in and io.data, which obscures what the module is supposed to replace and wastes keystrokes.

@jardhu
Copy link
Collaborator Author

jardhu commented Nov 6, 2019

Hey @powerjg, when you have time could you look at this PR? I'll need it merged for the non combinational CPU.

Copy link
Contributor

@powerjg powerjg left a comment

Choose a reason for hiding this comment

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

Sorry this took me so long. I scheduled time for it a few different times but things kept coming up. I have a few minor requests below. Generally, I really like the interface, and I'm impressed with your scala magic!

src/main/scala/pipelined/cpu-bp.scala Outdated Show resolved Hide resolved
src/main/scala/pipelined/cpu.scala Outdated Show resolved Hide resolved
src/main/scala/pipelined/cpu.scala Outdated Show resolved Hide resolved
src/main/scala/pipelined/stage-register.scala Show resolved Hide resolved
src/main/scala/pipelined/stage-register.scala Outdated Show resolved Hide resolved
src/main/scala/pipelined/stage-register.scala Outdated Show resolved Hide resolved
@@ -0,0 +1,64 @@
// Definition for a pipeline stage register module and its interface

// TODO: Change this to 'pipelined' package in a future patch
Copy link
Contributor

Choose a reason for hiding this comment

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

Great idea! please open an issue :)

Copy link
Contributor

@powerjg powerjg left a comment

Choose a reason for hiding this comment

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

Looks like all of the comments were addressed, though I didn't look closely. Thanks!

@jardhu
Copy link
Collaborator Author

jardhu commented Nov 14, 2019

There's one more thing I need to do, which is to remove the compileOptions parameter from the StageReg.

@jardhu jardhu merged commit c512989 into jlpteaching:master Nov 14, 2019
@jardhu jardhu deleted the pipeline-register branch November 14, 2019 02:32
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