Skip to content

[dv,clk_mgr] Vendor in clk_mgr DV environment from OT - #698

Open
tchilikov-semify wants to merge 8 commits into
lowRISC:mainfrom
tchilikov-semify:clk_mgr
Open

[dv,clk_mgr] Vendor in clk_mgr DV environment from OT#698
tchilikov-semify wants to merge 8 commits into
lowRISC:mainfrom
tchilikov-semify:clk_mgr

Conversation

@tchilikov-semify

Copy link
Copy Markdown
Collaborator

This PR vendors in the clk_mgr DV environment from OT, and adapts it to fit to mocha.

The regression can be ran with:
dvsim hw/top_chip/ip_autogen/clkmgr/dv/clkmgr_sim_cfg.hjson -i all

Notably, the clkmgr_sec_cm test fails intermittently because an alert does
not arrive within the expected window. This is due to a larger issue where clkmgr is fed one clock in the top leveldc design, but its config declares three (hw/top_chip/data/clkmgr_cfg.hjson declares main at 1 GHz and
io/aon at 50 MHz).

Additionally, this PR disables the clock manager measurement tests, since this unit is disabled in the mocha.

Lastly, some shared sequences used by the clk_mgr tests have a minor bugfix addressing transactions started during a reset.

The DV templates hardcode earlgrey's four hint clocks (aes, hmac, kmac, otbn)
and build signal names from them. Mocha has one hint clock, clk_main_hint, so
the generated environment referred to signals that don't exist and wouldn't
compile.
Clock measurement is disabled in mocha, so the hardware holds its config lock
open instead of letting software clear it. The randomized CSR tests write to
the lock, read back a different value, and fail. Exclude it from the tests
that write to it.
clk_mgr has no interrupts, but the testplan still imported the shared
interrupt testplan. That added an interrupt test to the V2 regression that
doesn't exist, so every dvsim run logged an error about it and the report
carried testpoints that could never be covered.
Clock measurement is disabled in mocha, so any test that tries to exercise it
can't pass. Drop the two measurement tests and their testpoints, and skip the
measurement checks inside the tests that also cover other things.
The alert agent answers alerts coming from the design. If a reset lands at the
wrong moment the agent ends up waiting forever for a reply that will never
arrive, and stops answering alerts for the rest of the test. Tests then hang or
time out waiting for an alert the design has already sent.
The shadow register test holds a reset line low for a while, then lets go. It
also starts a second sequence that reads and writes registers at the same time.
But holding that reset low blocks the register interface by design, so those
accesses just queue up and never complete. If the reset is held longer than the
access timeout, the test dies.

Start the register sequence after the reset is released instead of before it is
applied. The other half of this task already does it in that order.
@tchilikov-semify

Copy link
Copy Markdown
Collaborator Author

This PR will close issue #432

@tchilikov-semify tchilikov-semify linked an issue Aug 20, 2026 that may be closed by this pull request
@tchilikov-semify

Copy link
Copy Markdown
Collaborator Author

Results of running the regression:

Test Results

