Skip to content

[rom_ctrl, dv] rom_ctrl simulations ported to mocha#435

Open
KolosKoblasz-Semify wants to merge 3 commits intolowRISC:mainfrom
KolosKoblasz-Semify:kk_rom_ctrl_dv
Open

[rom_ctrl, dv] rom_ctrl simulations ported to mocha#435
KolosKoblasz-Semify wants to merge 3 commits intolowRISC:mainfrom
KolosKoblasz-Semify:kk_rom_ctrl_dv

Conversation

@KolosKoblasz-Semify
Copy link
Copy Markdown
Collaborator

@KolosKoblasz-Semify KolosKoblasz-Semify commented Apr 10, 2026

rom_ctrl module's simulations relay on OpenTitan project specific paths.
These are modified to fit into Mocha repo.

This PR will close: #177

Command results from:
dvsim hw/vendor/lowrisc_ip/ip/rom_ctrl/dv/rom_ctrl_32kB_sim_cfg.hjson -i nightly

                [   legend  ]: [Q: queued, D: dispatched, P: passed, F: failed, K: killed, T: total]                                                                                             
00:01:46  [    build    ]: [Q: 000, D: 000, P: 002, F: 000, K: 000, T: 002] 100%                                                                                                             
00:05:00  [     run     ]: [Q: 000, D: 000, P: 265, F: 001, K: 000, T: 266] 100% 

`

Failure Buckets

  • UVM_ERROR (rom_ctrl_corrupt_sig_fatal_chk_vseq.sv:149) [rom_ctrl_corrupt_sig_fatal_chk_vseq] Check failed (cfg.rom_ctrl_vif.pwrmgr_data.done != MuBi4True) has 1 failure:
    • Test rom_ctrl_corrupt_sig_fatal_chk has 1 failure.
      • 2.rom_ctrl_corrupt_sig_fatal_chk.59291826974623340318801047515561390684876095977744966578288946903992868473900
        Line 96, in log /home/kkoblasz/projects/mocha/scratch/kk_rom_ctrl_dv/rom_ctrl_32kB-sim-xcelium/2.rom_ctrl_corrupt_sig_fatal_chk/latest/run.log

          UVM_ERROR @ 1064671812 ps: (rom_ctrl_corrupt_sig_fatal_chk_vseq.sv:149) [uvm_test_top.env.virtual_sequencer.rom_ctrl_corrupt_sig_fatal_chk_vseq] Check failed (cfg.rom_ctrl_v
        

if.pwrmgr_data.done != MuBi4True)
UVM_INFO @ 1064671812 ps: (uvm_report_catcher.svh:705) [UVM/REPORT/CATCHER]
--- UVM Report catcher Summary ---

`

Also, integration into the sim_cfgs bundle (+check if coverage collection works well too):
dvsim hw/top_chip/dv/mocha_sim_cfgs.hjson -i smoke --cov

## TOP_MOCHA_BATCH_SIM Simulation Results (Summary)
### Tuesday April 21 2026 10:10:12 UTC
### Github Revision: [`abf3232`](https://github.com/KolosKoblasz-Semify/mocha/tree/abf323221c0209c23a184edc4324293ea3238f09)
### Branch: kk_rom_ctrl_dv
## TOP_MOCHA_BATCH_SIM Simulation Results (Summary)
### Monday April 27 2026 16:07:19 UTC
### Github Revision: [`8b1978c`](https://github.com/KolosKoblasz-Semify/mocha/tree/8b1978cccbb333e80176555785eeb75561aad821)
### Branch: kk_rom_ctrl_dv

|                                           Name                                           |  Passing  |  Total  |  Pass Rate  |  Coverage  |
|:----------------------------------------------------------------------------------------:|:---------:|:-------:|:-----------:|:----------:|
|                     [UART](scratch/kk_rom_ctrl_dv/reports/uart.html)                     |     9     |    9    |  100.00 %   |  82.37 %   |
|            [SPI_DEVICE_2P](scratch/kk_rom_ctrl_dv/reports/spi_device_2p.html)            |     8     |    8    |  100.00 %   |  71.69 %   |
|                 [SPI_HOST](scratch/kk_rom_ctrl_dv/reports/spi_host.html)                 |    10     |   10    |  100.00 %   |  75.83 %   |
|                 [RV_TIMER](scratch/kk_rom_ctrl_dv/reports/rv_timer.html)                 |     3     |    3    |  100.00 %   |  67.33 %   |
|               [PRIM_ALERT](scratch/kk_rom_ctrl_dv/reports/prim_alert.html)               |     2     |    2    |  100.00 %   |  89.85 %   |
|                 [PRIM_ESC](scratch/kk_rom_ctrl_dv/reports/prim_esc.html)                 |     1     |    1    |  100.00 %   |  78.36 %   |
|                [PRIM_LFSR](scratch/kk_rom_ctrl_dv/reports/prim_lfsr.html)                |     2     |    2    |  100.00 %   |  79.40 %   |
|                      [I2C](scratch/kk_rom_ctrl_dv/reports/i2c.html)                      |     8     |    8    |  100.00 %   |  68.09 %   |
|                [XBAR_PERI](scratch/kk_rom_ctrl_dv/reports/xbar_peri.html)                |     1     |    1    |  100.00 %   |  65.89 %   |
|                     [GPIO](scratch/kk_rom_ctrl_dv/reports/gpio.html)                     |     9     |    9    |  100.00 %   |  78.22 %   |
|            [ROM_CTRL_32KB](scratch/kk_rom_ctrl_dv/reports/rom_ctrl_32kb.html)            |    11     |   11    |  100.00 %   |  64.58 %   |
| [RV_DM_USE_JTAG_INTERFACE](scratch/kk_rom_ctrl_dv/reports/rv_dm_use_jtag_interface.html) |     0     |    7    |   0.00 %    |     --     |
|            [TOP_MOCHA_SIM](scratch/kk_rom_ctrl_dv/reports/top_mocha_sim.html)            |    20     |   22    |   90.91 %   |  60.37 %   |



