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

[sw/silicon_creator] ROM digest and chip_info #14892

Closed
2 tasks
alphan opened this issue Sep 13, 2022 · 6 comments · Fixed by #18100
Closed
2 tasks

[sw/silicon_creator] ROM digest and chip_info #14892

alphan opened this issue Sep 13, 2022 · 6 comments · Fixed by #18100
Assignees
Labels
Component:Software Issue related to Software Priority:P2 Priority: medium SW:ROM ROM related issues Type:Task Tasks, to-do list.

Comments

@alphan
Copy link
Contributor

alphan commented Sep 13, 2022

Noticed while working on #14884

From the rom_ctrl spec:

The top eight words in ROM (by logical address) are interpreted as a 256-bit expected hash. Unlike the rest of ROM, their data is not stored scrambled, so the expected hash can be read directly.

  • Do we need to store chip_info in ROM?
  • If yes, we need to reserve 256 bits at the top of ROM for its digest. See test_rom.ld.

@moidx @cfrantz @tjaychen

@alphan alphan added Component:Software Issue related to Software Type:Task Tasks, to-do list. SW:ROM ROM related issues labels Sep 13, 2022
@alphan alphan self-assigned this Sep 13, 2022
@timothytrippel
Copy link
Contributor

Noticed this as well while working on #14890 :) ... was just about to file an issue thanks @alphan !

@tjaychen
Copy link

sorry i think i'm a little confused. So are we saying today during build, we insert chip_info into the top 128B, but during the rom_ctrl scramble we end up overriding it with the digest..? does that mean chip info doesn't print out correctly today at all?

@tjaychen
Copy link

ooo wait i see we subtract the digest size in test_rom..

@tjaychen
Copy link

yeah it feels like this would be good to have in the real rom.
Since someone could look at the printout and reference back to the repo for a particular githash.

@alphan
Copy link
Contributor Author

alphan commented Sep 13, 2022

From ROM sync: Remove chip_info, use 32-bit truncated commit hash, print during shutdown. Use VER: for the prefix.

@msfschaffner msfschaffner added this to the Project: M3 milestone Sep 30, 2022
@andreaskurth
Copy link
Contributor

Assigning to M2.5 with Priority:P2 Priority: medium because ROM will be frozen after that. Please feel free to defer post M2.5 if we should not implement this for this release.

(I came across this while triaging rom_ctrl.)

