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

Misc Additions to Local FPGA Branch #669

Merged
merged 5 commits into from
Sep 7, 2020

Conversation

abejgonzalez
Copy link
Contributor

Related issue: #666

Type of change: new feature

Impact: rtl change + other

Release Notes
This builds off of #666 to have it use the Chipyard make system and try to make the compile work with the newest RC changes. Note, this doesn't check for RTL functionality... still needs to be checked on an Arty board.

@abejgonzalez abejgonzalez self-assigned this Sep 4, 2020
@abejgonzalez abejgonzalez changed the title Local fpga arty abe Use Chipyard Make System for Local FPGA Branch Sep 4, 2020
Copy link
Contributor

@colinschmidt colinschmidt left a comment

Choose a reason for hiding this comment

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

Seem pretty good. I think we don't need to consume the weird style habits in the makefile, and instead can make the names more similar to the rest of chipyard.

Also obviously testing would be good, but I assume that can happen after the merge into the orig PR.

Not blocking merge since this is just a PR to a PR

@@ -0,0 +1,3 @@
*
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should make the builds in here look more standard so we can change this ignore all to something like generated-src,output, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reasonable goal.

#########################################################################################
all_vsrcs := \
$(sim_vsrcs) \
$(base_dir)/generators/sifive-blocks/vsrc/SRLatch.v \
Copy link
Contributor

Choose a reason for hiding this comment

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

Why these included via the standard firrtl method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are just black boxes and do not have a resource associated with them. So we would have to make a PR for these to be included through the "normal automatic" way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now, I just blindly included them, later I think a PR should be opened in both places to make this automatic.

Copy link
Contributor

Choose a reason for hiding this comment

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

Issue to track?

fpga/Makefile Outdated
$(build_dir)/$(long_name).rom.v

#########################################################################################
# build rom for the fpga
Copy link
Contributor

Choose a reason for hiding this comment

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

rom->bootrom

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Just copied the names.

fpga/Makefile Outdated
export LONG_NAME=$(long_name)
export ROMCONF=$(build_dir)/$(long_name).rom.conf

romgen := $(build_dir)/$(long_name).rom.v
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like this name. It is the generated rom not a rom generator. I think rom_v rom_file etc are better names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Just copied the names.

fpga/Makefile Show resolved Hide resolved
@@ -35,11 +40,11 @@ hex: $(hex)

Copy link
Contributor

Choose a reason for hiding this comment

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

I can't comment on the above lines since they aren't in the diff for this PR, but I have one question.
Is the hardcoded target_address coming from an RTL config fragment? If so we should think about how to do this without repeating ourselves.

Copy link
Contributor Author

@abejgonzalez abejgonzalez Sep 4, 2020

Choose a reason for hiding this comment

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

Yea. Im not sure. I need to look into this more... they end up using a MaskROM over a BootROM in the code which is a bit confusing to me. Why not use a BootROM? I need to further investigate.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe MaskROM implies a specific kind of ROM that is reprogrammable with just a single VLSI mask update. I think there is an overload used here sometimes for an FPGA ROM that can be updated without the rest of the bit stream being changed.

Besides that definition, I think a MaskROM can be a BootROM (a ROM that contains code to boot, and is where the core resets to), but not all BootROMs would be MaskROMs and not all MaskROMs would be BootROMs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So it looks like the MaskROM is used to load in a ROM after elaboration using readmemh. This differs from the BootROM which bakes the .img directly into the module in Chisel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be good to just swap MaskROM for the BootROM


.PHONY: romgen
romgen: $(romgen)

.PHONY: clean
clean::
rm -rf $(hex) $(elf)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#vim>emacs

@@ -51,6 +51,7 @@ class E300ArtyDevKitPlatformIO(implicit val p: Parameters) extends Bundle {
//-------------------------------------------------------------------------

class E300ArtyDevKitPlatform(implicit val p: Parameters) extends Module {
//val sys = Module(LazyModule(new E300ArtyDevKitSystem).module) This can be DigitalTop?
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this just remnants from some other testing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh. Yea. This should be deleted.

val maskROMs = p(MaskROMLocated(location)).map { MaskROM.attach(_, this, CBUS) }

val maskROMResetVectorSourceNode = BundleBridgeSource[UInt]()
tileResetVectorNexusNode := maskROMResetVectorSourceNode
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems weird to support both bootROM and maskROM above but then not do some connection here.
Do we require a maskROM but optionally allow a bootROM that never can be the reset location?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea. This was a hack to try and do what the original code wanted. I need to look into this.

GENERATOR_PACKAGE := chipyard
TB := none # unused
TOP := E300ArtyDevKitPlatform

Copy link
Contributor

Choose a reason for hiding this comment

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

Should the goal be to eventually eliminate most of these overrides? I believe eventually everything can just live as part of the core chipyard generator.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think thats related to the other checkbox in my review of the original PR. I believe the answer is yes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. The goal is to get rid of these. I just hard-coded them so that this particular example works all the time. Ideally, this will change with more configuration exposed.

@abejgonzalez
Copy link
Contributor Author

Updated. Now uses the CY BootRom, addressed some comments, and now uses DigitalTop (aka can now access all CY projects). Need to see what the MockAON is since I don't think it can be "disabled" but so far this is getting closer.

@abejgonzalez abejgonzalez changed the title Use Chipyard Make System for Local FPGA Branch Misc Additions to Local FPGA Branch Sep 5, 2020
@abejgonzalez abejgonzalez merged commit b6a54ea into local-fpga-arty Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants