-
Notifications
You must be signed in to change notification settings - Fork 662
Remove dependency on srecord #2327
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
base: master
Are you sure you want to change the base?
Conversation
|
Hi Tim, thanks for this work. The main things I'd like to check are whether these changes will also work with the lowRISC toolchain and matching the existing style in "examples/sw/simple_system/common/common.mk" a bit better. I believe the lowRISC toolchain objcopy is |
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've convinced myself that the "Run quality checks (Lint and DV)" CI job should test these changes.
Could you please make a few style-related tweaks (see inline comments), mark the PR as non-draft, and then I'll try running it through the full CI.
| riscv32-unknown-elf-objcopy -O binary $(OPATH)coremark.elf $(OPATH)coremark.bin | ||
| srec_cat $(OPATH)coremark.bin -binary -offset 0x0000 -byte-swap 4 -o $(OPATH)coremark.vmem -vmem | ||
|
|
||
| objcopy --input-target=binary --output-target=verilog --reverse-bytes=4 --verilog-data-width=4 $(OPATH)coremark.bin $(OPATH)coremark.vmem |
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 tweaks here should make this change fit in better with the existing code. Could you please swap out objcopy for riscv32-unknown-elf-objcopy, use the short version of flags where available (-O and -I) to match the lines above, and wrap the line before column 100?
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 generally prefer long arguments for scripts, where readability is more important than saving a few keystrokes... I guess -I and -O aren't too bad.
I also changed it so it directly converts from .elf to .vmem - a bit simpler and more regular.
| # is widely available. | ||
| %.vmem: %.bin | ||
| srec_cat $^ -binary -offset 0x0000 -byte-swap 4 -o $@ -vmem | ||
| objcopy --input-target=binary --output-target=verilog --reverse-bytes=4 --verilog-data-width=4 $< $@ |
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.
Again, a few tweaks would be a big help for maintaining style. Could you please replace objcopy with $(OBJCOPY), and use the short version of flags where available (-O and -I) to match the recipe below?
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.
Updated
The linked issue was resolved 6 years ago so it's probably safe to use the new flag.
815ebc6 to
7b516ae
Compare
|
This PR is similar to #2062. I am not the expert on these tools, but it might be useful to check out the discussions that were held there as well. Once this PR gets merged, the other one can be closed. |
|
My apologies @Timmmm, it seems there is more to this dependency than I realised. From what I can gather following the trail of links from #2062, we will probably have to stick with That said, I wonder if it would be possible to update the toolchain. @jwnrt would likely be able to comment once he's back from holiday. |
|
We are in the (gradual) process of updating our toolchain. I had a PR (lowRISC/lowrisc-toolchains#87) to update binutils which would include the working objcopy, but we found that it required a newer version of Clang to generate the correct marker symbols it needs for disassembly, so that was blocking. We are currently updating Clang to v21 so when that’s done we can update Binutils too. |
The linked issue was resolved 6 years ago so it's probably safe to use the new flag.
Draft because I'm not sure how to actually test this. Is it used anywhere with Verilator?