@andreaskurth andreaskurth added the Priority:P2 Priority: medium label Feb 28, 2023
@arunthomas arunthomas assigned dmcardle and unassigned alphan Apr 17, 2023
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 20, 2023
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 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

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

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 20, 2023
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 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

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

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 20, 2023
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. Note
that it contains 32 bits of a git commit hash starting at 0x7f80,
followed by a human-readable timestamp.

    ...
    00007f70: 0000 0000 0000 0000 0000 0000 0000 0000  ................
    00007f80: e3fe 72cd 3230 3233 2d30 342d 3230 2031  ..r.2023-04-20 1
    00007f90: 363a 3533 3a34 3800                      6:53:48.

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 20, 2023
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. Note
that it contains 32 bits of a git commit hash starting at 0x7f80,
followed by a human-readable timestamp.

    ...
    00007f70: 0000 0000 0000 0000 0000 0000 0000 0000  ................
    00007f80: e3fe 72cd 3230 3233 2d30 342d 3230 2031  ..r.2023-04-20 1
    00007f90: 363a 3533 3a34 3800                      6:53:48.

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 20, 2023
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. Note
that it contains 32 bits of a git commit hash starting at 0x7f80,
followed by a human-readable timestamp.

    ...
    00007f70: 0000 0000 0000 0000 0000 0000 0000 0000  ................
    00007f80: e3fe 72cd 3230 3233 2d30 342d 3230 2031  ..r.2023-04-20 1
    00007f90: 363a 3533 3a34 3800                      6:53:48.

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 21, 2023
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. Note
that it contains 32 bits of a git commit hash starting at 0x7f80,
followed by a human-readable timestamp.

    ...
    00007f70: 0000 0000 0000 0000 0000 0000 0000 0000  ................
    00007f80: e3fe 72cd 3230 3233 2d30 342d 3230 2031  ..r.2023-04-20 1
    00007f90: 363a 3533 3a34 3800                      6:53:48.

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 21, 2023
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. Note
that it contains 32 bits of a git commit hash starting at 0x7f80,
followed by a human-readable timestamp.

    ...
    00007f70: 0000 0000 0000 0000 0000 0000 0000 0000  ................
    00007f80: e3fe 72cd 3230 3233 2d30 342d 3230 2031  ..r.2023-04-20 1
    00007f90: 363a 3533 3a34 3800                      6:53:48.

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 21, 2023
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. Note
that it contains 32 bits of a git commit hash starting at 0x7f80,
followed by a human-readable timestamp.

    ...
    00007f70: 0000 0000 0000 0000 0000 0000 0000 0000  ................
    00007f80: e3fe 72cd 3230 3233 2d30 342d 3230 2031  ..r.2023-04-20 1
    00007f90: 363a 3533 3a34 3800                      6:53:48.

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 24, 2023
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. Note
that it contains 32 bits of a git commit hash starting at 0x7f80,
followed by a human-readable timestamp.

    ...
    00007f70: 0000 0000 0000 0000 0000 0000 0000 0000  ................
    00007f80: e3fe 72cd 3230 3233 2d30 342d 3230 2031  ..r.2023-04-20 1
    00007f90: 363a 3533 3a34 3800                      6:53:48.

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 24, 2023
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. Note
that it contains 32 bits of a git commit hash starting at 0x7f80,
followed by a human-readable timestamp.

    ...
    00007f70: 0000 0000 0000 0000 0000 0000 0000 0000  ................
    00007f80: e3fe 72cd 3230 3233 2d30 342d 3230 2031  ..r.2023-04-20 1
    00007f90: 363a 3533 3a34 3800                      6:53:48.

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 24, 2023
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. Note
that it contains 32 bits of a git commit hash starting at 0x7f80,
followed by a human-readable timestamp.

    ...
    00007f70: 0000 0000 0000 0000 0000 0000 0000 0000  ................
    00007f80: 0000 0000 633e 05dd e3fe 72cd 3230 3233  ....c>....r.2023
    00007f90: 2d30 342d 3231 2031 353a 3237 3a30 3100  -04-21 15:27:01.

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 24, 2023
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. Note
that it contains 32 bits of a git commit hash starting at 0x7f80,
followed by a human-readable timestamp.

    ...
    00007f70: 0000 0000 0000 0000 0000 0000 0000 0000  ................
    00007f80: 0000 0000 633e 05dd e3fe 72cd 3230 3233  ....c>....r.2023
    00007f90: 2d30 342d 3231 2031 353a 3237 3a30 3100  -04-21 15:27:01.

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 25, 2023
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. Note
that it contains 32 bits of a git commit hash starting at 0x7f80,
followed by a human-readable timestamp.

    ...
    00007f70: 0000 0000 0000 0000 0000 0000 0000 0000  ................
    00007f80: 0000 0000 633e 05dd e3fe 72cd 3230 3233  ....c>....r.2023
    00007f90: 2d30 342d 3231 2031 353a 3237 3a30 3100  -04-21 15:27:01.

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 25, 2023
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. Note
that it contains 32 bits of a git commit hash starting at 0x7f80,
followed by a human-readable timestamp.

    00007f80: 0000 0000 0000 0000 633e 05dd e3fe 72cd  ........c>....r.
    00007f90: 3230 3233 2d30 342d 3231 2031 353a 3237  2023-04-21 15:27
    00007fa0: 3a30 3100 0000 0000                      :01.....

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 25, 2023
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. Note
that it contains 32 bits of a git commit hash starting at 0x7f80,
followed by a human-readable timestamp.

    00007f70: 0000 0000 0000 0000 0000 0000 0000 0000  ................
    00007f80: 633e 05dd e3fe 72cd 0000 0000 3230 3233  c>....r.....2023
    00007f90: 2d30 342d 3235 2031 353a 3133 3a32 3900  -04-25 15:13:29.

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 25, 2023
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. Note
that it contains 32 bits of a git commit hash starting at 0x7f80,
followed by a human-readable timestamp.

    00007f70: 0000 0000 0000 0000 0000 0000 0000 0000  ................
    00007f80: 633e 05dd e3fe 72cd 0000 0000 3230 3233  c>....r.....2023
    00007f90: 2d30 342d 3235 2031 353a 3133 3a32 3900  -04-25 15:13:29.

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 26, 2023
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. Note
that it contains 32 bits of a git commit hash starting at 0x7f80,
followed by a human-readable timestamp.

    00007f70: 0000 0000 0000 0000 0000 0000 0000 0000  ................
    00007f80: 9461 ce0e c828 0d91 0000 0000 0000 0000  .a...(..........

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 28, 2023
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. Note
that it contains 32 bits of a git commit hash starting at 0x7f80,
followed by a human-readable timestamp.

    00007f70: 0000 0000 0000 0000 0000 0000 0000 0000  ................
    00007f80: 9461 ce0e c828 0d91 0000 0000 0000 0000  .a...(..........

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 28, 2023
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. Note
that it contains 32 bits of a git commit hash starting at 0x7f80,
followed by a human-readable timestamp.

    00007f70: 0000 0000 0000 0000 0000 0000 0000 0000  ................
    00007f80: 9461 ce0e c828 0d91 0000 0000 0000 0000  .a...(..........

Issue lowRISC#14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 28, 2023
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>
dmcardle added a commit to dmcardle/opentitan that referenced this issue Apr 28, 2023
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>
dmcardle added a commit to dmcardle/opentitan that referenced this issue May 1, 2023
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>
dmcardle added a commit that referenced this issue May 1, 2023
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 #14892
Signed-off-by: Dan McArdle <dmcardle@opentitan.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:Software Issue related to Software Priority:P2 Priority: medium SW:ROM ROM related issues Type:Task Tasks, to-do list.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants