lowRISC / opentitan

OpenTitan: Open source silicon root of trust
https://www.opentitan.org
Apache License 2.0
2.53k stars 754 forks source link

[chip-test, sival] chip_sw_rv_core_ibex_smoke #20031

Closed GregAC closed 9 months ago

GregAC commented 11 months ago

Test point name

chip_sw_rv_core_ibex_smoke

Host side component

None

OpenTitanTool infrastructure implemented

None

Silicon Validation (SiVal)

Yes

Emulation Targets

Contact person

@GregAC

Checklist

Please fill out this checklist as items are completed. Link to PRs and issues as appropriate.

estimate 4

GregAC commented 11 months ago

Note we can at least partially auto-generate this with RISCV DV. Perhaps use that to generate a few fragments that are then stitched together with hand-written code. We can use the Ibex testbench coverage setup to ensure the test does execute every instruction.

A key property will be to ensure that if an instruction doesn't execute correctly that some aspect of the register state that we check will be affected. It may make sense to do multiple register state checks at different points rather than just one at the end to make this property easier to obtain.

HU90m commented 11 months ago

@GregAC

  1. For the CSR instructions, is one instance of each of CSR{W,S,C} fine?
  2. Can you think of a nice way of executing and checking ecall, ebreak, mret and dret?
GregAC commented 11 months ago

For the CSR instructions, is one instance of each of CSR{W,S,C} fine?

Yes, this test isn't aiming to verify CSR details just the instructions themselves

Can you think of a nice way of executing and checking ecall, ebreak, mret and dret?

Perhaps we just skip dret as that is fiddly or even impossible with the setup we have in silicon (you could maybe remap the debug ROM area to SRAM with the address remapper so you can write code that gets executed in debug mode but I think more effort than it's worth here). For the others you'll just to have an exception handler, ebreak will cause an exception by default as does ecall and you'll need an mret in that handler.

jwnrt commented 9 months ago

Closed by https://github.com/lowRISC/opentitan/pull/20372