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
[sw/silicon_creator] Add structured kChipInfo to ROM #18100
Conversation
4673b8f
to
95fd0b8
Compare
It looks like #17829 was merged recently. Can you rebase and check if it simplifies our lives? |
While not ideal, I think it was fine (static constant in a header), linker is responsible for shuffling things at the end according to our linker scripts. |
9b26e6e
to
d123df0
Compare
d123df0
to
a728316
Compare
d91bb64
to
4df6a9c
Compare
Hey @cfrantz, this is ready for a review when you get a chance! |
4df6a9c
to
765cec7
Compare
02af19c
to
910d28c
Compare
CC: @msfschaffner, |
910d28c
to
de4b7e5
Compare
ACK |
de4b7e5
to
7798787
Compare
3876c62
to
7181b67
Compare
PR lowRISC#17829 updated the FIFO size, but this constant was stale. Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
PR lowRISC#17829 updated the FIFO size, but the constant in this macro was still stale. Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
This commit adds a new `chip_info_t` struct that contains info about the ROM's provenance. The ROM now prints the Git commit hash on shutdown after the "VER:" prefix. The ROM linker script was already configured to place the .chip_info section at the top of ROM, but I'm not confident that it worked as expected. The autogenerated header contained a static constant, so I think a copy would be inlined at some arbitrary location into any compilation unit that used it, rather than being placed by the linker script. To verify that the ROM prints the Git commit hash on shutdown: ./bazelisk.sh test --test_output=streamed \ //sw/device/silicon_creator/rom/e2e:shutdown_output_dev_fpga_cw310_rom To verify that the .chip_info section contains data from chip_info.o: ./bazelisk.sh build-then 'less %s' --config riscv32 \ //sw/device/silicon_creator/rom:rom_with_fake_keys_fpga_cw310_map To see the value of `kChipInfo` at the end of ROM: ./bazelisk.sh build-then 'xxd %s | less' --config riscv32 \ //sw/device/silicon_creator/rom:rom_with_fake_keys_fpga_cw310_bin For example, here's the end of the ROM from the previous command. At 0x7f80, there are 64 bits of a Git commit hash (e20871e1cf102bf6). 00007f70: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 00007f80: f62b 10cf e171 08e2 .+...q.. Issue lowRISC#14892 Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
7181b67
to
6549f54
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.
Thanks @dmcardle !
This commit adds a new
chip_info_t
struct that contains info about the ROM's provenance. The ROM now prints the Git commit hash on shutdown after the "VER:" prefix.The ROM linker script was already configured to place the .chip_info section at the top of ROM, but I'm not confident that it worked as expected. The autogenerated header contained a static constant, so I think a copy would be inlined at some arbitrary location into any compilation unit that used it, rather than being placed by the linker script.
To verify that the ROM prints the Git commit hash on shutdown:
To verify that the .chip_info section contains data from chip_info.o:
To see the value of
kChipInfo
at the end of ROM:For example, here's the end of the ROM from the previous command. At 0x7f80, there are 64 bits of a Git commit hash (e20871e1cf102bf6).
Fixes #14892
Further discussion in #18198