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

[bazel] Add capability to execute jtag/RAM tests #19719

Merged
merged 6 commits into from
Oct 6, 2023

Conversation

cfrantz
Copy link
Contributor

@cfrantz cfrantz commented Sep 21, 2023

  1. RAM-based binaries need only produce the .elf file.
  2. Create a cw310_jtag_params helper that includes the necessary
    dependencies and flags for a JTAG test dispatch via opentitantool.
  3. Convert a RAM/JTAG test to the new rules.

Note: this PR depends on #19650, #19697 and #19710. You need only review the last two commits.

@cfrantz cfrantz force-pushed the bazel-ram branch 5 times, most recently from 2ad9318 to ed1ede8 Compare October 4, 2023 19:01
1. Add a `kind` attribute to the binary and test rules to indicate
   whether the target is for flash, ram or rom.
2. Plumb flash scrambling support into the exec_env and binary rules.
3. Update the `rom` attribute in the exec environments and binary rules.
   Allow the label to be any provider.
4. Implement flash and rom paths for fpga_cw310 and sim_{dv,verilator}.
4a. When building, apply the scrambling transform to the ROM binary.
4b. When testing, retrieve the supplied ROM and substitute it into the
    test flow.  Currently, only verilator can run ROM tests.
5. Update `sim.mk` to collect the correct file resources for the
   test_rom.

Signed-off-by: Chris Frantz <[email protected]>
1. Re-arrange the exec_envs so that there are environments that do not
   depend on the ROM targets.
2. Convert the test_rom target to use `opentitan_binary`.
3. Update the `test_rom_test` to use the standard exec_envs.
4. Add tentative CW340 support (build only - testing not yet supported).

Signed-off-by: Chris Frantz <[email protected]>
Demonstrate how to convert a `test_in_rom` test to the new
opentitan_test rule.

Signed-off-by: Chris Frantz <[email protected]>
1. Define a basic CW305 exec_env.The build/release pipeline expects to
   find cw305 artifacts for the test_rom.
2. The englishbreakfast verilator model does not understand ROM scrambling,
   so we also create a non-scrambled VMEM file.

Signed-off-by: Chris Frantz <[email protected]>
1. RAM-based binaries need only produce the `.elf` file.
2. Create a `cw310_jtag_params` helper that includes the necessary
   dependencies and flags for a JTAG test dispatch via opentitantool.

Signed-off-by: Chris Frantz <[email protected]>
@timothytrippel
Copy link
Contributor

  1. RAM-based binaries need only produce the .elf file.

I guess we can eventually remove the option to load SRAM VMEM programs then: https://cs.opensource.google/opentitan/opentitan/+/master:sw/host/opentitanlib/src/test_utils/load_sram_program.rs;drc=05ba6772e04509a9ed133e692cda16d6dc9cd309;l=36
(once everything switches over)?

rules/opentitan/fpga_cw310.bzl Show resolved Hide resolved
rules/opentitan/openocd.bzl Show resolved Hide resolved
@cfrantz cfrantz merged commit 2438b17 into lowRISC:master Oct 6, 2023
29 checks passed
@cfrantz cfrantz deleted the bazel-ram branch November 17, 2023 16:01
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.

4 participants