{"id":13775033,"url":"https://github.com/PeterMonsson/sv_waveterm","last_synced_at":"2025-05-11T07:31:52.486Z","repository":{"id":145424269,"uuid":"610237016","full_name":"PeterMonsson/sv_waveterm","owner":"PeterMonsson","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-02T20:53:26.000Z","size":64,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-03T17:11:15.701Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"SystemVerilog","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PeterMonsson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-03-06T11:22:24.000Z","updated_at":"2024-03-14T05:19:26.000Z","dependencies_parsed_at":"2023-03-23T13:17:40.996Z","dependency_job_id":"374be302-b5f0-4c80-b5f3-0d37473e9c34","html_url":"https://github.com/PeterMonsson/sv_waveterm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterMonsson%2Fsv_waveterm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterMonsson%2Fsv_waveterm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterMonsson%2Fsv_waveterm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterMonsson%2Fsv_waveterm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PeterMonsson","download_url":"https://codeload.github.com/PeterMonsson/sv_waveterm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225027329,"owners_count":17409412,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T17:01:33.064Z","updated_at":"2024-11-17T10:30:27.963Z","avatar_url":"https://github.com/PeterMonsson.png","language":"SystemVerilog","funding_links":[],"categories":["Verification Frameworks"],"sub_categories":[],"readme":"# Spend less time debugging with sv_waveterm - spend more time on fun work\r\n\r\nSV Waveterm shows you a short waveform directly in your log like this:\r\n\r\n            +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+ +\r\n    clk     + +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+\r\n                    +------------------------\r\n    reset_b  -------+                        \r\n            +-----------+---+---+---+---+---+\r\n    counter |0          |1  |2  |3  |4  |5  |\r\n            +-----------+---+---+---+---+---+\r\n\r\nThis waveform is a fast way to get more context on a failure than from an error message alone. Seeing the waveform directly in your log may save you a debug session with your waveform viewer, so that you can go back to the fun work faster.\r\n\r\nYou display the waveform by defining what signals you want to track with macros:\r\n\r\n    `include \"sv_waveterm.sv\"  \r\n    \r\n    `sv_waveterm_begin(counter_waves, clk)\r\n      `sv_waveterm_int(reset_b)\r\n      `sv_waveterm_int(counter)\r\n    `sv_waveterm_end\r\n\r\nAnd printing the the waves in your error messages:\r\n\r\n    $error(\"Counter is 5\\n%s\", counter_waves.sprint());\r\n\r\nThis could for example be an assertion:\r\n\r\n    a_not_5 : assert property(\r\n      @(posedge clk) disable iff (!reset_b)\r\n      counter != 5\r\n    ) else $error(\"Counter is 5\\n%s\", counter_waves.sprint());\r\n\r\nSee a full example for assertions at [examples/basic](./examples/basic/tb.sv)\r\n\r\nThis could also be additional information in SVUnit error messages:\r\n\r\n    `FAIL_IF_LOG(counter == 5, {\"Unexpected 5 in counter:\\n\", counter_waves.sprint()})\r\n\r\nSee a full example for SVUnit at [examples/svunit](./examples/svunit/counter_unit_test.sv)\r\n\r\n\r\n# Save time with sv_waveterm\r\n\r\nHere is how sv_waveterm saves time from the authors own experience: Nightly regression failed for some tests. Investigation starts:\r\n\r\n## Without sv_waveterm\r\n\r\n| Action | time |\r\n| ------ | ---- |\r\n| search log for error message | 25 seconds |\r\n| realize that there is too little information to triage issue | (not timed) |\r\n| git fetch, checkout, etc. | 1 minute 5 seconds | \r\n| compile, elab and wait until waveform viewer is ready | 4 minutes and 20 seconds | \r\n| add waves, start sim and zoom in on the error |  1 minute and 12 seconds | \r\n| triage issue | (not timed) | \r\n| Total | 7 minutes 2 seconds |\r\n\r\n## With sv_waveterm\r\n\r\n| Action | time |\r\n| ------ | ---- |\r\n| search log for error message | 25 seconds |\r\n| triage issue | (not timed) |\r\n| git fetch, checkout, etc. | 1 minute 5 seconds |\r\n| Total | 1 minute 30 seconds |\r\n\r\n## Conclusion\r\n\r\nsv_waveterm saved 5 minutes of debugging time compared to the traditional workflow, by saving a compile, elaboration and simulation run with the waveform viewer open. This is just a single data-point, but it gives you an indication on what to expect for your own environment.\r\n\r\nAs the car ads say: Your mileage may vary.\r\n\r\n# Install\r\n\r\nAdd \u003csv_waveterm\u003e/src to your include directory list.\r\n\r\n# License\r\n\r\n## Example code\r\n\r\nAll example code is licensed under CC0 \"No Rights Reserved\" so that you can use the examples freely for anything.\r\n\r\n## Source code\r\n\r\nsv_waveterm (c) by Peter Monsson\r\n\r\nLicensed under the Apache License, Version 2.0 (the\r\n\"License\"); you may not use this file except in compliance\r\nwith the License.  You may obtain a copy of the License at\r\n\r\n  http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing,\r\nsoftware distributed under the License is distributed on an\r\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, either express or implied.  See the License for the\r\nspecific language governing permissions and limitations\r\nunder the License.    \r\n\r\n# Maturity\r\n\r\nSV Waveterm is currently low maturity and thus not ready for commercial use. If this is something that you would like to see then please contact me directly:\r\n\r\nTwitter: https://twitter.com/SVAssertions\r\n\r\nLinkedIn: https://www.linkedin.com/in/petermonsson/\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPeterMonsson%2Fsv_waveterm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPeterMonsson%2Fsv_waveterm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPeterMonsson%2Fsv_waveterm/lists"}