lowRISC / lowRISC/opentitan

[aon_timer] Watchdog seems to be running at the wrong frequency on CW310

Open
#19,826 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
SystemVerilog
Stars
3.6k
Forks
1.1k
Avg merge
2d 22h
Merged PRs (30d)
141

Description

Description

While debugging the //sw/device/silicon_creator/rom/e2e:shutdown_watchdog_dev_400000_cw310_rom_with_fake_keys, I observe that the watchdog count does not seem to be running at 200kHz which is what the documentation claims.

I instrumented the test to pet the watchdog then wait one second and then output the count. This is the output

[2023-10-03T15:44:31.238Z  console]ROM:0c8e382c
[2023-10-03T15:44:31.238Z  console]bootstrap:1
[2023-10-03T15:44:31.238Z  console]ROM:0c8e382c
[2023-10-03T15:44:31.543Z  console]I00000 ottf_main.c:154] Running sw/device/silicon_creator/rom/e2e/hang_test.c
[2023-10-03T15:44:32.550Z  console]I00001 hang_test.c:24] Returning after 1 seconds
[2023-10-03T15:44:32.554Z  console]I00002 hang_test.c:27] watchdog count: 251132
[2023-10-03T15:44:32.558Z  console]I00003 ottf_main.c:109] Finished sw/device/silicon_creator/rom/e2e/hang_test.c
[2023-10-03T15:44:32.566Z  console]I00004 status.c:28] PASS!
[2023-10-03T15:44:33.161Z  console]ROM:0c8e382c
[2023-10-03T15:44:33.563Z  console]I00000 ottf_main.c:154] Running sw/device/silicon_creator/rom/e2e/hang_test.c
[2023-10-03T15:44:34.570Z  console]I00001 hang_test.c:24] Returning after 1 seconds
[2023-10-03T15:44:34.579Z  console]I00002 hang_test.c:27] watchdog count: 251132
[2023-10-03T15:44:34.579Z  console]I00003 ottf_main.c:109] Finished sw/device/silicon_creator/rom/e2e/hang_test.c
[2023-10-03T15:44:34.585Z  console]I00004 status.c:28] PASS!
[2023-10-03T15:44:35.181Z  console]ROM:0c8e382c
[2023-10-03T15:44:35.583Z  console]I00000 ottf_main.c:154] Running sw/device/silicon_creator/rom/e2e/hang_test.c
[2023-10-03T15:44:36.590Z  console]I00001 hang_test.c:24] Returning after 1 seconds
[2023-10-03T15:44:36.594Z  console]I00002 hang_test.c:27] watchdog count: 251132
[2023-10-03T15:44:36.598Z  console]I00003 ottf_main.c:109] Finished sw/device/silicon_creator/rom/e2e/hang_test.c
[2023-10-03T15:44:36.605Z  console]I00004 status.c:28] PASS!

As can be seen in the log, Returning after 1 seconds is pretty almost exactly one second after the start of the test. However the timer seems to be running at 250kHz instead of 200kHz.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the //sw/device/silicon_creator/rom/e2e:shutdown_watchdog_dev_400000_cw310_rom_with_fake_keys test and the hang_test.c output described in the report. Compare the one-second wait with the reported watchdog count and trace how the CW310 watchdog frequency is determined. Done means the observed count is reconciled with the documented 200 kHz frequency.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.