Stage Name Tests Max Job Runtime Simulated Time Passing Total Pass Rate
V1 smoke clkmgr_smoke 2.000s 48.895us 50 50 100.00 %
V1 csr_hw_reset clkmgr_csr_hw_reset 1.000s 41.636us 5 5 100.00 %
V1 csr_rw clkmgr_csr_rw 2.000s 26.830us 20 20 100.00 %
V1 csr_bit_bash clkmgr_csr_bit_bash 9.000s 1629.248us 5 5 100.00 %
V1 csr_aliasing clkmgr_csr_aliasing 2.000s 41.693us 5 5 100.00 %
V1 csr_mem_rw_with_rand_reset clkmgr_csr_mem_rw_with_rand_reset 2.000s 85.753us 20 20 100.00 %
V1 regwen_csr_and_corresponding_lockable_csr clkmgr_csr_rw 2.000s 26.830us 20 20 100.00 %
V1 regwen_csr_and_corresponding_lockable_csr clkmgr_csr_aliasing 2.000s 41.693us 5 5 100.00 %
V1 TOTAL 105 105 100.00 %
V2 peri_enables clkmgr_peri 2.000s 44.233us 50 50 100.00 %
V2 trans_enables clkmgr_trans 2.000s 39.986us 50 50 100.00 %
V2 clk_status clkmgr_clk_status 2.000s 18.288us 50 50 100.00 %
V2 jitter clkmgr_smoke 2.000s 48.895us 50 50 100.00 %
V2 stress_all clkmgr_stress_all 15.000s 1833.690us 50 50 100.00 %
V2 alert_test clkmgr_alert_test 2.000s 19.977us 50 50 100.00 %
V2 tl_d_oob_addr_access clkmgr_tl_errors 3.000s 305.435us 20 20 100.00 %
V2 tl_d_illegal_access clkmgr_tl_errors 3.000s 305.435us 20 20 100.00 %
V2 tl_d_outstanding_access clkmgr_csr_hw_reset 1.000s 41.636us 5 5 100.00 %
V2 tl_d_outstanding_access clkmgr_csr_rw 2.000s 26.830us 20 20 100.00 %
V2 tl_d_outstanding_access clkmgr_csr_aliasing 2.000s 41.693us 5 5 100.00 %
V2 tl_d_outstanding_access clkmgr_same_csr_outstanding 2.000s 50.068us 20 20 100.00 %
V2 tl_d_partial_access clkmgr_csr_hw_reset 1.000s 41.636us 5 5 100.00 %
V2 tl_d_partial_access clkmgr_csr_rw 2.000s 26.830us 20 20 100.00 %
V2 tl_d_partial_access clkmgr_csr_aliasing 2.000s 41.693us 5 5 100.00 %
V2 tl_d_partial_access clkmgr_same_csr_outstanding 2.000s 50.068us 20 20 100.00 %
V2 TOTAL 370 370 100.00 %
V2S tl_intg_err clkmgr_sec_cm 3.000s 379.579us 4 5 80.00 %
V2S tl_intg_err clkmgr_tl_intg_err 3.000s 260.606us 20 20 100.00 %
V2S shadow_reg_update_error clkmgr_shadow_reg_errors 2.000s 53.849us 20 20 100.00 %
V2S shadow_reg_read_clear_staged_value clkmgr_shadow_reg_errors 2.000s 53.849us 20 20 100.00 %
V2S shadow_reg_storage_error clkmgr_shadow_reg_errors 2.000s 53.849us 20 20 100.00 %
V2S shadowed_reset_glitch clkmgr_shadow_reg_errors 2.000s 53.849us 20 20 100.00 %
V2S shadow_reg_update_error_with_csr_rw clkmgr_shadow_reg_errors_with_csr_rw 2.000s 91.264us 20 20 100.00 %
V2S sec_cm_bus_integrity clkmgr_tl_intg_err 3.000s 260.606us 20 20 100.00 %
V2S sec_cm_meas_config_shadow clkmgr_shadow_reg_errors 2.
000s 53.849us 20 20 100.00 %
V2S sec_cm_idle_intersig_mubi clkmgr_idle_intersig_mubi 3.000s 460.887us 50 50 100.00 %
V2S sec_cm_jitter_config_mubi clkmgr_csr_rw 2.000s 26.830us 20 20 100.00 %
V2S sec_cm_idle_ctr_redun clkmgr_sec_cm 3.000s 379.579us 4 5 80.00 %
V2S sec_cm_meas_config_regwen clkmgr_csr_rw 2.000s 26.830us 20 20 100.00 %
V2S sec_cm_clk_ctrl_config_regwen clkmgr_csr_rw 2.000s 26.830us 20 20 100.00 %
V2S prim_count_check clkmgr_sec_cm 3.000s 379.579us 4 5 80.00 %
V2S TOTAL 134 135 99.26 %
V3 regwen clkmgr_regwen 2.000s 49.768us 50 50 100.00 %
V3 stress_all_with_rand_reset clkmgr_stress_all_with_rand_reset 129.000s 37116.651us 50 50 100.00 %
V3 TOTAL 100 100 100.00 %
TOTAL 609 610 99.84 %

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.

Clock Manager DV - Block-level env to be imported from OT

1 participant