@KolosKoblasz-Semify KolosKoblasz-Semify force-pushed the kk_rom_ctrl_dv branch 2 times, most recently from bb98462 to eb4fb89 Compare April 15, 2026 20:00
Comment thread hw/vendor/lowrisc_ip.vendor.hjson Outdated
@KolosKoblasz-Semify KolosKoblasz-Semify force-pushed the kk_rom_ctrl_dv branch 3 times, most recently from 846bb35 to d9d868d Compare April 21, 2026 09:19
@KolosKoblasz-Semify KolosKoblasz-Semify marked this pull request as ready for review April 21, 2026 11:23
Copy link
Copy Markdown
Contributor

@martin-velay martin-velay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks great. The commits are well structured IMO and the regression results are looking good. Thanks Kolos!

Copy link
Copy Markdown
Collaborator

@marnovandermaas marnovandermaas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only concern I have is that this pulls in a lot of IP blocks from OpenTitan. Where are these dependencies coming from. Is there a way to remove those dependencies from ROM control DV?

Comment thread hw/vendor/lowrisc_ip.vendor.hjson Outdated
marnovandermaas

This comment was marked as outdated.

@marnovandermaas
Copy link
Copy Markdown
Collaborator

Ignore my last review. I need to do a clean build next week and some more investigation.

Copy link
Copy Markdown
Collaborator

@marnovandermaas marnovandermaas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it took me a little longer but now I think these are the working changes that remove dependencies for the 5 extra IP blocks:
marnovandermaas@42a3d04
Would you mind encoding this in patch file and then removing all those IP blocks from the vendor script.

@KolosKoblasz-Semify
Copy link
Copy Markdown
Collaborator Author

Ok, it took me a little longer but now I think these are the working changes that remove dependencies for the 5 extra IP blocks: marnovandermaas@42a3d04 Would you mind encoding this in patch file and then removing all those IP blocks from the vendor script.

Which 5 IPs should be removed?

I know about these 4:
csrng
edn
entropy_src
flash_ctrl

@marnovandermaas
Copy link
Copy Markdown
Collaborator

marnovandermaas commented Apr 27, 2026

Blocks that should not be vendored in this PR:

  • csrng
  • edn
  • entropy_src
  • flash_ctrl
  • keymgr
  • otp_ctrl

In my earlier comment where I said 5 I had already removed flash control since you removed that before my latest review.

@KolosKoblasz-Semify KolosKoblasz-Semify force-pushed the kk_rom_ctrl_dv branch 2 times, most recently from ad5dbbb to 804c024 Compare April 27, 2026 12:24
Comment thread hw/vendor/lowrisc_ip.vendor.hjson Outdated
 * The required dependencies added to: hw/vendor/lowrisc_ip.vendor.hjson
 * Patch file created to apply necessary modifications to rom_ctrl cfg files
 * rom_ctrl UVM TB simplified and patched to enable
   fewer modules vendored in as dependencies
 * rom_ctrl dv needs sram_scrambler_pkg.sv as a patch file
   to enable reduced number of vendored in modules.

Signed-off-by: Kolos Koblasz <kolos.koblasz@semify-eda.com>
 * kmac_app_agent modifications added
 * rom_ctrl modifications added
 * sram_ctrl modifications added

Signed-off-by: Kolos Koblasz <kolos.koblasz@semify-eda.com>
 * hw/top_chip/dv/mocha_sim_cfgs.hjson modified to point at the real
   rom_ctrl configuration files
 * temporary config files deleted

Signed-off-by: Kolos Koblasz <kolos.koblasz@semify-eda.com>
Copy link
Copy Markdown
Contributor

@martin-velay martin-velay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is looking good, and thanks for having removed the extra-dependencies.

Copy link
Copy Markdown
Collaborator

@marnovandermaas marnovandermaas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the progress here. One more dependency to remove: SRAM control.

- for (genvar k = 1; k < KmacDataIfWidth / 8 - 1; k++) begin : gen_strb_check
- `ASSERT(StrbAlignLSB_A, kmac_data_req.valid && kmac_data_req.strb[k] === 0 |->
+ for (genvar k = 1; k < kmac_app_agent_pkg::KmacDataIfWidth / 8 - 1; k++) begin : gen_strb_check
+ `ASSERT(StrbAlignLSB_A, kmac_data_req.valid && kmac_data_req.strb[k] === 0 |->
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: extra indent not necessary.

{from: "hw/ip/rv_timer", to: "ip/rv_timer", patch_dir: "rv_timer"}, // Timer.
{from: "hw/ip/spi_device", to: "ip/spi_device", patch_dir: "spi_device"}, // SPI device.
{from: "hw/ip/spi_host", to: "ip/spi_host", patch_dir: "spi_host"}, // SPI host.
{from: "hw/ip/sram_ctrl", to: "ip/sram_ctrl"}, // SRAM Ctrl.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to pull in SRAM control any more right?

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.

ROM DV - Block-level env to be imported from OT

3 participants