Compare commits

...
1860 Commits
Author SHA1 Message Date
Wilson Snyder 436d3d76f0 Version bump 2025-02-24 18:19:40 -05:00
Wilson Snyder c1f0787669 Commentary: Changes update 2025-02-24 18:15:08 -05:00
Yilou Wang dae4c8ee22 Support constrained random for arrays in structs (#5765) (#5802) 2025-02-24 17:51:51 -05:00
Wilson Snyder 5daf7385f1 Commentary: Changes update 2025-02-24 04:04:23 -05:00
Wilson Snyder 4ce8164277 Fix parsing input wire with default and range (#5800). 2025-02-24 03:51:49 -05:00
Todd Strader 7ec32799b0 Fix expression coverage + VarXRefs (#5797) 2025-02-22 15:55:23 -05:00
Geza Lore 812861e7f2 Optimize splitting trigger computation and dump (#5798) 2025-02-23 05:57:36 +10:00
Wilson Snyder 1857f6399c Fix $monitor with dotted references (#5794). 2025-02-21 17:18:49 -05:00
Todd Strader f7ccc013e7 Improve V3EmitV for interfaces (#5796) 2025-02-21 16:49:14 -05:00
Kamil Rakoczy 2e1fa8f338 Add --preproc-resolve for modules in preprocessor output (#5789)
Signed-off-by: Kamil Rakoczy <[email protected]>
2025-02-22 04:47:54 +10:00
Todd Strader 70459b3208 Fix V3EmitV for non-zero based arrays (#5790) 2025-02-21 05:49:32 +11:00
Ryszard Rozak 2a23ec74e4 Fix dpi context functions (#5788) 2025-02-20 10:15:09 +01:00
Wilson Snyder be1ace423e Fix time import error on time parameters (#5786). 2025-02-19 17:03:59 -05:00
Wilson Snyder 2d0149b703 Commentary: Changes update 2025-02-19 17:00:29 -05:00
Todd Strader 34ced254c0 Support expression coverage (#5719) 2025-02-19 16:42:23 -05:00
Wilson Snyder fe15171649 Internals: cppcheck cleanups. No functional change. 2025-02-18 01:14:51 -05:00
Wilson Snyder 4092ac7e72 Commentary: Changes update 2025-02-18 01:05:10 -05:00
Yutetsu TAKATSUKASA 1a07af57a3 Fix unpacked split_var (#5782) (#5785) 2025-02-18 05:34:57 +11:00
Kamil Rakoczy c840ffb0ae Support nested classes (#4178) (#5778)
Signed-off-by: Kamil Rakoczy <[email protected]>
2025-02-17 23:47:41 +11:00
Wilson Snyder fbe8439eb8 Commentary: Changes update 2025-02-15 00:58:14 -05:00
Wilson Snyder 754c5c71f1 Fix force VPI public signal visibility (#5225). 2025-02-15 00:58:14 -05:00
Wilson Snyder 6940ee420d Commentary 2025-02-15 00:58:14 -05:00
Todd Strader b645fcf027 More V3EmitV support (#5779) 2025-02-14 14:58:11 -05:00
Krzysztof Bieganski ffb02cea15 Fix ignoring joins in stringify in preprocessor (#5777)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2025-02-13 18:33:12 -05:00
Krzysztof Bieganski f753ae2518 Support selects on arbitrary string expressions (#5773) 2025-02-11 12:06:34 -05:00
Dave Sargeant caa19c0cb3 Fix VFileContent reference count (#5769) (#5771) 2025-02-10 10:04:04 -05:00
Trung Nguyen aa3942ab24 Internals: constexpr for VlUnpacked data access (#5725) (#5770)
Add `constexpr` to data access functions of `VlUnpacked` whose `std::array` equivalent in C++14 is `constexpr`.
2025-02-09 22:45:50 -05:00
github action cc1133c0d9 Apply 'make format' 2025-02-08 00:07:38 +00:00
Moubarak Jeje ac659d525b Support VPI array accessors (#5612) 2025-02-07 19:06:46 -05:00
Krzysztof Bieganski 283f6c7433 Add --preproc-token-limit (#5768) 2025-02-07 10:32:12 -05:00
Moubarak Jeje 5b65c15eca Internals: Add datap cast functions (#5761) 2025-02-05 15:29:54 -05:00
Yilou Wang 6b4183632c Support Unpacked Structures' Constrained Randomization (#5657) (#5759) 2025-02-03 11:56:00 -05:00
Wilson Snyder e0e164cea2 Internals: Optimize clearFired (#5753) 2025-01-30 07:52:38 -05:00
Bartłomiej Chmiel a379382d32 Fix handling forced assigns in V3Life (#5757) 2025-01-28 07:30:40 -05:00
Wilson Snyder e2a6e19cac Cleanup V3EmitMk report style 2025-01-25 17:52:27 -05:00
Wilson Snyder 61bfb6c308 Remove list/map from keyword warnings.
Reduces warning verbosity from `map` in UVM.
Assumes user doesn't do a `using namespace std`.
2025-01-25 16:08:15 -05:00
Wilson Snyder bdcfc4e286 Reduce verbosity under --debug default level 2025-01-25 16:01:20 -05:00
Wilson Snyder 70c6651aac Fix -Wno-subobject-linkage on GCC (#5754) 2025-01-25 15:45:30 -05:00
Wilson Snyder 41bb54bc2c Add Makefile targets count to stats 2025-01-25 13:35:56 -05:00
Wilson Snyder 001c098e5a Optimize empty function definition bodies (#5750). 2025-01-25 12:13:25 -05:00
Wilson Snyder 98e40c847c Internals: Suppress vlSelf unused suppression when known used. No functional change intended. 2025-01-25 12:06:05 -05:00
Wilson Snyder 05c7a3b90b Optimize labels as final if block statements (#5744). 2025-01-25 10:29:35 -05:00
Wilson Snyder 694f2ff7c7 Tests: renames 2025-01-25 10:24:59 -05:00
Wilson Snyder 6281385ee8 Commentary/Internals: Sort option names. No functional change. 2025-01-24 21:31:57 -05:00
Wilson Snyder 7e6dd9473f Commentary: Changes update 2025-01-24 21:27:52 -05:00
Wilson Snyder 929e15fa4c Fix various round-trip Verilog output, including packed arrays 2025-01-24 21:00:45 -05:00
Wilson Snyder 432d5f851d Internals: Cleanup some misnamed nodep's. No functional change. 2025-01-24 20:52:31 -05:00
Wilson Snyder d4f4fefd1d Fix -j ignored after -f (#5749). 2025-01-24 17:30:59 -05:00
Wilson Snyder d8080008b4 Commentary 2025-01-24 07:47:32 -05:00
Wilson Snyder bed9aa9904 Internals: Cleanup std::string empty string constructors. 2025-01-24 07:47:32 -05:00
Bartłomiej Chmiel 35fa0d051d Support integer atom type ports in --hierarchical (#5748) 2025-01-24 07:47:11 -05:00
Bartłomiej Chmiel 0507fb4655 Improve hierarchical DPI wrapper scheduling performance (#2583) (#5734) 2025-01-20 14:24:09 -05:00
Geza Lore f4a01eb452 Fix inlined expression with assignment under LHS of NBA (#5736) (#5740) 2025-01-20 07:23:10 -05:00
Wilson Snyder 4954e76b28 Commentary: Changes update 2025-01-18 15:26:41 -05:00
Wilson Snyder fa1b11252e Fix duplicate-named class variable equivalence (#5737). 2025-01-18 15:25:49 -05:00
Andrew Nolte dddc1b5b4d Fix vpiDefName issues with non-inlined scopes and dpi conflicts (#5732) 2025-01-16 15:02:36 -05:00
Natan Kreimer 20faa99464 Fix VPI iteration over hierarchy (#5314) (#5731) 2025-01-13 07:40:34 -05:00
Ethan Sifferman dc43071f1c Improve `resetall support (#5728) (#5730) 2025-01-11 22:53:11 -05:00
Wilson Snyder fdf29b970f Fix VL_UNLIKELY with constructors 2025-01-11 15:27:11 -05:00
Wilson Snyder 70814fa11a Commentary: Add --public-ignore to ignore public metacomments (#5716). 2025-01-11 12:34:12 -05:00
Wilson Snyder 529b8337ec Commentary: Changes update 2025-01-11 12:30:07 -05:00
Andrew Nolte f8dd65c7cd Add --public-ignore to ignore public metacomments (#7819) 2025-01-11 12:29:39 -05:00
Wilson Snyder 28a59a2b21 Update gtkwave from upstream. 2025-01-11 12:16:46 -05:00
Yilou Wang d3e205f201 Support constraints on associative array user-defined keys (#5671) (#5729) 2025-01-11 12:07:52 -05:00
Wilson Snyder dfe28f7ed0 Fix misoptimizing away $urandom (#5703). 2025-01-11 08:48:40 -05:00
github action bb871728c9 Apply 'make format' 2025-01-10 00:05:16 +00:00
Krzysztof Starecki 69dce205d3 Support multidimensional array access via VPI (#2812) (#5573) 2025-01-09 19:04:26 -05:00
Krzysztof Bieganski 052812bb87 Fix BLKSEQ on suspendable processes (#5722)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2025-01-09 08:40:32 -05:00
Yilou Wang 0380a36c76 Fix constrained random for > 64-bit associative arrays (#5670) (#5682) 2025-01-09 08:33:38 -05:00
Wilson Snyder 44f49669a3 Support side effects of form variable[index_function()]++. 2025-01-08 19:37:20 -05:00
github action ff244c1d1f Apply 'make format' 2025-01-08 14:44:48 +00:00
Krzysztof Starecki 260ac342f4 Tests: Add support for Questa in TestSimulator class (#5718) 2025-01-08 09:43:57 -05:00
Nick Brereton 87d856339f Add lint error on importing package within a class (#5634) (#5679) 2025-01-07 16:52:44 -05:00
Wilson Snyder e171463fa2 Add COVERIGN warning, as a more specific UNSUPPORTED error. 2025-01-06 18:48:32 -05:00
Wilson Snyder 481adf8fe7 Commentary 2025-01-06 17:56:50 -05:00
Andrew Nolte b8288b97f7 Improve VPI write errors (#5712) 2025-01-06 17:56:18 -05:00
Andrew Nolte 0d34f56b74 Fix packages with --public-depth 1 (#5708) 2025-01-06 15:21:32 -05:00
Wilson Snyder dcaf6476e8 Fix matching language extension options including dots. 2025-01-05 22:52:29 -05:00
Wilson Snyder 76b2ac9cc1 Support +incdir with multiple directories. 2025-01-05 19:30:39 -05:00
Wilson Snyder b6a400ee9b Support generated classes (#5665). 2025-01-05 17:10:04 -05:00
Wilson Snyder 78d6ec8114 Fix error message when call task as a function (#3089). 2025-01-04 12:55:15 -05:00
Wilson Snyder 88dd95980a Internal cleanups, remove extra iterate, but no functional change intended 2025-01-04 12:50:55 -05:00
Wilson Snyder b531001f55 Fix segfault when only enum value referenced in package (#5714). 2025-01-04 10:36:34 -05:00
Wilson Snyder 1d0563212e Fix pattern assignment to real inside struct (#5713). 2025-01-03 19:39:48 -05:00
Wilson Snyder 8ca49d98c1 Fix %p format output for real inside struct (#5713). 2025-01-03 19:15:03 -05:00
Wilson Snyder 036c1fb0f9 Commentary: Changes update 2025-01-03 10:02:48 -05:00
Wilson Snyder 19258ee18a Commentary 2025-01-03 10:00:56 -05:00
أحمد المحمودي 578d8d8391 Fix man pages whatis section (#5710) 2025-01-03 09:58:33 -05:00
Geza Lore 010ae580b1 Fix V3Simulate constant reuse (#5709)
Use a generational allocator for reusing AstConst across
V3Simulate::clear(), instead of using user1 (which is also used
to store values of nodes).

Also fix invalid lookup on array initializer
2025-01-03 05:33:29 -05:00
Wilson Snyder 951f5eaa82 Commentary 2025-01-02 08:09:02 -05:00
Wilson Snyder 3a69dd4a43 Commentary 2025-01-02 08:07:57 -05:00
Wilson Snyder f52155a768 Copyright year update. 2025-01-02 06:21:30 -05:00
Wilson Snyder 16b3d9101c devel release 2025-01-01 09:11:15 -05:00
Wilson Snyder 8ff77e9d47 Version bump 2025-01-01 09:04:41 -05:00
Wilson Snyder 4361c516fd Commentary: Update contributors. 2025-01-01 09:04:21 -05:00
Wilson Snyder 7d5772c749 Commentary: Changes update 2025-01-01 08:45:29 -05:00
Wilson Snyder f5e2f60dcc Update include/gtkwave from upstream 2025-01-01 08:40:49 -05:00
Wilson Snyder 8fbb725f34 Copyright year update. 2025-01-01 08:30:25 -05:00
Bartłomiej Chmiel 72a47e16c1 Fix verilator_gantt for hierarchically Verilated models (#5700) 2024-12-23 09:10:46 -06:00
Wilson Snyder 530ebecfb7 Tests: Add module-in-module coverage 2024-12-19 21:42:52 -05:00
Wilson Snyder 9a3dcaa10b Fix spelling 2024-12-19 21:30:14 -05:00
Wilson Snyder 8a121803f5 Add configure CFG_CXX_VERSION 2024-12-19 20:56:47 -05:00
Wilson Snyder bb45fd6c6c Add error on --savable --timing (#5690). 2024-12-19 17:30:40 -05:00
Wilson Snyder 62945bb3bc Commentary: Changes update 2024-12-19 17:23:44 -05:00
Todd Strader 079a53e820 Commentary: SYMRSVDWORD + VPI documentation (#5696) 2024-12-19 17:14:15 -05:00
Todd Strader a23fad91a3 Tests: Reduce test_regress VPI copypasta (#5694) (#5693) 2024-12-19 16:29:16 -05:00
Anthony Moore 5f1df5b389 Add a default CMAKE_BUILD_TYPE (#5691) (#5692) 2024-12-19 15:17:44 -05:00
Todd Strader 74d5d008bb Fix VPI + SYMRSVDWORD intersection (#5686) 2024-12-19 15:15:28 -05:00
Todd Strader 8a9fc9237d Tests: Execute t_emit_accessors (#5689) (#5688) 2024-12-19 15:01:57 -05:00
Ryszard Rozak c093b24342 Fix width extension of operands of inside operator (#5685) 2024-12-19 15:51:51 +01:00
Wilson Snyder 29fb82d3b7 Commentary 2024-12-16 18:02:17 -05:00
Wilson Snyder c7355b4056 Commentary: Changes update 2024-12-15 09:19:30 -05:00
Wilson Snyder 4b4ca90c71 Internals: Create FuncRef/TaskRef directly from Func/Task pointer. No functional change intended 2024-12-15 09:15:49 -05:00
Wilson Snyder 6aa7123a8c Internals: Function/variable renames. No functional change. 2024-12-14 12:49:42 -05:00
Wilson Snyder 80b2fa3583 Add error on randc inside dist 2024-12-14 11:47:46 -05:00
Wilson Snyder 7886204690 Tests: Add t_class_new_scoped (unsupported) 2024-12-13 17:58:08 -05:00
Wilson Snyder c2dcca980e Improve to throw UNSUPPORTED instead of syntax error on extend class arguments 2024-12-13 17:15:04 -05:00
Wilson Snyder a23dfdc4ee Fix backward external constraint error, from recent new support.
(Thanks sv-tests!)
2024-12-13 16:54:14 -05:00
Todd Strader 41a038b79b Fix interface bracketed array parameter access (#5678) (#5677) 2024-12-13 12:00:49 -05:00
Ryszard Rozak a8e06874bd Fix randomize..with of parameterized classes (#5676)
Broke in 7a04a5b
2024-12-13 09:32:47 -05:00
Yilou Wang 54ef9ad31c Support associative array basic constrained randomization (#5658) (#5670) 2024-12-12 11:31:54 -05:00
Bartłomiej Chmiel 32f9cf072b Fix hierarchical verilation for projects with dot-f dependency lists (#5199) (#5669) 2024-12-12 11:25:19 -05:00
Ryszard Rozak 03e8ef0b0f Fix wildcard equality and inside operators for non-fourstate expressions (#5673) 2024-12-12 14:51:48 +01:00
Wilson Snyder a2f327f729 Support extern constraint 2024-12-12 08:16:19 -05:00
Wilson Snyder 6e204ed0dd Internals: Cleanup 'error error' on fatals 2024-12-11 08:52:41 -05:00
Bartłomiej Chmiel 58ddf997e3 Improve optimization of duplicate wide expressions (#5637)
Prevent inlining of expensive wide expressions in V3Gate (#5637)
2024-12-11 11:45:31 +00:00
Ryszard Rozak 9656311521 Fix error on duplicated declaration of gen block (#5663) 2024-12-06 07:20:31 -05:00
Wilson Snyder 676fd31635 Commentary: Changes update 2024-12-05 08:54:43 -05:00
Wilson Snyder a7f8c9cc74 Commentary 2024-12-05 08:54:00 -05:00
Wilson Snyder a247041cab Internals: Refactor 713dab27 to avoid IfaceRef being known in LinkCells 2024-12-03 12:00:56 -05:00
Wilson Snyder 59fd238a05 Tests: Add t_interface_hidden 2024-12-03 12:00:56 -05:00
Yilou Wang a64660a530 Fix foreach mixed array (#5655) (#5656) 2024-12-03 07:57:50 -05:00
Todd Strader e9a1c75b7f Tests: Demonstrate unsupported scoped pattern array init (#5652) 2024-12-02 18:33:34 -05:00
Todd Strader b6f292f556 Fix imported array assignment literals (#5642) (#5648) 2024-12-02 15:08:47 -05:00
Wilson Snyder 4781a6046a Update error as misnamed port dtype might be interface 2024-12-02 07:35:44 -05:00
Wilson Snyder b16b48f458 Internals: Misc ANSI port parsing cleanups; baseline for future commit. 2024-12-02 07:21:39 -05:00
Wilson Snyder b4e91c87a6 Tests: Add t_interface_find 2024-12-02 07:20:40 -05:00
Bartłomiej Chmiel a668b7c658 Fix missing VlProcess handle in coroutines with splits (#5623) (#5650)
Signed-off-by: Bartłomiej Chmiel <[email protected]>
2024-12-02 05:43:26 -05:00
Wilson Snyder 94fd17e4f7 Internals: Port parsing cleanups 2024-12-01 23:03:19 -05:00
Wilson Snyder abd4c480cd Tests: Fix JSON file number, from earlier commit 2024-12-01 23:00:27 -05:00
Wilson Snyder aa2b653c71 Internals: With --dumpi-tree >= 9, create pre-sort cells.tree 2024-12-01 17:38:02 -05:00
Wilson Snyder d75f41b641 Tests: Add param type to t_typename test 2024-12-01 17:28:13 -05:00
Wilson Snyder b0f898cec8 Internals: Determine needing verilated_std without symbol table 2024-12-01 11:35:00 -05:00
Wilson Snyder 9ec5413d33 Tests: Cleaner error summaries 2024-12-01 10:27:05 -05:00
Wilson Snyder 611567c385 Internals: add make format-c/format-py. No functional change. 2024-12-01 10:26:01 -05:00
Wilson Snyder 7a04a5b9a8 Internals: Refactor symIterate functions. No functional change intended 2024-11-30 22:55:16 -05:00
Wilson Snyder 2d71d66cf5 Commentary 2024-11-30 22:35:36 -05:00
Wilson Snyder a51e26e62d Internals: Some V3LinkCells debug improvements. No functional change. 2024-11-30 20:09:05 -05:00
Wilson Snyder 5021989cb6 Tests: Rename interface-to-wire (#5649 test partial) 2024-11-30 19:05:26 -05:00
Wilson Snyder 2284ada723 Tests: Interface-to-wire (#5649 test partial) 2024-11-30 19:00:00 -05:00
Wilson Snyder e44f34dde3 Improve concat lint error & cleanups for future commit. 2024-11-30 18:56:00 -05:00
Wilson Snyder 0c820c3068 Internals: Standardize template argument names. No functional change. 2024-11-29 20:20:38 -05:00
Wilson Snyder 990ccd6763 Internals: Standardize on template<typename. No functional change. 2024-11-29 18:01:50 -05:00
Wilson Snyder f631587a20 Internals: Rename classOrPackageSkip as kept confusing with member accessor. No functional change. 2024-11-29 16:57:18 -05:00
Wilson Snyder 9f8fcaf827 Fix linking types of typedefs 2024-11-29 16:09:39 -05:00
Wilson Snyder d7893a60ca Internals: In V3LinkDot debug, show node name prefix. No functional change. 2024-11-29 16:09:04 -05:00
Wilson Snyder 93090c56ee Fix mis-aliasing of instances with mailbox parameter types (#5632 partial). 2024-11-29 09:20:02 -05:00
Wilson Snyder d750ffc129 Internals: Fix debug dump of deleted nodes. 2024-11-29 08:51:32 -05:00
Wilson Snyder 7efa0fc82a Internals: Rewrite skipRefp to avoid recursion and fix const-ness. No functional change intended. 2024-11-29 08:10:51 -05:00
Wilson Snyder 8db9db7e25 Internals: Rename same() function. No functional change. 2024-11-28 15:01:58 -05:00
Wilson Snyder d165671225 Improve error when no parameter type value (#5645 partial) 2024-11-28 14:09:06 -05:00
Wilson Snyder 7a8f71e7d8 Add --fno-slice to disable array assignment slicing (#5644). 2024-11-28 13:49:34 -05:00
Wilson Snyder e0ad430cd9 Internals: V3Slice style cleanup. No functional change; ignore whitespace 2024-11-28 13:33:59 -05:00
Wilson Snyder 7695687e87 Commentary: Changes update 2024-11-27 17:56:05 -05:00
Todd Strader 94e545bdca Fix interface and struct pattern collision (#5640) (#5639) 2024-11-27 17:20:21 -05:00
Wilson Snyder 99daa8d24b Support default disable iff and $inferred_disable (#4016). 2024-11-26 22:27:32 -05:00
Wilson Snyder e14903cfb2 Internals: Fix null skipRef for consistency. No functional change intended. 2024-11-26 22:10:54 -05:00
Wilson Snyder bee344d1ae Add error on illegal --prefix etc. values (#5507). 2024-11-26 21:06:43 -05:00
Wilson Snyder 713dab278c Fix mis-public interfaces, broke in f58aee2ff2 2024-11-26 19:16:05 -05:00
Wilson Snyder 29ad93c89d Tests: Add t_interface_colon_bad (#5281) 2024-11-25 21:50:24 -05:00
Wilson Snyder 7a9140821d Fix public_module requiring a wire to become public (#4916). 2024-11-25 21:21:11 -05:00
Wilson Snyder 2ba0749993 Tests: Verify function ref (#3385) 2024-11-25 20:38:41 -05:00
Wilson Snyder 25d75ee86f Add --fno-inline-funcs to disable function inlining. 2024-11-25 19:59:10 -05:00
Wilson Snyder a72009fb41 Fix UNDRIVEN on refs 2024-11-25 18:41:38 -05:00
Wilson Snyder a934d965be Internals: Rename isInoutish 2024-11-25 18:25:36 -05:00
Wilson Snyder 1277a40b31 Tests: Add driver --obj-suffix option 2024-11-24 21:12:08 -05:00
Wilson Snyder 6f35fec5ce Commentary 2024-11-24 20:47:57 -05:00
Wilson Snyder f58aee2ff2 Internals: Defer marking variables as IfaceRef until cells resolved. No functional change intended. 2024-11-24 18:33:10 -05:00
Wilson Snyder f5ee7aa0ab Internals: Decouple Bison class/package symbol table parsing from Link symbol table. (#5629)
Not intended to change non-error cases, but side-effects are likely.
2024-11-24 18:19:19 -05:00
Wilson Snyder 749b0345df Commentary: Changes update 2024-11-23 22:06:07 -05:00
Wilson Snyder 7e9535381a Tests: Use VM_PREFIX 2024-11-23 22:02:19 -05:00
github action 0d5fedce92 Apply 'make format' 2024-11-24 03:02:04 +00:00
sumpster 24b5c641f5 Fix array of struct member overwrites on member update (#5605) (#5618) (#5628) 2024-11-23 22:01:02 -05:00
sumpster ca31bcdbb6 Tests: Fix solver help output detection case insensitive (#5626) (#5627) 2024-11-23 18:10:37 -05:00
Ryszard Rozak ae990ebcda Add warning on global constraints (#5625) 2024-11-22 08:47:14 -05:00
Bartłomiej Chmiel 58dae8f931 Fix clang_check_attributes TypeError when accessing compilation database (#5622)
Signed-off-by: Bartłomiej Chmiel <[email protected]>
2024-11-21 07:05:18 -05:00
Ryszard Rozak 5470cf9fa9 Support randomize size constraints with restrictions (#5582 partial) (#5611) 2024-11-15 10:45:06 -05:00
Wilson Snyder 9bde98e912 Commentary 2024-11-14 21:07:45 -05:00
Wilson Snyder 81ac386a4a Tests: Renames 2024-11-14 21:05:59 -05:00
Tom Manner c98744b914 Internals: Fix VerilatedContext::randSeed comments (#5609) 2024-11-14 11:07:23 -05:00
Greg Davill 904be103df Support parameter names in pattern initialization (#5593) (#5596) 2024-11-14 07:25:58 -05:00
Wilson Snyder 8e82440a55 Fix extranous local:: error 2024-11-13 19:15:10 -05:00
Wilson Snyder 32c789c355 Commentary 2024-11-13 19:14:38 -05:00
Wilson Snyder d4a8cbb1d6 Fix function fork...join_none regression with unknown type (#4449). 2024-11-13 08:00:43 -05:00
Wilson Snyder 192236a832 Fix module automatic 2024-11-13 07:10:48 -05:00
Wilson Snyder e223228ec0 Fix installation of waiver file (#5607) 2024-11-12 22:41:05 -05:00
github action c7dbdf876a Apply 'make format' 2024-11-13 03:12:11 +00:00
Wilson Snyder 3ffea76e11 Add --no-std-waiver and default reading of standard lint waivers file (#5607). 2024-11-12 22:11:19 -05:00
Wilson Snyder 09547f839f Tests: Remove file-number hardcoded dependencies. 2024-11-12 21:39:13 -05:00
Wilson Snyder 0bf413b260 Add lint_off --contents in configuration files. (#5606) 2024-11-12 20:21:16 -05:00
Wilson Snyder a5b2cb6ddf Commentary: Changes update 2024-11-12 17:19:42 -05:00
Wilson Snyder 779cf9248a Cleanup/standardize configuration file string handling 2024-11-12 11:29:27 -05:00
Krzysztof Starecki 1d06364284 Support vpiDefName (#5572) 2024-11-12 11:28:39 -05:00
Wilson Snyder 833c215c45 Tests: Move uvm to subdirectory and add context-sensitive waivers 2024-11-11 20:49:59 -05:00
Wilson Snyder 4d95f6f7b8 Add --waiver-multiline for context-sensitive --waiver-output. 2024-11-11 20:00:26 -05:00
Wilson Snyder 46a5f04840 Internals: Link 'std' in LinkFind 2024-11-11 09:44:08 -05:00
Wilson Snyder 3c686d0eb2 Commentary 2024-11-11 08:44:46 -05:00
Wilson Snyder 7c8ff1d19c Add --no-std-package as subset-alias of --no-std. 2024-11-11 08:30:07 -05:00
Wilson Snyder 151c5b6a1d Tests: Rename some tests 2024-11-10 20:00:16 -05:00
Wilson Snyder 15d1751b23 Internals: Defer class extends resolution until link 2024-11-10 19:34:00 -05:00
Wilson Snyder b71d49e55a Internals: Defer $unit package resolution until link 2024-11-10 18:36:12 -05:00
Wilson Snyder c3b2bfbc39 Internals: Fix missing cleanFileline 2024-11-10 18:26:23 -05:00
github action b74a8f133f Apply 'make format' 2024-11-10 21:54:54 +00:00
Wilson Snyder 873048c21c Fix 'local::' parsing in wrong scope 2024-11-10 16:51:34 -05:00
Wilson Snyder 75e9986d39 Fix local:: mis-allowed in class extends 2024-11-10 16:43:21 -05:00
Geza Lore 863abdb1f7 Fix NBAs to unpacked arrays of unpacked structs (#5603)
This happened to work before #5516, by creating a whole shadow copy of
the entire array. Revert back to that behaviour for now, it will be
slow, but works still.

Fixes #5590
2024-11-10 17:38:28 +00:00
Geza Lore 03bd1bfc63 Move Concat balancing from DFG to FuncOpt (#5602)
This means it applies more widely, e.g. inside sequential logic.
2024-11-10 17:23:11 +00:00
Wilson Snyder 4257fcf9d0 Change parsing of cells to be non-symbol table sensitive. 2024-11-10 12:08:37 -05:00
Wilson Snyder a68da7e220 Internals: Style cleanup. Ignore whitespace if diff. No functional change. 2024-11-10 10:59:18 -05:00
Geza Lore 77ef2cd487 Split up assignments to wides with Concat on the RHS (#5599)
Add a new pass to split up (recursively):

foo = {l, r};

into the following, with the right indices, iff the concatenation
straddles a wide word boundary.

foo[_:_] = r;
foo[_:_] = l;

This eliminates more wide temporaries.

Another 23% speedup on VeeR EH2 high_perf. Also brings the predicted
stack size from 8M to 40k.
2024-11-10 15:51:59 +00:00
Wilson Snyder 7f1aae640f Fix dotted reference in delay value (#2410). 2024-11-10 10:23:29 -05:00
Wilson Snyder 0ec025c40c Internals: Rename rule. No functional change. 2024-11-10 10:14:42 -05:00
Wilson Snyder bc87270ca9 Add UNSUPPORTED on property variable, instead of syntax error. 2024-11-09 22:26:59 -05:00
Wilson Snyder 0e11b0929c Internals: whitespace 2024-11-09 21:33:22 -05:00
Wilson Snyder b741105329 Tests: Fix t_dist_whitespace error message 2024-11-09 20:47:59 -05:00
Wilson Snyder 2f4d1647f0 Fix non-interface error message 2024-11-09 20:28:47 -05:00
Wilson Snyder 4a88ddc616 Tests: Fix interface syntax error 2024-11-09 17:22:16 -05:00
Wilson Snyder 99e7dbc82b Internals: Put unsupported nettypes into symbol table, so parse as idType 2024-11-09 17:15:41 -05:00
Wilson Snyder c7a7965c49 Rename identifer token 2024-11-09 16:49:34 -05:00
Geza Lore f073b278f9 Balance concatenations in DFG (#5598)
The DFG peephole pass converts all associative trees into right leaning,
which is good for simplifying pattern recognition, but can lead to an
excessive amount of wide intermediate results being constructed for
right leaning concatenations.

Add a new pass to balance concatenation trees by trying to:
- Create VL_EDATASIZE (32-bit) sub-terms, so words can then be packed
  easily afterwards
- Try to ensure the operands of a concat are roughly the same width
  within a concatenation tree. This does not yield the shortest tree,
  but it ensures it has many sub-nodes that are small enough to fit into
  machine registers.

This can eliminate a lot of wide intermediate results, which would need
temporaries, and also increases ILP within sub-expressions (assuming the
C compiler can't figure that out itself).

This is over 2x run-time speedup on the high_perf configuration of
VeeR EH2 (which you could arguably also get with -fno-dfg, but oh well).
2024-11-09 18:14:19 +00:00
Wilson Snyder 4969125e5a Add error on soft constraints of randc 2024-11-09 12:45:55 -05:00
Wilson Snyder d230ccd716 Add error on solve before of randc variable. 2024-11-09 12:26:48 -05:00
Wilson Snyder 3fae11595a Support pure constraint. 2024-11-09 12:05:26 -05:00
Wilson Snyder 1e546bb9d9 Add assertion on firing event inside class (#5597) 2024-11-09 09:28:40 -05:00
Wilson Snyder 138daaf565 Commentary: Changes update 2024-11-09 08:35:40 -05:00
Wilson Snyder 3438d8f2b0 Tests: Use illegal struct 2024-11-09 08:34:17 -05:00
Wilson Snyder e55ed8eb66 Commentary 2024-11-09 08:24:50 -05:00
Wilson Snyder a55daf5367 Commentary 2024-11-09 07:56:47 -05:00
Yilou Wang a173883b2d Support basic constrained random for multi-dimensional dynamic array and queue (#5591) 2024-11-08 14:04:58 -05:00
Wilson Snyder 61d2284eab Commentary 2024-11-08 07:47:46 -05:00
Ryszard Rozak 6083480abb Fix rand dynamic arrays with null handles (#5594)
l
2024-11-08 06:53:43 -05:00
Wilson Snyder 2e1128b417 Internals: Iterator cleanup. No functional change intended. 2024-11-06 19:21:03 -05:00
Yilou WangandUdaya Raj Subedi e47208d9b3 Support queue's assignment push_back/push_front('{}) (#5585) (#5586)
Co-authored-by: Udaya Raj Subedi <[email protected]>
2024-11-06 17:31:48 -05:00
Wilson Snyder 87bd8fefa0 Add error on wait with missing .triggered. (#4457) 2024-11-05 01:22:56 -05:00
Wilson Snyder 753ea29df8 Add error on illegal enum base type (#3010). 2024-11-05 00:58:46 -05:00
Wilson Snyder b1dfdef0a9 Add error when improperly storing to parameter (#5147). 2024-11-05 00:17:40 -05:00
Wilson Snyder 2e4676dc11 Internals: Add missing VL_RESTORERS to V3LinkLValue; probably fixes no real cases, bug better safe. 2024-11-05 00:03:23 -05:00
Wilson Snyder eaaf91c82b Internals: Cleanup VL_RESTORER format in V3LinkLValue. No functional change. 2024-11-04 23:55:39 -05:00
Bartłomiej ChmielandRyszard Rozak 4e71f359bf Fix duplicate scope identifiers decoding (#5584)
Signed-off-by: Bartłomiej Chmiel <[email protected]>
Co-authored-by: Ryszard Rozak <[email protected]>
2024-11-04 06:06:15 -08:00
Ryszard Rozak b3348a38d0 Internals: Remove repeated clearing of constraints (#5583)
Signed-off-by: Ryszard Rozak <[email protected]>
2024-11-04 04:48:55 -08:00
Wilson Snyder 7854118883 Fix negative assignment pattern keys (#5580). 2024-11-02 10:06:01 -04:00
Wilson Snyder ed0e1af7aa Commentary: Changes update 2024-11-02 09:47:55 -04:00
github action e1a9734917 Apply 'make format' 2024-11-02 13:43:43 +00:00
Zhou Shen 589612f914 Fix can't locate scope error in interface task delayed assignment (#5462) (#5568) 2024-11-02 09:42:57 -04:00
Geza Lore 76b4c2f254 driver.py: Properly detect cfg with ccache (#5579) 2024-11-01 17:14:17 +00:00
Wilson Snyder b097cec72d Tests: Reduce false t_const_number_unsized_parse timeouts (#5577) 2024-11-01 12:39:29 -04:00
Wilson Snyder 9689a4f58a Internals: Support VL_UNREACHABLE in C++23/MSVC. No functional change intended. 2024-10-31 21:29:13 -04:00
Geza Lore aac0186871 Fix pylint 3.2.7 global-variable-not-assigned (#5578) 2024-11-01 15:27:08 +00:00
Geza Lore f458951b17 Fix slow unsized number parsing (#5577)
Try to avoid allocating and deallocating a full --max-num-width
buffer on parsing every single unsized number literal.
2024-11-01 14:10:44 +00:00
Andrew Nolte 4448778dbf Add coverage point hierarchy to coverage reports (#5575) (#5576) 2024-11-01 09:30:44 -04:00
Todd Strader dab826bef9 VPI error instead of fatal for vpi_get_value() on large signals (#5571) 2024-10-31 17:02:37 -04:00
Todd Strader 9fae951d9d Fix --output-groups leftover files issue (#5574) 2024-10-31 14:38:53 -04:00
Todd Strader 0f2a8c6c22 Fix BLKANDNBLK for for VARXREFs (#5569) 2024-10-29 07:27:40 -04:00
Wilson Snyder 68e0cf5523 devel release 2024-10-27 10:08:18 -04:00
Wilson Snyder d6ba65ba75 Version bump 2024-10-27 09:38:06 -04:00
Wilson Snyder f496138855 Commentary: Changes update 2024-10-27 09:33:54 -04:00
Wilson Snyder 2f272a4190 Fix $countbits in assert with non-tristates (#5566). 2024-10-27 09:30:54 -04:00
Wilson Snyder 469eca7de2 Commentary: Changes update 2024-10-25 18:54:39 -04:00
Todd Strader ec2eae607a Fix enum name method (#5563) 2024-10-25 18:49:45 -04:00
Ryszard Rozak 292c2e289e Support rand dynamic arrays of objects (#5557) (#5564) 2024-10-25 12:00:43 -04:00
Ryszard Rozak 87ac61140d Tests: Don't use indices in check_rand (#5561)
Signed-off-by: Ryszard Rozak <[email protected]>
2024-10-25 11:06:32 -04:00
Geza Lore 81ee89de15 Properly skip t_ccache_report when no ccache (#5562) 2024-10-25 14:33:26 +01:00
Todd Strader 83081aaefc Fix struct literal on pattern assignment (#5552) (#5559) 2024-10-24 18:50:57 -04:00
Tomasz Gorochowik fd2917c928 Commentary: Fix sv-bugpoint paragraph typo (#5558) 2024-10-24 09:41:27 -04:00
Ryszard Rozak 4cd69f9feb Fix queue element access (#5551) 2024-10-24 09:40:54 -04:00
Eric Müller 4e5c7f4568 Fix build on gcc when using the spack wrapper (#5555) 2024-10-24 07:53:11 -04:00
Tomasz Gorochowik 647af27274 Commentary: Mention sv-bugpoint in the contributing guidelines (#5553) 2024-10-24 07:42:57 -04:00
Todd Strader 8cc7e180ca Fix array trace splitting (#5549) 2024-10-23 11:51:48 -04:00
Todd Strader d3d45c0be5 Tests: Fix file_grep_count() error message (#5550) 2024-10-23 10:07:03 -04:00
Wilson Snyder 549dd31224 Commentary: Changes update 2024-10-22 09:34:09 -04:00
Wilson Snyder 36888fac5d Fix long module names crashing string handling (#5546). 2024-10-22 09:25:58 -04:00
Yilou WangandUdaya Raj Subedi 2409f32d87 Fix multi-range indices assignment (#5534) (#5547)
Co-authored-by: Udaya Raj Subedi <[email protected]>
2024-10-21 09:56:50 -04:00
Yilou Wang 8c3cc3af8f Fix struct array assignment (#5455) (#5537) 2024-10-21 09:54:33 -04:00
Todd Strader 76fe224e7c Fix complex user type problem with --x-assign (#5543) 2024-10-18 19:52:25 -04:00
Krzysztof Boroński 7ccc93d9df Fix reduction methods for verilated types (#5542) 2024-10-18 19:51:44 -04:00
Geza Lore 55661e7f71 Install public executables into bindir instead of pkgdatadir (#5140) (#5544)
Instead of installing redirect scripts in to bindir, and real
executables in to pkgdatadir/bin, we now put the real executables into
bindir, and add redirect scripts into pkgdatadir/bin. (That is, we
redirect in the opposite direction as before).

This enables the same relocatable and testable installations as before
without putting architecture specific binaries into pkgdatadir, so
hopefully we now conform to the Linux Filesystem Hierarchy Standard.

This requires a small fixup in the installed `verilator` script to
hardcode the relative path between bindir and pkgdatadir.

Fixes #5140
2024-10-18 10:06:28 +01:00
Aidan McNay ece0613e09 Commentary: Fix CMake comments (#5545) 2024-10-17 16:39:51 -04:00
Ryszard Rozak 0dce97b09d Fix assignments of concatenation to queues and dynamic arrays (#5540) 2024-10-15 07:35:59 -04:00
Ryszard Rozak a3d0cc6522 Fix static function wrappers (#5536)
Signed-off-by: Ryszard Rozak <[email protected]>
2024-10-14 07:41:17 -04:00
Wilson Snyder 1df20f7076 Remove driver.pl - deprecated earlier with driver.py 2024-10-13 21:55:31 -04:00
Wilson Snyder 2fc94557a0 Fix error on enums with x/z using .name(), and internal refactoring 2024-10-11 22:37:48 -04:00
Vito GamberiniandWilson Snyder 789698cb5c Fix coverage counts missing due to table optimization (#5473) (#5474).
Co-authored-by: Wilson Snyder <[email protected]>
2024-10-10 21:22:06 -04:00
Yilou Wang 3cced9baad Fix foreach on associative arr with the same logic and update the tests (#5530) 2024-10-10 12:50:43 -04:00
Yilou Wang f3cc32554c Fix foreach with 2-D queues and dynamic arrays (#5525) (#5529) 2024-10-10 10:50:37 -04:00
Ryszard Rozak 2a905c1d6e Fix copy constructor of classes that use std::process (#5528)
Signed-off-by: Ryszard Rozak <[email protected]>
2024-10-10 14:40:07 +02:00
Wilson Snyder 230b145c04 Commentary 2024-10-10 08:14:21 -04:00
Wilson Snyder 9f34764f4b Tests: Find filenames with fix me 2024-10-10 07:48:23 -04:00
Wilson Snyder 69ac3c14e8 Fix crash with internal assertion on short array initializer (partial #5511) 2024-10-10 07:20:44 -04:00
Wilson Snyder f98637e122 Internals: Cleanup style of coverage visitors. No functional change. Ignore whitespace if diff. 2024-10-09 18:13:23 -04:00
Wilson Snyder 6d936654ba Commentary: Changes update 2024-10-09 18:01:34 -04:00
Wilson Snyder 4dd4047c47 Internals: Less verbose docs build 2024-10-09 18:01:30 -04:00
Zhou Shen 1710b6bab4 Support for wired nets, wor/trior/wand/triand. (#5496) 2024-10-09 17:53:46 -04:00
Geza Lore 041f6603c3 Make incorrect soft ordering constraint into a hard constraint. (#5520)
An ordering constraint between NBA commit blocks ('Post' logic) and the
written variable were previously added as soft constraints (cutable
edges). However these are required for correctness, so if it ever is
cut we will have incorrect simulation results.

Change these into hard constraints instead. This necessitates adding a
flag on AstVar to ignore special variables constructed during V3Delayed
that might otherwise appear as degenerate logic loops. E.g.:

if (VdlySet) {
   VdlySet = 0;  // <- This write to VdlySet can and must be ignored
   LHS = VdlyVal;
}

No functional change, but you might get an error if this constraint was
ever violated. (Theoretically it should never be, as these variables
were inserted in a way that does not require violating these constraints
...)
2024-10-09 11:43:53 +01:00
Geza Lore 5acced1e33 Refactor V3Delay for extensibility (#5516)
* Refactor V3Delay for extensibility

Introduce the concept of an "NBA Scheme", which is the lowering pattern
we can use for various variables that are the targets of NBAs.
E.g.:
 - ShadowVariable (old default scheme)
 - FlagShared (old array set flag scheme)
 - ValueQueueWhole (recent dynamic commit queue)

We now analyse all AstAssignDly before making any decisions on which
scheme to apply. We then choose a specific scheme for each variable that
is the target of an NBA, and then all NBAs targeting that variable use
the same scheme. This enables easy mix and match of schemes as needed,
while remaining consistent by design after extensions.

Output is perturbed due to node insertion order, but no functional
or performance change is intended.
2024-10-09 10:39:40 +01:00
Yilou Wang 920c8012de Support unconstrained randomization for associative array and queue (#5515) 2024-10-08 10:54:20 -04:00
Geza Lore 8f1ea09558 Add lsb index to V3Number::setMask (#5522) 2024-10-08 13:15:36 +01:00
Wilson Snyder b873c23cf2 Internals: Refactor into V3Width enumSelect function 2024-10-07 21:44:07 -04:00
Wilson Snyder 13c7b6e827 Tests: Faster first retry 2024-10-07 21:44:07 -04:00
Wilson Snyder bbce7926b9 Tests: Remove unused clk input 2024-10-07 21:44:07 -04:00
Wilson Snyder 2c445e4bfd Commentary: Changes update 2024-10-07 21:44:07 -04:00
Furqan Nadir 338d54fd34 Commentary: Add name to CONTRIBUTORS (#5519) 2024-10-07 14:10:43 -04:00
Ryszard Rozak 009d1f2f5b Fix -j option without argument in hierarchical verilation (#5514)
Signed-off-by: Ryszard Rozak <[email protected]>
2024-10-07 07:31:59 -04:00
github action 08279645ca Apply 'make format' 2024-10-06 22:10:07 +00:00
Wilson Snyder 28ecd8e908 Support local and protected on typedef (#5460). 2024-10-06 18:08:40 -04:00
Wilson Snyder bc8a332ee8 Tests: Disable last test due to clang warning 2024-10-06 05:00:57 -04:00
Wilson Snyder d52822781c Tests: Fix driver for --iv etc 2024-10-06 04:49:53 -04:00
github action bdd37e40fe Apply 'make format' 2024-10-06 08:02:10 +00:00
Wilson Snyder 4b713e9882 Fix pattern initialization with typedef key (#5512). 2024-10-06 04:01:15 -04:00
Wilson Snyder fd9f5ab34e Fix not reporting class reference with extra parameters (#5467). 2024-10-04 05:38:36 -04:00
Wilson Snyder d06f986b51 Add elaboration dot-error message context, plus debug improvements 2024-10-04 05:38:05 -04:00
Wilson Snyder 8638e46cb7 Fix IEEE version number 2024-10-04 05:22:09 -04:00
Wilson Snyder 85909f02b3 Commentary 2024-10-04 05:21:18 -04:00
Nathan Graybeal 3572bd2f1a Fix configure inserting absolute paths for Python and Perl (#5504) (#5505)
* Migrate all tools to AC_CHECK_PROG
2024-10-04 10:08:44 +01:00
Wilson Snyder ff1d20d50c Tests: Add t_struct_initial_assign, still fails (#5380) (#5381). 2024-10-03 20:36:23 -04:00
Wilson Snyder c300075a20 Tests: Remove driver Python version package requirement (#5505) 2024-10-03 19:39:28 -04:00
Wilson Snyder 4bdfc653a3 Add error on misused genvar (#408). 2024-10-03 18:54:30 -04:00
Wilson Snyder 554653900a Commentary: Move C++20 deprec to after Ubuntu 20.04 EOL 2024-10-03 18:15:51 -04:00
Wilson Snyder b90b81e12c Tests: Fix string !== for other simulators. 2024-10-03 18:14:53 -04:00
Han Qi bf2b4e1b6a Fix equivalence checking when replacing type parameters (#5213) (#5255) 2024-10-03 21:19:07 +01:00
Yilou Wang c05c48aaf3 Support unpacked array Constrained Randomization (#5437) (#5489) 2024-10-02 10:29:47 -04:00
Fabian Keßler 39143cc15a Fix explicit CMAKE_INSTALL_PREFIX usages (#5500) 2024-10-01 13:38:16 -04:00
Wilson Snyder 03012da11c Internals: astgen: Detect bad node types after edits.
Also add checks for nodes that can be multiple types with syntax
`AstNode<AstNodeExpr|AstNodeDType>`
2024-09-30 22:25:28 -04:00
0547108e3f Add -output-groups to build with concatenated .cpp files (#5257)
Signed-off-by: Bartłomiej Chmiel <[email protected]>
Signed-off-by: Ryszard Rozak <[email protected]>
Signed-off-by: Arkadiusz Kozdra <[email protected]>
Co-authored-by: Mariusz Glebocki <[email protected]>
Co-authored-by: Arkadiusz Kozdra <[email protected]>
Co-authored-by: Bartłomiej Chmiel <[email protected]>
Co-authored-by: Wilson Snyder <[email protected]>
Co-authored-by: Ryszard Rozak <[email protected]>
2024-09-30 21:42:36 -04:00
Bartłomiej Chmiel 1a31aa5d62 Internals: Fix annotation checker not considering base class virtual function annotations (#5459) 2024-09-30 21:34:34 -04:00
Wilson Snyder 13a1240359 Commentary: Changes update 2024-09-29 21:41:05 -04:00
Wilson Snyder b7e5486baa Internals: Fix astgen spacing 2024-09-29 16:56:50 -04:00
Wilson Snyder afeca21d73 Internals: For debug, quote symbol table to see spaces. 2024-09-29 16:56:32 -04:00
Wilson Snyder d0ec6092b3 Change package import/export to link post-parsing, prep for later commit. 2024-09-28 20:55:22 -04:00
Wilson Snyder 5c923d6629 Fix to avoid IMPLICIT creation if data type of same name. 2024-09-28 17:58:26 -04:00
Wilson Snyder 1dc6fd3d93 Internals: Move interface error to later phase, prep for later commit. No functional change intended. 2024-09-28 17:37:44 -04:00
Arkadiusz Kozdra 5b56c80830 Better error recovery (#5493)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-09-27 20:38:49 +02:00
Wilson Snyder 2291d3d4c6 Tests: Fix some non-IEEE issues in tests. 2024-09-27 09:00:20 -04:00
Arkadiusz Kozdra 02e7767886 Fix randomize with foreach constraints (#5492)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-09-26 19:31:06 +02:00
Geza Lore 2a01365f9b Fix V3Table trying to generate 'x' bits in the lookup table. (#5491)
Due to out of range selects, V3Table attempted to create a table in the
constant pool with an 'x' value in it, which caused an internal error.

Ensure V3Table behaves the same for out of range selects as the original
logic would.

There is a related bug #5490, about leaving partially out of range
selects in the logic after inserting bounds checks in V3Unknown.
2024-09-26 16:31:47 +01:00
Arkadiusz KozdraandSzymon Gizler 91c8866ac3 Fix exponential ConcatN (#5488)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
Co-authored-by: Szymon Gizler <[email protected]>
2024-09-26 05:12:24 -04:00
Wilson Snyder 798bbe98e8 Add syntax error on empty case items, per IEEE grammar. 2024-09-25 22:40:28 -04:00
Wilson Snyder a3bbf13506 Internals: Minor parser reorgs in prep for future pull. No functional change intended. 2024-09-25 20:41:49 -04:00
Wilson Snyder 650da7beb2 Examples: Cleanup some spacing 2024-09-25 14:24:01 -04:00
Geza Lore 3bc09d49fb Generate one trigger per SenItem instead of per SenTree (#5483) 2024-09-25 10:35:50 +01:00
Wilson Snyder 6c61a9aff3 Support objcache when compiling Verilated files with cmake. 2024-09-24 20:55:11 -04:00
Wilson Snyder a4085f3a06 Internals: Standardize format of CMake files with gersemi. No functional change intended. 2024-09-24 20:43:19 -04:00
Wilson Snyder 3ae18af8dd Fix short-circuting on method calls (#5486). 2024-09-24 20:24:27 -04:00
Wilson Snyder 811eab8fa5 Fix short-circuting with associative array access (#5484). 2024-09-24 19:24:01 -04:00
Wilson Snyder 4ec75b2618 Fix over-permissive parsing of UDPs without identifiers 2024-09-24 18:53:32 -04:00
Wilson Snyder 5a65d27851 Internals: bisonpre: Support -Wcounterexamples 2024-09-23 21:42:02 -04:00
Chris Bachhuber 685ea0bc65 Add Docker pre-commit hook (#5238) (#5452) 2024-09-23 07:37:24 -04:00
Wilson Snyder c48d80592e Fix extra dot in coverage point hierarchy when using name()=''. 2024-09-23 07:34:12 -04:00
Wilson Snyder 0aa8356eca Change --main and --binary to use a TOP hierarchy name of "" (#5482). 2024-09-22 23:03:51 -04:00
Wilson Snyder 670b7c5243 Support DPI imports and exports with double underscores (#5481). 2024-09-22 22:11:01 -04:00
Wilson Snyder 706679e6b1 Support DPI imports and exports with double underscores. 2024-09-22 22:06:39 -04:00
Wilson Snyder d288488b7f Fix --binary with .cpp PLI filenames under relative directory paths. 2024-09-22 16:47:15 -04:00
Chris Bachhuber b17619296a Documentation: Highlight syntax in install.rst (#5478) 2024-09-22 15:55:12 -04:00
Wilson Snyder 88bd479bc7 Add error on instances without parenthesis. 2024-09-22 12:25:35 -04:00
Wilson Snyder 2584befa5a Internals: Show tree traversal in V3LinkDot Resolve debug. No functional change intended. 2024-09-22 10:46:04 -04:00
Wilson Snyder 90215878f8 Tests: Improve t_dist_warn_coverage.py 2024-09-22 09:10:03 -04:00
Wilson Snyder a1a74cb1d9 Fix mis-parsing of constraint = new. 2024-09-22 09:10:01 -04:00
Wilson Snyder 9f9770e722 Parse elaboration-time nettype declarations (as UNSUPPORTED) 2024-09-21 21:00:02 -04:00
Wilson Snyder 888af29a72 Delay struct type determination until elaboration 2024-09-21 20:27:55 -04:00
Wilson Snyder 5f39c69d19 Delay parameter type assignment determination until elaboration 2024-09-21 20:27:41 -04:00
Wilson Snyder e7de2c5a05 Remove warning on unsized numbers exceeding 32-bits. 2024-09-21 19:19:12 -04:00
Geza Lore 59b07529b1 driver.py: fix aslr_off (#5477) 2024-09-21 16:37:51 +01:00
Geza Lore a6e9bce0dd driver.py: consume all stdout from subprocess (#5476) 2024-09-21 16:24:45 +01:00
Wilson Snyder 2c52119d6c Tests: Rename some tests into proper groups. No functional change. 2024-09-21 10:04:58 -04:00
Wilson Snyder 48faf8d036 Fix tracing when name() is empty (#5470). 2024-09-21 08:25:14 -04:00
Wilson Snyder 0484143282 Tests: Update t_timing_finish (#5472) 2024-09-21 07:46:04 -04:00
Wilson Snyder 0ee214a157 Tests: Fix t_timing_fork_comb_bad committed earlier 2024-09-20 22:16:00 -04:00
Wilson Snyder 774ec42be4 Internals: Experimental cleanup; avoid :: on package symbol tables 2024-09-20 20:39:49 -04:00
Wilson Snyder 5a6f2b661d Tests: Avoid multiple lint/compile runs in one test; hard to debug 2024-09-20 20:34:35 -04:00
Wilson Snyder 80cba789f4 Internals: Remove V3LinkParse's need of class links. No functional change intended. 2024-09-20 18:26:23 -04:00
Wilson Snyder 92dd8ee8f5 Fix timing mode not exiting on empty events (#5472). 2024-09-20 17:46:27 -04:00
Todd Strader 1665d15d4d Fix user-type parameter overlap (#5469) 2024-09-20 14:29:31 -04:00
Wilson Snyder f0fb0b05ff Internals: Misc V3Param cleanups. 2024-09-20 08:59:10 -04:00
Wilson Snyder 02e88e3848 Fix suppression of WIDTH* warnings when immediately under a size cast (#3417). 2024-09-19 22:56:47 -04:00
Wilson Snyder 87eef36b1c Tests: Fix driver race sometimes missing final log data 2024-09-19 22:49:40 -04:00
Wilson Snyder 579257bc42 Tests: Fix driver not accepting debug pass-down flags to Verilator, broke earlier commit. 2024-09-19 22:08:40 -04:00
Wilson Snyder e2041f7450 Commentary: Changes update 2024-09-19 20:29:39 -04:00
Yilou Wang 70112438c3 Support packed/unpacked and dynamic array unconstrained randomization (#5414) (#5415) 2024-09-19 20:07:05 -04:00
Wilson Snyder 175e1dde73 Tests: Run t_hier_block_cmake.py first so finishes 2024-09-19 19:33:43 -04:00
Wilson Snyder e990415ee0 Tests: Improve driver performance with forkserver 2024-09-19 19:28:07 -04:00
Wilson Snyder 1543b202b2 Tests: Move per-command expect= to instead check logfiles 2024-09-19 18:53:22 -04:00
Wilson Snyder f63168a5b5 CI: More parallelism 2024-09-19 18:51:33 -04:00
Wilson Snyder 49bccb5f1b Commentary 2024-09-19 17:58:37 -04:00
Wilson Snyder c7e1358bb7 Tests: Fix --gdb with one test (#5466) 2024-09-19 17:06:32 -04:00
Geza Lore 62a58f420c Fix latest pylint issues (#5465) 2024-09-19 15:51:13 +01:00
Arkadiusz Kozdra dd95e033e7 Support inside array constraints (#5448)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-09-19 07:27:59 -04:00
Wilson Snyder 371a4055b0 Fix false LIFETIME warning on repeat in fork-join (#5456). 2024-09-18 21:20:17 -04:00
Wilson Snyder f251f7b774 Tests: CONSTRIAINTIGN, ZERODLY no longer need suppression on UVM 2024-09-17 21:21:08 -04:00
Wilson Snyder 0f3e0de891 Commentary 2024-09-17 20:58:14 -04:00
Wilson Snyder 7081ea0ede Support as a task call 2024-09-17 20:53:08 -04:00
Wilson Snyder fb04765c0e Fix class reference with pin that is a class reference (#5454). 2024-09-17 17:38:18 -04:00
Wilson Snyder b8bda729d4 Tests: Fix debug message 2024-09-16 20:29:23 -04:00
Wilson Snyder 195a665293 Internals: Fix V3LinkDot debug message print 2024-09-15 21:18:51 -04:00
Wilson Snyder c8de3630a5 Tests: Fix driver error report, and passing --dumpi-tree 2024-09-15 21:10:44 -04:00
Wilson Snyder 99a29acca0 CI: One-time yamlfix cleanups. No functional change intended. 2024-09-15 14:37:09 -04:00
Wilson Snyder 48a607cc78 Internals: Cleanup Makefile.in to commented sections. No functional change intended. 2024-09-15 13:55:43 -04:00
Wilson Snyder 19170badd3 Fix warning IEEE reference (#5453) 2024-09-15 11:05:48 -04:00
Wilson Snyder 77fc771ed0 Tests: Fix missing stdout on execute() 2024-09-14 18:01:49 -04:00
github action 9b9a554489 Apply 'make format' 2024-09-14 00:46:48 +00:00
Wilson Snyder 0fe8c73d19 Fix $fatal to not be affected by +verilator+error+limit (#5135). 2024-09-13 20:45:44 -04:00
Wilson Snyder eb66e137db Fix fault on defparam with UNSUPPORTED ignored (#5450). 2024-09-13 18:31:55 -04:00
Wilson Snyder c2b82c293f Tests: Fix driver creating .out with --gold 2024-09-13 18:31:35 -04:00
Arkadiusz Kozdra 0b7510befa Support basic dist constraints (#5431) 2024-09-12 05:20:36 -07:00
Arkadiusz Kozdra 140eb0a6e5 Re-sync parser on endclass
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-09-11 15:57:45 +02:00
Arkadiusz Kozdra 6b8f253ecd Re-sync parser in constraints and cross coverpoints
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-09-11 15:57:45 +02:00
Arkadiusz Kozdra ac29393ec9 Do not parse covergroup identifiers as types
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-09-11 15:57:45 +02:00
Wilson Snyder 22d6bb8180 Fix display with multiple string formats (#5311). 2024-09-11 08:41:11 -04:00
Wilson Snyder f4e4602dcb Tests: Fix driver handling of interrupts 2024-09-10 20:29:26 -04:00
Wilson Snyder 521c5c2f75 Fix extra events in traces (#5405). 2024-09-10 19:14:52 -04:00
Wilson Snyder 3525484730 Commentary 2024-09-10 19:04:55 -04:00
Arkadiusz Kozdra 4a58997604 Support basic constrained queue randomization (#5413)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-09-10 09:33:14 -04:00
Arkadiusz Kozdra ef259f63ca Fix randomize treated as std::randomize in classes (#5436) 2024-09-10 09:10:36 -04:00
Arkadiusz Kozdra 2f690c0530 Fix foreach colliding index names (#5444)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-09-10 07:17:21 -04:00
Wilson Snyder 283a5edbdb Tests: Make GCOV_PREFIX path directories 2024-09-09 21:47:47 -04:00
Wilson Snyder e566b5a4f5 Change .vlt config files to be read before .v files (#5185). 2024-09-09 20:18:54 -04:00
Wilson Snyder 4e4fdd3b66 Fix multidimensional function return value selects (#5382). 2024-09-09 19:56:09 -04:00
Wilson Snyder 434896d50c Tests: test class IGNOREDRETURN. 2024-09-09 19:48:15 -04:00
Andrew Nolte 1e7611edea Change to use maximum for cover point aggregation (#5402) 2024-09-09 14:20:18 -04:00
Geza Lore 2890126110 Remove out of range Sel in V3Unknown (#5443)
Fixes #5393
2024-09-09 14:09:29 +01:00
Wilson Snyder 07bb8c701d Convert test driver to Python (#5427) 2024-09-08 13:00:03 -04:00
Wilson Snyder 55ae48ac13 Commentary 2024-09-08 11:11:20 -04:00
Wilson Snyder c83ee391bb Fix associative array next/prev/first/last mis-propagating constants (#5435). 2024-09-07 15:25:35 -04:00
Wilson Snyder d01b917062 Commentary: Changes update 2024-09-07 15:24:06 -04:00
Wilson Snyder b21117091b CI: Add Ubuntu 24.04 GCC; combine reloc with GCC-10 runs 2024-09-07 13:43:47 -04:00
Wilson Snyder 3a73d83741 Tests: Fix clang 18 warning 2024-09-07 10:20:59 -04:00
Wilson Snyder 9643232d36 CI: Add Ubuntu 24.04 script (not enabled yet) 2024-09-07 10:12:35 -04:00
Wilson Snyder 7b41d2046d Fix GTKWave clang 18 warning 2024-09-07 10:12:09 -04:00
Wilson Snyder 7eb1b6c32b Tests: Fix GCC 13.2.0 issues. No functional change. 2024-09-06 22:04:49 -04:00
Andrew Nolte 083fb7e9c2 Add partial coverage symbol and branch data in lcov info files (#5388) 2024-09-06 18:15:18 -04:00
Krzysztof Bieganski afb8428db4 Support IEEE-compliant intra-assign delays (#3711) (#5441) 2024-09-06 18:13:52 -04:00
Bartłomiej Chmiel d6923c8571 Improve performance of V3VariableOrder with parallelization (#5406) 2024-09-06 08:04:26 -04:00
Wilson Snyder 1c38744fd1 Tests: Fix requiring core dump 2024-09-04 20:10:05 -04:00
Krzysztof Bieganski 51691dfde5 Fix driving clocking block in Reactive
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-09-04 07:57:51 -04:00
Arkadiusz Kozdra 409efa1249 Internals: Factor out creating clocking event. No functional change.
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-09-04 07:57:51 -04:00
Wilson Snyder e4ff0909dc Tests: Misc test cleanups from Python branch. 2024-09-03 21:42:06 -04:00
Wilson Snyder d3670b6890 Test: Remove old test 2024-09-03 21:32:09 -04:00
Wilson Snyder 7a74ddc1af Internals: Fix some getter/setter ordering. No functional change intended. 2024-09-02 18:48:49 -04:00
Wilson Snyder 551862a55e Tests: Move some misplaced files. No functional change. 2024-09-02 15:50:40 -04:00
Arkadiusz Kozdra d3fcec3e84 Fix clearing trigger of events with no sentrees (#5426)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-09-02 18:19:49 +02:00
Krzysztof Bieganski 088862d449 Support appending to queue via [] (#5421) 2024-09-02 09:45:47 -04:00
github action e9f758ce67 Apply 'make format' 2024-09-02 01:13:41 +00:00
Wilson Snyder b698bfd850 Tests: Untabify some tests. 2024-09-01 21:12:37 -04:00
Wilson Snyder c9970ff822 Tests: Fix --verbose broken display 2024-09-01 21:01:07 -04:00
Wilson Snyder df594ee430 Tests: Fix ll scan test. 2024-09-01 20:59:42 -04:00
Todd Strader 201e343795 Fix sformatf internal error on initial automatics (#5423) 2024-08-30 19:35:47 -04:00
Wilson Snyder 9a307c4abd Tests: Cleanup trace_filename use. No test functionality change. 2024-08-30 18:34:42 -04:00
Krzysztof Bieganski 657d7f257b Support named event locals (#5422)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-08-30 17:10:47 +02:00
Wilson Snyder 0ec5e02ce1 Improve hex too many digits error (#5419). 2024-08-30 07:48:00 -04:00
Wilson Snyder cdfb2221bb Tests: Remove ancient GCC 4.4 skip. 2024-08-29 19:25:22 -04:00
Krzysztof Bieganski f133a2811f Fix capturing params in randomize() with (#5416) (#5418)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-08-29 23:02:21 +02:00
Krzysztof Bieganski aecf38e3ad Fix V3Randomize compile error on old GCC (#5403) (#5417).
No functional change intended.
2024-08-29 10:39:54 -04:00
Wilson Snyder fa32d10f39 Fix performance of V3Trace when many activity blocks (#5372). 2024-08-28 20:45:51 -04:00
Wilson Snyder f4fe89a8c4 Commentary: Changes update 2024-08-28 17:32:57 -04:00
Krzysztof Bieganski 675d9a641e Call pre/post_randomize on randomize() with (#5412)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-08-28 19:42:49 +02:00
Krzysztof Bieganski d896f1ff08 Fix queue [$-i] select as reference argument (#5411)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-08-28 17:29:12 +02:00
Arkadiusz Kozdra 5cb6f370e9 Internals: Emit rand constraint right away. No functional change intended. (#5409)
This change gets rid of most of the shared pointers and useless memory
allocations.  Also takes advantage of higher-arity bvxor/concat to
reduce amount of data sent to the solver.

Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-08-28 16:11:39 +02:00
Kaleb Barrett e04ef5d83a Add method to check if there are VPI callbacks of the given type (#5399) 2024-08-27 17:36:51 -04:00
Krzysztof Bieganski 155dcc5658 Fix empty foreach in if in constraints (#5408)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-08-27 15:39:36 +02:00
Wilson Snyder e927536099 Reduce --debugi 2 verbosity 2024-08-27 07:28:27 -04:00
Krzysztof Bieganski f623db7d68 Normalize types in constraints (#5407)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-08-27 12:53:44 +02:00
Wilson Snyder d40f7f5167 Tests: Fix lint-py (last commit) 2024-08-27 05:31:40 -04:00
Wilson Snyder 34bb013941 Tests: Fix broken t_proc.pl, and misc cleanups. 2024-08-26 21:53:36 -04:00
Wilson Snyder ae35be9102 Internals: Reformat with new settings (last commit). No functional change. 2024-08-26 21:53:36 -04:00
Wilson Snyder bde4097df2 Internals: Add .style.yapf 2024-08-26 21:53:36 -04:00
Wilson Snyder 17b70788df Internals: Run yapf3 in parallel 2024-08-26 21:53:36 -04:00
Krzysztof Bieganski b1927e4fb5 Fix infinite recursion due to recursive functions/tasks (#5398) 2024-08-26 12:18:52 -04:00
Yilou Wang c4cb26fa9a Support unconstrained randomization for unions (#5395) (#5396) 2024-08-26 11:04:45 -04:00
Wilson Snyder 4e86e60491 Tests: Use only case-sensitve non-extended regexps 2024-08-26 08:14:39 -04:00
Wilson Snyder d3e07b6ad9 Internals: Always use parallel for make -j 4 clang-format yapf format-pl-exec
make[1]: Entering directory '/svaha/wsnyder/SandBox/homecvs/v4/verilator'
yapf3 -i bin/verilator_ccache_report bin/verilator_difftree bin/verilator_gantt bin/verilator_includer bin/verilator_profcfunc examples/json_py/vl_file_copy examples/json_py/vl_hier_graph docs/guide/conf.py docs/bin/vl_sphinx_extract docs/bin/vl_sphinx_fix src/astgen src/bisonpre src/config_rev src/cppcheck_filtered src/flexfix src/vlcovgen src/.gdbinit.py test_regress/t/*.pf nodist/clang_check_attributes nodist/code_coverage nodist/dot_importer nodist/fuzzer/actual_fail nodist/fuzzer/generate_dictionary nodist/install_test nodist/log_changes  nodist/code_coverage.dat
chmod a+x test_regress/t/*.pl
clang-format-14 -i ./include/verilated.cpp ./include/verilated_cov.cpp ./include/verilated_dpi.cpp ./include/verilated_fst_c.cpp ./include/verilated_fst_sc.cpp ./include/verilated_probdist.cpp ./include/verilated_profiler.cpp ./include/verilated_random.cpp ./include/verilated_save.cpp ./include/verilated_threads.cpp ./include/verilated_timing.cpp ./include/verilated_vcd_c.cpp ./include/verilated_vcd_sc.cpp ./include/verilated_vpi.cpp ./examples/make_hello_c/sim_main.cpp ./examples/make_hello_sc/sc_main.cpp ./examples/make_protect_lib/sim_main.cpp ./examples/make_tracing_c/sim_main.cpp ./examples/make_tracing_sc/sc_main.cpp ./src/VlcMain.cpp ./src/VlcTop.cpp ./src/V3Active.cpp ./src/V3ActiveTop.cpp ./src/V3Assert.cpp ./src/V3AssertPre.cpp ./src/V3Ast.cpp ./src/V3AstNodes.cpp ./src/V3Begin.cpp ./src/V3Branch.cpp ./src/V3Broken.cpp ./src/V3CCtors.cpp ./src/V3CUse.cpp ./src/V3Case.cpp ./src/V3Cast.cpp ./src/V3Class.cpp ./src/V3Clean.cpp ./src/V3Clock.cpp ./src/V3Combine.cpp ./src/V3Common.cpp ./src/V3Config.cpp ./src/V3Const.cpp ./src/V3Coverage.cpp ./src/V3CoverageJoin.cpp ./src/V3Dead.cpp ./src/V3Delayed.cpp ./src/V3Depth.cpp ./src/V3DepthBlock.cpp ./src/V3Descope.cpp ./src/V3Dfg.cpp ./src/V3DfgAstToDfg.cpp ./src/V3DfgCache.cpp ./src/V3DfgDecomposition.cpp ./src/V3DfgDfgToAst.cpp ./src/V3DfgOptimizer.cpp ./src/V3DfgPasses.cpp ./src/V3DfgPeephole.cpp ./src/V3DfgRegularize.cpp ./src/V3DupFinder.cpp ./src/Verilator.cpp ./src/V3EmitCBase.cpp ./src/V3EmitCConstPool.cpp ./src/V3EmitCFunc.cpp ./src/V3EmitCHeaders.cpp ./src/V3EmitCImp.cpp ./src/V3EmitCInlines.cpp ./src/V3EmitCMain.cpp ./src/V3EmitCMake.cpp ./src/V3EmitCModel.cpp ./src/V3EmitCPch.cpp ./src/V3EmitCSyms.cpp ./src/V3EmitMk.cpp ./src/V3EmitV.cpp ./src/V3EmitXml.cpp ./src/V3Error.cpp ./src/V3ExecGraph.cpp ./src/V3Expand.cpp ./src/V3File.cpp ./src/V3FileLine.cpp ./src/V3Force.cpp ./src/V3Fork.cpp ./src/V3Gate.cpp ./src/V3Global.cpp ./src/V3Graph.cpp ./src/V3GraphAcyc.cpp ./src/V3GraphAlg.cpp ./src/V3GraphPathChecker.cpp ./src/V3GraphTest.cpp ./src/V3Hash.cpp ./src/V3Hasher.cpp ./src/V3HierBlock.cpp ./src/V3Inline.cpp ./src/V3Inst.cpp ./src/V3InstrCount.cpp ./src/V3Interface.cpp ./src/V3Param.cpp ./src/V3ParseGrammar.cpp ./src/V3ParseImp.cpp ./src/V3ParseLex.cpp ./src/V3PreProc.cpp ./src/V3PreShell.cpp ./src/V3Premit.cpp ./src/V3ProtectLib.cpp ./src/V3Randomize.cpp ./src/V3Reloop.cpp ./src/V3Sampled.cpp ./src/V3Sched.cpp ./src/V3SchedAcyclic.cpp ./src/V3SchedPartition.cpp ./src/V3SchedReplicate.cpp ./src/V3SchedTiming.cpp ./src/V3SchedVirtIface.cpp ./src/V3Scope.cpp ./src/V3Scoreboard.cpp ./src/V3Slice.cpp ./src/V3Split.cpp ./src/V3SplitAs.cpp ./src/V3SplitVar.cpp ./src/V3StackCount.cpp ./src/V3Stats.cpp ./src/V3StatsReport.cpp ./src/V3String.cpp ./src/V3Subst.cpp ./src/V3TSP.cpp ./src/V3Table.cpp ./src/V3Task.cpp ./src/V3ThreadPool.cpp ./src/V3Timing.cpp ./src/V3Trace.cpp ./src/V3TraceDecl.cpp ./src/V3Tristate.cpp ./src/V3Undriven.cpp ./src/V3Unknown.cpp ./src/V3Unroll.cpp ./src/V3VariableOrder.cpp ./src/V3Waiver.cpp ./src/V3Width.cpp ./src/V3WidthCommit.cpp ./src/V3WidthSel.cpp ./src/V3Life.cpp ./src/V3LifePost.cpp ./src/V3LinkCells.cpp ./src/V3LinkDot.cpp ./src/V3LinkInc.cpp ./src/V3LinkJump.cpp ./src/V3LinkLValue.cpp ./src/V3LinkLevel.cpp ./src/V3LinkParse.cpp ./src/V3LinkResolve.cpp ./src/V3Localize.cpp ./src/V3MergeCond.cpp ./src/V3Name.cpp ./src/V3Number.cpp ./src/V3OptionParser.cpp ./src/V3Options.cpp ./src/V3Order.cpp ./src/V3OrderGraphBuilder.cpp ./src/V3OrderMoveGraph.cpp ./src/V3OrderParallel.cpp ./src/V3OrderProcessDomains.cpp ./src/V3OrderSerial.cpp ./src/V3Os.cpp ./src/V3Param.cpp ./src/V3ParseGrammar.cpp ./src/V3ParseImp.cpp ./src/V3ParseLex.cpp ./src/V3PreProc.cpp ./src/V3PreShell.cpp ./src/V3Premit.cpp ./src/V3ProtectLib.cpp ./src/V3Randomize.cpp ./src/V3Reloop.cpp ./src/V3Sampled.cpp ./src/V3Sched.cpp ./src/V3SchedAcyclic.cpp ./src/V3SchedPartition.cpp ./src/V3SchedReplicate.cpp ./src/V3SchedTiming.cpp ./src/V3SchedVirtIface.cpp ./src/V3Scope.cpp ./src/V3Scoreboard.cpp ./src/V3Slice.cpp ./src/V3Split.cpp ./src/V3SplitAs.cpp ./src/V3SplitVar.cpp ./src/V3StackCount.cpp ./src/V3Stats.cpp ./src/V3StatsReport.cpp ./src/V3String.cpp ./src/V3Subst.cpp ./src/V3TSP.cpp ./src/V3Table.cpp ./src/V3Task.cpp ./src/V3ThreadPool.cpp ./src/V3Timing.cpp ./src/V3Trace.cpp ./src/V3TraceDecl.cpp ./src/V3Tristate.cpp ./src/V3Undriven.cpp ./src/V3Unknown.cpp ./src/V3Unroll.cpp ./src/V3VariableOrder.cpp ./src/V3Waiver.cpp ./src/V3Width.cpp ./src/V3WidthCommit.cpp ./src/V3WidthSel.cpp ./include/verilated.h ./include/verilated_config.h ./include/verilated_cov.h ./include/verilated_cov_key.h ./include/verilated_dpi.h ./include/verilated_fst_c.h ./include/verilated_fst_sc.h ./include/verilated_funcs.h ./include/verilated_imp.h ./include/verilated_intrinsics.h ./include/verilated_profiler.h ./include/verilated_random.h ./include/verilated_save.h ./include/verilated_sc.h ./include/verilated_sc_trace.h ./include/verilated_sym_props.h ./include/verilated_syms.h ./include/verilated_threads.h ./include/verilated_timing.h ./include/verilated_trace.h ./include/verilated_trace_imp.h ./include/verilated_types.h ./include/verilated_vcd_c.h ./include/verilated_vcd_sc.h ./include/verilated_vpi.h ./include/verilatedos.h ./include/verilatedos_c.h ./src/V3Active.h ./src/V3ActiveTop.h ./src/V3Assert.h ./src/V3AssertPre.h ./src/V3Ast.h ./src/V3AstInlines.h ./src/V3AstNodeDType.h ./src/V3AstNodeExpr.h ./src/V3AstNodeOther.h ./src/V3AstUserAllocator.h ./src/V3Begin.h ./src/V3Branch.h ./src/V3Broken.h ./src/V3CCtors.h ./src/V3CUse.h ./src/V3Case.h ./src/V3Cast.h ./src/V3Class.h ./src/V3Clean.h ./src/V3Clock.h ./src/V3Combine.h ./src/V3Common.h ./src/V3Config.h ./src/V3Const.h ./src/V3Coverage.h ./src/V3CoverageJoin.h ./src/V3Dead.h ./src/V3Delayed.h ./src/V3Depth.h ./src/V3DepthBlock.h ./src/V3Descope.h ./src/V3Dfg.h ./src/V3DfgCache.h ./src/V3DfgOptimizer.h ./src/V3DfgPasses.h ./src/V3DfgPatternStats.h ./src/V3DfgPeephole.h ./src/V3DfgVertices.h ./src/V3DupFinder.h ./src/V3EmitC.h ./src/V3EmitCBase.h ./src/V3EmitCConstInit.h ./src/V3EmitCFunc.h ./src/V3EmitCMain.h ./src/V3EmitCMake.h ./src/V3EmitMk.h ./src/V3EmitV.h ./src/V3EmitXml.h ./src/V3Error.h ./src/V3ExecGraph.h ./src/V3Expand.h ./src/V3File.h ./src/V3FileLine.h ./src/V3Force.h ./src/V3Fork.h ./src/V3FunctionTraits.h ./src/V3Gate.h ./src/V3Global.h ./src/V3Graph.h ./src/V3GraphAlg.h ./src/V3GraphPathChecker.h ./src/V3GraphStream.h ./src/V3Hash.h ./src/V3Hasher.h ./src/V3HierBlock.h ./src/V3Inline.h ./src/V3Inst.h ./src/V3InstrCount.h ./src/V3Interface.h ./src/V3LangCode.h ./src/V3LanguageWords.h ./src/V3Life.h ./src/V3LifePost.h ./src/V3LinkCells.h ./src/V3LinkDot.h ./src/V3LinkInc.h ./src/V3LinkJump.h ./src/V3LinkLValue.h ./src/V3LinkLevel.h ./src/V3LinkParse.h ./src/V3LinkResolve.h ./src/V3List.h ./src/V3Localize.h ./src/V3MemberMap.h ./src/V3MergeCond.h ./src/V3Mutex.h ./src/V3Name.h ./src/V3Number.h ./src/V3OptionParser.h ./src/V3Options.h ./src/V3Order.h ./src/V3OrderCFuncEmitter.h ./src/V3OrderGraph.h ./src/V3OrderInternal.h ./src/V3OrderMoveGraph.h ./src/V3Os.h ./src/V3PairingHeap.h ./src/V3Param.h ./src/V3Parse.h ./src/V3ParseImp.h ./src/V3ParseSym.h ./src/V3PchAstMT.h ./src/V3PchAstNoMT.h ./src/V3PreExpr.h ./src/V3PreLex.h ./src/V3PreProc.h ./src/V3PreShell.h ./src/V3Premit.h ./src/V3ProtectLib.h ./src/V3Randomize.h ./src/V3Reloop.h ./src/V3Rtti.h ./src/V3Sampled.h ./src/V3Sched.h ./src/V3Scope.h ./src/V3Scoreboard.h ./src/V3SenExprBuilder.h ./src/V3SenTree.h ./src/V3Simulate.h ./src/V3Slice.h ./src/V3Split.h ./src/V3SplitAs.h ./src/V3SplitVar.h ./src/V3StackCount.h ./src/V3Stats.h ./src/V3StdFuture.h ./src/V3String.h ./src/V3Subst.h ./src/V3SymTable.h ./src/V3TSP.h ./src/V3Table.h ./src/V3Task.h ./src/V3ThreadPool.h ./src/V3Timing.h ./src/V3Trace.h ./src/V3TraceDecl.h ./src/V3Tristate.h ./src/V3Undriven.h ./src/V3UniqueNames.h ./src/V3Unknown.h ./src/V3Unroll.h ./src/V3VariableOrder.h ./src/V3Waiver.h ./src/V3Width.h ./src/V3WidthCommit.h ./src/V3WidthRemove.h ./src/VlcBucket.h ./src/VlcOptions.h ./src/VlcPoint.h ./src/VlcSource.h ./src/VlcTest.h ./src/VlcTop.h ./src/config_build.h ./src/config_package.h ./src/config_rev.h ./src/verilog.y ./src/V3PreLex.l ./src/verilog.l test_regress/t/*.c* test_regress/t/*.h
make[1]: Leaving directory '/svaha/wsnyder/SandBox/homecvs/v4/verilator'
2024-08-26 05:01:37 -04:00
Wilson Snyder fa4af38b0a configure: Print inbound CXX setting 2024-08-26 04:58:59 -04:00
Wilson Snyder a9635aaa2c Tests: Default to check_finished=>1 2024-08-24 19:27:59 -04:00
Wilson Snyder f0cd6dd95c Fix REALCVT warning on integral timescale conversions (#5378). 2024-08-24 08:01:28 -04:00
Wilson Snyder d8fdfa6be2 Internals: git ignore nohup.out 2024-08-24 07:56:48 -04:00
Wilson Snyder f9511e9755 Internals: Make V3Number::selfTest() 2024-08-24 05:41:22 -04:00
Wilson Snyder cfe1f23fff Commentary: Changes update 2024-08-23 18:45:54 -04:00
Wilson Snyder 8741fd17ad Internals: cppcheck cleanups. No functional change intended. 2024-08-23 18:24:34 -04:00
ffe76717c6 Thread pool rewrite (#5161)
Signed-off-by: Krzysztof Bieganski <[email protected]>
Signed-off-by: Bartłomiej Chmiel <[email protected]>
Signed-off-by: Arkadiusz Kozdra <[email protected]>
Co-authored-by: Krzysztof Bieganski <[email protected]>
Co-authored-by: Arkadiusz Kozdra <[email protected]>
Co-authored-by: Wilson Snyder <[email protected]>
2024-08-23 08:36:49 -04:00
Krzysztof Bieganski eb8bbcda05 Internals: Simplify CaptureVisitor in V3Randomize (#5397) 2024-08-23 07:57:57 -04:00
Arkadiusz Kozdra ed7040adc0 Fix dot fallback finding wrong symbols (#5394) 2024-08-22 15:49:08 -04:00
Wilson Snyder 48776277bd devel release 2024-08-21 08:55:53 -04:00
Wilson Snyder 8ca45df9c7 Version bump 2024-08-21 08:40:24 -04:00
Wilson Snyder 8db9c1d227 Commentary: Changes update 2024-08-21 08:40:14 -04:00
Krzysztof Bieganski 930f35acc9 Support constraint_mode (#5338) 2024-08-21 06:16:44 -04:00
Krzysztof Bieganski 13e0fc7c27 Fix virtual interface null checks (#5391) 2024-08-21 05:40:52 -04:00
Bartłomiej Chmiel a730daabef Support 'parameter type' in hierarchical blocks (#5309) (#5333) 2024-08-21 05:30:59 -04:00
Andrew Nolte 3c28b72897 Tests: Add info files to golden (#5390) 2024-08-21 06:44:02 +03:00
Wilson Snyder 05e5f1955e Update include/gtkwave from upstream 2024-08-20 15:23:53 -04:00
Wilson Snyder 378800ee4a Commentary: Changes update 2024-08-20 15:13:44 -04:00
Wilson Snyder 43a57da950 Add quotes to not-found filenames 2024-08-20 14:47:43 -04:00
James BaileyandJames Bailey 99a43b7695 Fix +: and -: unpacked array slicing when array has nonzero low index (#5345) (#5387)
Co-authored-by: James Bailey <[email protected]>
2024-08-20 14:20:48 -04:00
Krzysztof Bieganski 59d2eea302 Fix capturing fields from superclass in randomize() with (#5389)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-08-20 13:25:58 -04:00
Kaleb Barrett 6f3f64e63f Add --timing flag as Verilated cc define (#5383) 2024-08-18 20:02:54 +03:00
Drew Ranck 48c71ef76c Support default value on module input (#5358) (#5373) 2024-08-15 10:04:07 -04:00
Ryszard Rozak 563faeb33f Internals: Fix removing nodes in V3Life (#5365) 2024-08-14 09:23:24 +02:00
Wilson Snyder 9c5c77c69c Favor use of more general idAny in parser 2024-08-13 15:25:07 -04:00
Wilson Snyder 4573e04488 Fix segfault after unsupported member call (#5359). 2024-08-13 14:39:37 -04:00
Krzysztof Bieganski 6cb0a41857 Support inline random variable control (#5317)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-08-13 14:20:31 -04:00
Geza Lore 124e3463fc Fix cache config file resolution performance (#5369)
V3ConfigWildcardResolver::resolve used to only cache the result of a
name lookup if there were any directives applied to the queried name.

This can be a performance problem. E.g. the module resolver is invoked
for every variable to check for attributes. If you had 'n' variables in
the design, and you also had 'k' directives that apply to specific
modules not involving most of the 'n' variables, then checking the
attributes involved O(n*k) operations. This can be very expensive
for large 'n' and 'k'.

In this patch we resolve every name exactly once, so the same above is
now O(n) in the worst case, and often a lot smaller due to repeat
lookups.
2024-08-13 19:52:23 +02:00
Ethan Sifferman 1b15509a9c Fix lint_off on Errors (#5351) (#5363) 2024-08-11 21:04:46 +02:00
Wilson Snyder eb3f10399a Internal: Rename tokenPipeScanTypeEq. No functional change. 2024-08-11 12:15:20 -04:00
Wilson Snyder 4660806c8f Internals: Remove wrong = new grammar rule. 2024-08-11 11:03:28 -04:00
Wilson Snyder 6f5d1037b4 Commentary 2024-08-11 10:33:04 -04:00
Wilson Snyder 24b097b228 Improve new class error (#5359) 2024-08-11 10:09:05 -04:00
Wilson Snyder a0ea96b355 Favor use of more general idAny in parser 2024-08-09 18:00:36 -04:00
Wilson Snyder a663da7393 Internals: Split idType from simple_type. No functional change intended 2024-08-09 17:45:54 -04:00
Tim Hutt c812a9b18f Fix shortened module names when searching for files (#5196) (#5246) 2024-08-09 17:23:00 -04:00
Arkadiusz Kozdra 367249ec84 Add parsing but otherwise ignore std::randomize (#5354) 2024-08-09 17:21:32 -04:00
Wilson Snyder f4acc59b82 Tests: Check for wrong quotes in docs (#5355) 2024-08-09 17:18:59 -04:00
Luca Colagrande d1da1664f0 Docs: Fix typos in :vlopt: command usage in docs (#5355) (#5356) 2024-08-09 14:17:36 +01:00
Krzysztof Bieganski b100615726 Internals: Relax requirements for AstClass iteration methods (#5335)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-08-09 10:05:52 +01:00
Krzysztof Bieganski ec0815e9ac Fix NBAs in suspendables (#5348)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-08-08 22:12:00 +01:00
Krzysztof Bieganski 97e9996f0b Fix optimized-out sentrees with --timing (#5080) (#5349)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-08-08 21:57:12 +01:00
Krzysztof Bieganski b7af859ba3 Fix forks capturing non-input ports in tasks (#5237) (#5343)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-08-08 21:55:46 +01:00
Krzysztof Bieganski 701fa5438a Fix output clockvar overwriting signal (#5320) (#5347)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-08-08 21:48:25 +01:00
Geza Lore 004865a8b2 Fix tracing_{on,off} in the presence of non-inlined modules (#5346)
Previously "*.foo.*" failed to match non-inlined instances called 'foo'.
2024-08-08 17:16:54 +01:00
Arkadiusz Kozdra 3e5859e5da Support constraining AstSel (#5344)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-08-08 15:37:08 +01:00
Arkadiusz Kozdra 78555b683c Fix missing type coercion in 'inside {array}' (#5340) 2024-08-08 03:46:41 -04:00
Wilson Snyder c2e44dbd99 Fix $sformat with array arguments (#5330). 2024-08-08 03:32:07 -04:00
Wilson Snyder 18fc3e6089 Internals: Favor idAny in typedefs. 2024-08-07 18:45:53 -04:00
Wilson Snyder f4f8ea0dcf Internals: Change cast fileline to point to cast operator 2024-08-07 18:45:53 -04:00
Arkadiusz Kozdra f78c4e8490 Fix compilation error on unreachable disable fork / wait fork (#5339)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-08-07 18:44:02 -04:00
Arkadiusz Kozdra e6fe367bdb Support streams to/from arrays of wide data (#5334) 2024-08-06 16:18:16 +01:00
Ryszard Rozak 3426ee5170 Fix purity of functions with AstJumpBlock or AstStmtExpr (#5332) 2024-08-06 16:07:38 +01:00
Arkadiusz Kozdra a32b8d80f9 Support streaming operator on arrays and wide data (#5326)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-08-06 08:48:46 -04:00
Bartłomiej Chmiel 3b81654c72 Fix -Wunused-but-set-variable clang warning (#5331)
Signed-off-by: Bartłomiej Chmiel <[email protected]>
2024-08-06 08:48:12 -04:00
Wilson Snyder 6abd556f5a Tests: Fix GCC 11.4.0 hang 2024-08-06 08:47:28 -04:00
Varun Koyyalagunta 31c1df638b Fix assert on wide expression (#5319) (#5324) 2024-08-06 01:45:57 -04:00
Krzysztof Bieganski f4cb2c8cf2 Add more rand_mode unsupported errors (#5329)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-08-05 17:56:03 -04:00
Bartłomiej Chmiel 7d5e19365e Support assertcontrol directive type (#5310)
Signed-off-by: Bartłomiej Chmiel <[email protected]>
2024-08-05 17:54:13 -04:00
Wilson Snyder 6fa1ade4e0 Commentary: Changes update 2024-08-05 04:03:21 -04:00
Bartłomiej Chmiel 99c619a4c9 Error on static variable initializers using automatic variables in procedures (#5296) 2024-08-05 08:39:43 +01:00
Krzysztof Bieganski 37a4002098 Fix stringify in nested preprocessor macros (#5323) 2024-08-02 11:46:02 -04:00
Krzysztof Boroński 45ee949cc4 Internals: Disambiguate variable references under with clauses of randomize() methods (#5277) 2024-08-02 11:45:17 -04:00
Arkadiusz Kozdra 54f9f4b6a9 Support foreach constraints (#5302)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-08-02 10:03:55 -04:00
Arkadiusz Kozdra a61178bd89 Internals: Convert foreach loops in V3Begin as well as V3Width (#5283) 2024-08-02 08:29:05 -04:00
Krzysztof Bieganski 2f5c58b345 Support rand_mode (#5273)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-07-31 22:30:48 +01:00
Wilson Snyder 403a197e23 Python lint fix 2024-07-28 14:57:29 -04:00
Wilson Snyder 3a659d460d Fix ==? and !=? with X values. 2024-07-28 14:40:55 -04:00
Wilson Snyder 8707c88787 Tests: Close misc internal code coverage holes 2024-07-28 14:18:24 -04:00
github action 167cba723e Apply 'make format' 2024-07-28 17:59:13 +00:00
Wilson Snyder 7f40dd8b5b CI: Fix codecov upload 2024-07-28 13:58:26 -04:00
Wilson Snyder 1609c23fea Fix cputime being zero 2024-07-28 13:14:10 -04:00
Wilson Snyder 216fc8a212 CI: Fix codecov upload 2024-07-27 07:18:50 -04:00
Wilson Snyder 5136ea1082 CI: Fix codecov upload 2024-07-27 07:02:18 -04:00
Wilson Snyder 5b931faf2b CI: Fix codecov upload 2024-07-27 06:31:20 -04:00
Wilson Snyder a2496e041e CI: Change to action-based codecov upload 2024-07-26 14:07:53 -04:00
Wilson Snyder fab268f772 CI: Change to action-based codecov upload 2024-07-26 10:39:08 -04:00
Wilson Snyder 550d47b7f4 CI: Change to action-based codecov upload 2024-07-26 10:27:00 -04:00
Markus Krause a01a21db86 Fix make flows to pass PYTHON3 (like perl) (#5307) (#5308)
Fixes #5307
2024-07-26 09:35:37 -04:00
Wilson Snyder 2082f1aa9e Internals: Update fastcov.py from upstream 2024-07-26 08:48:12 -04:00
Wilson Snyder 50a5a1ff5b Tests: Fix some verilog.y parser coverage holes 2024-07-26 07:29:15 -04:00
Arkadiusz Kozdra 1600cc01a4 Internals: clean up begin blocks and lifetimes in foreach loops (#5306)
According to IEEE 1800-2023 12.7.3, the loop creates an implicit block
around it, containing declarations of the loop variables with automatic
lifetime.

No functional change intended.

Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-07-26 05:50:29 -04:00
Ryszard Rozak b9e1d55262 Fix handling of rand fields not referenced in constraints (#5305)
Signed-off-by: Ryszard Rozak <[email protected]>
2024-07-26 05:46:30 -04:00
Geza Lore 0d43c14b93 Internals: Remove redundant hash lookup (#5276 partial) (#5303)
Minor help for #5276
2024-07-25 16:07:58 -04:00
Ricardo Barbedo 87d1c10fa7 Fix compiler coroutine check (#5190) (#5300)
The necessary options to support C++ coroutines vary greatly between
compilers, its versions, and the standard library being used. This
patch makes the check for coroutine support more robust by adding a
declaration of a coroutine variable, instead of just including the
header. It also makes sure that the HAVE_COROUTINE and
CFG_CXXFLAGS_COROUTINES flags are always set together, and only when
coroutine support is detected.
2024-07-24 17:21:14 -04:00
Udaya Raj Subedi a2506a6f96 Fix monitor block sensitivity items (#4400) (#5294) 2024-07-24 07:18:57 -04:00
Bartłomiej Chmiel 20dba7464d Support--compiler-include headers in user-supplied cpp files (#5271)
Signed-off-by: Bartłomiej Chmiel <[email protected]>
2024-07-24 06:40:39 -04:00
Wilson Snyder cb5d03ff0b Fix WIDTHEXPAND on left shift of intuitive amount (#5284). 2024-07-24 06:39:27 -04:00
github action 2727c33219 Apply 'make format' 2024-07-24 10:07:59 +00:00
Wilson Snyder 0419ed0430 Fix initializing static array in dynamic arrays and queues (#5287). 2024-07-24 06:06:57 -04:00
Wilson Snyder 1e3c7a5496 Fix inline function ref port persistence 2024-07-23 18:47:04 -04:00
Wilson Snyder d2dfcbca53 Internals: Add log_changes for updating Changes file 2024-07-23 18:36:57 -04:00
Wilson Snyder e779934443 Commentary: Changes update 2024-07-22 17:22:37 -04:00
Arkadiusz Kozdra a3b255b054 Internal: Suppress new clang-tidy messages (#5293)
The two most useless warning classes are llvmlibc-* on virtually every
identifier use that it does not resolve to __llvm_libc:: namespace, and
altera-* ones that warn on virtually every loop statement that it could
be unrolled with a pragma.  No functional change.

Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-07-22 13:11:50 -04:00
Krzysztof Bieganski f5caa4b7dc Fix randomizing current object with rand class instance member (#5292)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-07-22 14:41:12 +02:00
Wilson Snyder 8f4490628f Commentary: Clarify some warning messages. 2024-07-20 17:50:14 -04:00
Wilson Snyder df566bdf4d Improve PINMISSING to show related port 2024-07-20 17:37:33 -04:00
Wilson Snyder 981d3ce782 Add suggestions on misspelled PLI functions. 2024-07-20 07:20:10 -04:00
Wilson Snyder b7345eb5d5 Tests: Add checkp macro. No test functionality change. 2024-07-20 06:51:50 -04:00
Krzysztof Bieganski 2bd2b9324f Fix inline constraints creating class random generator (#5280) 2024-07-19 13:03:48 -04:00
Arkadiusz Kozdra 298faa84ee Fix elaborating foreach loops (#5285) 2024-07-19 14:56:30 +02:00
Arkadiusz Kozdra 43377ed8b0 Add support for this.randomize with (#5282)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-07-19 09:14:56 +02:00
Krzysztof Bieganski b18037b7e7 Internals: Move non-visit methods to the proper place (#5279) 2024-07-18 08:57:39 -04:00
Yutetsu TAKATSUKASA 095b1ccb67 Fix incorrect result of width mismatch (#5186) (#5189) 2024-07-17 11:54:58 +02:00
Krzysztof Bieganski 2a30a87580 Fix randomization when used with inheritance (#5268)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-07-17 08:21:45 +02:00
Krzysztof Bieganski e11bc6beeb Internals: Refactor function argument traits (#5269)
No functional change intended.

Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-07-16 20:55:04 +02:00
Arkadiusz Kozdra 0a9b31bb30 Add warning on dist in constraints (#5264) 2024-07-15 21:01:33 -04:00
Krzysztof Bieganski 34e37d7bd0 Keep one member map for randomize method creation (#5263)
No functional change intended.

Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-07-15 16:42:41 +02:00
Yangyu Chen 164a7a7c5d Improve emitted code to use a reference for VlSelf (#5254) 2024-07-15 09:44:01 -04:00
Krzysztof Obłonczek 67ea819d82 Fix toggle coverage aggregation on same line (#5248)
Documentation states that minimum of all reported coverage of all signals in a line should be taken.
Previous logic would break if there were any signals with zero coverage followed by signals with
nonzero coverage - a minimum from those nonzero toggle count would be taken, disregarding zero
coverage of previous signals.

Internal-tag: [#62193]

Signed-off-by: Krzysztof Obłonczek <[email protected]>
2024-07-14 17:05:58 -04:00
Andrew Nolte 60f9e21d8c Fix --x-assign to be independent from +verilator+rand+reset (#5214) 2024-07-14 17:04:00 -04:00
Wilson Snyder dc037db1cd Internals: Make upcase clean. No functional change. 2024-07-14 15:28:00 -04:00
Wilson Snyder 0658af90f5 Fix classes/modules of case-similar names (#5109). 2024-07-14 13:57:16 -04:00
Wilson Snyder 131623de34 Internals: Favor s string literals. No functional change. 2024-07-14 11:39:45 -04:00
Wilson Snyder 74ae879c2f Internals: Remove duplicate filenameNonExt. No functional change. 2024-07-14 11:31:32 -04:00
Wilson Snyder 8c3b754bac Internals: Rename some filename functions. No functional change. 2024-07-14 09:34:54 -04:00
Wilson Snyder e080f5c0cb Fix tracing with --main-top-name - (#5261). 2024-07-14 07:35:26 -04:00
Wilson Snyder 2284cf595d Commentary: Changes update 2024-07-14 07:34:36 -04:00
Wilson Snyder b1cc0c54c1 Tests: Fail with test.pl-file-needs-have_solver()-call if forget have_solver() 2024-07-13 08:55:06 -04:00
Geza Lore 4cf017d7fe Tests: Skip t_randomize_method_constraints when no solver is installed (#5260) 2024-07-13 08:31:16 -04:00
Geza Lore 25f5db4b5f DFG: Allow inlining of variabels driven from forced vars (#5259)
Not sure why this was disabled before, but it seems legal to me to
change

'forced A' -> 'B' -> 'C'

into

'forced A' -> 'B',
'forced A' -> 'C'

Fixes #5249
2024-07-13 12:35:09 +01:00
Krzysztof Boroński 3cf9606ea9 Support inline constraints for class randomization methods (#5234)
Signed-off-by: Krzysztof Boronski <[email protected]>
2024-07-12 16:18:18 +02:00
Wilson Snyder 6882f8c55e Commentary: Surfer (#5253) 2024-07-11 18:33:35 -04:00
Krzysztof Bieganski 2696a9a5bd Fix unconstrained randomization of unpacked structs (#5252)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-07-11 16:43:56 +02:00
Krzysztof Bieganski abb46c9cb2 Refactor AstMemberSel creation with AstVar (#5251)
No functional change intended.

Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-07-11 16:42:58 +02:00
Wilson Snyder bbb223f217 Fix error on empty generate with -O0 (#5250). 2024-07-11 06:59:15 -04:00
Arkadiusz Kozdra 570e1bc35a Support conditional constraints (#5245) 2024-07-10 11:30:18 -04:00
11da07d3b9 Support $assertcontrol assertion_type (#5236)
Signed-off-by: Bartłomiej Chmiel <[email protected]>
Signed-off-by: Ryszard Rozak <[email protected]>
Co-authored-by: Ryszard Rozak <[email protected]>
Co-authored-by: Wilson Snyder <[email protected]>
2024-07-10 05:06:13 -04:00
Arkadiusz Kozdra 2cfec0ecc3 Support clocking blocks in virtual interfaces (#5235) 2024-07-09 18:31:58 -04:00
Wilson Snyder e3e7b3f2b5 Fix errors on using string in incorrect format (#5240). 2024-07-09 08:30:20 -04:00
Wilson Snyder fe0b210a0c Fix errors on using string in incorrect format (#5340). 2024-07-09 08:29:22 -04:00
Chris Bachhuber c383f4868f Commentary: Mention docker hub explicitly (#5241) 2024-07-09 06:59:43 -04:00
Wilson Snyder b66fdd7421 Fix unknown conversion on queues (#5220). 2024-07-08 10:19:51 -04:00
Wilson Snyder 83878325a7 Commentary: Update git issue templates. 2024-07-08 08:12:58 -04:00
github action 490bc63eb5 Apply 'make format' 2024-07-06 12:13:35 +00:00
Ryan Ziegler 947b6fd23f Add --emit-accessors (#5182) (#5227) 2024-07-06 13:12:53 +01:00
Wilson Snyder de44ca8df3 Fix top-level unpacked structure resets (#5221). 2024-07-05 17:22:26 -04:00
Wilson Snyder 3cee54dfdf Commentary: Changes update 2024-07-05 17:17:29 -04:00
Geza Lore dace2c0a9a Tests: Skip t_constraint_state when no solver is installed (#5224) 2024-07-04 11:42:53 +01:00
Liam Braun ca4858eb7f Fix concurrency for mailbox and semaphores (#5222) 2024-07-03 22:29:32 +01:00
Wilson SnyderandSeth Pellegrino a6d438d111 Fix mis-removing $value$plusargs calls (#5127) (#5137). [Seth Pellegrino]
Co-authored-by: Seth Pellegrino <[email protected]>
2024-07-02 18:46:58 -04:00
Bartłomiej Chmiel 955ed3f193 Fix splitting if statements with impure conditions (#5219) 2024-07-02 15:17:10 -04:00
Wilson Snyder 8bffb8c391 Fix table optimizing logic with side effect (#5137 prep) 2024-07-02 09:22:56 -04:00
Arkadiusz Kozdra 85356f464f State-dependent constraints (#5217)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-07-01 20:19:15 +02:00
Arkadiusz Kozdra 72993ec3dd Support cross-module clockvars access (#5184) 2024-06-30 15:19:02 -04:00
404allen404 d6a294b784 Commentary: Fix typo in for --trace-max-array and --trace-max-width options (#5205) 2024-06-27 21:25:21 -04:00
Bartłomiej Chmiel 864a852bca Add --compiler-include for additional C++ includes (#5139) (#5202) 2024-06-27 18:53:44 -04:00
Wilson Snyder b0992406aa Commentary: Changes update 2024-06-25 19:22:00 -04:00
Bartłomiej Chmiel 9e2c8aefc8 Add --pins-sc-uint-bool to force SystemC uint type (#5192) 2024-06-25 05:27:09 -04:00
Gus Smith 4c584c17e6 Add -std=gnu++20 (#5200) 2024-06-25 05:23:50 -04:00
Wilson Snyder 3315a6e431 Internals: Also cleanup gettes/setters in .cpp. No functional change intended. 2024-06-22 19:50:59 -04:00
github action ba0183131c Apply 'make format' 2024-06-22 22:58:42 +00:00
Ryan Ziegler e1580b9c3d Internals: Reorder class getters/setters (#5197). No functional change intended. 2024-06-22 18:57:54 -04:00
Tim Hutt aadd5ea509 Fix linking with pthreads on CMake (#5194) 2024-06-21 10:34:11 -04:00
Philip Axer 833df6d9ea Fix CMake installation missing verilated.mk (#5187) (#5188) 2024-06-19 08:07:17 -04:00
Wilson Snyder 607c19a67d Fix isPure to be superset of isOutputter.
This may cause some additional SIDEEFFECT warnings that previously were not shown.
2024-06-16 21:43:30 -04:00
Wilson Snyder d5cfe1a379 Fix fusing macro arguments to not ignore whitespace (#5061). 2024-06-15 09:21:21 -04:00
Wilson Snyder 6e557791c8 devel release 2024-06-15 08:49:57 -04:00
Wilson Snyder cd693ce02b Version bump 2024-06-15 08:43:45 -04:00
Wilson Snyder 2641bc98aa Update include/gtkwave from upstream 2024-06-15 08:14:43 -04:00
Wilson Snyder ad2862ce3f Fix DPI import of null C-string (#5179). 2024-06-14 22:50:54 -04:00
Bartłomiej Chmiel 4695967185 Fix signed types emitted in hierarchical Verilation (#5178)
Signed-off-by: Bartłomiej Chmiel <[email protected]>
2024-06-14 08:07:32 -04:00
Wilson Snyder f96e99542c Internals: Fix cppcheck warnings. No functional change. 2024-06-13 21:29:03 -04:00
Wilson Snyder 7de193c2e9 Commentary: Changes update 2024-06-13 18:04:57 -04:00
Arkadiusz Kozdra 442c9bc316 Support parsing and otherwise ignoring inline constraints (#5126) 2024-06-13 08:38:20 -04:00
Arkadiusz Kozdra 3203019408 Fix coroutines without awaits to have a co_return (#4208) (#5175)
After the V3Timing refactoring the V3SchedTiming phase could apparently
move away all awaits from a coroutine without adding a co_return
statement.

Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-06-12 15:13:52 -04:00
Geza Lore bc853e260b Support StructSel in unpacked array assignments (#5176) 2024-06-12 17:07:33 +01:00
github action d6e5703298 Apply 'make format' 2024-06-12 11:44:29 +00:00
Alex Solomatnikov a9e50327fd Fix hierarchical compilation with nested -F (#5114) (#5124) 2024-06-12 07:42:52 -04:00
Wilson Snyder 6f0a36318e Tests: Fix test stability (#5167 update). 2024-06-11 20:55:01 -04:00
Wilson Snyder 221fecad0b Commentary 2024-06-11 19:47:53 -04:00
Wilson Snyder fd1e4d9e45 Add assertion on reusing VerilatedContext (#5167). 2024-06-11 19:38:58 -04:00
Wilson Snyder 920ed5ca3d Internals: Avoid unordered_map/set. No functional change intended. 2024-06-11 18:52:09 -04:00
Arthur Rosa 2537431273 Fix table optimization when applied on real data type (#5172) (#5173) 2024-06-11 13:26:11 -04:00
Bartłomiej Chmiel 13114f2efe Fix SystemC BITS_PER_DIGIT in VL_ASSIGN_SBW (#5170)
The BITS_PER_DIGIT macro value differs between SystemC versions,
thus referencing it directly is required.
2024-06-10 20:45:49 -04:00
Arkadiusz Kozdra e9f59e44a5 Fix non-constant replication in concats (#5171)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-06-10 11:21:43 -04:00
Arkadiusz Kozdra d4c3e35f97 Support $psprintf system function (#4314) (#5169)
`$psprintf` is a non-standard system function present in some other
simulators, and has been rejected for standardization by IEEE because
of being basically the same as `$sformatf`.

To encourage users to fix their codebase, a warning is emitted by
default, but it gets otherwise interpreted as `$sformatf` as early as
during lexing.

Signed-off-by: Arkadiusz Kozdra <[email protected]>

* wording/formatting

Signed-off-by: Arkadiusz Kozdra <[email protected]>

---------

Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-06-10 08:38:26 -04:00
Wilson Snyder 02dd33b60e Commentary: Changes update 2024-06-09 17:10:53 -04:00
Geza Lore 2bc883f3b3 Extend out-of-range select (#5159) (#5164) 2024-06-09 17:05:14 -04:00
Geza Lore 29db25b70e Reset radix in width warnings (#5166) 2024-06-09 14:39:17 +01:00
Geza Lore d6bc0c712a Disable ASLR for more tests. (#5165)
These show spurious errors with some toolchains due to an address sanitizer bug.
2024-06-09 14:32:31 +01:00
github action 962efa3691 Apply 'make format' 2024-06-09 02:45:26 +00:00
Valentin Atepalikhin 4babba16d6 Support 2D dynamic array initialization (#4700) (#5122)
* Support 2D dynamic array initialization (#4700)
- new[] on sub arrays (as per original issue)
- Built-in methods for sub-arrays
- Initialization and literals assignmensts
- Dynamic array as an element for other arrays and queues
2024-06-08 22:44:45 -04:00
Wilson Snyder 5363d89870 Tests: Disable msbuild executable running (#5163) 2024-06-08 19:37:31 -04:00
Wilson Snyder 44acb08ea9 Tests: Commentary - enable msbuild debug 2024-06-08 19:36:50 -04:00
Yutetsu TAKATSUKASA 6584b4d426 Fix assertion failure in V3Gate (#5101) 2024-06-08 08:37:01 -04:00
Paul Bowen-Huggett 9ff06c1664 Fix 'experimental/coroutine' file not found on macOS (#5030) (#5031) (#5151)
libcxx has removed the experimental/coroutine include file in favor of
the C++20-standard coroutine include. If the latter is available we
use it otherwise falling back to the existing experimental version (in
which case we also disable the deprecated-experimental-coroutine warning).

(See also https://reviews.llvm.org/D108697.)
2024-06-08 08:33:50 -04:00
github action 1537c9badc Apply 'make format' 2024-06-08 03:05:01 +00:00
Wilson Snyder 708f875b31 Fix MSVC warnings. No functional change intended. 2024-06-07 22:52:56 -04:00
Kaleb Barrett 0d3cb86a44 Fix VerilatedVpiPutHolder class (#5156) 2024-06-07 22:25:33 -04:00
Wilson Snyder 5c2b9d55b2 Fix MSVC C4805 == type mismatch warning 2024-06-07 22:14:32 -04:00
Arkadiusz Kozdra 1dbf1be3e6 Support inout clocking items (#5160) 2024-06-07 08:30:58 -04:00
Wilson SnyderandDercury 3f886f7c61 Fix select value too wide (#5148) (#5153).
Co-authored-by: Dercury <[email protected]>
2024-06-07 08:27:03 -04:00
Wilson Snyder 7c9fa8647c Fix string to be more standard (#5082) (#5083). 2024-05-31 21:51:12 -04:00
Wilson Snyder dbf68a99e8 Tests: SHow expected values in t_typenames 2024-05-30 22:54:40 -04:00
Andrew NolteandAndrew Nolte 53c2e416f4 Tests: Extend t_typenames (#5083)
Co-authored-by: Andrew Nolte <[email protected]>
2024-05-30 22:32:14 -04:00
github action e834b5be2d Apply 'make format' 2024-05-29 20:56:45 +00:00
Kaleb Barrett bd7689f59a Fix overflow of string on VPI reads (#5145) (#5146) 2024-05-29 16:55:46 -04:00
Kaleb Barrett 3496eb80a5 Improve VerilatedVpiPutHolder storage requirements (#5144) 2024-05-29 08:39:08 -04:00
Ryszard Rozak 839c3bf444 Commentary: Fix docs of verilator_coverage (#5149)
Signed-off-by: Ryszard Rozak <[email protected]>
2024-05-29 08:11:35 -04:00
Geza Lore d4b3583307 Apply DFG regularization to cyclic graphs (#5142)
The Dfg2Ast conversion assumes the 'regularize' pass was run, but we
failed to run it on cyclic sub-graphs. Do so now.

Fixes #5130.
2024-05-26 12:01:30 +01:00
Wilson Snyder ee130cb20d Tests: Skip if no constraint solver 2024-05-23 22:25:14 -04:00
github action 552a146f9c Apply 'make format' 2024-05-22 11:54:22 +00:00
Pawel Jewstafjew 913679f261 Fix output C++ type error on change detect of I/O arrays (#5125) (#5131)
operand order reversed for AstCMethodHard "neq"
interface between C-style arrays and VlUnpacked
overloads added to VlUnpacked::neq(), VlUnpacked::assign()
VlUnpacked::operator=() added

Fixes  #5125
2024-05-22 12:53:28 +01:00
Ethan Sifferman d9078df650 Fix 4-state value support for $readmem (#5070) (#5078) 2024-05-21 17:27:32 -04:00
Wilson Snyder f84592af49 Fix x-valued parameters with --x-assign unique (#5129). 2024-05-21 08:07:57 -04:00
Wilson Snyder 5f85c89425 Commentary: Changes update 2024-05-18 17:48:52 -04:00
Wilson Snyder 94f789b677 Update issue template 2024-05-18 17:41:36 -04:00
Arkadiusz Kozdra 739be2f782 Support constrained randomization with external solvers (#4947) 2024-05-17 10:38:34 -04:00
Krzysztof Bieganski 25b9a16bc7 Fix references to ports in forks (#5123)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-05-17 07:38:36 -04:00
Arkadiusz Kozdra 9a8e68928d Internals: Move getenvStr to verilatedos. (#5118)
* Internals: Move getenvStr to verilatedos. No functional change intended.
* Fix POS34-C. Do not call putenv() with a pointer to an automatic variable as the argument.

Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-05-13 10:23:51 -04:00
Todd Strader 19cccd170e Fix vpiInertialDelay for memories (#5113) 2024-05-10 18:49:43 -04:00
Wilson Snyder d99c8f5d44 Fix redundant AstExtend breaks DFG (#5112) 2024-05-10 18:48:09 -04:00
Geza Lore cf111d2e1f Do not create aliases for forced port signals (#5105)
+ don't remove forced signals in V3Const and Dfg

Fixes #5062
2024-05-10 18:19:51 +01:00
Arkadiusz Kozdra 45eb5b8a5c Fix method calls parsing in constraints (#5110) 2024-05-10 06:37:19 -04:00
Yinan Xu ce5cad17a8 Add increasing of stack size when possible (#5071) (#5104) 2024-05-08 22:40:42 -04:00
Wilson Snyder ed01befc25 Fix tracing interface functions (#5108). 2024-05-08 22:23:53 -04:00
Wilson Snyder 69a2bfee68 Commentary: Changes update 2024-05-08 08:41:56 -04:00
Wilson Snyder 1cc37ad6ce Internals: Add missing VL_DO_DANGLING. No functional change intended. 2024-05-08 08:36:24 -04:00
2a9f29912c Add parameterless assert control system tasks (#5010)
Signed-off-by: Bartłomiej Chmiel <[email protected]>
Co-authored-by: Ryszard Rozak <[email protected]>
Co-authored-by: Wilson Snyder <[email protected]>
Co-authored-by: Arkadiusz Kozdra <[email protected]>
2024-05-08 08:31:34 -04:00
Wilson Snyder 298e0f24d1 Add traceCapable indication to model header (#5053). 2024-05-03 20:18:06 -04:00
Geza Lore 80b08b71aa Support NBAs to arrays inside loops (#5092)
For NBAs that might execute a dynamic number of times in a single
evaluation (specifically: those that assign to array elements inside
loops), we introduce a new run-time VlNBACommitQueue data-structure
(currently a vector), which stores all pending updates and the necessary
info to reconstruct the LHS reference of the AstAssignDly at run-time.

All variables needing a commit queue has their corresponding unique
commit queue.

All NBAs to a variable that requires a commit queue go through the
commit queue. This is necessary to preserve update order in sequential
code, e.g.:
 a[7] <= 10
 for (int i = 1 ; i < 10; ++i) a[i] <= i;
 a[2] <= 10
needs to end with array elements 1..9 being 1, 10, 3, 4, 5, 6, 7, 8, 9.

This enables supporting common forms of NBAs to arrays on the left hand
side of <= in non-suspendable/non-fork code. (Suspendable/fork
implementation is unclear to me so I left it unchanged, see #5084).

Any NBA that does not need a commit queue (i.e.: those that were
supported before), use the same scheme as before, and this patch should
have no effect on the generated code for those NBAs.
2024-05-03 07:45:49 -04:00
Vito Gamberini 64ba569f0d Fix MacOS missing <type_traits> header (#5096) (#5097) 2024-05-02 21:38:36 -04:00
Wilson Snyder 3cb4033c97 Fix width extension of unpacked array select (#5095). 2024-05-02 20:41:39 -04:00
github action 6509bac59e Apply 'make format' 2024-05-02 23:03:39 +00:00
Wilson Snyder ec45a77d93 Fix macro expansion in strings per 1800-2023 (#5094). 2024-05-02 19:02:28 -04:00
Wilson Snyder 8044833c74 Fix $typename on array.min and others (#5049). 2024-05-01 20:07:13 -04:00
Geza Lore 3f89bdcfac Defer conversion of set flag based AssignDlys (#5091)
No functional change. Postpone the conversion of all AstAssignDlys that
use the 'VdlySet' scheme for array LHSs until after the complete
traversal of the netlist. The next patch takes advantage of this by
using some extra information also gathered through the traversal to
change the conversion.

AstAssignDlys inside suspendable or fork are not deferred and are
processed identical to the previous version.

There are some TODOs in this patch that are fixed in the next patch.

Output code perturbed due to variable ordering.

MULTIDRIVEN message ordering perturbed due to processing order change.
2024-05-02 00:24:00 +01:00
Todd Strader c99364b81a Support vpiInertialDelay (#5087) 2024-05-01 18:56:50 -04:00
Geza Lore d841a791e6 Refactor V3Delayed to enable algorithmic extension (#5090)
No functional change.

This patch is just cleanup with some non-functional changes to enable
the next patch. Most importantly createDlyOnSet, which implements NBAs
for arrays, has a new streamlined implementation that does the same
thing. Some output code is perturbed due to statement/local variable
insertion order.

Also renamed Vdlyvfoo to VdlyFoo for easier readability of the generated
code.
2024-05-01 23:06:25 +01:00
Geza Lore b5b937e2f2 Fix missed optimization in V3Delayed (#5089)
Checking the wrong node meant we never actually pushed constant
bit-select indices into the delayed update, as was the intention, but
always generated a temporary instead.
2024-05-01 16:22:56 +01:00
Todd Strader 4a41f69293 Internals: Remove C-style cast in VPI_HANDLE (#5088) 2024-05-01 10:11:44 -04:00
Wilson Snyder 8fd038f88e Add --localize-max-size option and optimization (#5072). 2024-04-30 19:46:54 -04:00
Wilson Snyder 4982f63da2 Update coverage for last commit 2024-04-30 19:34:41 -04:00
Wilson Snyder 71bc60fb91 Add error on zero width select (#5028). 2024-04-30 18:38:37 -04:00
Wilson Snyder 0da7ecf753 Commentary: Changes update 2024-04-30 07:37:06 -04:00
Andrea Calabrese 25ca1af8b3 Internals: Fix missing const (#4899) 2024-04-29 22:57:56 -04:00
Wilson Snyder 5d54fa8e6f Fix missing parameters with comma to be errors (#4979) (#5012). 2024-04-29 22:41:16 -04:00
Christopher Taylor e8c5b9faad Fix missing flex include path variable (#4970) (#4971) 2024-04-29 22:01:09 -04:00
Aleksander Kiryk 8e0301c287 Fix bound queue printing (#5032) 2024-04-29 21:52:06 -04:00
Iztok Jeras 3f625fc359 Tests: Add unsupported streaming LHS tests (#4302) 2024-04-29 21:35:19 -04:00
Geza Lore 72b96d5069 tests: disable ASLR for t_trace_ub_misaligned_address (#5075)
This works around an address-sanitizer bug hit with some GCC versions
2024-04-29 15:38:00 +01:00
Bartłomiej Chmiel d1b45b8d32 Fix attempted to destroy locked thread pool error (#5040) 2024-04-29 07:59:24 -04:00
Wilson Snyder 5601056ed0 Tests: Check for bad event methods 2024-04-28 13:10:25 -04:00
Wilson Snyder 8ed269c77f Make 'disable isn't underneath a begin' into UNSUPPORTED error (#4699). 2024-04-27 21:30:40 -04:00
Geza Lore 27b7e70218 Fix DFG assertion with SystemC (#5076)
Fixes #5050
2024-04-27 13:41:10 +01:00
Geza Lore 97680656d3 Remove unknown '--' form cmake -E (#5073)
After #5063, with cmake 3.22.1, I get test failures, saying:
    cmake -E env: unknown option '--'
The '--' is necessary so removing.
2024-04-27 11:09:59 +01:00
Michael Bikovitsky 4202ec2ab2 Fix CMake builds to export VERILATOR_ROOT (#5063) 2024-04-26 19:29:10 -04:00
Wilson Snyder 4f3a816fb0 Fix false ASSIGNIN on functions with explicit port map (#5069). 2024-04-26 19:26:21 -04:00
Todd Strader 25fd8ef5c0 Add VPI eval needed tracking (#5065) 2024-04-25 09:07:31 -04:00
Gökçe Aydos a9664b8d16 Remove $(info) which cannot be silenced by -MAKEFLAGS '--quiet' (#5059) 2024-04-20 08:48:16 -05:00
Wilson Snyder 26a5729514 Add CITATION.cff (#5057) (#5058). 2024-04-19 20:33:11 -04:00
Arkadiusz Kozdra 5b839699ac Support empty queue as dynarray default value (#5055)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-04-18 11:53:23 -05:00
Wilson Snyder 1315aa31ed Commentary 2024-04-13 08:18:45 -04:00
Wilson Snyder 5d8da6b4ac Fix width extension on delays (#5045). 2024-04-13 08:16:59 -04:00
Wilson Snyder aac2563a07 Commentary: Changes update 2024-04-13 08:03:57 -04:00
Wilson Snyder 8e44487354 Tests: update style 2024-04-13 08:02:25 -04:00
Wilson Snyder 1012c054e6 Fix $system with string argument (#5042). 2024-04-11 17:31:14 -04:00
Paul Wright a8b5738b44 Support __en/__out signals on top level inout ports (#4812) (#4856) 2024-04-11 09:02:58 -04:00
Wilson Snyder 72845167e6 Commenary: Fix README badge paragraph 2024-04-10 17:02:07 -04:00
Krzysztof Bieganski 7ca2d6470a Fix consecutive zero-delays (#5038)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-04-05 16:48:47 -04:00
Wilson Snyder 33e999e01a devel release 2024-04-05 06:23:30 -04:00
Wilson Snyder 522bead374 Version bump 2024-04-05 05:52:00 -04:00
Wilson Snyder 030286142f Commentary: Changes update 2024-04-04 22:11:33 -04:00
Wilson Snyder 8a4ceb5717 Tests: Fix test failure, last commit. 2024-04-02 07:04:27 -04:00
Andrew Nolte 63fa6accc4 [Vpi] Fix missing scopes 2 (#4965) 2024-04-01 23:11:15 -04:00
Wilson Snyder 28718f964a Fix tracing replicated hierarchical models (#5027) (#5029) 2024-03-30 16:00:52 -04:00
Wilson Snyder 1d486e3a59 Rename statsPrintSummary() 2024-03-30 13:19:47 -04:00
Wilson Snyder 9b396f7125 Fix pylint warning 2024-03-30 13:13:51 -04:00
Wilson Snyder e16cbce52e Internals: Fix clang_check_attributes false error print 2024-03-30 11:58:34 -04:00
Wilson Snyder 840970e8f7 Internals: Add VL_MT_SAFE flags 2024-03-30 11:54:29 -04:00
Wilson Snyder e390d6779d Internals: Rename threadsInModel() 2024-03-30 11:13:14 -04:00
Wilson Snyder 39ee522f92 Commentary: Changes update 2024-03-28 08:22:15 -04:00
Wilson Snyder 9526efcf72 Fix V3Hash MacOS ambiguity (#5011) 2024-03-28 08:11:48 -04:00
github action d397e0d838 Apply 'make format' 2024-03-28 11:32:57 +00:00
Szymon Gizler 8301fdc6d3 Add JSON AST dumps (#5020) 2024-03-28 07:32:18 -04:00
Arkadiusz Kozdra f645382f11 Support inside range with implicit type conversion (#5026)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-03-28 07:31:45 -04:00
Wilson Snyder 1ed5557d2d Support 1800-2023 class and function :initial, :extends, :final virtual overrides (#5025). (#5025) 2024-03-27 23:57:58 -04:00
Wilson Snyder 28b9216f8a Fix tracing class parameters (#5014). 2024-03-27 20:07:46 -04:00
Wilson Snyder 0114cb67ca Fix $readmem with missing newline (#5019). 2024-03-27 18:42:20 -04:00
Wilson Snyder ea8f86dd30 Internals: Prefer '(void)' to avoid unused var. No functional change. 2024-03-27 18:07:14 -04:00
Wilson Snyder 0ff77fc352 Internals: Remove extra single-line {}. No functional change. 2024-03-27 17:57:49 -04:00
Wilson Snyder 341963e820 Internals: Avoid '%Error' so can grep logs for real errors 2024-03-27 09:00:34 -04:00
Wilson Snyder db60b92613 Fix internal error on missing pattern key (#5023) 2024-03-27 08:41:58 -04:00
Geza Lore 98206a4f04 Improve V3List user interface (#4996) 2024-03-25 23:06:25 +00:00
Wilson Snyder 4df9e2e0e5 Add printing summary reports (#4909) (#5018) 2024-03-25 07:03:17 -04:00
Wilson Snyder 34e4cffb62 Add stats on output size 2024-03-24 10:50:53 -04:00
Wilson Snyder 71d76c993c Fix MSVC++ warnings. No functional change. 2024-03-24 10:19:26 -04:00
Wilson Snyder e67bdb4c08 Commentary 2024-03-24 09:23:37 -04:00
Wilson Snyder 23f013f2d7 Add stats on input size etc (#5017) 2024-03-24 09:14:31 -04:00
Geza Lore 9b729b80e0 Plug memory leaks (#5016) 2024-03-23 22:12:43 +00:00
Wilson Snyder 38ad328956 Remove duplicate stop ignored messages 2024-03-22 19:35:42 -04:00
Wilson Snyder f767f0cfaa Commentary 2024-03-22 19:35:13 -04:00
Fuad Ismail 1c79df8630 Support stream operation on unpacked array (#4714) (#5006) 2024-03-21 18:26:42 -04:00
Wilson Snyder 248573205b Commentary: Changes update 2024-03-20 18:27:35 -04:00
Arkadiusz Kozdra 88831ca21b Fix preprocessor to respect strings in joins (#5007)
This adheres more to the wording used in IEEE 1800-2017 22.5.1,
specifying the join operator to be more of a delimiter than join:

> A `` delimits lexical tokens without introducing white space,
> allowing identifiers to be constructed from arguments.

Before, string RHS arguments to the join operator were silently dropped.

Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-03-20 08:54:23 -04:00
Arkadiusz Kozdra 26f15e11c4 Fix unique {} constraints missing semicolon (#5001)
Signed-off-by: Arkadiusz Kozdra <[email protected]>
2024-03-19 08:22:39 -04:00
Ryszard Rozak 5c0a7e06dc Fix inout ports of unpacked stuct type (#5000) 2024-03-19 06:43:06 -04:00
Andrew Nolte 290b313dc0 Fix missing VPI scopes (#4918) 2024-03-18 20:47:28 -04:00
Wilson Snyder 93e5ca3f6d Fix class type as an associative array parameter (#4997). 2024-03-18 20:44:18 -04:00
Geza Lore 6ffff8565f Use the same serial ordering within MTasks as we use in serial mode (#4994)
The goal here is to use as single ordering heuristic (which can be
improved later) within MTasks as we do for serial code ordering. The
heuristic itself is factored out into the new OrderMoveGraphSerializer.
This also yields slightly nicer ordering than the previously use
GraphStream, so we end up with fewer trigger (domain) conditionals in
the MTasks, this can be worth a few percent speedup.

This has the somewhat nice side-effect of reusing OrderMoveGraphVertex
for both serial and parallel mode, so MTaskMoveGraphVertex can be
removed.

Serial mode yields identical output.
2024-03-17 13:15:39 +00:00
Geza Lore 494e05b326 Fix install instructions for attribute checks, do the same in CI (#4995)
On Ubuntu 22.04, pip install clang picks up a mismatched version by
default. There are 'apt' packages with correct dependencies, so use
those instead.
2024-03-17 12:10:13 +00:00
Kevin Nygaard a24f61403a Support implicitly-typed variable definitions in for-loop initializers (#4945) (#4986)
- Adds support for C-style for-loop initializers
    - Current implementation supports: for (x a = 1, y b = 2, ...)
    - This patch extends support to:   for (x a = 1,   b = 2, ...)
- Adds unit test for new feature
2024-03-16 19:02:37 -04:00
Geza Lore 292cc54768 Compute MTask affinity in V3VariableOrder (#4991)
Instead of carrying around MTask affinity from scheduling, compute it in
V3VariableOrder (where it is used), by tracing through the code. This
simplifies some code and has the benefit of handling variables
introduced after scheduling. It's worth a few % speed at run-time, and
the new implementation of V3VariableOrder is slightly more efficient,
though the speed/space is still dominated by the TSP sort.
2024-03-16 16:32:12 +00:00
Geza Lore e8a9662eb5 Simplify LogicMTask/ExecMTask IDs (#4990)
There is no strong need to re-map LogicMTask IDs and it just adds extra
processing. Instead we just allocate a separate set of ExecMTask IDs as
they are created, which can also be used as the unique profiling ID as
well. The only effect on the output of this is the change in mtask IDs
emitted, which was fairly arbitrary to begin with.
2024-03-16 14:02:17 +00:00
Wilson Snyder 0262819c20 Fix object assignment from conditionals (#4968). 2024-03-16 09:12:18 -04:00
Wilson Snyder d3b93a1113 Fix object reference to conditional null : null 2024-03-16 09:12:18 -04:00
Wilson Snyder 5f8c06c805 Internals: Add AstNode::isNull(). No functional change. 2024-03-16 09:12:18 -04:00
Kevin Nygaard a5ad26cd28 Fix tests on macOS (#4984) (#4985) 2024-03-16 09:08:03 -04:00
Fuad Ismail 5802818b9a Add error when pass net to function argument (#4132) (#4966) 2024-03-16 08:25:42 -04:00
Geza Lore df519ff16e Fix --prof-exec predicted time values (#4988)
Wrapping the functions in #4933 broke --prof-exec report as the
predicted MTask times are computed during thread packing, but are
emitted in the wrapping functions.
2024-03-16 12:17:24 +00:00
Geza Lore bf8a88a0ad Do not create any empty ExecMTasks (#4987) 2024-03-16 12:00:32 +00:00
Geza Lore 878204db73 Do not feed any empty logic into scheduling (#4972) 2024-03-16 10:35:56 +00:00
Nolan Poe 08c76b1da6 Fix GCC14 warnings on template specialization syntax (#4974) (#4975) 2024-03-15 22:21:08 -04:00
Wilson Snyder e82c9db6da Fix unpacked structure upper bit cleaning (#4978). 2024-03-15 21:56:24 -04:00
Wilson Snyder 65c3cb4708 Tests: stop testing if --fail-max tests fail 2024-03-15 21:11:24 -04:00
Wilson Snyder 0cab076b86 CI: Reenable address sanitizer and fix core dumps (#4983) 2024-03-15 21:06:21 -04:00
Wilson Snyder 3a28ed24ea Revert last bin/verilator change. 2024-03-15 10:34:50 -04:00
Wilson Snyder 71775eae4c sanitize 2024-03-15 10:32:31 -04:00
Wilson Snyder 953249aa43 CI: Add dist-vlt-3 to avoid out of disk space 2024-03-12 07:49:01 -04:00
Wilson Snyder 229dbbb100 Tests: RUn same job count as CPU instead of +1 to reduce CI congestion 2024-03-11 20:13:23 -04:00
Wilson Snyder 4a439beae5 Add error on missing pure virtual functions (#4961). 2024-03-11 18:56:30 -04:00
Wilson Snyder 49022c3e73 Add error on calling static function without object (#4962). 2024-03-11 18:23:55 -04:00
Geza Lore c92ced4ac7 Do not defer deletion in const-bit-op-tree
Deferring deletion of unused terms is not necessary, but can cause huge
memory usage increases in some bad cases.
2024-03-11 17:33:40 +00:00
Wilson Snyder ba47da6587 Internals: Move vl_timescaled_double to verilated_funcs.h. No functional change intended 2024-03-10 22:34:32 -04:00
Wilson Snyder 2c27f22900 Remove unused vltstd::exchange, should be using C++14 std::exchange instead 2024-03-10 22:32:51 -04:00
Geza Lore c0391990ad Increase graph ParallelismReprot values to uint64_t 2024-03-10 18:56:31 +00:00
Geza Lore 2247e1e345 Cleanup/simplify V3OrderParallel (#4959)
No functional change.
2024-03-10 18:15:45 +00:00
Geza Lore e4847464d4 Split V3Partition into logically separate pieces (#4958)
V3Partition used to contain 2 conceptually separate set of algorithms

- The MTask partitioning/coarsening algorithm used by V3Order. This has
  been moved to V3OrderParallel.cpp

- The lowering of AstExecGraph into per thread functions by packing
  tasks into threads and creating additional code
  (V3Partition::finalize). This has been moved to the new
  V3ExecGraph.cpp

This patch is just code movement/rename with minimal fixes required to
do so.
2024-03-10 15:58:58 +00:00
Wilson Snyder 7694a7bf41 Fix suggestion of ulimit -s (#4956) 2024-03-10 11:20:25 -04:00
Geza Lore a686e547cf Factor out graph parallelism report into a generic algorithm (#4957)
This is a generic algorithm parametrised by a cost function, so
implement it as such for easy reuse.
2024-03-10 14:56:43 +00:00
Geza Lore 1481d34959 Add candidate item count to MergeCond stats 2024-03-09 22:11:04 +00:00
Nolan Poe 04512e5d04 Add custom version for verilator --version packaging (#4954) 2024-03-09 16:44:25 -05:00
Geza Lore 9a3aed57b1 Internals: Simplify/cleanup V3OrderSerial (#4955). No functional change.
Remove redundant data structures and simplify/cleanup implementation.

No functional change. Output is identical.
2024-03-09 16:19:35 -05:00
Geza Lore 5a69321be3 Split V3Order into further part and decouple various components (#4953)
Continuing the idea of decoupling the implementations of the various algorithms.

The main points:

-Move the former "processDomain" stuff, dealing with assigning combinational logic into the relevant sensitivity domains into V3OrderProcessDomains.cpp

-Move the parallel code construction in V3OrderParallel.cpp (Could combine this with some parts of V3Partition - those not called from V3Partition::finalize - but that's not for this patch).

-Move the serial code construction into V3OrderSerial.cpp

-Factored the very small common code between the parallel and serial code construction (processMoveOneLogic) into V3OrderCFuncEmitter.cpp
2024-03-09 12:43:09 +00:00
Wilson Snyder 5ee938fd1c Fix assignment of null into struct member (#4952). 2024-03-08 17:33:51 -05:00
Arkadiusz Kozdra f78783e187 Internals: Use LogOr/LogAnd on inside operator expansion (#4951)
This will help introducing constrained randomization, as SMT solvers
treat booleans and 1-bit vectors as incompatible types.
2024-03-08 08:17:41 -05:00
Wilson Snyder 11bfe7a7bb cppcheck fixes. No functional change. 2024-03-07 19:20:00 -05:00
Wilson Snyder 8ba494c71f Fix null characters in shortened identifiers (#4946). 2024-03-07 18:09:55 -05:00
Geza Lore acb63c929b Split V3Order.cpp into multiple smaller files (#4950). No functional change intended.
Move OrderBuildVisitor into V3OrderGraphBuilder.cpp (and rename to
V3OrderGraphBuilder). Move ProcessMoveBuildGraph to
V3OrderMoveGraphBuilder.cpp (and rename to V3OrderGraphBuilder).

This patch is pure code movement/rename, no refactoring at all.
2024-03-07 17:12:19 -05:00
Geza Lore 26dd5d4550 Add some missing VNUserInUse (#4949) 2024-03-07 20:26:58 +00:00
Bartłomiej Chmiel 32f288084a Add UNUSEDLOOP when unused loop is removed (#4926) 2024-03-07 08:33:49 -05:00
Andrew Nolte 6db149c588 Fix generate blocks in vpi_iterate (#3609) (#4913) 2024-03-06 18:33:30 -05:00
Geza Lore 0fed5f8b3e Avoid creating redundant vertices in V3DfgPeephole (#4944)
Add a new data-structure V3DfgCache, which can be used to retrieve
existing vertices with some given inputs vertices. Use this in
V3DfgPeephole to eliminate the creation of redundant vertices.

Overall this is performance neutral, but is in prep for some future
work.
2024-03-06 18:01:52 +00:00
Geza Lore a30930bdcc Fix unsound temporary name generation in V3DfgRegularize
Sadly used to produce some conflicting names.
2024-03-05 19:17:41 +00:00
Geza Lore 3a1355fb54 Fix bad assertion in DFG variable elimination
Fixes #4943
2024-03-05 18:51:46 +00:00
Andrew Nolte 97db128d66 Tests: Add VPI dump testcases (#4838) 2024-03-05 12:08:22 -05:00
Wilson Snyder 3d57256070 Commentary: Changes update 2024-03-04 08:22:36 -05:00
Wilson Snyder 5dc8fb5b4f Commentary (#4930) 2024-03-04 08:04:39 -05:00
Wilson Snyder 3f0d434f82 Gtkwave: Update from upstream for warning cleanup (#4941) 2024-03-03 19:24:03 -05:00
Wilson Snyder 2cdc5ea48b Fix unaligned access in --trace --runtime-debug (#4941). 2024-03-03 12:33:11 -05:00
Geza Lore 745605efe3 Fix DFG removing forceable signals (#4942)
DFG could remove forceable signals by replacing them with their
in-design driver. This is a bit of a pain to prevent, and ideally the
forcing transform should happen before DFG, but implementing it there is
a pain due to having to rewrite ports based on direction.  This is an
attempted fix in DFG. More cases might remain.
2024-03-03 16:22:41 +00:00
Wilson Snyder 0fbd4313b2 Fix __Vlip undefined error in --freloop (#4824). 2024-03-03 11:10:46 -05:00
Wilson Snyder 9f8f61ef2f Internals: Only show SimulateVisitor note once per type 2024-03-03 11:10:19 -05:00
github action 4b1f4938b8 Apply 'make format' 2024-03-03 15:23:47 +00:00
Kefa Chen 5f1dc73a1b Support public packed struct / union (#860) (#4878) 2024-03-03 10:23:04 -05:00
Geza Lore 5e1fc6e24d Add DFG 'regularize' pass, and improve variable removal (#4937)
This functionality used to be distributed in the removeVars pass and the
final dfgToAst conversion. Instead added a new 'regularize' pass to
convert DFGs into forms that can be trivially converted back to Ast, and
a new 'eliminateVars' pass to remove/repalce redundant variables. This
simplifies dfgToAst significantly and makes the code a bit easier to
follow.

The new 'regularize' pass will ensure that every sub-expression with
multiple uses is assigned to a temporary (unless it's a trivial memory
reference or constant), and will also eliminate or replace redundant
variables. Overall it is a performance neutral change but it does
enable some later improvements which required the graph to be in this
form, and this also happens to be the form required for the dfgToAst
conversion.
2024-03-02 19:49:29 +00:00
Wilson Snyder 0ec32ee404 Parse 1800-2023 map expressions and throw UNSUPPORTED 2024-03-02 10:15:19 -05:00
Wilson Snyder 97b21b3849 Parse 1800-2023 2024-03-02 10:15:19 -05:00
Wilson Snyder 214173c6b8 Support 1800-2023 preprocessor ifdef expressions; add PREPROC zero warning. 2024-03-02 10:15:19 -05:00
Wilson Snyder 3786f59e03 Change to IEEE 1800-2023 warning mentions 2024-03-02 10:15:19 -05:00
Wilson Snyder fa7234ff68 Support 1800-2023 DPI headers, svGetTime/svgGetTimeUnit/svGetTimePrecision methods. 2024-03-02 10:15:19 -05:00
Wilson Snyder 91dd3c5fac Support 1800-2023 keywords. 2024-03-02 10:15:19 -05:00
Wilson Snyder a378dbd9b2 Tests: Fix t_dist_whitespace 2024-03-02 10:14:54 -05:00
Yutetsu TAKATSUKASA da9521a351 Internals: Add --debug-width option for developers to check width consistency (#4923) 2024-03-02 08:57:26 -05:00
Wilson Snyder af51107587 Fix statistics missing some additions. 2024-03-01 20:27:57 -05:00
Wilson Snyder e60f652a64 Commentary (#4936) 2024-03-01 17:32:26 -05:00
Wilson Snyder a4813ec677 Add warning on TOP-named modules (#4935). 2024-03-01 17:28:12 -05:00
Kamil Rakoczy 01dadb0a8d Fix try-lock spuriously fails (#4931) (#4938) 2024-03-01 15:29:13 -05:00
Geza Lore 9dcb7ea6a9 Fix minor V3DfgPatternStats coding issues 2024-03-01 14:56:35 +00:00
github action adfe072b89 Apply 'make format' 2024-03-01 14:15:34 +00:00
Yan Xu b12f8b3d73 Fix V3Unknown unpacked struct x-assign (#4934) 2024-03-01 09:14:49 -05:00
Geza Lore f56f318217 Make installation relocatable, and the installation testable (#4927)
Fixes #4893
2024-03-01 00:08:28 +00:00
Geza Lore 3af0eb7fa0 Internals: Emit a separate CFunc for each MTask body (#4932) (#4933) 2024-02-29 16:53:53 -05:00
Wilson Snyder a69cb9b044 Tests: Avoid verilated.v include in most tests 2024-02-27 18:08:37 -05:00
Geza Lore b68a696859 Ignore all JSON tree dumps in test-snap/test-diff 2024-02-27 17:16:34 +00:00
Wilson Snyder e320b0b581 Internals: Favor const_iterators. No functional change intended. 2024-02-25 17:12:13 -05:00
Wilson Snyder 42041f2403 Fix invalid cast on string structure creation (#4921). 2024-02-25 08:19:53 -05:00
Wilson Snyder 881c6ee655 devel release 2024-02-24 07:52:19 -05:00
Wilson Snyder d8b2993974 Version bump 2024-02-24 07:39:16 -05:00
Wilson Snyder 30e711aa5c Commentary: Changes update 2024-02-23 11:49:42 -05:00
Yutetsu TAKATSUKASA 51ae8e13fb Add --assert-case option (#4919) 2024-02-23 23:05:53 +09:00
Geza Lore 0892b39ad2 Fix incorrect code generation for change expression on typedefed unpacked array (#4915) 2024-02-23 03:53:42 -05:00
Geza Lore 5964d5cf63 Fix inconsistent driver resolution with typedefs (#4917) 2024-02-22 18:33:23 +00:00
Wilson Snyder 2162a31d3a Commentary: Changes update 2024-02-22 03:57:56 -05:00
Paul Swirhun e00e4d4245 Fix whitespace in pragma protect version (#4914) 2024-02-22 03:29:57 -05:00
Yutetsu TAKATSUKASA 4b9532fe24 Improve message for priority case assertion failure (#4905) 2024-02-22 03:09:14 -05:00
Jiangjie Weng c3ff52208a Commentary: Fix typo in the call condition of designp->nextTimeSlot() (#4912) 2024-02-21 10:15:29 -05:00
Andrew NolteandAndrew Nolte cfb73923bd Test driver: Add -xrun Xcelium support (#4896)
Co-authored-by: Andrew Nolte <[email protected]>
2024-02-20 14:41:05 -05:00
Yutetsu TAKATSUKASAandWilson Snyder a951446f9b Add --[no]-stop-fail option (#4904)
Co-authored-by: Wilson Snyder <[email protected]>
2024-02-19 21:26:58 +09:00
Wilson Snyder a187a16e56 Commentary: Changes update 2024-02-13 21:47:09 -05:00
Wilson Snyder d1dec38f38 Fix integer compare warning (#4887). No functional change. 2024-02-13 18:37:41 -05:00
Yutetsu TAKATSUKASA 65b632a7dd Improve assertion for unique case (#4892)
- Use parallel_case, unique, and unique0 in error message
- Distinguish multiple match and no match
- Show the case value that triggers the assertion
2024-02-13 21:53:32 +09:00
Geza Lore ec0787015e Ignore JSON tree dumps and DFG stats in test-snap/test-diff 2024-02-11 20:38:16 +00:00
Geza Lore cbc76a7816 Dump DFG patterns with --stats (#4889)
With --stats, we will print DFG pattern combinations, one per line, as
S-expressions to new stat files, together with their frequency, to aid
discovery of new peephole patterns.
2024-02-11 15:41:10 +00:00
Szymon Gizler d667b73e8d Add --json-only and related JSON dumping (#4715) (#4831). 2024-02-09 17:50:09 -05:00
Wilson Snyder 248de2be2e Fix coverage with member 2024-02-08 21:51:36 -05:00
Wilson Snyder 365537d8e3 Fix coverage of delayed nets 2024-02-08 20:25:17 -05:00
Wilson Snyder a23cf1ceea Fix toggle coverage dataDeclp error on multi-edge driven signals. 2024-02-08 19:21:44 -05:00
Wilson Snyder be471e9ccc Internals: Minor coverage reformatting/renaming. No functional change. 2024-02-08 19:10:38 -05:00
Wilson Snyder d0e7eaafc9 Tests: Define stop uniformly. No functional change. 2024-02-08 18:39:13 -05:00
Wilson Snyder 13b7cce8be Fix compile error on structs with queues (and ignore toggle coverage on queues). 2024-02-08 08:44:27 -05:00
Wilson Snyder efff630763 Fix tautological-compare warnings. 2024-02-07 22:16:08 -05:00
Wilson Snyder e2e0795538 Fix toggle coverage of unpacked unions with reals. 2024-02-07 21:03:32 -05:00
Wilson Snyder c20634e4f8 Fix coverage of real arrays giving operator^ not defined 2024-02-07 20:11:27 -05:00
Wilson Snyder 715dce546f Fix debug infinite loop when bad coverage pointers 2024-02-07 19:57:02 -05:00
Wilson Snyder 07d86bf91d Allow loop unrolling with coverage 2024-02-07 19:56:32 -05:00
Krzysztof Bieganski fe8c7c5a94 Fix timing with expr on assign LHS (#4880)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-02-06 07:27:19 -05:00
Wilson Snyder 7ada5195d8 Fix this in member initialization (#4710). (#4876) 2024-02-04 19:44:10 -05:00
Wilson Snyder a6ad85244f Backout (#4710) due to leak 2024-02-04 18:13:22 -05:00
Wilson Snyder f13f2296de Fix this in member initialization (#4710). 2024-02-04 16:09:01 -05:00
Wilson Snyder b1d901f100 Tests: Hardcode copyright exceptions (#4874) 2024-02-04 15:43:01 -05:00
Wilson Snyder 8ab576f7e6 Internals: Use std::to_string. No functional change intended. 2024-02-04 14:38:25 -05:00
Wilson Snyder 6f92c9c974 CI: Update upload-artifacts/download-artifacts version (#4875) 2024-02-04 10:29:34 -05:00
Wilson Snyder 7425037db6 Fix Copyright 2024-02-04 09:35:19 -05:00
Geza Lore 6ca60429ce Fix incorrect temporary insertion in loop conditions with statements (#4873)
When the condition of an AstWhile loop contains a statement (e.g.
through an AstExprStmt), temporaries inserted in that statement need to
go before that statement, not in the AstWhile precondition.
2024-02-04 09:19:54 -05:00
Bartłomiej ChmielandBartłomiej Chmiel c702fc944e Fix SystemC biguint sign desynchronization (#4870)
* Fix writing to SystemC values with `VL_ASSIGN_SBW`

Signed-off-by: Krzysztof Bieganski <[email protected]>
Co-authored-by: Bartłomiej Chmiel <[email protected]>
2024-02-02 07:00:13 -05:00
Yutetsu TAKATSUKASA 999c9ae21c Fix #4864 of wrong runtime result (#4867)
* Fix #4864. Ignore if EQ/NE is under SHIFTR.
2024-01-30 00:00:00 +09:00
Szymon Gizler c715cfc254 Add --valgrind switch (#4828) 2024-01-29 07:50:05 -05:00
Wilson Snyder 22687a6901 Internals: Use C++14 quoted literal std::string 2024-01-28 21:00:20 -05:00
Wilson Snyder eecdf4b0f3 Internals: Use C++14 exchange 2024-01-28 21:00:20 -05:00
Wilson Snyder e3e5f30ba1 Check for C++14 without also accepting GNU C++11 (#4865) 2024-01-28 19:42:29 -05:00
Wilson Snyder ce174743bb Fix some MSVC warnings 2024-01-28 14:47:14 -05:00
Wilson Snyder a84be1844f MSVC fix, part of fix of null (#4862). 2024-01-28 11:05:38 -05:00
Wilson Snyder 9ccef4180f Fix $fwrite of null (#4862). 2024-01-28 09:05:50 -05:00
Wilson Snyder 3bf896f7db Commentary: Changes update 2024-01-28 09:04:29 -05:00
Yutetsu TAKATSUKASA e4a0e5aad6 Fix #4857 consider NOT when checking EQ/NEQ under AND/OR tree (#4863) 2024-01-28 22:36:09 +09:00
Wilson Snyder d6f8ccd20b Add unroll_disable and unroll_full loop control metacomments (#3260). 2024-01-26 07:49:07 -05:00
Wilson Snyder 94460867d3 Fix nondeterministic fork/tristate ordering (#4690). 2024-01-25 20:33:43 -05:00
Wilson Snyder 5b70325e52 Internals: Style/debug cleanups. No functional change. 2024-01-25 20:26:56 -05:00
Wilson Snyder 3aece189ac Fix tracing chandles (#4860). 2024-01-25 08:13:52 -05:00
Wilson Snyder 188f0eb4ad Tests: Add t_enum_enumvalue_struct_bad (#2855) 2024-01-25 07:57:45 -05:00
Wilson Snyder d4c8a15407 Add --runtime-debug for Verilated executable runtime debugging. 2024-01-25 07:34:30 -05:00
Wilson Snyder 354a534d68 Add '--decorations node' for inserting debug comments into emitted code. 2024-01-24 21:51:47 -05:00
Wilson Snyder c8a40e0b52 Commentary; Tests: Check summary options match guide options 2024-01-24 19:28:46 -05:00
Wilson Snyder 771cb5f60b Tests: Fix last commit when no coroutines. 2024-01-24 18:48:27 -05:00
Wilson Snyder 23836ee8d0 Document gprof steps better. Add t_prof_timing test to show GCC bug (#4858). 2024-01-24 17:55:23 -05:00
github action 8a7f36c34b Apply 'make format' 2024-01-24 12:46:22 +00:00
Jonathan Schröter 31262e81f9 Fix to not emit already waived warnings in waiver output (#4574) (#4818) 2024-01-24 07:45:38 -05:00
github action 3d006afacc Apply 'make format' 2024-01-24 03:08:39 +00:00
Wilson Snyder 74ec50f933 Support interface class diamond relationship. 2024-01-23 22:07:35 -05:00
Wilson Snyder 21e85f87bc Fix compilation error on multi-inherited interface class usage (#4819). 2024-01-23 19:36:11 -05:00
github action 0b8daf4ae4 Apply 'make format' 2024-01-23 18:06:10 +00:00
Paul Swirhun 6c0c88cfc4 Fix unsafe write in wide array insertion (#4850) (#4855) 2024-01-23 13:05:27 -05:00
Wilson Snyder f0d010d9c5 Github: Update actions (#4852) 2024-01-22 22:32:00 -05:00
Wilson Snyder 2989e54eaa Add unsupported warning on property iff (#4848) 2024-01-21 16:18:48 -05:00
Wilson Snyder 1a2c9ca813 Updat GTKwave libraries from upstream 2024-01-21 13:59:54 -05:00
Wilson Snyder e3f3e3399f Commentary: Changes update 2024-01-21 13:50:27 -05:00
Yutetsu TAKATSUKASA 6b8531f0a6 Fix widthMin in replaceShiftOp (#4837) (#4841) (#4849) 2024-01-21 10:30:01 -05:00
Yutetsu TAKATSUKASA 50df902b54 Fix incorrect bit-op-tree NOT optimization (#4832) (#4847)
* Fix #4832. Bit-op-tree opt. should not touch a subtree under NOT in AND/OR tree.
2024-01-21 07:25:24 -05:00
Wilson Snyder 3a5248a919 Internals: Mark structs final/VL_NOT_FINAL. No functional change intended. 2024-01-20 15:06:46 -05:00
Wilson Snyder 1a92502788 Add --main support for dumping coverage, and +verilator+coverage+file runtime option. 2024-01-20 12:28:49 -05:00
Wilson Snyder a38fea1f9e Tests: Use context coverage write 2024-01-20 11:19:42 -05:00
Wilson Snyder d595d4c7ac Tests: Use --binary with some --timing tests 2024-01-20 10:57:00 -05:00
Wilson Snyder a43fd06f85 Tests: Imply no driver.pl make when using --build. No functional change intended 2024-01-20 10:37:35 -05:00
Wilson Snyder 375a121377 Tests: Use lint() where able instead of compile(). No functional change intended. 2024-01-20 10:25:17 -05:00
Wilson Snyder fef0502d50 Tests: Imply make_main=>0 on --main tests 2024-01-20 10:17:35 -05:00
Wilson Snyder c30b9d04a8 Change unused vars to standard void syntax. No functional change intended. 2024-01-20 08:57:22 -05:00
Wilson Snyder 89cfa0737f Internals: Fix cppcheck warnings 2024-01-17 19:48:07 -05:00
Wilson Snyder 8b03f2d47b Commentary 2024-01-17 19:47:07 -05:00
Anthony Donlon f80c167d65 Fix warnings in verilated_sc_trace.h for Clang. No functional change. (#4807) (#4827) 2024-01-17 19:30:42 -05:00
Szymon Gizler db3ce29b36 Fix wrong utimes() param (#4829) 2024-01-17 08:32:44 -05:00
Wilson Snyder 6f96c6763d Commentary 2024-01-17 08:25:54 -05:00
Szymon Gizler 372cdf1fc8 Tests: Let debugger handle signals instead of test driver (#4817) 2024-01-16 11:18:20 -05:00
github action 54922c036a Apply 'make format' 2024-01-14 00:53:31 +00:00
Adrian Sampson 2e999a5441 Fix too null pointer dereference (#4810) (#4825) 2024-01-13 20:52:50 -04:00
Tim Hutt 5073f208af Internals: Use more standard syntax for avoiding unused variable warnings (#4826) 2024-01-13 15:34:59 -05:00
Larry Doolittle c9d7486d16 Fix maybe-uninitialized compiler warning (#4820) (#4822) 2024-01-12 13:09:34 -05:00
Wilson Snyder 27d906a6b3 Commentary: Changes update 2024-01-12 08:20:53 -05:00
Wilson Snyder 21bf2d62d2 Fix mis-splitting of dump control functions (#4821). 2024-01-12 08:19:30 -05:00
Wilson Snyder fcdd8e5da6 Fix missing includes with multiple inheritance (#3819 partial) 2024-01-11 20:19:48 -05:00
Andrew Nolte ab47fc6656 Fix localparam elaboration (#3858) (#4794) 2024-01-11 07:49:07 -05:00
Szymon Gizler 5f52c066e5 Internals: Add serializeOnly() and dumpTreeEitherLevel() (#4815) (#4715). No functional change intended. 2024-01-09 10:35:13 -05:00
Wilson Snyder 19cb366e5d Update ifdef (#4805) (#4807). No functional change. 2024-01-08 07:35:34 -05:00
Anthony Donlon 55d1b87b34 Support parsing anonymous primitive instantiations (#4809) 2024-01-07 10:59:56 -05:00
Wilson Snyder eec41fd039 Fix lint_off disables on preprocessor warnings (#4703). 2024-01-06 18:49:19 -05:00
Wilson Snyder 69043549d6 Fix const anon union (#4800) 2024-01-06 17:26:07 -05:00
Wilson Snyder 68e4eeb53e Add predicted stack overflow warning (#4799). 2024-01-06 16:16:14 -05:00
Wilson Snyder 0ca90257a5 Add predicted stack overflow warning (#4799). 2024-01-06 16:14:58 -05:00
Anthony Donlon 7507c5f56c Support SystemC 3.0.0 public review version (#4805) (#4807) 2024-01-06 06:01:35 -05:00
Wilson Snyder acbbb2594a Tests: Make some tests single-threaded only, for faster regressions 2024-01-05 18:25:39 -05:00
Wilson Snyder 5294140753 Fix delays using wrong timeunits when modules inlined (#4806). 2024-01-05 18:07:24 -05:00
Wilson Snyder a36a07c297 Internals: Favor UASSERT over v3fatalSrc. No functional change intended. 2024-01-05 18:00:06 -05:00
Wilson Snyder 47b129bf07 Commentary 2024-01-05 07:14:40 -05:00
Chykon 1a0c8f1573 Commentary: Add a link to Create-Binary Execution to the list of examples (#4802) 2024-01-04 10:47:22 -05:00
Wilson Snyder 2be6f03848 Commentary: runtime debugging 2024-01-03 21:03:17 -05:00
github action 4172c0f29e Apply 'make format' 2024-01-03 12:13:21 +00:00
Pengcheng Xu ec01008fe3 Change zero replication width error to ZEROREPL warning (#4753) (#4762) 2024-01-03 07:11:50 -05:00
Marlon James 8ea814e4b4 Fix VPI parameter iteration (#4798) 2024-01-02 18:57:34 -05:00
Marlon James 0195fe9dfd Add vpiConstType support to vpi_get_str() (#4797) 2024-01-02 18:52:57 -05:00
Marlon James e430ea13f4 Fix vpi_get() and vpi_get64() to return vpiUndefined on errors (#4795)
See IEEE 1800-2017 section 38.6 and 38.7.
2024-01-02 16:25:14 -05:00
Mariusz Glebocki 719954a24a Internals: Make V3Const.cpp parseable by non-compilers (#4796) 2024-01-02 14:51:40 -05:00
Paul Wright 3adb31f53b Fix $time not rounding up (#4790) (#4792) 2024-01-01 20:11:46 -05:00
Wilson Snyder 3eaed3b6f5 Remove deprecated 32-bit pointer mode (#4791). 2024-01-01 10:16:48 -05:00
Wilson Snyder 22de598456 devel release 2024-01-01 03:46:48 -05:00
Wilson Snyder 5c5314b39c Version bump 2024-01-01 03:42:12 -05:00
Wilson Snyder e76f29e5ba Copyright year update 2024-01-01 03:19:59 -05:00
Wilson Snyder 5a83209b9b Tests: Fix last commit on width (#4781). 2023-12-31 13:28:49 -05:00
Wilson Snyder 4655ee014b Fix max multiply width. (#4781) 2023-12-31 11:42:06 -05:00
Wilson Snyder 12f0017d4a Commentary: Changes update 2023-12-31 11:35:11 -05:00
Wilson Snyder ca3b5fbe99 Add verilated asserts that VL_MULS_MAX_WORDS does not overflow (#4781). No functional change intended. 2023-12-30 15:31:58 -05:00
Wilson Snyder 9de6612cde Avoid shift by 32 even if later masked, to avoid sanitizer warning (#4781). No functional change intended. 2023-12-30 14:46:57 -05:00
Rasfunk 2d7e8b58e4 Require C++14 or newer (#4784) (#4786) 2023-12-29 10:39:00 -05:00
Wilson Snyder f3a97841bd Commentary 2023-12-27 15:35:22 -05:00
Wilson Snyder 40f0378136 CI: Run --sanitize on Ubuntu 22.04 in prep for eventual 24.04. (#4782) 2023-12-27 15:01:17 -05:00
Wilson Snyder 17b6ce1379 Commentary: Changes update 2023-12-27 10:15:29 -05:00
Wilson Snyder 14ac24cacc Commentary: sccache 2023-12-26 15:15:15 -05:00
Wilson Snyder 6bf253deda Tests: Test for unsupported default disable (#4016) 2023-12-24 13:11:09 -05:00
Wilson Snyder aa4346a0e3 Tests: Add test for unfixed (#4237) 2023-12-24 12:19:15 -05:00
Wilson Snyder 8c541a6e4d Tests: Add test for unfixed (#4038) 2023-12-24 12:17:54 -05:00
Wilson Snyder 1a43afe6f7 Fix $finish twice to no longer exit (#4757). 2023-12-24 11:02:52 -05:00
Wilson Snyder 9882c4c761 Github: Commentary 2023-12-24 10:35:12 -05:00
Wilson Snyder 54ad04b6e9 Fix 'for' loop with outside variable reference (#4660). 2023-12-24 10:17:44 -05:00
Fan Shupei 540cd772e4 Add user C/C++ code to final achieve, and make a libmodel.a (#4749) (#4754) 2023-12-23 09:31:10 -05:00
Krzysztof Bieganski 621de301c7 Run the V3Fork stage only if --timing is set (#4778)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2023-12-22 22:57:45 +01:00
Wilson Snyder 8769c1a92b Internals: Add -fno-dead-cells, -fno-dead-assigns for debug use 2023-12-22 16:26:51 -05:00
github action 8e1c0b0852 Apply 'make format' 2023-12-21 12:49:55 +00:00
Jordan McConnon 56d6791205 Support invoking interface methods on virtual interface variables (#4774) (#4775) 2023-12-21 07:49:07 -05:00
Krzysztof Bieganski 016e630ecf Refine dynamic NBA condition (#4773)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2023-12-20 18:12:17 +01:00
Wilson Snyder 69b779b4a8 Internals: Cleanup cpp-check warnings. No functional change. 2023-12-20 07:49:03 -05:00
Wilson Snyder 7a537765bc Tests: Comment driver.pl with some argument meanings. No functional change. 2023-12-19 22:43:18 -05:00
Wilson Snyder 21b2e874ce Tests: Make some includes more generic to help copying tests. No test change. 2023-12-19 21:08:30 -05:00
Wilson Snyder 55ad950609 Fix power operator with wide numbers and constants (#4721) (#4763) 2023-12-19 19:22:54 -05:00
Todd Strader 654ab117f2 Fix tracing FST enums (#4661) (#4756) 2023-12-19 11:07:06 -05:00
Todd Strader 5ec9bfc47d Support packages in vpi_handle_by_name() (#4768) 2023-12-15 17:32:23 -05:00
Todd Strader 1066f06ec1 Support VPI parameter iteration (#4765) 2023-12-15 13:53:13 -05:00
Todd Strader 668dbb25ab Tests: Use test macros in t_vpi_package (#4726) (#4764). 2023-12-15 12:11:51 -05:00
Todd Strader fced4d6e57 Support vpiConstType in vpi_get() (#4761) 2023-12-14 20:37:47 -05:00
Geza Lore c5ba6e22fa Minor cleanup of trace internals 2023-12-12 20:27:16 +00:00
Geza Lore 6012ec8eb7 Put dynamic NBA commit in eval_phase__nba
Fixes #4634
2023-12-12 18:11:43 +00:00
Mariusz Glebocki 75a44e5aa9 Fix deadlocks in error handler (#4672) 2023-12-12 08:10:01 -05:00
Ryszard Rozak a811f2e17d Support inside operator on unpacked arrays and queues (#4751) 2023-12-12 09:20:22 +01:00
Stefan Wallentowitz b65f2509a2 Devcontainer support (#4748)
devcontainers are a convenient way to provide users a reproducible
build environment. It is currently supported by Visual Studio Code,
Visual Studio and IntelliJ.

When the user opens the verilator repo in VSCode with the standard
devcontainer extension installed, VSCode will ask the user if they
want to reopen in the devcontainer, then build the Docker image as per
our definition and then restart VSCode 'remotely' attached to the
Docker container.

More information:
https://code.visualstudio.com/docs/devcontainers/containers

Also:

- zlibc is missing on Debian-based systems now
- Add non-root user to Dockerfile and make default
2023-12-12 08:46:25 +01:00
Ryszard Rozak b60117c713 Fix typedefs pointing to parameterized classes (#4747)
* Skip handling of ClassOrPackageRef nodes that point to Typedefs
2023-12-08 07:13:38 -05:00
Ryszard Rozak d3142736c8 Tests: Add a test for type parameters in virtual interfaces (#4746) 2023-12-08 07:11:32 -05:00
Ryszard Rozak 1ececf1127 Support multiple parameters in virtual interfaces (#4745) 2023-12-07 13:56:16 +01:00
Geza Lore a09f7713ce Fix race in t_interface_virtual_sched_ico 2023-12-06 16:32:22 +00:00
Geza Lore f3bace10ae Improve V3Premit performance etc. (#4736)
- Enable creating constant pool entries for RHS of simple
  var = const assignments
- Never extract ArraySel (it's just pointer arithmetic)
- Remove unnecessary AstTraceInc precond child tree
- Always fully recurse expressions (fix transplanted from #4617)
- General cleanup

Overall the patch is performance neutral to slightly positive, but saves
~10% peak Verialtor memory usage due to not creating temporaries (which
are later expanded) for any ArraySels.
2023-12-06 09:42:46 -05:00
Wilson Snyder 39d9bd4d47 Internals: V3LinkDot fix missing restorer. 2023-12-06 08:29:33 -05:00
Ryszard Rozak eb2cfe1d19 Support parameterized virtual interaces (#4047) (#4743) 2023-12-06 08:02:04 -05:00
Ryszard Rozak ca5a7d7656 Add class name in the error msg about calling 'new' on virtual class (#4739) 2023-12-05 16:31:59 +01:00
Krzysztof Bieganski ea2084392f Support --timing triggers for virtual interfaces (#4673) 2023-12-04 22:11:07 -05:00
Geza Lore 5d99534d54 Improve W primitive operations with -Oz (#4733) 2023-12-02 22:59:30 +00:00
Geza Lore f048cff093 Add inline for VL_ATTR_ALWINLINE, even on non GNU-C platforms (#4734)
This is required to avoid multiple definition errors at link time for
functions defined in headers and marked VL_ATTR_ALWINLINE.
2023-12-02 21:51:59 +00:00
Wilson Snyder f571181d36 Commentary: Changes update 2023-12-02 16:48:33 -05:00
Wilson Snyder fc9b66b078 Tests: Fix t_assigndly_dynamic_notiming_bad to survive new dead code elimination 2023-12-02 15:57:38 -05:00
Wilson Snyder f039a94744 Tests: Add _bad to some negative tests. 2023-12-02 09:48:06 -05:00
Wilson Snyder b4baa7ce02 Internals: Avoid extranious base class calls in recent commit. 2023-12-01 19:05:21 -05:00
Krzysztof Boroński bd38c8fe3c Fix # 0 delays for process resumption, etc. (#4697) 2023-12-01 13:08:58 -05:00
Todd Strader 9a0748d8ed vpi_iterate packages with vpiInstance (#4726) 2023-12-01 07:34:09 -05:00
Wilson Snyder feae9ca4aa Internals: Use astgen for cross-node pointers. No functional change intended. (#4727) 2023-11-30 19:58:16 -05:00
Ryszard Rozak d1ee9827a0 Fix block names of nested do..while loops (#4728) 2023-11-30 14:32:12 +01:00
Todd Strader 1fe591ae20 fix --rrsim (#4725) 2023-11-30 07:15:12 -05:00
Krzysztof Bieganski b820e1b587 Support iff in sensitivity list (#1482) (#4626)
Adds a new field to `AstSenItem` that stores the `iff` condition which is then handled by `SenExprBuilder`.

Signed-off-by: Krzysztof Bieganski <[email protected]>
2023-11-29 19:10:32 +01:00
Ryszard Rozak ebfc2a4942 Fix parameter passing to ports (#4723)
Signed-off-by: Ryszard Rozak <[email protected]>
2023-11-29 17:07:23 +00:00
Wilson Snyder 7167d4bdc0 Fix shift of > 32-bit number (#4719). 2023-11-27 21:41:32 -05:00
Wilson Snyder a022b672a0 Fix 0**0 with wide numbers (#4721). 2023-11-26 17:11:22 -05:00
William D. Jones a7a48221d3 Fix Windows include gates in filesystemFlush implementation. (#4720) 2023-11-26 05:26:20 +01:00
Wilson Snyder e5118661a7 Commentary 2023-11-24 13:02:05 -05:00
Wilson Snyder 58d9a5ebac Use newline instead of endl, for fewer stream flushes 2023-11-24 11:45:52 -05:00
Wilson Snyder fae7f11222 Fix compilers seeing empty input due to file system races (#4708). Part 2. 2023-11-22 05:18:13 -05:00
Wilson Snyder 1986e62477 Internals: Remove unused append dumpTreeFile option 2023-11-21 22:32:13 -05:00
Wilson Snyder 0ee2a0e6d7 Don't remove DepSet as messes with skip-identical, part of last commit 2023-11-21 22:08:47 -05:00
Wilson Snyder 2b28ddd0c6 Fix MSWIN compile in last commit 2023-11-21 21:49:36 -05:00
Wilson Snyder b15ef49c57 Fix compilers seeing empty input due to file system races (#4708). 2023-11-21 21:22:35 -05:00
Wilson Snyder ed05caec93 Rename __hier*.f files to match other generated files 2023-11-21 20:31:54 -05:00
Wilson Snyder 25ca965938 Commentary 2023-11-21 19:17:39 -05:00
github action ead27db9f0 Apply 'make format' 2023-11-21 02:02:56 +00:00
Jinyan Xu 4650105d90 Fix conflicted namespace for coroutines (#4701) (#4707) 2023-11-20 21:02:10 -05:00
Krzysztof Bieganski b8417abee5 Fix dynamic NBAs with automatic vars (#4696)
This patch addresses two issues with NBAs in non-inlined functions/tasks:
- If the NBA writes to a local automatic var, the var could cease to exist before the NBA executes. This is normally addressed by fork dynscopes (#4356), but NBA-to-fork transformation happens way after `V3Fork` (in `V3Timing`). To solve this, we put NBAs that write to locals under forks in `V3Fork` already. This way, such locals will be put in dynscopes, and will still exist after the task containing the NBA exits.
- The above change means that any writes in forks other than `fork..join` should be handled by `V3Fork`. Thus, in `V3SchedTiming`, we only have to worry about read references, so we can simply copy all remaining locals. Because we copy, lifetimes are not an issue. This fixes a bug that allowed assignment intravals to be overwritten if they go out of scope in the containing function.
2023-11-16 11:21:23 +01:00
Krzysztof Boroński cc982ec7fe Fix range access to fields under classes that depend on parameter resolution (#4681)
Signed-off-by: Krzysztof Boronski <[email protected]>
2023-11-15 14:24:41 +01:00
Ryszard Rozak 2dba76a7c2 Fix access type of function arguments (#4692) (#4694) 2023-11-14 17:02:13 -05:00
Wilson Snyder 9fd5634778 Internals: Remove unneeded private's. No functional change 2023-11-13 21:37:45 -05:00
Wilson Snyder c8063e5732 Internals: Misc cleanups in V3Graph and V3Dead. No functional change. 2023-11-12 22:08:08 -05:00
Wilson Snyder ee3ba7c761 Internals: Use faster VNVisitorConst where able. No functional change intended. 2023-11-12 18:26:40 -05:00
Geza Lore 2882737bcd V3Const: Fix select into And/Or/Xor pattern (#4689) 2023-11-12 19:41:18 +00:00
Geza Lore 47588f343b astgen: Enforce the use of aliased operand accessors (#4688)
This patch enforces the use of the most specific accessors for operands
which have an '@astgen alias' declaration, by making the superclass
accessors of the same operands private. This ensures client code is
cleaner as you can't use multiple different methods to reference the
same operands (which we used to in some places). Also prep for some
refactoring.
2023-11-12 18:30:48 +00:00
Geza Lore 1c0af6c7bc Reduce peak memory use of V3Subst (#4687)
V3Subst is currently the pass responsible for peak memory usage. This
patch saves ~16% of peak memory on OpenTitan.

2 changes:
- It is actually safe to delete the substituted expressions immediately,
  but this is the lesser contribution
- More importantly, we only ever substitute STMTTEMP variables, which
  are always defined within the same CFunc, so we can limit the scope of
  the optimization to CFunc. This allows us to reclaim the SubstVarEntry
  structures at the end of every CFunc, rather than at the end of the
  whole pass, which gives us most of the memory savings.

Generated output is identical
2023-11-12 16:01:07 +00:00
Geza Lore b07ffb3c78 Cleanup V3Gate (#4667) (#4685)
Lot of redundant/dead/obsolete code here. NFCI, but contains some minor
bug fixes.
2023-11-12 15:29:25 +00:00
Geza Lore bea82def10 Add node memory usage info to V3Stats (#4684) 2023-11-12 14:19:53 +00:00
Wilson Snyder 671a857560 Fix compiler warning on 'wait' with non-zero constant. 2023-11-12 08:44:55 -05:00
Wilson Snyder eff2d977c1 Fix mis-elimination of variables across randomize() 2023-11-12 07:32:08 -05:00
Wilson Snyder 30a0d62436 Fix assignment of class reference to itself causing double free.
Test in next commit.
2023-11-12 07:30:56 -05:00
Wilson Snyder 91d0f25442 Internals: Fix style of iterator. No functional change. 2023-11-11 20:52:23 -05:00
Wilson Snyder 4a10c9ef6f Internals: Rename. No functional change. 2023-11-11 20:47:10 -05:00
Wilson Snyder 9d7f5bdc26 Internals: Dump CFunc entry points. 2023-11-11 20:34:51 -05:00
Wilson Snyder 99dbd23f1b Support passing constraints to --xml-only output (still otherwise unsupported) (#4683) 2023-11-11 20:20:37 -05:00
Wilson Snyder 673f086e87 Commentary: Update contributors. 2023-11-11 18:49:51 -05:00
Wilson Snyder 4103925835 Commentary: add docs/README.rst 2023-11-11 17:19:27 -05:00
Wilson Snyder cad2780219 Fix display with no % printing assoc array (#4376). 2023-11-11 15:28:44 -05:00
Wilson Snyder 4636a7f14b Internals: Fix uninitalized variables (#4636) 2023-11-11 14:58:54 -05:00
Wilson Snyder a64bdf50fb Commentary 2023-11-11 14:48:51 -05:00
Wilson Snyder 706534ffe1 Fix 'for' loop with outside variable reference (#4660). 2023-11-11 14:47:54 -05:00
Wilson Snyder 4286af3599 Commentary: Changes update 2023-11-11 10:38:37 -05:00
Wilson Snyder 9a0254a118 Optimize timing-delayed queue (#4584). (#4669) 2023-11-11 10:04:10 -05:00
Wilson Snyder f3ae4b8786 Fix spelling 2023-11-10 23:25:53 -05:00
Anthony Donlon 6566e853cd Support ccache when compiling Verilator with CMake (#4678) 2023-11-09 21:05:36 -05:00
Anthony Donlon ab06ace1f6 Fix trace when using SystemC with certain configurations (#4676) 2023-11-09 07:48:23 -05:00
David Ledger 9a65ed4ce2 Fix Mingw Compilation (#4675) 2023-11-08 06:27:56 -05:00
Marlon James 5ba7084815 Fix VPI TOP level variable iteration (#3919) (#4618) 2023-11-07 07:47:55 -05:00
Wilson Snyder dc10118d3b Fix C++20 compilation errors (#4670) 2023-11-06 07:13:31 -05:00
Wilson Snyder 27102ea0fb CI: Combine lint and build workflows (#4671) 2023-11-06 07:13:00 -05:00
Geza Lore c563175ff0 Fix scheduling of external force signals (#4668)
Used to set the wrong public flag on forceEn/forceVal, which means they
were not included in ICO as necessary, but V3Gate tended to inline them,
so this was hard to hit.

Fixes #4577
2023-11-05 16:58:22 +00:00
Krzysztof Boroński b110c55993 Fix a memory leak in V3Fork (#4628) 2023-11-05 11:39:06 -05:00
Geza Lore dc346b7ffa Remove deprecated options (#4663) 2023-11-04 17:28:36 +00:00
Anthony Donlon 88fcbf5f1d Fix interface parameters used in loop generate constructs (#4664) (#4665) 2023-11-04 13:19:35 -04:00
Wilson Snyder eace1d9c67 Internals: Use UINFO for preproc debug, to avoid stderr/cout output reordering confusion. 2023-11-04 10:51:14 -04:00
Anthony Donlon d0d39c13e7 Fix linking parameterized hierarchical blocks and recursive hierarchical blocks (#4654) 2023-11-03 07:55:53 -04:00
Anthony Donlon 2733d43ea7 Fix identifiers that end with '_' on Windows (#4655) 2023-11-02 17:53:52 -04:00
Geza Lore ae6ec411d0 Remove dead code from V3EmitV 2023-11-02 20:25:44 +00:00
Geza Lore 8a77af7a6d Remove redundant user*ClearTree calls 2023-11-02 19:16:48 +00:00
Wilson Snyder 2a57ead7e3 Commentary (#4517) 2023-11-01 17:43:11 -04:00
Wilson Snyder 839315b271 devel release 2023-10-31 19:53:03 -04:00
Wilson Snyder 67dfa37c56 Version bump 2023-10-31 19:50:01 -04:00
Wilson Snyder 590188820d Commentary: Changes update 2023-10-31 19:49:40 -04:00
Ryszard Rozak a764c70b4a Fix handling of static keyword in methods (#4649) 2023-10-31 08:15:54 -04:00
Wilson Snyder a27abab65f Fix PCH to recompile on version change 2023-10-31 08:10:41 -04:00
Wilson Snyder c241ec90ec Commentary: Changes update 2023-10-30 22:10:03 -04:00
Krzysztof Bieganski f789d28277 Fix signals read via virtual iface optimized out (#4645)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2023-10-30 21:26:46 -04:00
Wilson Snyder c1c8b30a35 CI: Add lint-py action (#4640) 2023-10-30 08:02:54 -04:00
Wilson Snyder 15046c6c59 Commentary: Icarus URL (#4639) 2023-10-30 08:01:12 -04:00
Ícaro Lima 1da15181da Update CONTRIBUTORS (#4641) 2023-10-29 16:44:42 -04:00
Wilson Snyder 3c6b755352 Tests: Rename t_opt_dead 2023-10-29 09:42:52 -04:00
Geza Lore 3c144ada53 Delete AstNode user5 (#4638)
This saves about 5% memory. V3AstUserAllocator is appropriate for most use
cases, performance is marginally up as we are mostly D-cache bound on
large designs.
2023-10-29 01:12:27 +01:00
Wilson Snyder 7ba6647c4f Internals: Cleanup some V3Graph constructors/funcs and docs. No functional change. 2023-10-28 20:11:28 -04:00
Geza Lore e708670f9a Minor memory optimizatoin of AstUser*Allocator 2023-10-28 20:31:57 +01:00
Geza Lore de4c6065dc make: add test-snap/test-diff targets (#4635) 2023-10-28 15:58:29 +01:00
Geza Lore d60f180f43 Avoid double traversal of maps
The typical find/if-not-exists-insert pattern can be achieved with 1
lookup instead of 2 using emplace with a sentinel value. Also maps value
initialize their values when inserted with the [] operator, this is
defined and so there is no need to explicitly insert zeroes for integer
values.
2023-10-28 13:41:43 +01:00
Geza Lore 30318a6654 C++11 cleanup 2023-10-28 11:26:48 +01:00
Geza Lore d8420413b7 test: fix FST trace file names 2023-10-28 10:40:07 +01:00
Geza Lore a5951babfc test: make output deterministic 2023-10-28 10:36:30 +01:00
Geza Lore 2cba167634 Make eval loop construction more unified and the output more readable 2023-10-28 08:48:04 +01:00
Krzysztof Boroński 89743aae5d Fix stable name generation in V3Fork (#4615) (#4624) 2023-10-27 15:08:02 -04:00
Ryszard Rozak e6135981a5 Fix dynamic casts of null values (#4631) 2023-10-27 15:58:40 +02:00
Kamil Rakoczy 739521333c Tests: Fix clang_check_attributes missing dataclass decorator (#4604) (#4611) 2023-10-27 08:24:27 -04:00
Ryszard Rozak 64af83161a Fix rand fields of reference types (#4627) 2023-10-26 17:17:23 -04:00
Chih-Mao Chen 98252634fc Include systemc instead of systemc.h in model header files (#4622) (#4623)
This may require that SystemC programs add:
using namespace sc_core;
using namespace sc_dt;
2023-10-26 14:36:18 -04:00
Krzysztof Boroński a87fb57656 Allow assigning events (#4403)
Signed-off-by: Krzysztof Boronski <[email protected]>
2023-10-26 16:38:47 +02:00
Geza Lore 34708bbba1 Respect --dump-tree-addrids in tree dumps 2023-10-25 18:17:26 +01:00
Krzysztof BorońskiandWilson Snyder f91259f46d Fix insertion at queue's end (#4619)
Signed-off-by: Krzysztof Boronski <[email protected]>
Co-authored-by: Wilson Snyder <[email protected]>
2023-10-25 17:41:28 +02:00
Marlon James cf6e362972 Support VPI variables of real and string data types (#4594) 2023-10-24 20:46:20 -04:00
Geza Lore 95c4ade718 Unify code generation for trace declarations in both trace formats (#4612)
This patch adds some abstract enums to pass to the trace decl* APIs, so
the VCD/FST specific code can be kept in verilated_{vcd,fst}_*.cc, and
removed from V3Emit*. It also reworks the generation of the trace init
functions (those that call 'decl*' for the signals) such that the scope
hierarchy is traversed precisely once during initialization, which
simplifies the FST writer. This later change also has the side effect of
fixing tracing of nested interfaces when traced via an interface
reference - see the change in the expected t_interface_ref_trace - which
previously were missed.
2023-10-24 16:33:29 +01:00
Ryszard Rozak 84125d7c92 Fix virtual methods (#4616) 2023-10-24 15:51:46 +02:00
Geza Lore 17721aff55 Remove unused IMPLICITWIRE var type 2023-10-24 10:02:00 +01:00
Geza Lore d1b6224c2b Associate trace codes with function indices (#4610)
For each traced variable, also register the trace function index that
will write it.
2023-10-23 16:01:55 +01:00
github action 1bd31742b9 Apply 'make format' 2023-10-23 14:07:52 +01:00
Geza Lore 165a2ef1b8 Separate tracing of const values from non-const values
Some values emitted to the trace files are constant (e.g.: actual
parameter values), and never change. Previously we used to trace these
in the 'full' dumps, which also included all other truly variable
signals. This patch introduces a new generated trace function 'const',
to complement the 'full' and 'chg' flavour, and 'const' now only
contains the constant signals, while 'full' and 'chg' contain only the
truly variable signals. The generate 'full' and 'chg' trace functions
now have exactly the same shape. Note that 'const' signals are still
traced using the 'full*' dump methods of the trace buffers, so there is
no need for a third flavour of those.
2023-10-23 14:07:52 +01:00
Ryszard Rozak 774c10396c Fix try_put method of unbounded mailbox (#4608) 2023-10-23 14:33:22 +02:00
Marlon James 33c5b5feb8 Add sv_vpi_user.h from IEEE 1800-2017 Annex M (#4606) 2023-10-22 20:41:40 -04:00
Wilson Snyder b83b9974ee Fix gcc -O0 incompatible allocator warning 2023-10-22 09:51:02 -04:00
Wilson Snyder bcbe5059a9 Internal: V3Graph style cleanup. No functional change 2023-10-22 09:50:38 -04:00
Wilson Snyder 5bda901146 Internals: Fix stats report to include main AstCFile made 2023-10-21 20:56:24 -04:00
Geza Lore 82565690c7 test driver.pl: don't redirect to STDOUT of interactive GDB 2023-10-22 00:56:10 +01:00
Geza Lore 978d900e36 Simplify and fix code stats
V3Stats for "fast" code have bit-rotted a little and is causing some
problems with tests that rely on stats outputs. The problem is that not
all code is necessarily reachable from eval() any more (due to the
complexity of some the features added over the past few years), so it
might miss some things, as for measuring the "fast" code, it is trying
to trace the execution paths via calls, starting from eval(). It also
appears the fast code can also contain calls to slow code in some
circumstances.

To avoid all that, removed trying to trace dynamic execution, and simply
report the static node counts, which is enough for testing.

Similarly, the variable counts are somewhat dubious, as they don't
include all data types, or all instances of a module in some stages.
Removing these as they are not widely used nor dependable. More specific
stats can be added if required and can be well defined.
2023-10-22 00:25:07 +01:00
Geza Lore d330100542 Create implicit nets for inputs of gate primitives.
Prior to this we failed to create implicit nets for inputs of gate
primitives, which is required by the standard (IEEE 1800-2017 6.10).
Note: outputs were covered due to being modeled as the LHS of
assignments, which do create implicit nets.
2023-10-21 22:45:26 +01:00
Geza Lore 4c0edd2efb Improve --prof-exec infrastructure and report
Again --prof-exec have bit-rotted a little with all the recent changes
to the structure of the generated code. This patch contains a few
improvements:
- Repalce the eval/evl_loop begin/end events with generic
  section_push/section_pop events, that can be arbitrarily sprinkled
  into the generate code (so long as they are matched correctly) to
  measure various sections. The report then contains a nested profile
  of the sections, and the VCD trace shows the section names.
- Better handling of exec graphs
- Clearer overall statistics
2023-10-21 21:09:03 +01:00
Geza Lore 146cdc020d Remove V3AstConstOnly.h
This is now redundant with the introduction of VNVisitorConst
2023-10-21 20:41:46 +01:00
Geza Lore 52f2b9ef58 Remove pointless test
t_optm_if_cond was a test for a then non-existent optimization to merge
conditionals. V3MergeCond implements this and has its own tests.
2023-10-21 20:41:46 +01:00
Geza Lore a09506a0ad Trivial simplification of V3EmitCModel
Still some remains of the --threads 0 mode. Remove unnecessary complexity
from V3EmitCModel. (Also don't pretend there is an MTask in single
threaded mode, when there really isn't.)
2023-10-21 20:41:46 +01:00
Geza Lore 10d33238b9 Do not merge entry/exit MTasks during coarsening 2023-10-21 19:31:52 +01:00
Geza Lore b78ea06829 Make VL_LOCK_SPINS configurable
It's unlikely one value fits all use case, so making VL_LOCK_SPINS
configurable at model build time.

For testing, we reduce the value as we expect high contention.
2023-10-21 18:05:53 +01:00
Wilson Snyder eae942b91c Internals: Fix some lint-py warnings 2023-10-21 12:48:36 -04:00
Geza Lore 1075b006b5 Consider children of AstConcat in V3InstrCount
Previously V3InstrCount used to completely ignore an AstConcat,
including its children (see the rational in the comment). The problem is
the operands can be huge and expensive compound expressions (especially
since DFG), and not just a simple variable reference. This fix gains
some MT speed improvement.
2023-10-21 17:15:40 +01:00
Wilson Snyder afaa02709c CI: Increase CCACHE_MAXSIZE (#4595) 2023-10-21 10:38:46 -04:00
Wilson Snyder 332a687aef Commentary 2023-10-21 10:35:07 -04:00
Geza Lore d1c7875406 Fix conditionals on obsolete --threads 0
Since we removed --threads 0 support, the 'threads()' option always
returns a value >= 1. Remove corresponding dead code.

Some of the coverage counters appear to use atomics even if the model is
single threaded. I'm under the impression this was a bug originally so
those ones I changed to use threads() > 1 instead.
2023-10-21 15:14:27 +01:00
Geza Lore cbc2f9eb32 Do not overwrite LD_LIBRARY_PATH in t_flag_ldflags 2023-10-21 11:34:36 +01:00
Quentin Corradi 26e3785963 Fix PLI/DPI user defined system task/function grammar (#4587) (#4588)
According to 1800-2017 36.3, 1800-2017 A.9.3, 1364-2005 20.2 and 1364-2005 A.9.3, user defined system task and function identifiers can use the same character set for the second character as all the following characters.
2023-10-21 02:43:49 -04:00
Wilson Snyder f8b7fb72b8 Fix fault on empty clocking block (#4593). 2023-10-21 02:40:08 -04:00
Krzysztof Bieganski 7b12f6a1dd Support NBAs in non-inlined functions/tasks (#4496) (#4572) 2023-10-20 20:01:45 -04:00
Mariusz Glebocki c7a0613c57 Support Clang 16 (#4592) 2023-10-20 15:47:09 -04:00
Aleksander Kiryk 83a0085c4d Support wait fork (#4586) 2023-10-20 07:13:57 -04:00
Wilson Snyder 05bb7fa821 Tests: Use UVM with UVM_NO_DPI defined 2023-10-20 02:37:11 -04:00
Wilson Snyder 4cc42133b5 Internals: Rename some parser rules. No functional change. 2023-10-19 20:13:27 -04:00
Wilson Snyder a773a52559 Cleanup some IEEE references 2023-10-19 19:26:36 -04:00
Wilson Snyder 5af271cf3a Fix display optimization ignoring side effects (#4585). 2023-10-19 18:33:58 -04:00
Wilson Snyder 0c2bab1f69 Fix method narrowing conversion compiler error (#4568). 2023-10-18 17:51:25 -04:00
Wilson Snyder b7233d063f Internals: Fix same() called outside of sameTree (#4561). 2023-10-18 17:36:21 -04:00
Krzysztof Bieganski 8720841c48 Fix to not remap local assign intravals in forks (#4583) 2023-10-18 16:49:20 -04:00
Wilson Snyder 263697e491 Commentary (#4580) 2023-10-18 08:15:55 -04:00
Wilson Snyder 493f1da266 Fix compile warning on unused member function variable (#4567). 2023-10-18 08:09:54 -04:00
Wilson Snyder 8b44a54bb2 Support Verilated precompiled header compilations (#4580) 2023-10-18 08:08:15 -04:00
Wilson Snyder b5828a7ce9 Fix header order botched by clang-format in recent commit. 2023-10-18 06:37:46 -04:00
Wilson Snyder 51a18225ad cmake: Fix missing headers 2023-10-18 06:37:38 -04:00
Wilson Snyder 28625451dd Fix MSVC makefile list (part of previous commit) 2023-10-18 06:07:05 -04:00
Wilson Snyder 3914176bc4 Internals: Remove unused IGNORED to fix MSVC warning. No functional change intended. 2023-10-18 06:06:00 -04:00
Wilson Snyder 13989b965d Tests: Add --binary with split, to check parallel builds 2023-10-17 23:13:04 -04:00
github action 770cd24f27 Apply 'make format' 2023-10-18 02:50:27 +00:00
Wilson Snyder 431bb1ed16 Support compiling Verilator with gcc/clang precompiled headers (#4579) 2023-10-17 22:49:28 -04:00
Ryszard Rozak 3bb9c7ee92 Fix dictionaries with keys of class types (#4576) 2023-10-17 17:15:24 +02:00
Ryszard Rozak 45edcbb03e Fix logical expressions with class objects - caching in v3Const (#4552) 2023-10-17 07:38:45 -04:00
Ryszard Rozak e99fd2892b Make VNDeleter a member of VNVisitor. No function change. (#4573) 2023-10-17 09:26:53 +02:00
Krzysztof Bieganski 99ea16d7fd Fix dynamic triggers for named events (#4571) 2023-10-16 11:06:41 -04:00
Krzysztof Bieganski bc9ff6d1bf Fix interface comparison (#4570) 2023-10-16 11:05:39 -04:00
Aleksander Kiryk ad3bcbb1bb Support disable fork (#4125) (#4569) 2023-10-16 14:02:29 +02:00
Yutetsu TAKATSUKASA 25dde58297 Internals: Use VN_AS instead of static_cast. Fix some wrong types. (#4561) 2023-10-16 05:17:52 -04:00
Anthony Donlon bba3487dc4 Internals: Fix hash and comparison function for AstBasicDType (#4564) 2023-10-15 15:15:46 -04:00
Anthony Donlon 4fdaa46328 Fix using functions/tasks following class definition inside module (#4553) 2023-10-15 13:01:32 -04:00
Anthony Donlon 4427f03b08 Fix error message for invalid parameter overrides (#4559) 2023-10-15 12:59:36 -04:00
Yutetsu TAKATSUKASA 4e2c63c8cb Support concatenation of unpacked arrays (#4558) 2023-10-15 12:53:35 -04:00
github action afecde87d8 Apply 'make format' 2023-10-15 11:00:14 +00:00
Wilson Snyder c14eae6d56 Add SIDEEFFECT warning on mishandled side effect cases (#487 partial) 2023-10-15 06:44:35 -04:00
Wilson Snyder 684aba0e90 Fix purity calculation during V3Const simplifying Ast 2023-10-15 06:25:42 -04:00
Wilson Snyder 46f8a659b3 Fix shift to remove operation side effects (#4563). 2023-10-14 22:34:37 -04:00
Wilson Snyder 3940a214d0 Internals: Reorder some shift functions for next commit. No functional change. 2023-10-14 22:23:58 -04:00
Wilson Snyder 411f563cbe Internals: Remove unneeded pure checks. No functional change. 2023-10-14 22:23:58 -04:00
Wilson Snyder b5a6b34968 Tests: Remove old hack from before unpacked structs 2023-10-14 22:23:58 -04:00
github action fa8eaf7355 Apply 'make format' 2023-10-14 19:20:22 +00:00
Wilson Snyder 7eb09c3445 Fix instance arrays connecting to array of structs (#4557). 2023-10-14 15:19:19 -04:00
Varun Koyyalagunta edfd3d7206 Fix large constant buffer overflow (#4556) 2023-10-13 07:08:58 +09:00
Wilson Snyder d699caf255 Revert fix Verilated Makefile to get CXX etc. from environment (#4549) (#4554). 2023-10-12 04:22:58 -04:00
Wilson Snyder bd4eede6b4 Commentary: Changes update 2023-10-10 20:43:32 -04:00
Wilson Snyder 1fd8e772b0 Fix loss of warning source content with `line enter (due to earlier commit 472ad90d83). 2023-10-10 20:40:21 -04:00
Anthony Donlon 7ce0bd1181 Fix broken link error for enum references (#4551) 2023-10-10 17:55:40 -04:00
Gus Smith a4b7c39a9a Fix Verilated Makefile to get CXX etc. from enviorment (#4549) (#4554) 2023-10-10 17:53:02 -04:00
Mariusz Glebocki a5ee8b39ef Internals: Remove use of V3Width code from V3AstNodes (#4537). No functional change intended.
`getCommonClassTypep` and its helper code has been moved to AstNode
class. This is a lot better place for this functionality. Moreover, it
allowed to get rid of the dependency on V3Width from generic AST-related
code.
2023-10-09 17:43:27 -04:00
Ryszard Rozak 5b06c60318 Internals: Change deleteTree to pushDeletep (#4548). No functional change intended. 2023-10-09 09:45:09 -04:00
Wilson Snyder b306715b4a Optimize empty expression statements (#4544). 2023-10-09 05:50:31 -04:00
Wilson Snyder 8d99bdac25 Internals: Move afterCommentp to AstNode. No functional change. 2023-10-09 05:03:57 -04:00
github action e114dfda6d Apply 'make format' 2023-10-09 08:14:14 +00:00
Wilson Snyder 472ad90d83 Change lint_off to not propagate upwards to files including where the lint_off is. 2023-10-09 04:12:01 -04:00
Wilson Snyder 622f0c047c Fix reporting `line at wrong spot. Rework some internal fileline parsing functions. 2023-10-08 20:38:45 -04:00
Wilson Snyder 7f38414276 Internals: Rename addIgnoreMatch. No functional change. 2023-10-08 01:02:23 -04:00
Wilson Snyder 1d3d59243c Fix preprocessor to show `line 2 on resumed file per IEEE. 2023-10-07 14:29:46 -04:00
Wilson Snyder e2343c03e0 Internals: Create V3WidthCommit from overly fat header. No functional change intended. 2023-10-06 23:18:26 -04:00
Wilson Snyder 0e0df1fb3b Fix enum functions in localparams (#3999). 2023-10-06 22:38:46 -04:00
Wilson Snyder 800a789f50 Fix inlining of real functions miscasting (#4543). 2023-10-06 21:33:31 -04:00
Wilson Snyder 106664b942 Internals: Fix long lines. No functional change. 2023-10-05 20:07:53 -04:00
Ryszard Rozak 1c738c6b83 Fix object destruction after a copy constructor (#4540) (#4541) 2023-10-05 07:21:33 -04:00
Wilson Snyder 25fa1d7c6a Commentary: Changes update 2023-10-04 20:17:14 -04:00
Wilson Snyder 45162652de Commentary 2023-10-04 20:13:59 -04:00
Wilson Snyder 537650a2cd Fix stream of 32 bit (#4536). 2023-10-03 22:10:50 -04:00
Todd Strader f849073137 Fix non-inlined interface tracing (#3984) (#4530) 2023-10-03 19:55:25 -04:00
Ryszard Rozak a3c154dcd3 Fix this in a constructor (#4533) 2023-10-03 14:32:18 +02:00
Ryszard Rozak 1b8228b642 Fix stream operations with operands of struct type (#4531) (#4532) 2023-10-03 07:23:20 -04:00
Wilson Snyder 732d03f4e5 Fix conversion of integers in $display %e (#4528). 2023-10-01 13:00:16 -04:00
Wilson Snyder 33787c6add Internals: Fix number nodep cloning, and assert stays consistent (#4528 partial) 2023-10-01 12:46:35 -04:00
Ryszard Rozak 44e7d2ebe6 Internals: rename VPurity class and related functions. No functional change (#4523) 2023-09-29 12:23:51 +02:00
Wilson Snyder e49ae663a6 Fix constification of $realtobits, $bitstoreal (#4522). 2023-09-28 22:45:00 -04:00
Wilson Snyder 2385ab8294 Tests: randc now supported 2023-09-26 22:53:25 -04:00
Wilson Snyder 84ccb23098 Fix C++11 compiler constexpr return error 2023-09-26 22:43:17 -04:00
Wilson Snyder ad343f8260 Add warning on interface instantiation without parens (#4094). 2023-09-26 22:15:48 -04:00
Wilson Snyder 018d766179 Fix clang error (#4462) 2023-09-26 21:07:43 -04:00
Justin Thiel a948be184c Tests: Add t_interface_localparam_unsup (#3857 partial) (#3858) 2023-09-26 20:35:23 -04:00
Wilson Snyder 72b4a74245 Fix clang error on last commit 2023-09-26 19:58:09 -04:00
Wilson Snyder 36c824d973 Add trace() API even when Verilated without --trace (#4462). 2023-09-26 18:37:50 -04:00
Anthony Donlon 229ce1aecf Fix handling input file path separator (#4515) (#4516) 2023-09-26 15:42:15 -04:00
Anthony Donlon be45a9b7d5 Style: Update clang-format config to make formatted code consistent between versions. No functional change (#4520) 2023-09-26 15:05:57 -04:00
Wilson Snyder d2c72a7f21 CI: Disable m32 runs 2023-09-25 12:30:25 -04:00
Anthony Donlon 60e9827ffe Support converting parameters inside modules to localparams (#4511) 2023-09-25 11:39:04 -04:00
Wilson Snyder a9256d4758 CI: Disable m32 runs 2023-09-25 11:28:44 -04:00
Anthony Donlon 750b5be5d3 Remove support for parameterized UDPs (#4518) 2023-09-25 10:40:44 -04:00
Mariusz Glebocki 28bd7e5b19 Rework multithreading handling to separate by code units that use/never use it. (#4228) 2023-09-24 22:12:23 -04:00
Anthony Donlon d64c023099 CI: Cancel previous runs for pull requests automatically (#4512) 2023-09-23 11:50:05 -04:00
Wilson Snyder 429cb1f7f7 Commentary (#4517) 2023-09-23 09:04:35 -04:00
Wilson Snyder 9f75068059 Cleanup some error messages to properly quote 2023-09-23 08:52:50 -04:00
Ryszard Rozak 4636e9cffb Fix passing arguments by reference (#3385 partial) (#4489) 2023-09-20 07:33:11 -04:00
Wilson Snyder 4b2bf556d8 Tests: Revert UVM upstream (chipsalliance/uvm-verilator#7) 2023-09-20 07:32:21 -04:00
Kamil Rakoczy a16ea94836 Fix detecting local vars in nested forks (#4493) (#4506) 2023-09-19 17:32:42 -04:00
Michal Czyz b9ea249f81 Rewrite usage of annotation options (#4486) (#4504) 2023-09-19 09:08:17 -04:00
Wilson Snyder 470f480bc1 Fix -m32 compile issue 2023-09-19 07:23:35 -04:00
Wilson Snyder 24ff3155ae Support randc (#4349). 2023-09-18 21:17:21 -04:00
Ryszard Rozak 47b3f464a9 Disable conversion of impure logical expressions to bitwise expressions (#487 partial) (#4437) 2023-09-18 09:21:30 -04:00
github action cd201f8eb8 Apply 'make format' 2023-09-18 01:44:43 +00:00
Wilson Snyder 016278a759 Commentary 2023-09-17 21:43:00 -04:00
Wilson Snyder b68f101e81 Support preprocessing __LINE__ 2023-09-17 19:49:38 -04:00
Wilson Snyder ab13548018 Support resizing function call inout arguments (#4467). 2023-09-17 18:23:44 -04:00
Wilson Snyder f507ee56b0 Fix warning in configure sc_main compile. (#4499) 2023-09-17 08:01:54 -04:00
Wilson Snyder 761adf1cf0 Internals: Add cloneTreePure to prepare for side effect check.
Use cloneTreePure when what is being cloned must be side-effect free.
Use cloneTree when safe to contain side effects (e.g. cloning module).
2023-09-16 22:50:54 -04:00
Wilson Snyder cd1fe64e6c devel release 2023-09-16 21:46:01 -04:00
Wilson Snyder 8f43e74288 Update CMakeList version 2023-09-16 20:54:54 -04:00
Wilson Snyder cef3960a4e Version bump 2023-09-16 18:36:39 -04:00
Wilson Snyder 783b7ecdab Fix clang override warning (last commit) 2023-09-16 17:52:02 -04:00
Wilson Snyder 8bd1c63b32 Support function non-constant default arguments (#4470). 2023-09-16 17:37:25 -04:00
Wilson Snyder e6fb7e970d Fix recursive display causing segfault (#4480). 2023-09-16 10:10:21 -04:00
Wilson Snyder 891cc0f9b6 Fix t_dist_cppstyle Perl performance issue (#4085). 2023-09-16 09:22:12 -04:00
Wilson Snyder 10fbe74cef Commentary: Changes update 2023-09-15 23:25:28 -04:00
Wilson Snyder 05d04a3959 Internals: Fix misnamed member. No functional change. 2023-09-15 23:02:34 -04:00
Wilson Snyder 19f7279542 Fix false INFINITELOOP on forever..mailbox.get() (#4323). 2023-09-15 22:05:55 -04:00
Wilson Snyder aa608472ae Support recursive function calls (#3267). 2023-09-15 20:46:31 -04:00
Wilson Snyder 26ed2a06a0 Tests: Add UVM test that generates ok with known issues commented out. (#1538) (#3267) (#4125) (#4323) (#4349) (#4465) (#4467) (#4468) (#4470) (#4493) (#4494) (#4495) (#4496) (#4497) 2023-09-15 20:26:46 -04:00
Wilson Snyder 07013da13d Tests: Disabled test (#4493) 2023-09-15 19:56:05 -04:00
Wilson Snyder d840c612d4 Fix IGNOREDRETURN to not warn on void-cast static function calls. 2023-09-15 19:01:11 -04:00
Wilson Snyder 188cf85b3f Suppress some debug unknown hash/simulate warnings in UVM. 2023-09-15 18:33:02 -04:00
Wilson Snyder c52ba28dd0 Tests: Fix commentary to unify issue references. 2023-09-15 18:12:11 -04:00
Wilson Snyder 10c1653e72 Fix ZERODLY to not warn on 'wait(0)'. 2023-09-15 08:53:29 -04:00
Wilson Snyder 2fbd41e13b Tests: Add t_queue_persistence.pl as broken test (#3385) (#4489) 2023-09-15 07:59:06 -04:00
Ryszard Rozak 96857c5f95 Fix the error message when the type of ref argument is wrong (#4490) 2023-09-15 07:17:24 -04:00
Wilson Snyder 131eb319e0 Tests: Advance UVM through V3LinkDot Param (#1538 partial) 2023-09-14 20:09:43 -04:00
Wilson Snyder 6e589377f4 Fix reference to extended class in parameterized class (#4466). 2023-09-14 20:07:49 -04:00
Wilson Snyder 2c84b37bf7 Internals: Rename some V3LinkDot variables. No functional change. 2023-09-14 20:06:20 -04:00
Kamil Rakoczy 0d67caff77 Internals: V3Task: refactor common code to connectPort. No functional change intended (#4488)
Signed-off-by: Kamil Rakoczy <[email protected]>
2023-09-14 07:24:49 -04:00
Anthony Donlon 3dde57d539 Fix lint of case statements with enum and wildcard bits (#4464) (#4487) 2023-09-14 07:22:49 -04:00
Kamil Rakoczy ec2e3ec0e4 Update clang_check_attributes to take into account MT_DISABLED (#4479) 2023-09-13 16:32:18 -04:00
Kamil Rakoczy 9fe459c820 Internals: V3LockGuard: Add constructor for adopting already locked mutex. (#4476) 2023-09-13 13:52:59 -04:00
Wilson Snyder 823e0723fb Internals: Remove legacy define. No functional change. 2023-09-13 08:46:51 -04:00
Kamil Rakoczy 8bd6d7c5b1 Internals: Add V3ThreadSafety (#4477) 2023-09-13 07:57:48 -04:00
Wilson Snyder 839a8fa4d9 Fix error on enum with VARHIDDEN of cell (#4482). 2023-09-12 17:47:57 -04:00
Krzysztof Boroński 24917a187a Fix V3CUse, do not consider implementations (.cpp) at all (#4386) 2023-09-12 17:59:57 +02:00
Ryszard Rozak 6c6f03cf7c Fix static cast from a stream type (#4469) (#4485) 2023-09-12 11:06:12 -04:00
Kamil RakoczyandMariusz Glebocki 5676443139 Internals: Rename and slightly change other threads stopping/resuming methods. (#4478)
Co-authored-by: Mariusz Glebocki <[email protected]>
2023-09-11 13:43:26 -04:00
Kamil RakoczyandMariusz Glebocki e77d847671 Check whether V3ERROR_NO_GLOBAL_ is not already defined. (#4475)
Co-authored-by: Mariusz Glebocki <[email protected]>
2023-09-11 09:01:34 -04:00
Kamil RakoczyandMariusz Glebocki 0baee84e96 Move dpiTemporaryVarSuffix() to header. (#4474)
Co-authored-by: Mariusz Glebocki <[email protected]>
2023-09-11 09:01:09 -04:00
Ryszard Rozak c446cc2596 Internals: Remove unused constructor. No functional change. (#4473)
Signed-off-by: Ryszard Rozak <[email protected]>
2023-09-11 07:10:33 -04:00
Ryszard Rozak b66c4153b1 Compute purity of AstCMethodHard (#4460) 2023-09-11 13:06:15 +02:00
Wilson Snyder d72f1b89fc Internals: Minor internal code coverage cleanups 2023-09-10 18:53:51 -04:00
Wilson Snyder b5b278d072 Fix fork crash with no init, test for (#4471) 2023-09-10 08:53:21 -04:00
Wilson Snyder cb5466a90b Tests: UVM passes V3Param stage 2023-09-09 11:54:55 -04:00
Wilson Snyder 4de25369da Tests: Add t_uvm_all 2023-09-08 22:29:23 -04:00
Wilson Snyder cdd8953085 Disable Subst when not pure 2023-09-08 21:52:33 -04:00
Wilson Snyder 2f2f0164ff Internals: Use specific types on some cloneTrees. No functional change. 2023-09-08 21:51:59 -04:00
Kamil Rakoczy 6e977e1024 Generate compile_commands.json using bear (#4463) 2023-09-08 17:26:11 -04:00
Krzysztof Boroński 70b11f91b4 Support block_item_declaration in forks (#4455) 2023-09-08 16:40:14 +02:00
Wilson Snyder 014301587f Unsupported instead of syntax error on parameter var initial values 2023-09-08 08:37:17 -04:00
Krzysztof Bieganski 139e93d371 Internals: Reduce the number of typechecks in graphs (#4398). No functional change intended. 2023-09-08 07:35:52 -04:00
Krzysztof Bieganski fb1fc46b06 Internals: Rework self pointers (#4396) 2023-09-08 07:34:35 -04:00
Wilson Snyder 9882ab6c67 Tests: Remove unstable new test 2023-09-08 07:22:52 -04:00
Ryszard Rozak 1a1f919882 Check the output in t_class_method_str_literal.v (#4459) 2023-09-08 08:51:54 +02:00
Ryszard Rozak 91227d26bb Internals: Rename pure to dpiPure. No functional change. (#4461) 2023-09-08 08:51:19 +02:00
Wilson Snyder 11b5dae88d Support let 2023-09-07 21:45:51 -04:00
Wilson Snyder 0c7d485417 Fix error printing internal name() 2023-09-06 21:07:06 -04:00
Ryszard Rozak c40e34b134 Support assignments of stream expressions on queues to packed values (#4458) 2023-09-06 15:25:48 +02:00
Wilson Snyder 6cdf8da3f7 Fix documentation line wrap (#4456) 2023-09-05 07:25:33 -04:00
Wilson Snyder c65265477f Tests: Enable cover named property 2023-09-03 21:02:42 -04:00
Wilson Snyder de77f1ee5c Improve error that assert-under-assert is unsupported 2023-09-03 09:08:43 -04:00
Wilson Snyder c8c980c49d Fix mis-warning on #() in classes' own functions. 2023-09-02 08:33:56 -04:00
Wilson Snyder ad329612fd Internals: Remove unnecessary cloneTree. 2023-09-01 20:13:20 -04:00
Wilson Snyder c324895cbc Internals: Remove unnecessary cloneTree. 2023-09-01 19:49:57 -04:00
Wilson Snyder 679a4314dc Tests: Avoid side effect on array index 2023-09-01 19:26:50 -04:00
Wilson Snyder 36932d31c4 Fix C++11 missing C++14's std::make_unique. 2023-09-01 18:07:15 -04:00
Wilson Snyder ed25aaaad9 Internals: Fix g++ std11 warning. No functional change. 2023-09-01 17:59:30 -04:00
Wilson Snyder 147aa41ba5 Internals: Fix virt call in constructor warning. No functional change. 2023-09-01 17:58:17 -04:00
Ryszard Rozak 5b7e32581b Internals: Cleanup V3Task. No function change intended. (#4454) 2023-09-01 08:03:16 -04:00
Wilson Snyder 2f90fb2bec Set lifetime for repeat variable (#4451 partial) 2023-08-31 18:34:37 -04:00
Wilson Snyder 8c480fd39e Internals: Fix cppcheck warnings 2023-08-31 18:29:58 -04:00
Krzysztof Bieganski ffbbd438ae Internals: Use runtime type info instead of dynamic_cast for faster graph type checks (#4397) 2023-08-31 18:00:53 -04:00
Anthony Donlon 96ee81fa3f Fix unstable output of VHashSha256 (#4453) 2023-08-31 13:42:37 -04:00
Wilson Snyder 3d2399ea0f Tests: Enable fixed-earlier (#2314) 2023-08-30 18:10:30 -04:00
Wilson Snyder 6d5dde8645 Fix duplicate Vfork functions (#4418) 2023-08-30 17:59:25 -04:00
Wilson Snyder 048c9f3fe2 Support extra commas before $display 2023-08-30 17:31:11 -04:00
Wilson Snyder 373265752f Fix display %x formatting of real. 2023-08-30 17:21:33 -04:00
Wilson Snyder 5e6519c1b0 Commentary 2023-08-30 07:46:39 -04:00
Wilson Snyder ccdb52c1d9 Fix lifetime unknown error on enum.name (#4448). 2023-08-30 07:20:25 -04:00
Yinan Xu b4b74d72f0 Add prepareClone and atClone APIs for Verilated models (#3503) (#4444)
This API is used if the user copies the process using `fork`
and similar OS-level mechanisms. The `at_clone` member function
ensures that all model-allocated resources are re-allocated, such
that the copied child process/model can simulate correctly.

A typical allocated resource is the thread pool, which every model
has its own pool.
2023-08-30 07:02:55 -04:00
Wilson Snyder ca6ab584d0 Internals: Remove cloneTreeNull. No functional change intended. 2023-08-29 20:29:11 -04:00
github action 799a502cac Apply 'make format' 2023-08-29 23:56:25 +00:00
Ethan Sifferman 8d1570db28 Add check for conflicting options e.g. binary+lintonly (#4409) 2023-08-29 19:55:37 -04:00
Wilson Snyder 2a30bbe493 Fix internal error on real conversion (#4447). 2023-08-29 18:07:23 -04:00
Anthony Donlon cf6566b9bc Internal: Optimize program size by refactoring error reporting routines (#4446) 2023-08-29 16:54:32 -04:00
Krzysztof Boroński c3e19f2821 Move variables mutated under fork..join_none/join_any blocks into anonymous objects (#4356) 2023-08-29 20:01:00 +02:00
Ryszard Rozak e24197fd16 Don't move function calls before the expression (#4413) 2023-08-28 15:44:41 +02:00
Anthony Donlon 63db60f646 Fix using type in parameterized classes without #() (#4281) (#4440)
* Check whether a class is parameterized or not with AstClass::isParameterized method

* Fix usage conflict of user2 pointer in V3Param.cpp
2023-08-26 12:06:26 -01:00
Wilson Snyder e66b28823d Internals: Cleanup some spacing. No functional change. 2023-08-26 05:59:56 -04:00
Wilson Snyder 77bd565ef6 Commentary: Changes update 2023-08-25 08:28:26 -04:00
Wilson Snyder 00d63883f8 Fix false MULTITOP on bound interfaces (#4438). 2023-08-25 08:21:15 -04:00
Wilson Snyder 10dd675371 Fix false UNUSEDPARAM on generate localparam (#4427). 2023-08-25 07:59:29 -04:00
Ryszard Rozak 2daa32b98b Support assignments of packed values to stream expressions on queues (#4401) 2023-08-25 11:24:12 +02:00
Ryszard Rozak e8e7912871 Tests: Fix t_net_delay test (#4436) 2023-08-23 13:27:17 -01:00
Ryszard Rozak 90079c2974 Fix nested assignments on the LHS (#4435) 2023-08-23 12:08:22 +02:00
Wilson Snyder 967a8530dd Fix errors on some $past cases (#4425) 2023-08-22 01:49:06 -04:00
Krzysztof Boroński ef4794e36d Support parenthesesless calls to static methods (#4432) 2023-08-22 06:06:34 +01:00
Aleksander Kiryk 7c7c92d2dd Fix coroutine handle movement during queue manipulation (#4431) 2023-08-21 10:22:09 -04:00
Wilson Snyder 95f3dd0535 Commentary (#4429) 2023-08-21 06:23:35 -04:00
Anthony Donlon 768b78e7d0 Fix checking for parameter and port connections in the wrong place (#4428) 2023-08-20 08:55:16 -04:00
Aleksander Kiryk 4370254e73 Fix ++/-- under statements (#4399) 2023-08-19 07:03:21 -04:00
Wilson Snyder 436f72582b Update GTKWave from upstream. 2023-08-19 06:57:43 -04:00
Wilson Snyder af3aba7821 Commentary: Changes update 2023-08-19 04:56:49 -04:00
github action 7479db6ffc Apply 'make format' 2023-08-19 08:52:38 +00:00
Frans Skarman e9cc2786b7 Add --no-trace-top option (#4422) 2023-08-19 04:51:29 -04:00
Anthony Donlon cbdee5a804 Fix Windows filename format, etc. (#3873) (#4421)
* Ignore CLion project files and CMake outputs
* Supporting stripping file path that contains backslash
* Set /bigobj flag and increase stack size for windows platform
* Fix MSVC warnings
2023-08-16 07:34:57 -04:00
Anthony Donlon 0f66262fa1 Internals: Refactor AstNode::checkTreeIter for better stack size (#4420) 2023-08-16 07:32:39 -04:00
Jose Loyola 6c80457262 CI: Refactor docker build action to define DOCKER_HUB_NAMESPACE as repo variable (#4419) 2023-08-15 06:45:07 +02:00
Wilson Snyder 16008acdf1 Internals: Add disabled duplicate function check (#4418) 2023-08-12 10:51:35 -04:00
Wilson Snyder 5447ed2629 Fix multple function definitions in V3Sched (#4416). 2023-08-12 10:41:44 -04:00
Wilson Snyder 9eba61018a Tests: Ignore debug message in error line 2023-08-12 09:39:02 -04:00
Wilson Snyder bc97319402 Internals: State commentary. No functional change. 2023-08-12 08:55:08 -04:00
Wilson Snyder 709db5c648 Internals: Avoid unordered_set 2023-08-12 08:46:25 -04:00
Krzysztof Boroński b752faa107 Fix jumping over object initialization (#4411) 2023-08-11 18:28:37 +02:00
Krzysztof Boroński 8d512c3187 Fix variable lifetimes in extern methods (#4414) 2023-08-11 16:52:59 +02:00
Ryszard Rozak 2d9bc73709 Fix dtype of condition operation on class objects (#4345) (#4352) 2023-08-07 05:54:30 -04:00
Ryszard Rozak b0942ed8c7 Fix detection of mixed blocking and nonblocking assignment in nested assignments (#4404) 2023-08-07 11:35:44 +02:00
Wilson Snyder b1c1aa53a9 devel release 2023-08-06 10:53:16 -04:00
Wilson Snyder f79749e7b2 Version bump 2023-08-06 10:39:35 -04:00
Krzysztof Bieganski 1a77030c9b Internals: Speedup to only typecheck node child getters in debug builds (#4394) 2023-08-05 03:24:00 -04:00
Wilson Snyder 817ade27fb Commentary: Changes update 2023-08-05 03:18:00 -04:00
Aleksander Kiryk 4afa14b612 Internals: Remove m_pkgp and m_classp from WidthVisitor (#4402) 2023-08-05 03:07:23 -04:00
Krzysztof Bieganski 9caa79a7ea Internals: Remove the name field from AstVarRef (#4395) 2023-08-03 02:52:52 -04:00
Wilson Snyder 446f21d2a0 Tests: Fix more missing internal code coverage 2023-07-27 06:53:43 -04:00
Wilson Snyder 06521f6cf1 Tests: Fix some missing coverage, and cleanup some error messages 2023-07-27 06:53:43 -04:00
github action 75336670d7 Apply 'make format' 2023-07-27 09:44:05 +00:00
Andrew Miloradovsky 106a9fe67f Fix config_build.h issues (#4380) (#4381) 2023-07-27 05:42:35 -04:00
Wilson Snyder a5eccc199b Commentary: Changes update 2023-07-27 04:01:28 -04:00
Vito Gamberini 837d9f9d77 Require CMake config minimum version 3.13 (#4389) (#4390) 2023-07-26 17:54:18 -04:00
Anthony Donlon 959387b69f Support property declaration with empty parentheses (#4313) (#4317) 2023-07-26 05:18:21 -04:00
Ryszard Rozak fd0703b8c8 Fix selects on unpacked structs (#4359) 2023-07-25 12:50:24 +02:00
Ryszard Rozak 3ff608b9cb Fix non-public methods with wide output (#4364) 2023-07-25 04:55:58 -04:00
Aleksander Kiryk edc0a0e982 Optimize V3Number::opAdd (#4385) 2023-07-24 17:09:27 -04:00
Aleksander Kiryk 1549ff9185 Support more types in wait (#4374) 2023-07-24 08:14:01 -04:00
Wilson Snyder 3454641244 Commentary: Add website badge 2023-07-21 04:11:15 -04:00
Wilson Snyder 5dedf25e3b Commentary: Add website badge 2023-07-21 04:07:29 -04:00
Wilson Snyder 7214c180ae Commentary: Add website badge 2023-07-21 04:06:22 -04:00
Ryszard Rozak aa0ef554b3 Fix order of evaluation of function calls in statements (#4375) 2023-07-21 03:29:11 -04:00
Ryszard Rozak a6015863d8 Support for static method calls as default values of function arguments (#4378) 2023-07-21 03:27:00 -04:00
Aleksander Kiryk 5a694ccb8a Fix assign to input var in methods (#4367) 2023-07-17 09:52:37 -04:00
Aleksander Kiryk f7d09c671a Fix VlProcess not found (#4368) 2023-07-17 09:52:07 -04:00
Ryszard Rozak 4de1b22672 Fix handling of super.new calls (#4366) 2023-07-17 13:30:42 +02:00
Krzysztof Boroński 4bdda3f240 Improve propagation of process requirement and decouple it from suspendability (#4321) 2023-07-14 17:12:02 +02:00
Ryszard Rozak ced1dfeffd Fix select operation on assoc array with wide keys (#4360) 2023-07-12 18:48:24 +02:00
Krzysztof Boroński 0774f825cf Internals: Use pointer to const nodes in V3MemberMap (#4353) 2023-07-12 11:36:24 -04:00
Ryszard Rozak 23fe5c1b93 Fix string concatenations (#4354) 2023-07-10 12:58:54 -04:00
Wilson Snyder bd4afeea69 Tests: Fix removing line numbers (#4352) 2023-07-10 08:17:49 -04:00
Julian Daube 3ee9b33f8a Fix cmake astgen for Rocky Linux 8.7 (#4343) 2023-07-09 06:02:21 +05:00
Wilson Snyder 5be0813893 Explicity reference std:: in header files (#4338). No functional change intended. 2023-07-08 13:20:40 -04:00
Wilson Snyder f94c1b32e5 Internals: Make V3MemberMap to remove member cache (#4350) 2023-07-08 12:40:27 -04:00
Wilson Snyder ff4923cf67 Internals: Make V3MemberMap towards removing member cache (#4350) 2023-07-08 12:27:50 -04:00
Krzysztof Bieganski 5788bc8048 Propagate class timescale to class package (#4348)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2023-07-07 17:27:33 +02:00
Wilson SnyderandAhmed El-Mahmoudy 5749662194 Documentation: Drop analytics_id unless VERILATOR_ANALYTICS_ID set (#4333)
Co-authored-by: Ahmed El-Mahmoudy <[email protected]>
2023-07-07 10:44:33 -04:00
Krzysztof Bieganski d5d1cc47e0 Fix multiple edge timing controls in class methods (#4318) (#4320) (#4344)
Multiple edge timing controls in class methods would cause compilation errors on
the generated C++ code. This is because the `SenExprBuilder` used for these
would get recreated per timing control, resulting in duplicate variable names.
The fix is to have a single `SenExprBuilder` per scope.
2023-07-07 08:19:49 -04:00
Ryszard Rozak da043ca16d Fix comparison of class objects (#4346) 2023-07-07 16:20:23 +05:00
Aleksander Kiryk 9aa90569bf Support string replication with variable (#4341) 2023-07-07 13:05:06 +05:00
Wilson Snyder 294d78e0e2 Backout unstable dbb35ab8 (#4318) (#4320) 2023-07-05 14:26:28 -04:00
Wilson Snyder 8182c3fe2c Tests: Fix t_vpi_unimpl exiting early with missed error 2023-07-05 14:12:22 -04:00
Wilson Snyder 6f7bc38088 Tests: Improve specparam verilog.y coverage 2023-07-05 14:11:55 -04:00
Wilson Snyder dcbc0ccfdc Commentary: Revert lost name. 2023-07-05 13:55:47 -04:00
Aleksander Kiryk 399319dc1c Fix wildcard referring types (#4336) (#4342) 2023-07-05 13:08:00 -04:00
Krzysztof Bieganski 35d6da391b Fix multiple edge timing controls in class methods (#4318) (#4320)
Multiple edge timing controls in class methods would cause compilation errors on the generated C++ code. This is because the `SenExprBuilder` used for these would get recreated per timing control, resulting in duplicate variable names. The fix is to have a single `SenExprBuilder` per scope.
2023-07-05 10:36:10 +00:00
Aleksander Kiryk fcbd7c87af Fix unexpected RefDType on assoc arrays (#4337) 2023-07-04 18:13:22 +05:00
Ryszard Rozak 97feba6898 Support locator methods with "with" on assoc arrays (#4335) 2023-07-04 18:11:15 +05:00
Aleksander Kiryk 9249ffdb84 Fix queue slicing (#4329) 2023-07-03 13:55:24 -04:00
أحمد المحمودي 71df9e3381 Commentary: Fix typo of concurrent (#4332) 2023-07-02 16:12:09 -04:00
Wilson Snyder 3c964147be Add MISINDENT lint warning for misleading indentation. 2023-07-01 10:45:25 -04:00
Wilson Snyder 54b4b6b378 Internals: Fix missing calls to cleanFileline. 2023-07-01 08:59:26 -04:00
Wilson Snyder cff37f0775 Add GENUNNAMED lint warning.
Also fix generate-for blocks with empty statements getting lost.
2023-07-01 08:31:53 -04:00
Wilson Snyder 8b1cc3b303 Commentary: Changes update 2023-07-01 07:35:58 -04:00
Mariusz Glebocki 65b6121186 Revert .gdbinit modified by accident. (#4330)
`test_regress/.gdbinit` has been modified in
d42f9c095b most likely by accident.
Restore its previous content.
2023-06-30 16:57:31 -04:00
Ryszard Rozak 3d30527860 Fix unique..with method on queues of class objects (#4328) 2023-06-30 17:04:09 +02:00
Ryszard Rozak 24a9f7c650 Fix references to members of results of static methods (#4327) 2023-06-30 13:23:34 +02:00
Ryszard Rozak 242f661644 Fix selects of static members (#4326) 2023-06-30 09:12:22 +02:00
Aleksander Kiryk 32019d2bc4 Fix state update for always processes (#4311) 2023-06-29 09:21:49 -04:00
Krzysztof Boroński b252bb048f Fix unhandled overloads in V3InstrCount (#4324) 2023-06-28 08:49:56 -04:00
Ryszard Rozak ba47c01a01 Fix implicit calls of base class constructors with optional arguments (#4319) 2023-06-27 16:08:38 +02:00
Ryszard Rozak 51266898ec Fix comparison of string parameters (#4308) 2023-06-27 10:40:45 +02:00
Wilson Snyder f9164ab0d2 Internals: Assert dtype comparison. No functional change intended. 2023-06-25 07:40:00 -04:00
Wilson Snyder c43e707f43 Internals: refactor sameTreeIter. No functional change. 2023-06-25 07:26:45 -04:00
Mariusz Glebocki 85b7f828b3 Internals: Use std::packaged_task as a job wrapper; add and use V3ThreadPool::ScopedExclusiveAccess (#4310).
* Add VL_ASSERT_CAPABILITY; add assumeLocked and pretendUnlock to V3Mutex.

* Pass jobs as template-arguments and use std::packaged_task.

* Add and use V3ThreadPool::ScopedExclusiveAccess.
2023-06-23 18:25:12 -04:00
Wilson Snyder 7005a65d32 Tests: Attempt 20.04 fix for (#b1aec9b) (#4307) 2023-06-23 07:09:07 -04:00
Wilson Snyder 776d4e6ac2 CI: Build 20.04 on pull requests 2023-06-23 07:08:04 -04:00
Jiamin Zhu 1c88c3083c Fix splitting coroutines (#4297) (#4307) 2023-06-23 06:01:38 -04:00
Ryszard Rozak 4522834f7a Fix duplicate fork names (#4295) 2023-06-22 06:51:53 -04:00
Ryszard Rozak 9ee5fd0585 Fix handling of ref types in initial values of type parameters (#4304) 2023-06-20 14:10:07 -04:00
Wilson Snyder 63b2dbb827 Fix error when multiple duplicate DPI exports (#4301). 2023-06-20 06:26:46 -04:00
Wilson Snyder 5bee8ef15b Remove long deprecated verilated_heavy.h 2023-06-17 08:45:13 -04:00
Wilson Snyder e7de3d368f Commentary: Deprecation planned for 32-bit pointer -m32 mode (#4268). 2023-06-17 08:44:13 -04:00
Wilson Snyder d45deccc0a Internals: Favot std::array. No functional change intended. 2023-06-16 19:44:40 -04:00
Wilson Snyder d5b03ab721 Tests (#3806) (#3807) 2023-06-16 18:30:25 -04:00
Ryszard Rozak d1ff81a41c Fix class reference assignment checking (#4296) 2023-06-15 14:00:47 +02:00
Krzysztof Bieganski 43fa6858f6 Fix VlForkSync redeclaration (#4277)
Given nested forks, if the inner fork had a `join` or `join_any` at the end,
`V3Sched::transformForks()` would decide that the fork's `VlForkSync` variable
should be passed in from the outside. This resulted in the `VlForkSync` getting
redeclared as a function argument. Ultimately, it led to C++ compilation errors
due to variable redeclaration.

Fixed by rearranging the `if`s that decide whether a variable should be passed
in or left as-is.
2023-06-15 07:49:50 -04:00
Wilson Snyder db7eb45433 Contributors: Add Krzysztof Boronski and re-sort 2023-06-14 18:53:44 -04:00
Krzysztof Boronski 21c01ba97b V3Fork - transform processes that can outlive their parents into separate tasks (#4253)
Signed-off-by: Krzysztof Boronski <[email protected]>
2023-06-14 20:44:53 +02:00
Ryszard Rozak b517fb5ee3 Support some stream operations on queues (#4292) 2023-06-13 22:46:42 -04:00
Wilson Snyder 9dbc669199 devel release 2023-06-13 19:39:50 -04:00
Wilson Snyder 7d2d32420a Version bump 2023-06-13 19:31:57 -04:00
Wilson Snyder 48e98ea2bd Internals: Sort some error codes (#4253). No functional change intended. 2023-06-13 08:52:13 -04:00
Wilson Snyder 01d0f0327b Commentary (#4254) 2023-06-13 08:22:57 -04:00
Wilson Snyder 0dc887720d Tests: Fix tests, broke in commit 3a9eeabd 2023-06-12 22:38:45 -04:00
Wilson Snyder e08bbcdb07 Commentary 2023-06-12 21:59:52 -04:00
Wilson Snyder 70d26ec123 Commentary (#4211) (#4254) 2023-06-12 21:59:33 -04:00
Wilson Snyder a06f260f42 Fix C++11 compiler error with C++14 rbegin 2023-06-12 21:46:32 -04:00
Wilson Snyder d42f76c346 Tests: Fix tests, broke in commit 3a9eeabd 2023-06-12 21:36:23 -04:00
Wilson Snyder 66c3d6d2d1 Commentary 2023-06-12 20:52:29 -04:00
Wilson Snyder 81affad2dc Tests: Fix test, broke in previous commit 2023-06-12 20:41:33 -04:00
Wilson Snyder 2488af9066 Commentary: Changes update 2023-06-12 20:38:33 -04:00
Wilson Snyder 5cf9d78516 Commentary 2023-06-12 20:28:32 -04:00
Wilson Snyder 3a9eeabdb2 Tests: Auto detect and exit --timing with no coroutines 2023-06-12 20:09:12 -04:00
Julien Margetts ac4315e145 Fix LATCH warning on function local variables (#4221) (#4284) 2023-06-12 09:24:46 -04:00
John Wehle 5094e94df1 Fix tracing undefined alignment (#4201) (#4288) 2023-06-12 07:13:00 -04:00
Àlex Torregrosa 4b7b185d05 Fix VCD scope types (#4227) (#4282) 2023-06-08 11:43:04 -04:00
Aleksander Kiryk 6cb0335d28 Support array max (#4275) 2023-06-07 07:44:21 -04:00
Aleksander Kiryk c248318958 Fix struct redefinition (#4276) 2023-06-06 18:28:35 -04:00
Ryszard Rozak c3e5db5f04 Fix names of foreach blocks (#4264) 2023-06-06 16:24:42 +02:00
Krzysztof Bieganski 058233fc87 Set the global usesTiming flag if forks exist (#4274) 2023-06-06 09:35:12 -04:00
Mariusz Glebocki 186c851695 Internals: Avoid pessimistic mutex locking in waitIfStopRequested() (#4272). No functional change intended.
`stopRequested()` reads only atomic variables. It doesn't need a mutex
to do this.

This function is called in `waitIfStopRequested()`, which in turn
is called before execution of every job, and inside some jobs. With this
change the mutex inside `waitIfStopRequested` needs to be locked only in
very rare cases instead of every time.
2023-06-05 19:40:36 -04:00
Mariusz Glebocki 5aa36357f6 Internals: Use auto instead of SFINAE in return type (#4271). No functional change intended. 2023-06-05 18:53:19 -04:00
Wilson Snyder 191d30cf1c Update gtkwave from upstream (#4141) 2023-06-03 12:10:07 -04:00
Andrei Kostovski d8c2ecaaf8 Commentary: Update install.rst for help2man (#4260) (#4261) 2023-06-03 10:31:17 -04:00
github action a7b0551d23 Apply 'make format' 2023-06-03 14:11:23 +00:00
John Wehle dc34968fe7 Add class specific same methods for AstVarScope, AstVar, and AstScope (#4203) (#4250) 2023-06-03 10:07:39 -04:00
Jiamin Zhu 45f064f7cb Fix missing assignment for wide class members. (#4267) 2023-06-03 06:40:23 -07:00
Krzysztof Boroński 545caba720 Give iterated variables in foreach loops VAUTOM lifetimes (#4265)
Signed-off-by: Krzysztof Boronski <[email protected]>
2023-06-02 17:16:42 +02:00
Krzysztof Boroński 0e24f36fef Use STATIC lifetime for variables created from clocking items (#4262)
Signed-off-by: Krzysztof Boronski <[email protected]>
2023-06-01 17:49:27 +02:00
Aleksander Kiryk db7935faf3 Add std::process class (#4212) 2023-06-01 10:02:08 -04:00
Adrien Le Masle 9cc218db3e Fix incorrect multi-driven lint warning (#4231) (#4248) 2023-06-01 08:43:17 -04:00
Ryszard Rozak 15f8ebc562 Fix static methods with prototypes (#4220) 2023-05-31 21:18:32 -04:00
github action 205cae963b Apply 'make format' 2023-05-31 16:03:33 +00:00
Don Williamson df2746de71 Add --main-top-name option for C main TOP name (#4235) (#4249) 2023-05-31 09:02:26 -07:00
Risto Pejašinović 7f471d862e Fix operator == for unpacked struct, if elements are VlUnpacked arrays (#4247) 2023-05-31 08:34:34 -04:00
Risto Pejašinović 338acabe2b Fix AstStructSel clean when data type is structure (#4241) (#4244) 2023-05-30 23:44:48 -04:00
Ryszard Rozak 4f1f487ae4 Fix function calls in with statements (#4245) 2023-05-30 09:02:59 -04:00
Krzysztof Bieganski 77502aeb97 Add warning that timing controls in DPI exports are unsupported (#4238)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2023-05-30 09:00:10 -04:00
Ryszard Rozak ba82d43ca1 Support for condition operator on class objects (#4214) 2023-05-30 08:59:00 -04:00
Wilson Snyder e9135598b3 Fix method calls on function return values. 2023-05-29 18:51:27 -04:00
Risto Pejašinović 1c0739db10 Fix unpacked struct == and != operators (#4234) (#4240) 2023-05-29 12:08:39 -04:00
Ryszard Rozak dfd3907787 Mark AstMemberSel as clean (#4236) 2023-05-29 09:35:53 +02:00
Wilson Snyder 1069652701 Fix some AstExprStmt handling issues, towards side effect fixes. 2023-05-27 12:43:40 -04:00
Wilson Snyder 70b82f1aec Internals: V3Dead cleanups. No functional change. 2023-05-27 11:46:25 -04:00
Wilson Snyder 5573bdb219 Internals: Cleanup V3SplitAs VL_RESTORED. No functional change intended. 2023-05-27 10:43:04 -04:00
Wilson Snyder cf68578261 Internals: Cleanup V3SplitAs VL_RESTORED. No functional change intended. 2023-05-27 10:17:51 -04:00
Wilson Snyder f407d442d4 Commentary 2023-05-27 09:43:23 -04:00
Wilson Snyder 7f12ad9d91 Commentary: Changes update 2023-05-27 07:17:37 -04:00
Wilson Snyder 5efe9367d2 Fix SystemC signal copy macro use (#4135). 2023-05-27 07:00:26 -04:00
Wilson Snyder cfce92645f Tests: Check equality of complex types. 2023-05-26 18:01:11 -04:00
Krzysztof Bieganski 519792d02b Fix to commit coroutines immediately on wait statements (#4229)
Event-triggered coroutines live in two stages: 'uncommitted' and 'ready'. First
they land in 'uncommitted', meaning they can't be resumed yet. Only after
coroutines from the 'ready' queue are resumed, the 'uncommitted' ones are moved
to the 'ready' queue, and can be resumed. This is to avoid self-triggering in
situations like waiting for an event immediately after triggering it.

However, there is an issue with `wait` statements. If you have a `wait(b)`, it's
being translated into a loop that awaits a change in `b` as long as `b` is
false. If `b` is false at first, the coroutine is put into the `uncommitted`
queue. If `b` is set to true before it's committed, the coroutine won't get
resumed.

This patch fixes that by immediately committing event controls created from
`wait` statements. That means the coroutine from the example above will get
resumed from now on.
2023-05-25 20:20:44 -04:00
Jiamin Zhu bfa1f2d7ce Fix missing assignment for wide unpacked structs (#4233) 2023-05-25 20:13:02 -04:00
Aleksander Kiryk 42beaf467c Tests: Add incomplete type definition test (#4230) 2023-05-25 14:06:37 -04:00
Mariusz Glebocki 8303938d0e Internals: Make mutex classes uncopyable. (#4223) 2023-05-25 07:35:14 -04:00
Mariusz Glebocki 0ece155418 Internals: Move some includes to .cpp files. (#4224) 2023-05-24 18:53:14 -04:00
Ryszard Rozak 4f7e155e59 Fix class parameters of enum types (#4219) 2023-05-24 15:51:03 +02:00
Wilson Snyder ff324625e4 CI: Disable m32 on g++ 2023-05-23 23:04:24 -04:00
Wilson Snyder fd7515b046 Tests: Cleanup scenarios lines. No test run change. 2023-05-23 22:40:19 -04:00
Wilson Snyder 607f853bc7 CI: Disable m32 on g++ 2023-05-23 22:35:07 -04:00
Wilson Snyder 09fb1174f1 CI: Disable m32 on g++ 2023-05-23 22:34:27 -04:00
Wilson Snyder 542eaab3dd CI: Disable m32 on g++ 2023-05-23 22:28:40 -04:00
Wilson Snyder a301a498f5 CI: Disable m32 on g++ 2023-05-23 22:27:10 -04:00
Wilson Snyder d66e749ec8 CI: Fix mold build 2023-05-23 22:25:03 -04:00
Wilson Snyder c8ca54ea31 CI: Disable m32 on g++ 2023-05-23 22:24:47 -04:00
Wilson Snyder 5704552053 Fix ci for mold 2023-05-23 21:30:39 -04:00
Wilson Snyder 426069a4dd Configure for faster C++ linking using 'mold', if it is installed. 2023-05-23 21:26:29 -04:00
Wilson Snyder 19d0aabe7a Internals: Fix extra cast on ExprStmt. 2023-05-23 20:52:30 -04:00
Krzysztof Boroński fb0d735f68 Tests: Skip t_suspendable_deep if coroutines are not supported by CXX toolchain (#4217) 2023-05-23 14:02:40 -04:00
Krzysztof Boroński 167a30be1c Fix deep traversal of class inheritance timing (#4216) 2023-05-23 09:01:57 -04:00
Wilson Snyder 5982528274 Fix duplicate std:: declaration with -I (#4215). 2023-05-22 20:32:20 -04:00
Krzysztof Boroński de3095e3b4 Fix missing class forward declarations (#4151) 2023-05-22 08:29:01 -04:00
Wilson Snyder 8e0682f442 Fix V3Expand ignoring side effects 2023-05-21 21:02:39 -04:00
Wilson Snyder 140994d2c4 Internals: Cleanup more VL_RESTORER. No functional change intended. 2023-05-21 14:06:39 -04:00
Wilson Snyder 950e29d56e Internals: Cleanup some missing VL_RESTORER in V3Gate. No functional change intended. 2023-05-21 12:49:07 -04:00
Wilson Snyder 65667356b6 wip 2023-05-21 12:24:00 -04:00
Wilson Snyder 6b393e9d7c Internals: Allow statement-in-statement recursion in V3Premit 2023-05-21 12:03:13 -04:00
Wilson Snyder 4818130e4f Internals: Remove dead code, addBeforeStmt 2023-05-20 22:37:28 -04:00
Ryszard Rozak 9da3aacd08 Fix bit selections under parameterized classes (#4210) 2023-05-18 20:01:36 -04:00
Krzysztof Bieganski 729f8b9334 Move suspendable detection to a separate visitor (#4208)
This makes the implementation of the detection and propagation of the
suspendable property simpler and easier to read. More importantly, there are no
more jumps around the AST with the `visit` functions, which in some cases could
result in incorrect visitor context while in the `visit` function. See the added
test, which would cause Verilator to segfault before this patch.

In testing, verilation performance was not shown to be affected by this change.
Though there is a slight performance improvement from this patch, due to adding
one more check before refreshing class member cache.

Signed-off-by: Krzysztof Bieganski <[email protected]>
2023-05-17 17:09:33 +00:00
Ryszard Rozak 279216048b Fix dotted references in parameterized classes (#4206) 2023-05-16 07:40:02 -04:00
Ryszard Rozak 2ce7a348df Fix references to members of parameterized base classes (#4196) 2023-05-15 19:50:04 -04:00
Wilson Snyder 46f719ceaa Tests: Fix some coverage holes 2023-05-13 20:15:03 -04:00
Mariusz Glebocki 949be301de Internals: Fix unbalanced V3LockGuard locking (#4193) 2023-05-13 10:32:33 -04:00
Mariusz Glebocki be429a5800 Internals: Lock the same mutex reference as specified in VL_ACQUIRE. (#4194) 2023-05-13 10:28:34 -04:00
Mariusz Glebocki e7714e0902 Internals: Add additional clang's thread safety analysis annotations (#4195)
* Simplify some Clang-specific attribute defines.

* Add `VL_RETURN_CAPABILITY` and `VL_PT_GUARDED_BY`.
2023-05-12 09:06:36 -04:00
Krzysztof Bieganski 4835ed6967 Fix forced assignments that override non-continuous assignments (#4183) (#4192)
Only assign forced value on release if it was forced in the first place.
2023-05-12 06:57:12 -04:00
Ryszard Rozak 0198a3fc52 Use unchanged copy of parameterized class for instantation (#4179) 2023-05-11 09:56:15 +02:00
Krzysztof Boroński e095bf1af0 Support inside expressions with strings and doubles (#4138) (#4139) 2023-05-10 20:36:41 -04:00
Aylon Chaim Porat d5de67c6dc Fix wide structure VL_TOSTRING_W generation (#4188) (#4189)
* V3Common.cpp::makeVlToString: fix `VL_TOSTRING_W` statement generation to include width argument

* fix contribution name

* add testcase for long struct `VL_TO_STRING_W` bug
2023-05-10 20:34:44 -04:00
Ryszard Rozak 2267db093f Fix hashes of instances of parameterized classes (#4182) 2023-05-10 18:34:29 -04:00
Ryszard Rozak 5aecfa98a1 Internals: Add param value string to hash in V3Param.cpp (#4186) 2023-05-10 17:52:17 -04:00
Wilson Snyder 485e230dd8 Commentary (#4187) 2023-05-10 17:51:22 -04:00
Wilson Snyder befb415f27 Fix mod/div/round argument side effects 2023-05-07 22:31:31 -04:00
Wilson Snyder c0490627bf Tests: Update historical 2023-05-07 22:00:52 -04:00
Wilson Snyder d269fbb446 Add creating __inputs.vpp file with --debug (#4177). 2023-05-07 17:58:14 -04:00
Wilson Snyder 444020f7c7 Fix super.new missing data type (#4147). 2023-05-07 16:47:34 -04:00
Wilson Snyder 6188083baa Tests: Improve randc tests 2023-05-07 15:08:44 -04:00
Wilson Snyder c2a524d80b Commentary (#4175) 2023-05-07 08:36:03 -04:00
Wilson Snyder e6f5a0495f Fix $fscanf of decimals overflowing variables (#4174). 2023-05-07 08:25:10 -04:00
Wilson Snyder 0606a29f13 Fix arrays of unpacked structs (#4173). 2023-05-06 21:41:17 -04:00
Wilson Snyder c6052830e1 Fix C++17 requirement on previous commit. 2023-05-06 20:23:35 -04:00
Wilson Snyder 4bb876aee5 Fix false IMPLICITSTATIC on package functions. 2023-05-06 19:48:22 -04:00
Wilson Snyder a3640c1767 Support get_randstate/set_randstate class method function. 2023-05-06 19:09:19 -04:00
Wilson Snyder 250c6950cf Fix randomize missing simple class rand members. 2023-05-06 18:33:08 -04:00
Wilson Snyder 76f5de6e54 Replace flake8 with ruff for Python linting 2023-05-06 06:08:32 -04:00
Wilson Snyder 1a1c5c5d44 Internals: Fix pylint warning 2023-05-06 06:05:11 -04:00
Wilson Snyder 4ae80f9a9f Commentary 2023-05-05 22:50:28 -04:00
github action 8a3cb8daa8 Apply 'make format' 2023-05-06 02:37:42 +00:00
Ethan Sifferman 64ab537b68 Add NEWERSTD warning when using feature in newer language standard (#4168) (#4172). 2023-05-05 22:36:51 -04:00
Wilson Snyder fdea386727 Fix false WIDTHEXPAND on array declarations (#3959). 2023-05-05 22:05:19 -04:00
Wilson Snyder 28944ed862 Fix crash on duplicate imported modules (#3231). 2023-05-05 20:31:48 -04:00
Wilson Snyder 3250ee5707 Commentary: Changes update 2023-05-05 20:24:45 -04:00
Wilson Snyder d308a561e4 Fix detection of wire/reg duplicates 2023-05-05 20:16:27 -04:00
Wilson Snyder 584f8cc9e7 Internal: With --xml-only support --debug-exit-uvm 2023-05-05 13:47:34 -04:00
Kamil Rakoczy 61e1483b74 Add multi-threaded Verilating at emit stage (#3608) 2023-05-05 08:36:20 -04:00
Wilson Snyder 3bb4e34044 Commentary 2023-05-04 19:04:38 -04:00
Kamil Rakoczy 832b17d4d2 clang_check_attributes: fix mt-safe checks for global objects in constructor context (#4171) 2023-05-04 14:00:30 -04:00
Krzysztof Bieganski 76c5875912 Fix marking overridden methods as coroutines (#4120) (#4169)
This patch fixes two cases where methods in base classes were not being marked
as coroutines, even though they were being overridden by coroutines.
- One case is the class member cache not getting refreshed for searched classes.
- The other is when the overriding methods are not declared as `virtual`. In
  that case, the `isVirtual()` getter on such a method returns false, which led
  to `V3Timing` skipping the step of searching for overridden methods.

Signed-off-by: Krzysztof Bieganski <[email protected]>
2023-05-04 15:27:45 +02:00
Ryszard Rozak 266dc7679a Don't link AstRefDType if it has parameterized class ref (#4164) (#4170) 2023-05-04 15:09:01 +02:00
Jose Loyola d693dc85e4 Add Github action to build and push docker images (#4163) 2023-05-04 07:44:55 -04:00
Wilson Snyder add68130b8 Internals: Rename to dumpLevel(), to avoid confusion with make-a-dump() 2023-05-03 18:04:10 -04:00
Tudor Timi d9b5680a45 Fix crash caused by $display() optimization (#4165) (#4166) 2023-05-03 17:04:18 -04:00
Wilson Snyder dc25be536c Internals: Deprecate VL_ATTR_ALIGNED, use alignas instead. 2023-05-02 21:21:10 -04:00
Stefan Wallentowitz 7708c88e32 Fix duplicate static names in blocks in functions (#4144) (#4160)
Static variables of functions are created in the function. When blocks
in a function use identical names for static variables, we need to name
those variables properly.
2023-05-02 20:24:44 -04:00
february cozzocrea 707f230353 Commentary: Update install.rst help2man dependency (#4161) 2023-05-02 14:32:24 -04:00
Kamil Rakoczy 49d2eb9a08 Fix initialization order of initial static after function/task (#4159) 2023-05-02 11:50:57 -04:00
github action 128186ea68 Apply 'make format' 2023-05-02 11:29:45 +00:00
Hennadii ChernyshchykandOleh Maks 949be9d0a1 Optimize VPI callValueCbs (#4155)
Co-authored-by: Oleh Maks <[email protected]>
2023-05-02 07:28:56 -04:00
Wilson Snyder 3e986517c3 devel release 2023-04-30 07:10:14 -04:00
Wilson Snyder 5d3a9eec7f Version bump 2023-04-30 07:08:27 -04:00
Wilson Snyder 3d21a79148 Fix pylint warning 2023-04-29 22:22:38 -04:00
Wilson Snyder e15f5266a3 Commentary: Changes update 2023-04-29 22:16:53 -04:00
Toru Niina 9130eb8b99 Fix DPI function type alias (#4148) (#4149) 2023-04-28 07:21:09 -04:00
Ryszard Rozak 09e856d2f3 Fix deleting unused parameterized classes (#4150) 2023-04-28 07:20:25 -04:00
Ryszard Rozak ee5c0a2902 Support parameterized class references in extends statement (#4146) 2023-04-24 17:25:53 -04:00
Ryszard Rozak 621b7e63cf Print the type of provided RHS in class type check (#4145) 2023-04-24 17:24:04 -04:00
github action c6bf9fb89e Apply 'make format' 2023-04-24 11:29:33 +00:00
Risto PejašinovićandRisto Pejasinovic f794180865 Fix hier attribute of --xml-only cell section to respect begin blocks (#4129) (#4133)
Co-authored-by: Risto Pejasinovic <[email protected]>
2023-04-24 07:28:29 -04:00
Geza Lore 0e769d42a1 Optimize trigger evaluation
Pack the elements of VlTriggerVec as dense bits (instead of a 1 byte
bool per bit), and check whether they are set on a word granularity.
This effectively transforms conditions of the form `if (trig.at(0) |
trig.at(2) | trig.at(64))` into `if (trig.word(0) & 0x5 | trig.word(1) &
0x1)`. This improves OpenTitan ST by about 1%, worth more on some other
designs.
2023-04-24 09:09:36 +02:00
Wilson Snyder cbeb9d39ff Fix -CFLAGS to allow overriding optimization levels (#4140). 2023-04-23 10:18:48 -04:00
Wilson Snyder 5a98c1a3b1 Commentary 2023-04-23 10:10:05 -04:00
Geza Lore cac634d39b Fix DfgToAst conversion of CountBits (#4101) (#4143) 2023-04-23 08:49:44 -04:00
Peter Monsson 08330bad0b Fix variables in class methods to be automatic (#4111) (#4137) 2023-04-21 08:07:22 -04:00
Ryszard Rozak 84a46939b3 Fix class extend param references (#4136)
Signed-off-by: Ryszard Rozak <[email protected]>
2023-04-20 07:11:35 -04:00
Kamil Rakoczy 65a484e00b Internal: Update clang_check_annotations conditions (#4134) 2023-04-20 07:02:31 -04:00
Krzysztof Boroński 843fdd3e57 Resolve class lvalues after parameterization (#4131) 2023-04-19 18:05:37 -04:00
Ryszard Rozak a10b51705f Fix class param extends A=B (#4128)
Visit global class params even if a class extends a param
2023-04-17 09:08:57 -03:00
Eyck Jentzsch df86e39845 Fix systemc namespace issues (#4126) (#4127)
* replaces use of "systemc.h" with <systemc> to avoid default namespace import
2023-04-17 06:57:29 -03:00
Wilson Snyder 7f49b6c102 Parse 'let' as unsupported 2023-04-16 17:23:16 -04:00
Krzysztof Boroński 754a0b8320 Fix to use parallel build for projects with a lot of files (#4116) 2023-04-14 18:52:05 -04:00
Krzysztof Boroński 7d3b3761b2 Fix including __Syms header in generated C++ files (#4123) 2023-04-14 11:53:27 -04:00
Ryszard Rozak d1b80ffa29 Support parameterized return types of methods (#4122) 2023-04-14 08:52:43 -04:00
Ryszard Rozak f95ce886f1 Fix duplicating parameter class types (#4115) 2023-04-14 06:51:33 -04:00
Wilson Snyder fa16eff003 Commentary (#4118) 2023-04-14 06:46:53 -04:00
Geza Lore 23f90b13f3 Do not create unnecessary DPI AstSenTrees
No functional change
2023-04-13 14:01:45 +01:00
Geza Lore 37e7b5dfc7 Fix unused/hard-coded argument
No functional change.
2023-04-13 14:01:37 +01:00
Kamil Rakoczy e1683afb31 Internals: V3ThreadPool: add function waiting for list of futures (#4112) 2023-04-12 08:49:48 -04:00
Kamil Rakoczy e38b359d75 Internals: Refactor for better clang thread-safety analysis (#4092) 2023-04-11 07:25:10 -04:00
Kamil Rakoczy b6dcec2710 Internals: Split Mutex class used in verilated code and verilator (#4048) 2023-04-11 07:23:24 -04:00
Wilson Snyder 0307d59c1f Fix unpacked structs under classes (#4102). 2023-04-10 19:40:34 -04:00
Wilson Snyder 3aa013c8db Tests: Remove old file 2023-04-10 19:40:34 -04:00
github action fc70876aa9 Apply 'make format' 2023-04-10 23:38:20 +00:00
Srinivasan Venkataramanan 722ab9306a Support class method calls without parenthesis (#3902) (#4082) 2023-04-10 19:37:24 -04:00
Wilson Snyder 2ab34b5eeb Fix false error on new const assignment (#4098). 2023-04-09 19:46:47 -04:00
Wilson Snyder e3bdae77a0 Tests: Add randsequence test 2023-04-09 17:08:04 -04:00
Wilson Snyder 663d6a1c8d Commentary 2023-04-09 10:23:35 -04:00
Wilson Snyder bf5cbb512e Add UNSUPPORTED on dotted disable instead of syntax error 2023-04-09 10:11:47 -04:00
Wilson Snyder d4bb58630e Support 'for' initialization with comma 2023-04-09 09:56:39 -04:00
Wilson Snyder fff0eb5d88 Internals: Use standard 'result' name for return variable. No functional change. 2023-04-08 22:11:28 -04:00
Wilson Snyder 7ae0c5d546 Internals: cppcheck fixes. No functional change intended 2023-04-08 21:36:32 -04:00
Wilson Snyder 114d93b212 Internals: Move -debug-exit-uvm to post V3LinkDot, just before V3Param (#1538) 2023-04-08 15:11:26 -04:00
Wilson Snyder 13a87e5514 Parse process class, and report runtime errors (#3612) 2023-04-08 15:04:42 -04:00
Wilson Snyder d67d75282c Support ++/-- on dotted member variables. 2023-04-07 20:57:17 -04:00
Kamil Rakoczy 827cbf22c9 Fix sense expression variable naming (#4081) 2023-04-07 07:23:37 -04:00
Wilson Snyder 2530cda507 Fix debug crash when no std:: used 2023-04-06 21:43:39 -04:00
Wilson Snyder 38000a3da0 Fix unnecessary verilated_std.sv waivers in --waiver-output. 2023-04-06 21:43:23 -04:00
Wilson Snyder 6c21b21ecc Internals: Indent verilated_std.sv with Verilog-mode. No functional change. 2023-04-06 21:27:16 -04:00
Wilson Snyder 8caf9be3e6 Internals: Favor {} constructor syntax. No functional change intended. 2023-04-06 21:04:26 -04:00
Krzysztof Bieganski cdb61842d6 Internals: Remove VlNow (#4089)
`VlNow{}` is completely unnecessary, as coroutines are always on the
heap (unless optimized out). Also fix access of var ref passed to forked processes.
2023-04-06 10:31:52 -04:00
Wilson Snyder 05660d1118 Add CONSTRAINTIGN warning when constraint ignored. Likewise ignore constraint_mode, rand_mode. 2023-04-05 21:27:37 -04:00
Ryszard Rozak a3f9221a67 Fix importing symbols from base class (#4084) 2023-04-04 20:56:18 -04:00
Wilson Snyder 7e1980af7a Tests: Avoid t_dist failures on deleted files. 2023-04-02 15:10:45 -04:00
Wilson Snyder 921fd919b5 Tests: Improve short circuit test 2023-04-01 23:10:05 -04:00
Robert BalasandRobert Balas fc5a5ea53d Commentary: Fix spelling mistakes (#4080)
Co-authored-by: Robert Balas <[email protected]>
2023-04-01 20:45:28 -04:00
Wilson Snyder 86156dd05b Revert false-positive static error (#4072) (#4077) 2023-04-01 18:54:37 -04:00
Wilson Snyder 3219ffddd4 Tests: Ignore commented out messages 2023-04-01 18:17:45 -04:00
Wilson Snyder 3a01c32bf9 Revert false-positive static error (#4072) (#4077) 2023-04-01 15:45:34 -04:00
Wilson Snyder 9ffd0a4e70 Support queue[$-1] selects. 2023-04-01 15:23:39 -04:00
Wilson Snyder 90e049c674 Internals: Remove unneeded variable. No functional change. 2023-04-01 11:46:43 -04:00
Wilson Snyder 69121633cf Support class srandom and class random stability. 2023-04-01 10:50:27 -04:00
Wilson Snyder 28eadded87 Update include/gtkwave from upstream 2023-04-01 10:38:47 -04:00
Wilson Snyder 93c598dd19 Commentary 2023-04-01 10:38:33 -04:00
Krzysztof Bieganski d012563ab1 Fix tracing with awaits at end of block (#4075) (#4076)
Given an await at the end of a block, e.g. at the end of a loop body, a trace
activity setter was not inserted, as there were no following statements. This
patch makes the activity update unconditional.
2023-03-31 13:51:31 -04:00
Krzysztof Bieganski 0b96789e65 Add error on static access to non-static class member (#4072)
Before this patch, it was possible to access non-static class members using
static access, which resulted in C++ compilation errors. This adds
verilation-time checks for such situations.
2023-03-27 10:46:51 -04:00
Wilson Snyder 947402bc57 Fix interface generate begin (#4065). 2023-03-26 08:49:38 -04:00
Yutetsu TAKATSUKASA d4107dce52 Improve xor tree optimization (#4071)
* AstNot does not have to be frozen in an xor tree during BitOp tree optimization.

* Tests: Update stats.
2023-03-26 20:36:32 +09:00
Yutetsu TAKATSUKASA 990b19e048 Fix incorrect optimization of bit op tree (#4059) (#4070) 2023-03-26 03:29:10 -04:00
Srinivasan Venkataramanan 2290e6ccf2 Fix info message prints under --assert (#4036) (#4053) 2023-03-24 19:22:48 -04:00
Wilson Snyder 14c8f072f1 Commentary 2023-03-24 19:06:07 -04:00
Krzysztof Bieganski c55df02b1a Fix C++ compile errors when passing class refs as task arg (#4063)
1. Fixes passing a null reference as a task argument. Before this patch it would
   cause a C++ compile error like `cannot convert ‘VlNull’ to ‘VlClassRef<...>’`.

2. Fixes passing a class reference as a task argument when the argument is a
   reference to a base class. Before the patch it would cause a C++ compile
   error like `cannot convert ‘VlClassRef<{DERIVED_CLASS}>’ to ‘VlClassRef<{BASE_CLASS}>`.
2023-03-24 13:18:59 -04:00
Ryszard Rozak 5b86248b54 Add error if class types don't match (#4064) 2023-03-24 13:18:20 -04:00
Josep Sans 449ac44131 Fix _Vilp used before declaration (#4057) (#4062) 2023-03-24 11:51:02 +01:00
Ryszard Rozak f439a7927f Fix parameters in a class body to be localparam (#4061) 2023-03-23 10:20:35 +01:00
Aleksander Kiryk 277bd67f72 Fix NBAs inside fork-joins (#4050) 2023-03-21 10:39:29 -04:00
Krzysztof Bieganski 5de8ccbf32 Fix task calls as fork statements (#4055)
Before this patch, calling tasks directly under forks would result in each
statement of these tasks being executed concurrently. This was due to Verilator
inlining tasks most of the time. Such inlined tasks' statements would simply
replace the original call, and there would be no indication that these used to
be grouped together. Ultimately resulting in `V3Timing` treating each statement
as a separate process.

The solution is simply to wrap each fork sub-statement in a begin in `V3Begin`
(except for the ones that are begins, as that would be pointless). `V3Begin` is
already aware of forks, and is supposed to avoid issues like this one, so it
seems like a natural fit. This also protects us from similar bugs, i.e. if some
statement gets replaced or expanded into multiple statements.

Signed-off-by: Krzysztof Bieganski <[email protected]>
2023-03-21 13:50:53 +01:00
Wilson Snyder 577e0700ba Commentary: Changes update 2023-03-21 04:52:12 -04:00
github action 71a37484f5 Apply 'make format' 2023-03-21 08:43:31 +00:00
Jesse Taube daf157e6c0 Fix false LATCH warning on --assert 'unique else if' (#4033) (#4054). 2023-03-21 04:42:19 -04:00
Iztok Jeras 2aa6a229ca Change range order warning from LITENDIAN to ASCRANGE (#4010) 2023-03-20 20:44:11 -04:00
Wilson Snyder 9b869edd90 Internals: Fix cppcheck warnings. No functional change. 2023-03-18 19:28:48 -04:00
Wilson Snyder 2b21697b86 Support class extends of package::class. 2023-03-18 17:26:36 -04:00
Wilson Snyder 895ab8789b Internals: Fix recently added assertion false firing 2023-03-18 17:11:39 -04:00
Wilson Snyder 5f02f95ce6 Commentary (#3906) (#3931) 2023-03-18 15:49:11 -04:00
Wilson Snyder f2aac8c49a Internals: Use VNVisitorConst where possible, for better performance. No functional change indended. 2023-03-18 12:23:17 -04:00
Wilson Snyder 82e653a739 Internals: Avoid emit inheritance in V3EmitCBase. No functional change intended. 2023-03-18 12:23:17 -04:00
Tim Snyder 053f760e2a Fix characters from DEFENV literals for conda (#4035) (#4044)
The baked in DEFENV paths might end up with extra NULL characters
at the end if the binaries are installed by something that patches them
for relocatable installs (e.g. conda).  Avoid this issue by immediately
passing them through std::string::c_str() method to stop at the first NULL
2023-03-18 11:25:27 -04:00
Wilson Snyder ba9e141fae Commentary: Update CONTRIBUTING and internals xrefs (#4043) 2023-03-18 10:23:19 -04:00
Wilson Snyder d60a3e2b66 Fix random internal crashes (#666).
Internally, in V3Broken check m_interpp for null, and make several cleanups
in the addNext/addNextHere/unlinkFr* methods.
2023-03-18 09:48:26 -04:00
Yu-Sheng Lin 70c2d1eded Fix install, standardization in cmake CMakeLists.txt (#3974) 2023-03-18 07:38:09 -04:00
Wilson Snyder 80cbf81b3b Internals: Fix missing relink() and add assert 2023-03-17 22:29:48 -04:00
Kamil Rakoczy 798d7346cf Internals: Add VL_MT_SAFE attribute to functions that requires locking. (#3805) 2023-03-17 20:24:15 -04:00
Wilson Snyder d6c5d40f9b Internals: Add VNVisitorConst class. 2023-03-17 19:59:09 -04:00
Ryszard Rozak 371b8310d9 Support method calls without parenthesis (#4034)
* Support method class without parenthesis

Signed-off-by: Ryszard Rozak <[email protected]>

* Delete replaced nodes

Signed-off-by: Ryszard Rozak <[email protected]>

---------

Signed-off-by: Ryszard Rozak <[email protected]>
2023-03-17 13:25:39 +01:00
Ryszard Rozak 1ac721af8f Add STATICVAR warning and convert to automatic (#4027) (#4030)
Signed-off-by: Ryszard Rozak <[email protected]>
2023-03-17 07:48:41 -04:00
Wilson Snyder 85fd88ace2 Optimize duplicate JumpBlocks away (#4028) 2023-03-16 22:29:06 -04:00
Wilson Snyder ed1e377bb1 Fix large return blocks with --comp-limit-blocks (#4028). 2023-03-16 21:40:01 -04:00
Wilson Snyder 4240c29f4b Internals: Fix missing broken check 2023-03-16 21:14:49 -04:00
Wilson Snyder 51ba4a1531 Fix clocking block scope internal error (#4032). 2023-03-16 20:48:18 -04:00
Wilson Snyder d1b55cb7aa Fix compile error last commit (#4029) 2023-03-16 20:22:08 -04:00
Kamil Rakoczy bbf53bd5af Add VL_MT_SAFE attribute to several functions. (#3729) 2023-03-16 19:48:56 -04:00
Wilson Snyder b2ced6ff1d Add more debug info to --report-unoptflat graph (#4039) 2023-03-16 19:47:13 -04:00
Wilson Snyder a9b07fe7d7 Tests: Remove unintended t_0 test 2023-03-16 18:44:28 -04:00
Kamil Rakoczy 66e4656a8e Fix event controls reusing same variable (#4014) 2023-03-16 07:12:54 -04:00
Wilson Snyder 8f4d4f07a4 Commentary 2023-03-16 07:09:16 -04:00
Wilson Snyder 8e55580cde Update include/gtkwave from upstream 2023-03-15 22:11:06 -04:00
Wilson Snyder 8ae79066a2 Fix false ENUMVALUE on expressions and arrays. 2023-03-15 21:56:35 -04:00
Wilson Snyder 36da6a3563 Fix parsing #1_2 delays 2023-03-15 21:22:28 -04:00
Wilson Snyder 45690faea7 Parse defparam = as unsupported 2023-03-15 21:04:10 -04:00
Wilson Snyder 046fecbb35 Fix fclose(0). 2023-03-15 20:49:59 -04:00
Ryszard Rozak 0f6024ef3c Fix rand fields in base classes (#4025) 2023-03-15 11:48:18 -04:00
Wilson Snyder 2488b5a97f Fix pullup/pulldown to create implicit wires. 2023-03-14 21:14:27 -04:00
Wilson Snyder 56de6f1a9f Fix min/typ/max internal error 2023-03-14 20:40:58 -04:00
Wilson Snyder 0fc5d37901 Fix bounded queues with parameter bounds 2023-03-14 20:29:47 -04:00
Wilson Snyder ea4cc4e076 Parse nettype with package, still unsupported 2023-03-14 19:52:01 -04:00
Wilson Snyder 9e25c21fed Fix unpacked struct clocking 2023-03-14 19:35:40 -04:00
Ryszard Rozak fc3fdcc71c Tests: Fix randomize_method test (#4024) 2023-03-14 13:47:43 -04:00
Ryszard Rozak 80b7b8bbdb Don't call randomize on null field (#4023)
Signed-off-by: Ryszard Rozak <[email protected]>
2023-03-14 14:48:06 +01:00
Wilson Snyder a8ce272e4a Commentary: spelling 2023-03-14 08:39:54 -04:00
Wilson Snyder 72963c4e20 Commentary (#4020) 2023-03-14 08:29:39 -04:00
Ryszard Rozak 4e5bd361e0 Internal: Fix dumping of AstMethodCall (#4021) 2023-03-14 06:54:45 -04:00
Ryszard Rozak ed1a9309d4 Throw warning if static variable is declared in a loop (#4018)
Signed-off-by: Ryszard Rozak <[email protected]>
2023-03-14 10:03:08 +01:00
Ryszard Rozak 1d0a06438c Assign unique names for blocks in do..while loop (#4019) 2023-03-14 09:54:43 +01:00
Wilson Snyder 2c62714a30 Fix push to dynamic queue in struct (#4015). 2023-03-13 22:03:53 -04:00
Wilson Snyder f13e753b52 Change ZERODLY to a warning. 2023-03-12 21:28:14 -04:00
Wilson Snyder 39a5bce8a6 Parse covergroup, still unsupported. 2023-03-12 14:11:11 -04:00
Wilson Snyder ba953bfa94 Commentary: Changes update 2023-03-12 10:49:19 -04:00
Wilson Snyder 1debd0405b Support complicated IEEE 'for' assignments. 2023-03-12 10:46:40 -04:00
Wilson Snyder 1f1d9312d2 Parse event 'iff', still unsupported. 2023-03-11 22:39:59 -05:00
Wilson Snyder 259201b352 Support $fopen as an expression 2023-03-11 18:11:01 -05:00
Wilson Snyder bb45bd048e Commentary 2023-03-11 11:27:40 -05:00
Wilson Snyder 5489ec6eff Parse 'first_match', and still unsupported. 2023-03-11 11:08:37 -05:00
Wilson Snyder e55e81bcd0 Parse sequence 'local input', still unsupported. 2023-03-11 10:53:10 -05:00
Wilson Snyder 5c5c758718 Parse 'wait_order' and test, still unsupported. 2023-03-11 10:47:08 -05:00
Wilson Snyder b87669039e Commentary 2023-03-10 22:25:47 -05:00
Wilson Snyder 60a6ed2a20 Support assert property statement-else-statement 2023-03-10 22:13:17 -05:00
Wilson Snyder 81e8388c3f Parse 'expect', still unsupported. 2023-03-10 21:48:56 -05:00
Wilson Snyder 4532680e5f Internals: Cleanup assert/assume. No functional change. 2023-03-10 21:17:54 -05:00
Andrew Nolte fc17ab280a Add --public-depth to force public to a certain instance depth (#3952) 2023-03-09 21:48:05 -05:00
Wilson Snyder 621cd0f008 Internals: Framework for renaming warnings (#4010 partial) 2023-03-08 21:32:37 -05:00
Andrew Nolte 13c9877099 Add --public-params flag (#3990) 2023-03-08 19:38:26 -05:00
Wilson Snyder ff889fde18 Add debug comment when trace disabled (#4004). 2023-03-06 18:22:46 -05:00
Krzysztof Boroński f68c16a5e6 Fix symbol entries when inheriting classes (#3995) (#3996) 2023-03-06 07:43:58 -05:00
Ryszard Rozak cc45f64280 Add __PVT__ prefix to selects nodes (#4001) 2023-03-06 13:18:48 +01:00
Wilson Snyder 725ec088ea Parse 'sequence' declarations, property case/if, still unsupported. 2023-03-06 05:12:09 -05:00
Wilson Snyder 87c3de5aab Parse 'matches', still unsupported. 2023-03-05 23:58:54 -05:00
Wilson Snyder 6d7c04a3de Parse cycle delays and boolean abbrev, still unsupported. 2023-03-05 23:22:41 -05:00
Wilson Snyder d0f5ce0cc4 Parse intersect/throughout/within, still unsupported. 2023-03-05 19:57:09 -05:00
Wilson Snyder cb89ef9885 Parse more property expression syntax, as still unsupported 2023-03-05 19:42:21 -05:00
Wilson Snyder 90360d40fd Change property expression handling towards eventual more general expressions. 2023-03-05 18:52:55 -05:00
Wilson Snyder 15dcd326f8 Internals: Parse weak/strong but do not lex 2023-03-05 18:30:43 -05:00
Wilson Snyder ae1eb56695 Internals: Parser commentary 2023-03-05 17:59:17 -05:00
Wilson Snyder a47fd07585 Internals: Standard grammar for property_expression |-> |=>. 2023-03-05 16:59:24 -05:00
Wilson Snyder 19bc257002 Internals: UNSUPPORTED commentary 2023-03-05 16:45:07 -05:00
Wilson Snyder a1d4cd658e devel release 2023-03-04 11:31:58 -05:00
Wilson Snyder 21093fd1bd Version bump 2023-03-04 11:19:44 -05:00
Wilson Snyder 329a933efd Internals: Parse nettype as unsupported 2023-03-04 10:50:28 -05:00
Wilson Snyder e21198cb2d Add warning on missing class reference #() 2023-03-03 21:06:52 -05:00
Wilson Snyder ab502c5196 Fix coverage of class methods (#3998). 2023-03-03 19:26:15 -05:00
Felix Neumärker 12728bc478 Fix UNDRIVEN warning seg fault (#3989) 2023-03-03 18:54:38 -05:00
Wilson Snyder 3fc684359a Fix prettyName in structure dumps, partial (#4001) 2023-03-03 18:49:26 -05:00
Wilson Snyder 1e28387541 Tests: Add nettype test 2023-03-02 20:29:42 -05:00
Wilson Snyder dd917d50eb Internals: Parse interconnect then say unsupported 2023-03-02 20:02:14 -05:00
Kamil Rakoczy 0130c2bceb Internals: update clang attributes check report conditions (#3997) 2023-03-02 18:37:07 -05:00
Wilson Snyder 8a5804fc3a Tests: Add tagged union test 2023-03-02 08:11:11 -05:00
Wilson Snyder 3df29085c8 Fix end label fileline reporting. 2023-03-02 07:50:16 -05:00
Wilson Snyder 976af0068b Support parsing min:typ:max parameters 2023-03-01 23:11:48 -05:00
Wilson Snyder a85e6a9d8c Commentary: Changes update 2023-03-01 22:43:39 -05:00
Wilson Snyder 463ea57b0a Add error (vs previous warning) on enum value overflow. 2023-03-01 22:36:42 -05:00
Wilson Snyder 326a60d307 Add error on mixing .name and by-port instantiations. 2023-03-01 21:19:21 -05:00
Ryszard Rozak 2c60c5f816 Support recursive methods (#3987) 2023-03-01 21:07:37 -05:00
Cameron Kirk faf3804b9a Fix LITENDIAN warning is backwards (#3966) (#3967). 2023-03-01 11:46:44 -05:00
github action 08a433260c Apply 'make format' 2023-03-01 05:44:35 +00:00
Wilson Snyder 7fc278f6db Fix import of extends typedefs 2023-03-01 00:30:45 -05:00
Wilson Snyder b1a95f642f Support cast to numbers from strings. 2023-02-28 23:34:33 -05:00
Wilson Snyder c6a569df49 Commentary 2023-02-28 18:38:52 -05:00
Krzysztof Boroński 06661ab676 Disallow ++/-- over expressions with potential side effects (#3976). 2023-02-28 15:21:58 -05:00
Wilson Snyder d9a0e69597 Commentary, fix copyright 2023-02-28 01:09:09 -05:00
Wilson Snyder a0997d0b98 Fix internal error with UNSUPPORTED of procedural clocked assertions 2023-02-28 00:35:58 -05:00
Felix Neumärker a3ff375ce7 Fix timing delays to not truncate below 64 bits (#3973) (#3982) 2023-02-27 21:42:22 -05:00
Wilson Snyder c03affa544 Fix enum.next(0) and enum.prev(0). 2023-02-26 15:24:24 -05:00
Wilson Snyder 4703fc39be Add error to avoid @* fatal 2023-02-26 13:13:02 -05:00
Wilson Snyder 9bf0e54937 Internals: add const 2023-02-26 12:21:17 -05:00
Wilson Snyder b039f246df Lint check posedge of nonintegral 2023-02-26 12:08:10 -05:00
Wilson Snyder a93b344096 Tests: use standard lower case for Perl vm_prefix 2023-02-26 10:18:40 -05:00
Peter DebackerandPeter Debacker 191c71edea Fix cmake on macOS to mark weak symbols with -U linker flag (#3978) (#3979)
Co-authored-by: Peter Debacker <[email protected]>
2023-02-23 17:27:29 -05:00
Wilson Snyder b4dd398af6 Tests: Cleanup some C++ new calls. No functional change. 2023-02-23 06:14:54 -05:00
Wilson Snyder cfe0fdd5cc Untabify 2023-02-23 05:47:56 -05:00
Adam Bagley 003a8cfe75 Add lint warning on always_comb multidriven (#3888) (#3939) 2023-02-23 05:36:28 -05:00
Wilson Snyder 7559af5879 Fix missing error on negative replicate (#3963). 2023-02-22 19:11:02 -05:00
Ryszard Rozak 47a7e75841 Fix subsequent parameter declarations (#3969) 2023-02-22 11:26:25 +01:00
Wilson Snyder adf1de45de With -Wpedantic change ASSIGNIN to a warning 2023-02-21 16:45:35 -05:00
Ryszard Rozak 45f955f175 Fix self references to parameterized classes (#3962) 2023-02-17 11:17:35 -05:00
Ryszard Rozak 063f9a7a4c Fix dicts declared with ref type (#3960) 2023-02-16 12:49:45 -05:00
Wilson Snyder c82a098f2e Internals: Parse class extends :: 2023-02-14 21:23:55 -05:00
Wilson Snyder 393b7714c4 Convert some mis-syntax errors to UNSUPPORTED 2023-02-14 20:48:52 -05:00
Wilson Snyder 43d8de4f80 Support property var decls. 2023-02-14 20:44:14 -05:00
Wilson Snyder 026bbc306b Removed deprecated --cdc option. 2023-02-13 22:49:51 -05:00
Wilson Snyder f8b0e359b9 Support class parameters without initial values. 2023-02-13 22:06:52 -05:00
Wilson Snyder 94ef1b76d0 Fix error text on packed struct init. 2023-02-13 20:58:49 -05:00
Wilson Snyder 50929e5d43 Fix packed array structure replication. 2023-02-13 07:49:08 -05:00
github action 3f4b7af8a1 Apply 'make format' 2023-02-13 04:21:52 +00:00
Larry Doolittle bc6a7787ed Fix date on the front page of verilator.pdf (#3956) (#3957) 2023-02-12 23:21:03 -05:00
Wilson Snyder 5064ec2806 Support type case and type equality comparisons. 2023-02-12 20:09:10 -05:00
Wilson Snyder 4f19eeaffa Fix type(typedef) operation core dump 2023-02-12 19:57:52 -05:00
Wilson Snyder 10d0088f73 Fix generate case with empty body statements. 2023-02-12 18:14:18 -05:00
Wilson Snyder 15d0ec317d Fix lint for non-integral types in packed structs. 2023-02-12 16:32:36 -05:00
Wilson Snyder 260d58e47e Tests: Add struct tests 2023-02-12 13:30:52 -05:00
Wilson Snyder d9c4d9316f Parse checkers as UNSUPPORTED. 2023-02-11 14:31:28 -05:00
Wilson Snyder e9441cff50 Parse external constraints as UNSUPPORTED. 2023-02-11 13:29:52 -05:00
Wilson Snyder daa545774e Parse randsequence as UNSUPPORTED. 2023-02-11 13:03:10 -05:00
Wilson Snyder dee2e45e27 Tests: Add defparam not resolved test 2023-02-11 11:00:07 -05:00
Wilson Snyder 4d29487e75 Fix -Wpedantic on std::process. 2023-02-11 10:55:06 -05:00
Wilson Snyder 2bb2935924 Commentary: Changes update 2023-02-11 10:38:00 -05:00
Larry Doolittle aff3f7c4f6 Fix build on hppa (#3954)
As supplied by John David Anglin in Debian bug #1030913
2023-02-11 04:23:26 -05:00
Wilson Snyder 5aa4f46101 Internals: Add some std::. No functional change intended. 2023-02-10 20:32:39 -05:00
Zixi Li 8f87022496 Fix CMake bad C identifiers (#3948) (#3951) 2023-02-10 20:06:05 -05:00
Ryszard Rozak d34aa10faf Fix class field linking when a super classes is a param (#3949) 2023-02-10 07:44:14 -05:00
Kamil Rakoczy 93d50c4499 Internals: Add mutex to V3Error (#3680) 2023-02-09 22:15:37 -05:00
Todd Strader 4eb280601e handle constant format field widths (#3946) 2023-02-09 10:09:00 -05:00
Wilson Snyder b778784333 Add --annotate-points option, change multipoint on line reporting (#3876). 2023-02-08 20:22:54 -05:00
Todd Strader 9121a81a74 Fix constant enum methods (#3621) 2023-02-08 18:50:27 -05:00
Todd Strader d3cbb1e53f Fix constant string function assignment (#3945) 2023-02-08 18:48:07 -05:00
Wilson Snyder cf88700fc2 Fix virus detection false positive (#3944). 2023-02-08 18:44:07 -05:00
Ryszard Rozak 072d76fe8e Use VAR_BASE as attr type if a select's base is a ref (#3943)
Signed-off-by: Ryszard Rozak <[email protected]>
2023-02-07 15:10:19 +01:00
Aleksander Kiryk 3436d1780f Fix namespace fallback resolution (#3863) (#3942) 2023-02-07 07:13:55 -05:00
Wilson Snyder 1607225063 Fix VPI upper interface scopes not found (#3937). 2023-02-05 16:16:39 -05:00
Wilson Snyder 807e5b22a0 Fix verilator_difftree header flush 2023-02-05 15:20:56 -05:00
Wilson Snyder 2c64b83c19 Internals: Fix constructor syntax 2023-02-05 14:29:49 -05:00
Wilson Snyder dfc98e77c0 Commentary 2023-02-05 14:12:27 -05:00
Wilson Snyder 936bb7b1ed Add error on size with unsized number 2023-02-05 14:06:03 -05:00
Wilson Snyder 88e5017564 Internals: Directly assign dtype instead of using dtype's dtype 2023-02-05 13:50:29 -05:00
Wilson Snyder 508f6f7e5a Fix core dump with initial variable delays 2023-02-05 13:17:35 -05:00
Wilson Snyder 70eceae3d8 Fix core dump on bad dotted reference. 2023-02-05 12:45:14 -05:00
Wilson Snyder eb5aad94f1 Support to packed array 2023-02-05 10:18:03 -05:00
Wilson Snyder 2d89c458f6 Fix force/release of real. 2023-02-04 20:37:36 -05:00
Wilson Snyder d33ded22f9 Internals: Remove unused variable 2023-02-04 19:50:04 -05:00
github action edc32ca82d Apply 'make format' 2023-02-04 13:20:41 +00:00
Kritik Bhimani dc9c81256d Fix MsWin missing directory exception, and ::std (#3928) (#3933) (#3935) 2023-02-04 08:19:49 -05:00
Wilson Snyder 6908e471e7 Revert: e3558d9e: Support vpiDefName (#3906) (#3931) 2023-02-03 21:26:21 -05:00
Andrew Nolte e3558d9e1b Support vpiDefName (#3906) (#3931) 2023-02-03 19:14:41 -05:00
Wilson Snyder 11043aeb9b Work around mswin crash with --std (#3933) 2023-02-03 19:01:20 -05:00
Wilson Snyder 15c163c12e github: msbuild compile with -j 3 2023-02-03 18:47:54 -05:00
Wilson Snyder c7ed73e249 Fix MSVC++ compile warning 2023-02-03 18:47:37 -05:00
Wilson Snyder 4aa3e72509 Fix cmake 3.12+ warnings on MSWIN. 2023-02-03 17:16:39 -05:00
Aleksander Kiryk 31130c4b4a Fix std:: to be parsed first (#3864) (#3928) 2023-02-03 09:04:16 -05:00
github action 00f0027c80 Apply 'make format' 2023-02-03 13:48:46 +00:00
Joseph Nwabueze c8be50d40b Add /*verilator public[flat|flat_rd|flat_rw| ]*/ metacomments (#3894) 2023-02-03 08:47:55 -05:00
Wilson Snyder e16e9b89cd Commentary (#3932). 2023-02-03 07:27:23 -05:00
Yoda Lee 80b291407b Add cmake warning if multiple SOURCES w/o PREFIX (#3916) (#3927) 2023-02-02 22:08:13 -05:00
David Stanford d2aff13402 Commentary: Add some more details to the vpi example (#3925) 2023-02-02 21:51:23 -05:00
github action 82f450d838 Apply 'make format' 2023-02-03 00:11:37 +00:00
Wilson Snyder f6d4f1ad02 Fix very long VPI signal names (#3929). 2023-02-02 19:10:23 -05:00
Wilson Snyder 645e1387e0 Tests: Fix merge conflict failure 2023-02-02 19:10:20 -05:00
Andrew Nolte d3c14cc1ac Split WIDTH warning into WIDTHEXPAND and WIDTHTRUNC (#3900) 2023-02-02 18:25:25 -05:00
Ryszard Rozak 33468fa0e7 Fix class extend parameter dot case (#3926) 2023-02-02 17:59:47 -05:00
Ryszard Rozak 0e955d503e Handle references of static members of type aliases of a parametrized class (#3922)
Signed-off-by: Ryszard Rozak <[email protected]>
2023-02-02 08:36:11 +01:00
Andrew Nolte 18e317fb78 Fix inconsistent naming of generate scope arrays (#3840) 2023-02-01 17:30:02 -05:00
Wilson Snyder ef9f443532 Fix single-element replication to dynarray/unpacked/queue (#3548). 2023-01-31 22:43:41 -05:00
Wilson Snyder 6e3b957b30 Tests: Add iterate check (#3919) 2023-01-31 19:34:27 -05:00
Wilson Snyder aea1834ed8 Commentary (#3920) 2023-01-31 12:11:35 -05:00
Ryszard Rozak 7f3e178b68 Fix paramaterized class function linkage (#3917)
* Visit function arguments even if the function is unlinkable
* Don't use m_unlinedScopep in AstLambdaArgRef handling
2023-01-30 22:20:56 -05:00
Larry Doolittle 87a7881d46 Add SOURCE_DATE_EPOCH for docs/guide/conf.py (#3918) 2023-01-30 22:14:33 -05:00
Larry Doolittle 29f4821d78 Tests: Check Makefiles for stray tabs (#3914) 2023-01-30 07:31:39 -05:00
Larry Doolittle 9f9c84aa64 Internals: Avoid using <tab> in the middle of lines (#3913) 2023-01-29 22:39:22 -05:00
Larry Doolittle d80e0523cc Fix nonsensical permissions of some files in test_regress/t (#3912)
chmod a-x *.out *.v *.vlt
2023-01-29 20:32:19 -05:00
Wilson Snyder 164aa96953 Fix GCC warning (fixes recent #3510) 2023-01-29 17:34:48 -05:00
Wilson Snyder 6a12c4d02a Commentary: Changes update 2023-01-29 16:57:30 -05:00
Wilson Snyder 6a7dfb7696 Fix pattern assignment to unpacked structs (#3510). 2023-01-29 16:50:10 -05:00
Wilson Snyder 4208db7811 Support multiple-output buf/not gate primitives 2023-01-28 23:20:48 -05:00
Wilson Snyder a19dddf05e Fix real parameters of infinity and NaN. 2023-01-28 22:11:09 -05:00
Wilson Snyder 7855a78a0f Support %p of union with real 2023-01-28 21:41:50 -05:00
Wilson Snyder 248bd173d3 Support interface classes and class implements. 2023-01-28 18:06:37 -05:00
Wilson Snyder 8d2be855f5 Internals: Parsing and tests for class interfaces 2023-01-28 16:30:47 -05:00
Wilson Snyder ba8700f99d Support $changed_gclk, $fell_gclk, $rose_gclk, $stable_gclk 2023-01-28 14:05:26 -05:00
Wilson Snyder f20997a2f0 Support global clocking and $global_clock. 2023-01-28 12:31:52 -05:00
Wilson Snyder bea225e191 Fix duplicate name check on extern symbols 2023-01-28 11:55:44 -05:00
Wilson Snyder 93517b8378 Support unpacked unions. 2023-01-27 22:41:12 -05:00
Kamil Rakoczy a39c7f7dac Internals: Add V3ThreadPool class (#3898)
The thread pool is self tested, but not otherwise used by the code yet.
2023-01-27 10:43:50 -05:00
Wilson Snyder 5125b94fd8 Commentary (#3908) 2023-01-26 18:27:00 -05:00
Ilya Barkov d118a739dc Fix cinlude check (#3907) 2023-01-26 06:35:59 -05:00
Wilson Snyder c2a8810eb1 Tests: Check for new .pl file copyrights 2023-01-25 22:14:43 -05:00
Ryszard Rozak 91c44d7830 Support class extending its parameter (#3904) 2023-01-25 20:33:18 -05:00
Wilson Snyder 21aafe8f50 Tests: Fix file length issue (cousin of #3905) 2023-01-25 19:42:28 -05:00
Ryszard Rozak 4a8cfe367d Support function calls without parenthesis (#3903) (#3902)
Signed-off-by: Ryszard Rozak <[email protected]>
2023-01-24 15:36:30 +01:00
Ryszard Rozak b56e7f6910 Support static function variables (#3830) 2023-01-23 08:35:10 -05:00
Wilson Snyder 8a85cedaf5 Tests: Update test, part of (#3378) (#3892) 2023-01-23 07:23:42 -05:00
Varun Koyyalagunta be26e8da1b Support struct I/O in --lib-create (#3378) (#3892) 2023-01-22 22:24:36 -05:00
Wilson Snyder b2dd5de860 Tests: Fix some unusual check_finished cases. 2023-01-22 22:21:36 -05:00
Kamil Rakoczy 6ea725f479 Add --verilate-jobs option (#3889)
Currently this option isn't used, but in the future it will be used to specify parallelization of Verilation step.
2023-01-22 21:52:52 -05:00
Wilson Snyder 665758a68b devel release 2023-01-22 11:55:22 -05:00
7207 changed files with 306526 additions and 127802 deletions
+5
View File
@@ -63,6 +63,8 @@ ForEachMacros:
SortIncludes: true
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '"V3Pch.*\.h"'
Priority: -2 # Precompiled headers
- Regex: '"(config_build|verilated_config|verilatedos)\.h"'
Priority: -1 # Sepecials before main header
- Regex: '(<|")verilated.*'
@@ -112,6 +114,9 @@ SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 0
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
+1 -1
View File
@@ -1,4 +1,4 @@
Checks: '*,-hicpp*,-android-cloexec-fopen,-cert-dcl50-cpp,-cert-env33-c,-cert-err34-c,-cert-err58-cpp,-clang-analyzer-core.UndefinedBinaryOperatorResult,-clang-analyzer-security*,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-no-malloc,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-union-access,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-special-member-functions,-fuchsia-*,-google-default-arguments,-google-readability-todo,-google-runtime-references,-llvm-header-guard,-llvm-include-order,-misc-string-integer-assignment,-misc-string-literal-with-embedded-nul,-modernize-use-auto,-modernize-use-trailing-return-type,-readability-braces-around-statements,-readability-container-size-empty,-readability-delete-null-pointer,-readability-else-after-return,-readability-implicit-bool-conversion,-readability-named-parameter,-readability-static-accessed-through-instance'
Checks: '*,-hicpp*,-android-cloexec-fopen,-cert-dcl50-cpp,-cert-env33-c,-cert-err34-c,-cert-err58-cpp,-clang-analyzer-core.UndefinedBinaryOperatorResult,-clang-analyzer-security*,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-no-malloc,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-union-access,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-special-member-functions,-fuchsia-*,-google-default-arguments,-google-readability-todo,-google-runtime-references,-llvm-header-guard,-llvm-include-order,-misc-string-integer-assignment,-misc-string-literal-with-embedded-nul,-modernize-use-auto,-modernize-use-trailing-return-type,-readability-braces-around-statements,-readability-container-size-empty,-readability-delete-null-pointer,-readability-else-after-return,-readability-implicit-bool-conversion,-readability-named-parameter,-readability-static-accessed-through-instance,-llvmlibc-*,-altera-*'
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: none
+4 -4
View File
@@ -1,6 +1,6 @@
---
exclude_paths:
- '.github/**'
- 'ci/build_verilator.sh'
- 'include/vltstd/**'
- 'nodist/fastcov.py'
- ".github/**"
- "ci/build_verilator.sh"
- "include/vltstd/**"
- "nodist/fastcov.py"
+8
View File
@@ -0,0 +1,8 @@
{
"name": "Verilator Build Environment",
"build": {
"dockerfile": "../ci/docker/buildenv/Dockerfile"
}
}
+5 -1
View File
@@ -9,10 +9,14 @@ assignees: ''
Thanks for taking the time to report this.
Can you attach an example that shows the issue? (Must be openly licensed, ideally in test_regress format.)
Can you attach an example that shows the issue? (Must be openly licensed, completely self-contaned so can directly run what you provide. Ideally use test_regress format, see https://veripool.org/guide/latest/contributing.html?highlight=test_regress#reporting-bugs
What 'verilator' command line do we use to run your example?
What 'verilator --version' are you using? Did you try it with the git master version?
What OS and distribution are you using?
May we assist you in trying to fix this in Verilator yourself?
(Please avoid attaching screenshots that show text - you can convert images to text using e.g. https://ocr.space)
+2
View File
@@ -11,6 +11,8 @@ Thanks for taking the time to report this.
What would you like added/supported?
What 'verilator --version' are you using? Did you try it with the git master version?
Can you attach an example that runs on other simulators? (Must be openly licensed, ideally in test_regress format.)
May we assist you in trying to fix this in Verilator yourself?
+2
View File
@@ -8,3 +8,5 @@ assignees: ''
---
How may we help - what is your question?
(If reporting a bug or requesting a feature please use one of the other issue templates.)
+113 -92
View File
@@ -1,3 +1,4 @@
---
# DESCRIPTION: Github actions config
# This name is key to badges in README.rst, so we use the name build
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
@@ -9,7 +10,7 @@ on:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # weekly
- cron: '0 0 * * 0' # weekly
env:
CI_OS_NAME: linux
@@ -17,80 +18,74 @@ env:
CCACHE_COMPRESS: 1
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_LIMIT_MULTIPLE: 0.95
INSTALL_DIR: ${{ github.workspace }}/install
RELOC_DIR: ${{ github.workspace }}/relloc
defaults:
run:
shell: bash
working-directory: repo
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04]
compiler:
- { cc: clang, cxx: clang++ }
- { cc: gcc, cxx: g++ }
m32: [0, 1]
exclude:
# Build pull requests only with ubuntu-22.04 and without m32
- os: ${{ github.event_name == 'pull_request' && 'ubuntu-18.04' || 'do-not-exclude' }}
- os: ${{ github.event_name == 'pull_request' && 'ubuntu-20.04' || 'do-not-exclude' }}
- m32: ${{ github.event_name == 'pull_request' && 1 || 'do-not-exclude' }}
# Build -m32 only on ubuntu-22.04
- {os: ubuntu-18.04, m32: 1}
- {os: ubuntu-20.04, m32: 1}
- {cc: clang, cxx: clang++}
- {cc: gcc, cxx: g++}
include:
# Build GCC 10 on ubuntu-20.04
- os: ubuntu-20.04
compiler: { cc: gcc-10, cxx: g++-10 }
m32: 0
compiler: {cc: gcc-10, cxx: g++-10}
runs-on: ${{ matrix.os }}
name: Build | ${{ matrix.os }} | ${{ matrix.compiler.cc }} ${{ matrix.m32 && '| -m32' || '' }}
name: Build | ${{ matrix.os }} | ${{ matrix.compiler.cc }}
env:
CI_BUILD_STAGE_NAME: build
CI_RUNS_ON: ${{ matrix.os }}
CI_M32: ${{ matrix.m32 }}
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
CACHE_BASE_KEY: build-${{ matrix.os }}-${{ matrix.compiler.cc }}-m32=${{ matrix.m32 }}
CCACHE_MAXSIZE: 250M # Per build matrix entry (2000M in total)
VERILATOR_ARCHIVE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}${{ matrix.m32 && '-m32' || '' }}.tar.gz
CACHE_BASE_KEY: build-${{ matrix.os }}-${{ matrix.compiler.cc }}
CCACHE_MAXSIZE: 1000M # Per build matrix entry (* 5 = 5000M in total)
VERILATOR_ARCHIVE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}.tar.gz
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: repo
- name: Checkout
uses: actions/checkout@v4
with:
path: repo
- name: Cache $CCACHE_DIR
uses: actions/cache@v3
env:
CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ env.CACHE_KEY }}-${{ github.sha }}
restore-keys: |
${{ env.CACHE_KEY }}-
- name: Cache $CCACHE_DIR
uses: actions/cache@v4
env:
CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ env.CACHE_KEY }}-${{ github.sha }}
restore-keys: |
${{ env.CACHE_KEY }}-
- name: Install packages for build
run: ./ci/ci-install.bash
- name: Install packages for build
run: ./ci/ci-install.bash
- name: Build
run: ./ci/ci-script.bash
- name: Build
run: ./ci/ci-script.bash
- name: Tar up repository
working-directory: ${{ github.workspace }}
run: tar --posix -c -z -f ${{ env.VERILATOR_ARCHIVE }} repo
- name: Upload tar archive
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/${{ env.VERILATOR_ARCHIVE }}
name: ${{ env.VERILATOR_ARCHIVE }}
- name: Tar up repository
working-directory: ${{ github.workspace }}
run: tar --posix -c -z -f ${{ env.VERILATOR_ARCHIVE }} repo
- name: Upload tar archive
uses: actions/upload-artifact@v4
with:
path: ${{ github.workspace }}/${{ env.VERILATOR_ARCHIVE }}
name: ${{ env.VERILATOR_ARCHIVE }}
test:
needs: build
@@ -99,62 +94,88 @@ jobs:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
compiler:
- { cc: clang, cxx: clang++ }
- { cc: gcc, cxx: g++ }
m32: [0, 1]
suite: [dist-vlt-0, dist-vlt-1, dist-vlt-2, vltmt-0, vltmt-1]
exclude:
# Build pull requests only with ubuntu-22.04 and without m32
- os: ${{ github.event_name == 'pull_request' && 'ubuntu-18.04' || 'do-not-exclude' }}
- os: ${{ github.event_name == 'pull_request' && 'ubuntu-20.04' || 'do-not-exclude' }}
- m32: ${{ github.event_name == 'pull_request' && 1 || 'do-not-exclude' }}
# Build -m32 only on ubuntu-22.04
- {os: ubuntu-18.04, m32: 1}
- {os: ubuntu-20.04, m32: 1}
- {cc: clang, cxx: clang++}
- {cc: gcc, cxx: g++}
reloc: [0]
suite: [dist-vlt-0, dist-vlt-1, dist-vlt-2, dist-vlt-3, vltmt-0, vltmt-1]
include:
# Test with GCC 10 on ubuntu-20.04 without m32
- {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, m32: 0, suite: dist-vlt-0}
- {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, m32: 0, suite: dist-vlt-1}
- {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, m32: 0, suite: dist-vlt-2}
- {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, m32: 0, suite: vltmt-0}
- {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, m32: 0, suite: vltmt-1}
# Test with GCC 10 on ubuntu-20.04, also test relocation
- {os: ubuntu-20.04, compiler: {cc: gcc-10, cxx: g++-10}, reloc: 1, suite: dist-vlt-0}
- {os: ubuntu-20.04, compiler: {cc: gcc-10, cxx: g++-10}, reloc: 1, suite: dist-vlt-1}
- {os: ubuntu-20.04, compiler: {cc: gcc-10, cxx: g++-10}, reloc: 1, suite: dist-vlt-2}
- {os: ubuntu-20.04, compiler: {cc: gcc-10, cxx: g++-10}, reloc: 1, suite: dist-vlt-3}
- {os: ubuntu-20.04, compiler: {cc: gcc-10, cxx: g++-10}, reloc: 1, suite: vltmt-0}
- {os: ubuntu-20.04, compiler: {cc: gcc-10, cxx: g++-10}, reloc: 1, suite: vltmt-1}
# Ubuntu 24.04 only on GCC; not passing on clang yet
- {os: ubuntu-24.04, compiler: {cc: gcc, cxx: g++}, suite: dist-vlt-0}
- {os: ubuntu-24.04, compiler: {cc: gcc, cxx: g++}, suite: dist-vlt-1}
- {os: ubuntu-24.04, compiler: {cc: gcc, cxx: g++}, suite: dist-vlt-2}
- {os: ubuntu-24.04, compiler: {cc: gcc, cxx: g++}, suite: dist-vlt-3}
- {os: ubuntu-24.04, compiler: {cc: gcc, cxx: g++}, suite: vltmt-0}
- {os: ubuntu-24.04, compiler: {cc: gcc, cxx: g++}, suite: vltmt-1}
runs-on: ${{ matrix.os }}
name: Test | ${{ matrix.os }} | ${{ matrix.compiler.cc }} | ${{ matrix.suite }} ${{ matrix.m32 && '| -m32' || '' }}
name: Test | ${{ matrix.os }} | ${{ matrix.compiler.cc }} | ${{ matrix.reloc && 'reloc | ' || '' }} ${{ matrix.suite }}
env:
CI_BUILD_STAGE_NAME: test
CI_RUNS_ON: ${{ matrix.os }}
CI_M32: ${{ matrix.m32 }}
CI_RELOC: ${{ matrix.reloc }}
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
CACHE_BASE_KEY: test-${{ matrix.os }}-${{ matrix.compiler.cc }}-m32=${{ matrix.m32 }}-${{ matrix.suite }}
CCACHE_MAXSIZE: 64M # Per build matrix entry (2160M in total)
VERILATOR_ARCHIVE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}${{ matrix.m32 && '-m32' || '' }}.tar.gz
CACHE_BASE_KEY: test-${{ matrix.os }}-${{ matrix.compiler.cc }}-${{ matrix.reloc }}-${{ matrix.suite }}
CCACHE_MAXSIZE: 100M # Per build per suite (* 5 * 5 = 2500M in total)
VERILATOR_ARCHIVE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}.tar.gz
steps:
- name: Download tar archive
uses: actions/download-artifact@v3
with:
name: ${{ env.VERILATOR_ARCHIVE }}
path: ${{ github.workspace }}
- name: Download tar archive
uses: actions/download-artifact@v4
with:
name: ${{ env.VERILATOR_ARCHIVE }}
path: ${{ github.workspace }}
- name: Unpack tar archive
working-directory: ${{ github.workspace }}
run: tar -x -z -f ${{ env.VERILATOR_ARCHIVE }}
- name: Unpack tar archive
working-directory: ${{ github.workspace }}
run: tar -x -z -f ${{ env.VERILATOR_ARCHIVE }}
- name: Cache $CCACHE_DIR
uses: actions/cache@v3
env:
CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ env.CACHE_KEY }}-${{ github.sha }}
restore-keys: |
${{ env.CACHE_KEY }}-
- name: Cache $CCACHE_DIR
uses: actions/cache@v4
env:
CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache2
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ env.CACHE_KEY }}-${{ github.sha }}
restore-keys: |
${{ env.CACHE_KEY }}-
- name: Install test dependencies
run: ./ci/ci-install.bash
- name: Install test dependencies
run: ./ci/ci-install.bash
- name: Test
env:
TESTS: ${{ matrix.suite }}
run: ./ci/ci-script.bash
- name: Test
env:
TESTS: ${{ matrix.suite }}
run: ./ci/ci-script.bash
lint-py:
runs-on: ubuntu-22.04
name: Lint Python
env:
CI_BUILD_STAGE_NAME: build
CI_RUNS_ON: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: repo
- name: Install packages for build
run: ./ci/ci-install.bash
# We use specific version numbers, otherwise a Python package
# update may add a warning and break our build
- name: Install packages for lint
run: sudo pip3 install pylint==3.0.2 ruff==0.1.3 clang sphinx sphinx_rtd_theme sphinxcontrib-spelling breathe ruff
- name: Configure
run: autoconf && ./configure --enable-longtests --enable-ccwarn
- name: Lint
run: make -k lint-py
+4 -5
View File
@@ -1,17 +1,16 @@
---
# DESCRIPTION: Github actions config
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
#
name: Contributor Agreement
on:
push:
pull_request:
workflow_dispatch:
jobs:
Test:
name: "'docs/CONTRIBUTORS' was signed"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: test_regress/t/t_dist_contributors.pl
- uses: actions/checkout@v4
- run: test_regress/t/t_dist_contributors.py
+42 -49
View File
@@ -1,3 +1,4 @@
---
# DESCRIPTION: Github actions config
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
@@ -6,12 +7,11 @@ name: coverage
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # weekly
- cron: '0 0 * * 0' # weekly
env:
CI_OS_NAME: linux
CI_COMMIT: ${{ github.sha }}
CI_M32: 0
COVERAGE: 1
VERILATOR_ARCHIVE: verilator-coverage-${{ github.sha }}.tar.gz
@@ -22,7 +22,6 @@ defaults:
jobs:
Build:
runs-on: ubuntu-22.04
env:
@@ -30,49 +29,36 @@ jobs:
CI_RUNS_ON: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: repo
- name: Checkout
uses: actions/checkout@v4
with:
path: repo
- name: Install packages for build
run: ./ci/ci-install.bash
- name: Install packages for build
run: ./ci/ci-install.bash
- name: Build
run: ./ci/ci-script.bash
- name: Build
run: ./ci/ci-script.bash
- name: Tar up repository
working-directory: ${{ github.workspace }}
run: tar --posix -c -z -f ${{ env.VERILATOR_ARCHIVE }} repo
- name: Upload tar archive
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/${{ env.VERILATOR_ARCHIVE }}
name: ${{ env.VERILATOR_ARCHIVE }}
- name: Tar up repository
working-directory: ${{ github.workspace }}
run: tar --posix -c -z -f ${{ env.VERILATOR_ARCHIVE }} repo
- name: Upload tar archive
uses: actions/upload-artifact@v4
with:
path: ${{ github.workspace }}/${{ env.VERILATOR_ARCHIVE }}
name: ${{ env.VERILATOR_ARCHIVE }}
Test:
needs: Build
strategy:
fail-fast: false
matrix:
test:
- vlt-
- vltmt-
num:
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
test: [vlt-, vltmt-]
num: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
include:
- { test: dist, num: '' }
- {test: dist, num: ''}
runs-on: ubuntu-22.04
name: test-${{ matrix.test }}${{ matrix.num }}
env:
@@ -80,20 +66,27 @@ jobs:
CI_RUNS_ON: ubuntu-22.04
steps:
- name: Download tar archive
uses: actions/download-artifact@v3
with:
name: ${{ env.VERILATOR_ARCHIVE }}
path: ${{ github.workspace }}
- name: Download tar archive
uses: actions/download-artifact@v4
with:
name: ${{ env.VERILATOR_ARCHIVE }}
path: ${{ github.workspace }}
- name: Unpack tar archive
working-directory: ${{ github.workspace }}
run: tar -x -z -f ${{ env.VERILATOR_ARCHIVE }}
- name: Unpack tar archive
working-directory: ${{ github.workspace }}
run: tar -x -z -f ${{ env.VERILATOR_ARCHIVE }}
- name: Install test dependencies
run: ./ci/ci-install.bash
- name: Install test dependencies
run: ./ci/ci-install.bash
- name: Test
env:
TESTS: coverage-${{ matrix.test }}${{ matrix.num }}
run: ./ci/ci-script.bash
- name: Test
env:
TESTS: coverage-${{ matrix.test }}${{ matrix.num }}
run: ./ci/ci-script.bash
- name: Upload coverage data to Codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
find . -name '*.gcno' -exec rm {} \;
./ci/codecov -v upload-process -Z --sha ${{ github.sha }} -f nodist/obj_dir/coverage/app_total.info
+86
View File
@@ -0,0 +1,86 @@
---
# Build and push verilator docker image when tags are pushed to the repository.
# The following variable(s) must be configured in the github repository:
# DOCKER_HUB_NAMESPACE: docker hub namespace.
# The following secrets must be configured in the github repository:
# DOCKER_HUB_USER: user name for logging into docker hub
# DOCKER_HUB_ACCESS_TOKEN: docker hub access token.
name: Build Verilator Container
on:
push:
tags: ['v*']
workflow_dispatch:
inputs:
manual_tag:
description: 'Git tag to use for image build'
required: true
type: string
add_latest_tag:
description: 'Tag workflow_dispatch docker image as "latest"'
required: true
type: boolean
default: false
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
contexts:
- "ci/docker/run:verilator"
# - "ci/docker/buildenv:verilator-buildenv"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract context variables
run: |
echo "${{ matrix.contexts }}" | sed -r 's/(.*):.*/build_context=\1/' >> "$GITHUB_ENV"
echo "${{ matrix.contexts }}" | sed -r 's/.*:(.*)/image_name=\1/' >> "$GITHUB_ENV"
echo "git_tag=${GITHUB_REF#refs/*/}" >> "$GITHUB_ENV"
- name: Use manual tag
if: ${{ inputs.manual_tag }}
run: |
echo "git_tag=${{ inputs.manual_tag }}" >> "$GITHUB_ENV"
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: |
${{ vars.DOCKER_HUB_NAMESPACE }}/${{ env.image_name }}
tags: |
type=match,pattern=(v.*),group=1,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=raw,value=${{ inputs.manual_tag }},enable=${{ inputs.manual_tag != '' }}
type=raw,value=latest,enable=${{ inputs.add_latest_tag == true }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
buildkitd-flags: --debug
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and Push to Docker
uses: docker/build-push-action@v4
if: startsWith(github.ref, 'refs/tags/v')
with:
context: ${{ env.build_context }}
build-args: SOURCE_COMMIT=${{ env.git_tag }}
platforms: linux/arm64,linux/amd64
push: ${{ !env.ACT && startsWith(github.ref, 'refs/tags/v') }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
+3 -5
View File
@@ -1,13 +1,12 @@
---
# DESCRIPTION: Github actions config
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
#
name: format
on:
push:
pull_request_target:
workflow_dispatch:
jobs:
format:
runs-on: ubuntu-22.04
@@ -16,10 +15,9 @@ jobs:
CI_OS_NAME: linux
CI_RUNS_ON: ubuntu-22.04
CI_COMMIT: ${{ github.sha }}
CI_M32: 0
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install packages for build
+28 -29
View File
@@ -1,51 +1,50 @@
---
# DESCRIPTION: Github actions config
# This name is key to badges in README.rst, so we use the name build
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
#
name: msbuild
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # weekly
- cron: 0 0 * * 0 # weekly
env:
CI_OS_NAME: win
CI_COMMIT: ${{ github.sha }}
CCACHE_COMPRESS: 1
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_LIMIT_MULTIPLE: 0.95
defaults:
run:
working-directory: repo
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
windows:
windows:
name: run on windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
path: repo
- name: Cache $CCACHE_DIR
uses: actions/cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: msbuild-msvc-cmake
- name: compile
env:
WIN_FLEX_BISON: ${{ github.workspace }}/.ccache
run: ./ci/ci-win-compile.ps1
- name: test build
run: ./ci/ci-win-test.ps1
- name: Zip up repository
run: Compress-Archive -LiteralPath install -DestinationPath verilator.zip
- name: Upload zip archive
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/repo/verilator.zip
name: verilator-win.zip
- uses: actions/checkout@v4
with:
path: repo
- name: Cache $CCACHE_DIR
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: msbuild-msvc-cmake
- name: compile
env:
WIN_FLEX_BISON: ${{ github.workspace }}/.ccache
run: ./ci/ci-win-compile.ps1
- name: test build
run: ./ci/ci-win-test.ps1
- name: Zip up repository
run: Compress-Archive -LiteralPath install -DestinationPath verilator.zip
- name: Upload zip archive
uses: actions/upload-artifact@v4
with:
path: ${{ github.workspace }}/repo/verilator.zip
name: verilator-win.zip
+13 -4
View File
@@ -29,15 +29,24 @@ dddrun*
doxygen-doc
gdbrun*
gmon.out
ncverilog.history
internals.txt
ncverilog.history
nohup.out
verilator-config-version.cmake
verilator-config.cmake
verilator.pc
verilator.txt
verilator_bin*
verilator_coverage_bin*
verilator.pc
verilator-config.cmake
verilator-config-version.cmake
**/__pycache__/*
**/_build/*
**/obj_dir/*
/.vscode/
/.idea/
/cmake-build-*/
/test_regress/snapshot/
xmverilog.*
xrun.history
# Normal CMake build directory
/build
+8
View File
@@ -0,0 +1,8 @@
---
- id: verilator
name: verilator-lint
description: Runs verilator Docker image to lint (System) Verilog designs
args: [--lint-only]
language: docker_image
entry: verilator/verilator:latest
types_or: [verilog, system-verilog]
+4
View File
@@ -0,0 +1,4 @@
[style]
based_on_style = pep8
column_limit = 99
#split_before_arithmetic_operator=True
+27
View File
@@ -0,0 +1,27 @@
# See https://citation-file-format.github.io/
cff-version: 1.2.0
title: Verilator
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Wilson
family-names: Snyder
email: [email protected]
affiliation: Veripool
- given-names: Paul
family-names: Wasson
- given-names: Duane
family-names: Galbi
- name: 'et al'
repository-code: 'https://github.com/verilator/verilator'
url: 'https://verilator.org'
abstract: >-
The Verilator package converts Verilog and SystemVerilog hardware
description language (HDL) designs into a fast C++ or SystemC model
that, after compiling, can be executed. Verilator is not a
traditional simulator but a compiler.
license:
- LGPL-3.0-only
- Artistic-2.0
+97 -35
View File
@@ -4,7 +4,7 @@
#
#*****************************************************************************
#
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
# Copyright 2003-2025 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
@@ -14,44 +14,76 @@
cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0091 NEW) # Use MSVC_RUNTIME_LIBRARY to select the runtime
project(Verilator
VERSION 5.003
project(
Verilator
VERSION 5.034
HOMEPAGE_URL https://verilator.org
LANGUAGES CXX
)
option(DEBUG_AND_RELEASE_AND_COVERAGE
"Builds both the debug and release binaries, overriding CMAKE_BUILD_TYPE. Not supported under MSBuild.")
# Set default build type to Release if not specified
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE)
endif()
set(PYTHON3 python)
set(CMAKE_INSTALL_DATADIR ${CMAKE_INSTALL_PREFIX})
option(
DEBUG_AND_RELEASE_AND_COVERAGE
"Builds both the debug and release binaries, overriding CMAKE_BUILD_TYPE. Not supported under MSBuild."
)
find_package(Python3 COMPONENTS Interpreter)
set(PYTHON3 ${Python3_EXECUTABLE})
# See also CMake built-in; CMAKE_INSTALL_PREFIX is applied by the install command.
set(CMAKE_INSTALL_DATADIR .)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
include(CheckStructHasMember)
include(ExternalProject)
include(FindThreads)
if (NOT WIN32)
if(NOT WIN32)
message(WARNING "CMake support on Linux/OSX is experimental.")
endif()
if (MSVC)
if (DEFINED ENV{WIN_FLEX_BISON})
if(WIN32)
if(DEFINED ENV{WIN_FLEX_BISON})
set(WIN_FLEX_BISON "$ENV{WIN_FLEX_BISON}")
endif()
if (EXISTS ${WIN_FLEX_BISON})
if(EXISTS ${WIN_FLEX_BISON})
list(APPEND CMAKE_PREFIX_PATH ${WIN_FLEX_BISON})
endif()
if (NOT WIN_FLEX_BISON)
message(FATAL_ERROR "Please install https://github.com/lexxmark/winflexbison and set WIN_FLEX_BISON environment variable. Please use install cmake target after a successful build.")
if(NOT WIN_FLEX_BISON)
message(
FATAL_ERROR
"Please install https://github.com/lexxmark/winflexbison and set WIN_FLEX_BISON environment variable. Please use install cmake target after a successful build."
)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++20")
else()
if (NOT DEFINED ENV{FLEX_INCLUDE})
message(FATAL_ERROR "Please set environment variable FLEX_INCLUDE to the directory containing FlexLexer.h")
set(CMAKE_CXX_STANDARD 20)
endif()
set(OBJCACHE "" CACHE STRING "Path for ccache, auto-detected if empty")
option(OBJCACHE_ENABLED "Compile Verilator with ccache" ON)
if(OBJCACHE_ENABLED)
if(OBJCACHE STREQUAL "")
find_program(OBJCACHE_PATH ccache)
if(OBJCACHE_PATH STREQUAL "OBJCACHE_PATH-NOTFOUND")
set(OBJCACHE_PATH "")
endif()
else()
set(OBJCACHE_PATH "${OBJCACHE}")
endif()
set(WIN_FLEX_BISON "$ENV{FLEX_INCLUDE}")
if (WIN32 AND NOT MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
if(NOT OBJCACHE_PATH STREQUAL "")
execute_process(
COMMAND "${OBJCACHE_PATH}" --version
OUTPUT_VARIABLE objcache_version
)
string(REGEX MATCH "[^\n\r]+" objcache_version "${objcache_version}")
message(
STATUS
"Found ccache: ${OBJCACHE_PATH} (\"${objcache_version}\")"
)
set(CMAKE_CXX_COMPILER_LAUNCHER "${OBJCACHE_PATH}")
endif()
endif()
@@ -61,8 +93,8 @@ find_package(FLEX)
# Build
#set_property(GLOBAL PROPERTY JOB_POOLS one_job=1)
if (DEBUG_AND_RELEASE_AND_COVERAGE)
if (CMAKE_GENERATOR MATCHES "^Visual Studio ")
if(DEBUG_AND_RELEASE_AND_COVERAGE)
if(CMAKE_GENERATOR MATCHES "^Visual Studio ")
error("%Error: The DEBUG_AND_RELEASE_AND_COVERAGE option is not supported in MSBuild-based builds.")
endif()
set(saved_build_type ${CMAKE_BUILD_TYPE})
@@ -81,43 +113,73 @@ endif()
set(PACKAGE_NAME ${PROJECT_NAME})
set(PACKAGE_VERSION ${PROJECT_VERSION})
set(CXX ${CMAKE_CXX_COMPILER})
set(AR ${CMAKE_AR})
configure_file(include/verilated_config.h.in include/verilated_config.h @ONLY)
configure_file(include/verilated.mk.in include/verilated.mk @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/verilated_config.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
configure_package_config_file(verilator-config.cmake.in verilator-config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/include/verilated_config.h
DESTINATION include
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/include/verilated.mk
DESTINATION include
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/verilator-config.cmake DESTINATION ${CMAKE_INSTALL_PREFIX})
configure_package_config_file(verilator-config-version.cmake.in verilator-config-version.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}
configure_package_config_file(
verilator-config.cmake.in
verilator-config.cmake
INSTALL_DESTINATION .
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/verilator-config-version.cmake DESTINATION ${CMAKE_INSTALL_PREFIX})
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/verilator-config.cmake
DESTINATION .
)
foreach (program
configure_package_config_file(
verilator-config-version.cmake.in
verilator-config-version.cmake
INSTALL_DESTINATION .
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/verilator-config-version.cmake
DESTINATION .
)
foreach(
program
verilator
verilator_gantt
verilator_ccache_report
verilator_difftree
verilator_profcfunc
verilator_includer
)
install(PROGRAMS bin/${program} TYPE BIN)
endforeach()
install(DIRECTORY examples TYPE DATA FILES_MATCHING
install(
DIRECTORY examples
TYPE DATA
FILES_MATCHING
PATTERN "examples/*/*.[chv]*"
PATTERN "examples/*/Makefile*"
PATTERN "examples/*/CMakeLists.txt"
)
install(DIRECTORY include TYPE DATA FILES_MATCHING
install(
DIRECTORY include
TYPE DATA
FILES_MATCHING
PATTERN "include/verilated_config.h"
PATTERN "include/verilated.mk"
PATTERN "include/*.[chv]"
PATTERN "include/*.cpp"
PATTERN "include/*.vlt"
PATTERN "include/*.sv"
PATTERN "include/gtkwave/*.[chv]*"
PATTERN "include/vltstd/*.[chv]*"
)
+939 -29
View File
File diff suppressed because it is too large Load Diff
+171 -74
View File
@@ -7,7 +7,7 @@
#
#*****************************************************************************
#
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
# Copyright 2003-2025 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
@@ -15,13 +15,13 @@
#
#****************************************************************************/
#
# make all to compile and build Verilator.
# make install to install it.
# make TAGS to update tags tables.
# make all to compile and build Verilator.
# make install to install it.
# make TAGS to update tags tables.
#
# make clean or make mostlyclean
# Delete all files from the current directory that are normally
# created by building the program. Don't delete the files that
# created by building the program. Don't delete the files that
# record the configuration. Also preserve files that could be made
# by building, but normally aren't because the distribution comes
# with them.
@@ -52,6 +52,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
MAKEINFO = makeinfo
POD2TEXT = pod2text
PYTHON3 = @PYTHON3@
MKINSTALLDIRS = $(SHELL) $(srcdir)/src/mkinstalldirs
# Version (for docs/guide/conf.py)
@@ -76,7 +77,7 @@ datadir = @datadir@
# Directory in which to install documentation info files.
infodir = @infodir@
# Directory in which to install package specific files
# Directory in which to install package-specific files
# Generally ${prefix}/share/verilator
pkgdatadir = @pkgdatadir@
@@ -91,10 +92,12 @@ datarootdir = @datarootdir@
CFG_WITH_CCWARN = @CFG_WITH_CCWARN@
CFG_WITH_DEFENV = @CFG_WITH_DEFENV@
CFG_WITH_LONGTESTS = @CFG_WITH_LONGTESTS@
CFG_WITH_SOLVER = @CFG_WITH_SOLVER@
PACKAGE_VERSION = @PACKAGE_VERSION@
#### End of system configuration section. ####
######################################################################
# Main build targets
.SUFFIXES:
@@ -112,7 +115,7 @@ SUBDIRS = docs src test_regress \
examples/make_tracing_c \
examples/make_tracing_sc \
examples/make_protect_lib \
examples/xml_py \
examples/json_py \
INFOS = verilator.html verilator.pdf
@@ -145,6 +148,9 @@ verilator_exe verilator_bin$(EXEEXT) verilator_bin_dbg$(EXEEXT) verilator_covera
@echo "making verilator in src"
$(MAKE) -C src $(OBJCACHE_JOBS)
######################################################################
# Tests
.PHONY:msg_test
msg_test: all_nomsg
@echo "Build complete!"
@@ -153,9 +159,9 @@ msg_test: all_nomsg
@echo
.PHONY: test
ifeq ($(CFG_WITH_LONGTESTS),yes) # Local... Else don't burden users
ifeq ($(CFG_WITH_LONGTESTS),yes) # Local... Else don't burden users
test: smoke-test test_regress
# examples is part of test_regress's test_regress/t/t_a2_examples.pl
# examples is part of test_regress's test_regress/t/t_a2_examples.py
# (because that allows it to run in parallel with other test_regress's)
else
test: smoke-test examples
@@ -167,19 +173,26 @@ endif
@echo
smoke-test: all_nomsg
test_regress/t/t_a1_first_cc.pl
test_regress/t/t_a2_first_sc.pl
test_regress/t/t_a1_first_cc.py
test_regress/t/t_a2_first_sc.py
test_regress: all_nomsg
$(MAKE) -C test_regress
.PHONY: test-snap test-diff
test-snap test-diff:
$(MAKE) -C test_regress $@
examples: all_nomsg
for p in $(EXAMPLES) ; do \
$(MAKE) -C $$p VERILATOR_ROOT=`pwd` || exit 10; \
done
######################################################################
# Docs
.PHONY: docs
docs: info
docs: info $(VL_INST_MAN_FILES)
info: $(INFOS)
@@ -188,7 +201,8 @@ verilator.1: ${srcdir}/bin/verilator
verilator_coverage.1: ${srcdir}/bin/verilator_coverage
pod2man $< $@
%.1: ${srcdir}/bin/%
help2man --no-info --no-discard-stderr --version-string=- $< -o $@
help2man --no-info --no-discard-stderr --version-string=- \
-n "$(shell $< --help | head -n 3 | tail -n 1)" $< -o $@
.PHONY: verilator.html
verilator.html:
@@ -199,11 +213,35 @@ verilator.html:
verilator.pdf: Makefile
$(MAKE) -C docs verilator.pdf
# See uninstall also - don't put wildcards in this variable, it might uninstall other stuff
VL_INST_BIN_FILES = verilator verilator_bin$(EXEEXT) verilator_bin_dbg$(EXEEXT) verilator_coverage_bin_dbg$(EXEEXT) \
verilator_ccache_report verilator_coverage verilator_difftree verilator_gantt verilator_includer verilator_profcfunc
# Some scripts go into both the search path and pkgdatadir,
# so they can be found by the user, and under $VERILATOR_ROOT.
TAGFILES=${srcdir}/*/*.cpp ${srcdir}/*/*.h ${srcdir}/*/*.in \
${srcdir}/*.in ${srcdir}/*.pod
TAGS: $(TAGFILES)
etags $(TAGFILES)
.PHONY: doxygen
doxygen:
$(MAKE) -C docs doxygen
######################################################################
# Install
# Public executables intended to be invoked directly by the user
# Don't put wildcards in these variables, it might cause an uninstall of other stuff
VL_INST_PUBLIC_SCRIPT_FILES = verilator \
verilator_coverage \
verilator_gantt \
verilator_profcfunc \
VL_INST_PUBLIC_BIN_FILES = verilator_bin$(EXEEXT) \
verilator_bin_dbg$(EXEEXT) \
verilator_coverage_bin_dbg$(EXEEXT) \
# Private executabels intended to be invoked by internals
# Don't put wildcards in these variables, it might cause an uninstall of other stuff
VL_INST_PRIVATE_SCRIPT_FILES = verilator_ccache_report \
verilator_includer \
VL_INST_INC_BLDDIR_FILES = \
include/verilated_config.h \
@@ -212,6 +250,7 @@ VL_INST_INC_BLDDIR_FILES = \
# Files under srcdir, instead of build time
VL_INST_INC_SRCDIR_FILES = \
include/*.[chv]* \
include/*.vlt \
include/*.sv \
include/gtkwave/*.[chv]* \
include/vltstd/*.[chv]* \
@@ -222,19 +261,38 @@ VL_INST_DATA_SRCDIR_FILES = \
examples/*/Makefile* \
examples/*/vl_* \
installbin:
$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator $(DESTDIR)$(bindir)/verilator )
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_coverage $(DESTDIR)$(bindir)/verilator_coverage )
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_gantt $(DESTDIR)$(bindir)/verilator_gantt )
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_profcfunc $(DESTDIR)$(bindir)/verilator_profcfunc )
( cd bin ; $(INSTALL_PROGRAM) verilator_bin$(EXEEXT) $(DESTDIR)$(bindir)/verilator_bin$(EXEEXT) )
( cd bin ; $(INSTALL_PROGRAM) verilator_bin_dbg$(EXEEXT) $(DESTDIR)$(bindir)/verilator_bin_dbg$(EXEEXT) )
( cd bin ; $(INSTALL_PROGRAM) verilator_coverage_bin_dbg$(EXEEXT) $(DESTDIR)$(bindir)/verilator_coverage_bin_dbg$(EXEEXT) )
mkbindirs:
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/bin
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_includer $(DESTDIR)$(pkgdatadir)/bin/verilator_includer )
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_ccache_report $(DESTDIR)$(pkgdatadir)/bin/verilator_ccache_report )
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_difftree $(DESTDIR)$(pkgdatadir)/bin/verilator_difftree )
$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
installbin: | mkbindirs
cd $(srcdir)/bin; \
for p in $(VL_INST_PUBLIC_SCRIPT_FILES) ; do \
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \
done
perl -p -i -e 'use File::Spec;' \
-e' $$path = File::Spec->abs2rel("$(realpath $(DESTDIR)$(pkgdatadir))", "$(realpath $(DESTDIR)$(bindir))");' \
-e 's/my \$$verilator_pkgdatadir_relpath = .*/my \$$verilator_pkgdatadir_relpath = "$$path";/g' \
-- "$(DESTDIR)/$(bindir)/verilator"
cd bin; \
for p in $(VL_INST_PUBLIC_BIN_FILES) ; do \
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \
done
cd $(srcdir)/bin; \
for p in $(VL_INST_PRIVATE_SCRIPT_FILES) ; do \
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkgdatadir)/bin/$$p; \
done
installredirect: installbin | mkbindirs
cp ${srcdir}/bin/redirect ${srcdir}/bin/redirect.tmp
perl -p -i -e 'use File::Spec;' \
-e' $$path = File::Spec->abs2rel("$(realpath $(DESTDIR)$(bindir))", "$(realpath $(DESTDIR)$(pkgdatadir)/bin)");' \
-e 's/RELPATH.*/"$$path";/g' -- "${srcdir}/bin/redirect.tmp"
cd $(srcdir)/bin; \
for p in $(VL_INST_PUBLIC_SCRIPT_FILES) $(VL_INST_PUBLIC_BIN_FILES) ; do \
$(INSTALL_PROGRAM) redirect.tmp $(DESTDIR)$(pkgdatadir)/bin/$$p; \
done
rm ${srcdir}/bin/redirect.tmp
# Man files can either be part of the original kit, or built in current directory
# So important we use $^ so VPATH is searched
@@ -265,7 +323,7 @@ installdata:
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_c
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_sc
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_protect_lib
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/xml_py
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/json_py
cd $(srcdir) \
; for p in $(VL_INST_DATA_SRCDIR_FILES) ; do \
$(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \
@@ -277,8 +335,11 @@ installdata:
# We don't trust rm -rf, so rmdir instead as it will fail if user put in other files
uninstall:
-cd $(DESTDIR)$(bindir) && rm -f $(VL_INST_BIN_FILES)
-cd $(DESTDIR)$(pkgdatadir)/bin && rm -f $(VL_INST_BIN_FILES)
-cd $(DESTDIR)$(bindir) && rm -f $(VL_INST_PUBLIC_SCRIPT_FILES)
-cd $(DESTDIR)$(bindir) && rm -f $(VL_INST_PUBLIC_BIN_FILES)
-cd $(DESTDIR)$(pkgdatadir)/bin && rm -f $(VL_INST_PUBLIC_SCRIPT_FILES)
-cd $(DESTDIR)$(pkgdatadir)/bin && rm -f $(VL_INST_PUBLIC_BIN_FILES)
-cd $(DESTDIR)$(pkgdatadir)/bin && rm -f $(VL_INST_PRIVATE_SCRIPT_FILES)
-cd $(DESTDIR)$(mandir)/man1 && rm -f $(VL_INST_MAN_FILES)
-cd $(DESTDIR)$(pkgdatadir) && rm -f $(VL_INST_INC_BLDDIR_FILES)
-cd $(DESTDIR)$(pkgdatadir) && rm -f $(VL_INST_INC_SRCDIR_FILES)
@@ -301,16 +362,29 @@ uninstall:
-rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_c
-rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_sc
-rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_protect_lib
-rmdir $(DESTDIR)$(pkgdatadir)/examples/xml_py
-rmdir $(DESTDIR)$(pkgdatadir)/examples/json_py
-rmdir $(DESTDIR)$(pkgdatadir)/examples
-rmdir $(DESTDIR)$(pkgdatadir)
-rmdir $(DESTDIR)$(pkgconfigdir)
install: all_nomsg install-all
install-all: installbin installman installdata install-msg
install-all: installbin installredirect installman installdata install-msg
install-here: installman info
install-msg:
@echo
@echo "Installed binaries to $(DESTDIR)$(bindir)/verilator"
@echo "Installed man to $(DESTDIR)$(mandir)/man1"
@echo "Installed examples to $(DESTDIR)$(pkgdatadir)/examples"
@echo
@echo "For documentation see 'man verilator' or 'verilator --help'"
@echo "For forums and to report bugs see https://verilator.org"
@echo
######################################################################
# Format/Lint
# Use --xml flag to see the cppcheck code to use for suppression
CPPCHECK1_CPP = $(wildcard $(srcdir)/include/*.cpp)
CPPCHECK2_CPP = $(wildcard $(srcdir)/examples/*/*.cpp)
@@ -336,7 +410,7 @@ CPPCHECK_FLAGS = --enable=all --inline-suppr \
--suppress=useStlAlgorithm
CPPCHECK_FLAGS += --xml
CPPCHECK_DEP = $(subst .cpp,.cppcheck,$(CHECK_CPP))
CPPCHECK_INC = -I$(srcdir)/include -I$(srcdir)/src/obj_dbg -I$(srcdir)/src
CPPCHECK_INC = -I$(srcdir)/include -I$(srcdir)/include/gtkwave -I$(srcdir)/include/vltstd -I$(srcdir)/src/obj_dbg -I$(srcdir)/src
cppcheck: cppcheck-1 cppcheck-2 cppcheck-3 cppcheck-4 cppcheck-5 cppcheck-6 cppcheck-7 cppcheck-8
cppcheck-1:
@@ -378,25 +452,40 @@ analyzer-include:
-rm -rf examples/*/obj*
scan-build $(MAKE) -k examples
format: clang-format yapf format-pl-exec
format:
$(MAKE) -j 4 format-c format-py format-exec
CLANGFORMAT = clang-format-14
CLANGFORMAT_FLAGS = -i
CLANGFORMAT_FILES = $(CHECK_CPP) $(CHECK_H) $(CHECK_YL) test_regress/t/*.c* test_regress/t/*.h
clang-format:
format-c clang-format:
@$(CLANGFORMAT) --version | egrep 14.0 > /dev/null \
|| echo "*** You are not using clang-format-14, indents may differ from master's ***"
$(CLANGFORMAT) $(CLANGFORMAT_FLAGS) $(CLANGFORMAT_FILES)
YAMLFIX = YAMLFIX_WHITELINES=1 YAMLFIX_LINE_LENGTH=130 YAMLFIX_preserve_quotes=true yamlfix
yamlfix:
$(YAMLFIX) .
# CMake files
CMAKE_FILES = \
CMakeLists.txt \
examples/*/CMakeLists.txt \
src/CMakeLists.txt \
test_regress/CMakeLists.txt \
*.cmake.in \
# Python programs, subject to format and lint
PY_PROGRAMS = \
bin/verilator_ccache_report \
bin/verilator_difftree \
bin/verilator_gantt \
bin/verilator_includer \
bin/verilator_profcfunc \
examples/xml_py/vl_file_copy \
examples/xml_py/vl_hier_graph \
examples/json_py/vl_file_copy \
examples/json_py/vl_hier_graph \
docs/guide/conf.py \
docs/bin/vl_sphinx_extract \
docs/bin/vl_sphinx_fix \
@@ -406,6 +495,8 @@ PY_PROGRAMS = \
src/cppcheck_filtered \
src/flexfix \
src/vlcovgen \
src/.gdbinit.py \
test_regress/*.py \
test_regress/t/*.pf \
nodist/clang_check_attributes \
nodist/code_coverage \
@@ -413,46 +504,60 @@ PY_PROGRAMS = \
nodist/fuzzer/actual_fail \
nodist/fuzzer/generate_dictionary \
nodist/install_test \
nodist/log_changes \
# Python files, subject to format but not lint
PY_FILES = \
$(PY_PROGRAMS) \
nodist/code_coverage.dat \
test_regress/t/*.py \
# Python files, test_regress tests
PY_TEST_FILES = \
test_regress/t/*.py \
YAPF = yapf3
YAPF_FLAGS = -i
YAPF_FLAGS = -i --parallel
yapf:
format-py yapf:
$(YAPF) $(YAPF_FLAGS) $(PY_FILES)
FLAKE8 = flake8
FLAKE8_FLAGS = \
--extend-exclude=fastcov.py \
--ignore=E123,E129,E251,E402,E501,W503,W504,E701
GERSEMI = gersemi
GERSEMI_FLAGS = -i
format-cmake:
$(GERSEMI) $(GERSEMI_FLAGS) $(CMAKE_FILES)
PYLINT = pylint
PYLINT_FLAGS = --score=n --disable=R0801
PYLINT_FLAGS = --recursive=n --score=n --disable=R0801
PYLINT_TEST_FLAGS = $(PYLINT_FLAGS) --disable=C0103,C0114,C0116,C0209,C0411,C0413,C0301,R0801,R0912,R0915,R0916,R1702,W0511,W0621
RUFF = ruff
RUFF_FLAGS = check --ignore=E402,E501,E701
# "make -k" so can see all tool result errors
lint-py:
-$(FLAKE8) $(FLAKE8_FLAGS) $(PY_PROGRAMS)
-$(PYLINT) $(PYLINT_FLAGS) $(PY_PROGRAMS)
$(MAKE) -k lint-py-pylint lint-py-pylint-tests lint-py-ruff
format-pl-exec:
-chmod a+x test_regress/t/*.pl
lint-py-pylint:
$(PYLINT) $(PYLINT_FLAGS) $(PY_PROGRAMS)
install-msg:
@echo
@echo "Installed binaries to $(DESTDIR)$(bindir)/verilator"
@echo "Installed man to $(DESTDIR)$(mandir)/man1"
@echo "Installed examples to $(DESTDIR)$(pkgdatadir)/examples"
@echo
@echo "For documentation see 'man verilator' or 'verilator --help'"
@echo "For forums and to report bugs see https://verilator.org"
@echo
lint-py-pylint-tests:
$(PYLINT) $(PYLINT_TEST_FLAGS) $(PY_TEST_FILES) | $(PYTHON3) nodist/lint_py_test_filter
lint-py-ruff:
$(RUFF) $(RUFF_FLAGS) $(PY_PROGRAMS)
format-exec:
-chmod a+x test_regress/t/*.py
######################################################################
# Configure
IN_WILD := ${srcdir}/*.in ${srcdir}/*/*.in
# autoheader might not change config_build.h.in, so touch it
${srcdir}/config_build.h: ${srcdir}/config_build.h.in configure
# autoheader might not change config_package.h.in, so touch it
${srcdir}/config_package.h: ${srcdir}/config_package.h.in configure
cd ${srcdir} && autoheader
touch $@
Makefile: Makefile.in config.status $(IN_WILD)
@@ -462,12 +567,15 @@ config.status: configure
./config.status --recheck
configure: configure.ac
ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
autoconf --warnings=all
else
autoconf
endif
######################################################################
# Clean
maintainer-clean::
@echo "This command is intended for maintainers to use;"
@echo "rebuilding the deleted files requires autoconf."
@@ -498,17 +606,6 @@ distclean maintainer-clean::
rm -f bin/verilator_bin* bin/verilator_coverage_bin*
rm -f include/verilated.mk include/verilated_config.h
TAGFILES=${srcdir}/*/*.cpp ${srcdir}/*/*.h ${srcdir}/*/*.in \
${srcdir}/*.in ${srcdir}/*.pod
TAGS: $(TAGFILES)
etags $(TAGFILES)
.PHONY: doxygen
doxygen:
$(MAKE) -C docs doxygen
######################################################################
# Distributions
+26 -24
View File
@@ -1,17 +1,21 @@
.. Github doesn't render images unless absolute URL
.. Do not know of a conditional tag, "only: github" nor "github display" works
.. image:: https://img.shields.io/badge/License-LGPL%20v3-blue.svg
:target: https://www.gnu.org/licenses/lgpl-3.0]
.. image:: https://img.shields.io/badge/License-Artistic%202.0-0298c3.svg
|badge1| |badge2| |badge3| |badge4| |badge5| |badge6| |badge7|
.. |badge1| image:: https://img.shields.io/badge/Website-Verilator.org-181717.svg
:target: https://verilator.org
.. |badge2| image:: https://img.shields.io/badge/License-LGPL%20v3-blue.svg
:target: https://www.gnu.org/licenses/lgpl-3.0
.. |badge3| image:: https://img.shields.io/badge/License-Artistic%202.0-0298c3.svg
:target: https://opensource.org/licenses/Artistic-2.0
.. image:: https://repology.org/badge/tiny-repos/verilator.svg?header=distro%20packages
.. |badge4| image:: https://repology.org/badge/tiny-repos/verilator.svg?header=distro%20packages
:target: https://repology.org/project/verilator/versions
.. image:: https://api.codacy.com/project/badge/Grade/fa78caa433c84a4ab9049c43e9debc6f
.. |badge5| image:: https://img.shields.io/docker/pulls/verilator/verilator
:target: https://hub.docker.com/r/verilator/verilator
.. |badge6| image:: https://api.codacy.com/project/badge/Grade/fa78caa433c84a4ab9049c43e9debc6f
:target: https://www.codacy.com/gh/verilator/verilator
.. image:: https://codecov.io/gh/verilator/verilator/branch/master/graph/badge.svg
:target: https://codecov.io/gh/verilator/verilator
.. image:: https://github.com/verilator/verilator/workflows/build/badge.svg
.. |badge7| image:: https://github.com/verilator/verilator/workflows/build/badge.svg
:target: https://github.com/verilator/verilator/actions?query=workflow%3Abuild
@@ -57,17 +61,16 @@ files, the "Verilated" code.
These Verilated C++/SystemC files are then compiled by a C++ compiler
(gcc/clang/MSVC++), optionally along with a user's own C++/SystemC wrapper
file to instantiate the Verilated model. Executing the resulting executable
performs the design simulation. Verilator also supports linking Verilated
generated libraries, optionally encrypted, into other simulators.
file, to instantiate the Verilated model. Executing the resulting
executable performs the design simulation. Verilator also supports linking
Verilated generated libraries, optionally encrypted, into other simulators.
Verilator may not be the best choice if you are expecting a full-featured
replacement for a closed-source Verilog simulator, needs SDF annotation,
replacement for a closed-source Verilog simulator, need SDF annotation,
mixed-signal simulation, or are doing a quick class project (we recommend
`Icarus Verilog`_ for classwork.) However, if you are looking for a path
`Icarus Verilog`_ for classwork). However, if you are looking for a path
to migrate SystemVerilog to C++/SystemC, or want high-speed simulation of
synthesizable designs containing limited verification constructs, Verilator
is the tool for you.
designs, Verilator is the tool for you.
Performance
@@ -77,17 +80,16 @@ Verilator does not directly translate Verilog HDL to C++ or SystemC. Rather,
Verilator compiles your code into a much faster optimized and optionally
thread-partitioned model, which is in turn wrapped inside a C++/SystemC
module. The results are a compiled Verilog model that executes even on a
single-thread over 10x faster than standalone SystemC, and on a single
single thread over 10x faster than standalone SystemC, and on a single
thread is about 100 times faster than interpreted Verilog simulators such
as `Icarus Verilog`_. Another 2-10x speedup might be gained from
multithreading (yielding 200-1000x total over interpreted simulators).
Verilator has typically similar or better performance versus the
closed-source Verilog simulators (Carbon Design Systems Carbonator,
Modelsim/Questa, Cadence Incisive/NC-Verilog, Synopsys VCS, VTOC, and
Pragmatic CVer/CVC). But, Verilator is open-sourced, so you can spend on
computes rather than licenses. Thus, Verilator gives you the best
cycles/dollar.
Verilator has typically similar or better performance versus closed-source
Verilog simulators (e.g., Aldec Riviera-Pro, Cadence Incisive/NC-Verilog,
Mentor ModelSim/Questa, Synopsys VCS, VTOC, and Pragmatic CVer/CVC). But,
Verilator is open-sourced, so you can spend on computes rather than
licenses. Thus, Verilator gives you the best simulation cycles/dollar.
Installation & Documentation
@@ -139,7 +141,7 @@ Related Projects
Open License
============
Verilator is Copyright 2003-2023 by Wilson Snyder. (Report bugs to
Verilator is Copyright 2003-2025 by Wilson Snyder. (Report bugs to
`Verilator Issues <https://verilator.org/issues>`_.)
Verilator is free software; you can redistribute it and/or modify it under
@@ -147,7 +149,7 @@ the terms of either the GNU Lesser General Public License Version 3 or the
Perl Artistic License Version 2.0. See the documentation for more details.
.. _CHIPS Alliance: https://chipsalliance.org
.. _Icarus Verilog: http://iverilog.icarus.com
.. _Icarus Verilog: https://steveicarus.github.io/iverilog
.. _Linux Foundation: https://www.linuxfoundation.org
.. |Logo| image:: https://www.veripool.org/img/verilator_256_200_min.png
.. |verilator multithreaded performance| image:: https://www.veripool.org/img/verilator_multithreaded_performance_bg-min.png
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env perl
######################################################################
#
# Copyright 2003-2025 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
#
######################################################################
require 5.006_001;
use warnings;
use FindBin qw($RealBin $RealScript);
use strict;
my $relpath = RELPATH; # Substituted during Verilator 'make install'
unshift @ARGV, $RealScript;
exec { "$RealBin/$relpath/$RealScript" } @ARGV;
die "%Error: Exec failed,";
+96 -45
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
######################################################################
#
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
# Copyright 2003-2025 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
@@ -15,6 +15,7 @@ use Getopt::Long;
use FindBin qw($RealBin $RealScript);
use IO::File;
use Pod::Usage;
use Cwd qw(realpath);
use strict;
use vars qw($Debug @Opt_Verilator_Sw);
@@ -32,6 +33,7 @@ my $opt_rr;
my $opt_gdbbt;
my $opt_quiet_exit;
my $opt_unlimited_stack = 1;
my $opt_valgrind;
# No arguments can't do anything useful. Give help
if ($#ARGV < 0) {
@@ -56,15 +58,31 @@ if (! GetOptions(
# Switches
"gdb!" => \$opt_gdb,
"gdbbt!" => \$opt_gdbbt,
"quiet!" => \$opt_quiet_exit, # As -quiet implies -quiet-exit
"quiet-exit!" => \$opt_quiet_exit,
"rr!" => \$opt_rr,
"unlimited-stack!" => \$opt_unlimited_stack,
"valgrind!" => \$opt_valgrind,
# Additional parameters
"<>" => sub {}, # Ignored
)) {
pod2usage(-exitstatus => 2, -verbose => 0);
}
# WARNING: $verilator_pkgdatadir_relpath is substituted during Verilator 'make install'
my $verilator_pkgdatadir_relpath = "..";
my $verilator_root = realpath("$RealBin/$verilator_pkgdatadir_relpath");
if (defined $ENV{VERILATOR_ROOT}) {
if ((!-d $ENV{VERILATOR_ROOT}) || $verilator_root ne realpath($ENV{VERILATOR_ROOT})) {
warn "%Error: verilator: VERILATOR_ROOT is set to inconsistent path. Suggest leaving it unset.\n";
warn "%Error: VERILATOR_ROOT=$ENV{VERILATOR_ROOT}\n";
exit 1;
}
} else {
print "export VERILATOR_ROOT='$verilator_root'\n" if $Debug;
$ENV{VERILATOR_ROOT} = $verilator_root;
}
if ($opt_gdbbt && !gdb_works()) {
warn "-Info: --gdbbt ignored: gdb doesn't seem to be working\n" if $Debug;
$opt_gdbbt = 0;
@@ -109,6 +127,18 @@ if ($opt_gdb) {
. " -ex \"run " . join(' ', @quoted_sw)."\""
. " -ex 'set width 0'"
. " -ex 'bt' -ex 'quit'");
} elsif ($opt_valgrind) {
# Run under valgrind
my $valgrind_bin = ($ENV{VERILATOR_VALGRIND} || "valgrind --error-exitcode=1 --max-stackframe=2815880"
# Magic number sugested by valgrind, may need to be increased in future
# if you get warnings. See: https://valgrind.org/docs/manual/manual-core.html#opt.max-stackframe
);
run (ulimit_stack_unlimited()
. aslr_off()
. $valgrind_bin
. " " . verilator_bin()
. " " . join(' ', @quoted_sw));
} elsif ($Debug) {
# Debug
run(ulimit_stack_unlimited()
@@ -137,30 +167,13 @@ sub debug {
# Builds
sub verilator_bin {
my $bin = "";
# Use VERILATOR_ROOT if defined, else assume verilator_bin is in the search path
my $basename = ($ENV{VERILATOR_BIN}
|| ($Debug ? "verilator_bin_dbg" : "verilator_bin"));
if (defined($ENV{VERILATOR_ROOT})) {
my $dir = $ENV{VERILATOR_ROOT};
if (-x "$dir/bin/$basename"
|| -x "$dir/bin/$basename.exe") { # From a "make install" into VERILATOR_ROOT
$bin = "$dir/bin/$basename";
} else {
$bin = "$dir/$basename"; # From pointing to kit directory
}
if (-x "$RealBin/$basename" || -x "$RealBin/$basename.exe") {
return "$RealBin/$basename";
} else {
if (-x "$RealBin/$basename"
|| -x "$RealBin/$basename.exe") {
$bin = "$RealBin/$basename"; # From path/to/verilator with verilator_bin installed
} else {
$bin = $basename; # Find in PATH
}
# Note we don't look under bin/$basename which would be right if running
# in the kit dir. Running that would likely break, since
# VERILATOR_ROOT wouldn't be set and Verilator won't find internal files.
return $basename; # Find in PATH
}
return $bin;
}
#######################################################################
@@ -256,8 +269,7 @@ __END__
=head1 NAME
Verilator - Translate and simulate SystemVerilog code using C++/SystemC
Verilator - Lint, compile and simulate SystemVerilog code using C++/SystemC
=head1 SYNOPSIS
@@ -298,7 +310,9 @@ detailed descriptions of these arguments.
+1800-2009ext+<ext> Use SystemVerilog 2009 with file extension <ext>
+1800-2012ext+<ext> Use SystemVerilog 2012 with file extension <ext>
+1800-2017ext+<ext> Use SystemVerilog 2017 with file extension <ext>
+1800-2023ext+<ext> Use SystemVerilog 2023 with file extension <ext>
--assert Enable all assertions
--assert-case Enable unique/unique0/priority case related checks
--autoflush Flush streams after all $displays
--bbox-sys Blackbox unknown $system calls
--bbox-unsup Blackbox unsupported language features
@@ -307,13 +321,15 @@ detailed descriptions of these arguments.
--build-dep-bin <filename> Override build dependency Verilator binary
--build-jobs <jobs> Parallelism for --build
--cc Create C++ output
--cdc Clock domain crossing analysis
-CFLAGS <flags> C++ compiler arguments for makefile
--clk <signal-name> Mark specified signal as clock
--no-clk <signal-name> Prevent marking specified signal as clock
--compiler <compiler-name> Tune for specified C++ compiler
--compiler-include Include additional header in the precompiled one
--converge-limit <loops> Tune convergence settle time
--coverage Enable all coverage
--coverage-expr Enable expression coverage
--coverage-expr-max <value> Maximum permutations allowed for an expression
--coverage-line Enable line coverage
--coverage-max-width <width> Maximum array depth for coverage
--coverage-toggle Enable toggle coverage
@@ -325,7 +341,8 @@ detailed descriptions of these arguments.
--no-debug-leak Disable leaking memory in --debug mode
--debugi <level> Enable debugging at a specified level
--debugi-<srcfile> <level> Enable debugging a source file at a level
--no-decoration Disable comments and symbol decorations
--decorations <level> Set output comment and spacing level
--no-decoration Disable comments and lower spacing level
--default-language <lang> Default language to parse
+define+<var>=<value> Set preprocessor define
--dpi-hdr-only Only produce the DPI header file
@@ -334,12 +351,16 @@ detailed descriptions of these arguments.
--dump-graph Enable dumping V3Graphs to .dot files
--dump-tree Enable dumping Ast .tree files
--dump-tree-addrids Use short identifiers instead of addresses
--dump-tree-dot Enable dumping Ast .tree.dot debug files
--dump-tree-json Enable dumping Ast .tree.json files and .tree.meta.json file
--dump-<srcfile> Enable dumping everything in source file
--dumpi-dfg <level> Enable dumping DfgGraphs to .dot files at level
--dumpi-graph <level> Enable dumping V3Graphs to .dot files at level
--dumpi-tree <level> Enable dumping Ast .tree files at level
--dumpi-tree-json <level> Enable dumping Ast .tree.json files at level
--dumpi-<srcfile> <level> Enable dumping everything in source file at level
-E Preprocess, but do not compile
--emit-accessors Emit getter and setter methods for model top class
--error-limit <value> Abort after this number of errors
--exe Link to create executable
--expand-limit <value> Set expand optimization limit
@@ -347,31 +368,41 @@ detailed descriptions of these arguments.
-f <file> Parse arguments from a file
-FI <file> Force include of a file
--flatten Force inlining of all modules, tasks and functions
--future0 <option> Ignore an option for compatibility
--future1 <option> Ignore an option with argument for compatibility
-fno-<optimization> Disable internal optimization stage
-G<name>=<value> Overwrite top-level parameter
--gate-stmts <value> Tune gate optimizer depth
--gdb Run Verilator under GDB interactively
--gdbbt Run Verilator under GDB for backtrace
--generate-key Create random key for --protect-key
--getenv <var> Get environment variable with defaults
--get-supported <feature> Get if feature is supported
--help Display this help
--getenv <var> Get environment variable with defaults
--help Show this help
--hierarchical Enable hierarchical Verilation
--hierarchical-params-file <name> Internal option that specifies parameters file for hier blocks
-I<dir> Directory to search for includes
--if-depth <value> Tune IFDEPTH warning
+incdir+<dir> Directory to search for includes
--inline-mult <value> Tune module inlining
--instr-count-dpi <value> Assumed dynamic instruction count of DPI imports
-j <jobs> Parallelism for --build (alias to --build-jobs)
-j <jobs> Parallelism for --build-jobs/--verilate-jobs
--no-json-edit-nums Don't dump editNum in .tree.json files
--no-json-ids Don't use short identifiers instead of adresses/paths in .tree.json
--json-only Create JSON parser output (.tree.json and .meta.json)
--json-only-output .tree.json output filename
--json-only-meta-output .tree.meta.json output filename
--l2-name <value> Verilog scope name of the top module
--language <lang> Default language standard to parse
-LDFLAGS <flags> Linker pre-object arguments for makefile
--lib-create <name> Create a DPI library
+libext+<ext>+[ext]... Extensions for finding modules
--lint-only Lint, but do not make output
--localize-max-size <value> Tune localize optimization variable size
--make <build-tool> Generate scripts for specified build tool
-MAKEFLAGS <flags> Arguments to pass to make during --build
--main Generate C++ main() file
--main-top-name Specify top name passed to Verilated model in generated C++ main
--max-num-width <value> Maximum number width (default: 64K)
--Mdir <directory> Name of output object directory
--MMD Create .d dependency files
@@ -382,19 +413,23 @@ detailed descriptions of these arguments.
-O3 High-performance optimizations
-O<optimization-letter> Selectable optimizations
-o <executable> Name of final executable
--no-order-clock-delay Disable ordering clock enable assignments
--output-groups <numfiles> Group .cpp files into larger ones
--output-split <statements> Split .cpp files into pieces
--output-split-cfuncs <statements> Split model functions
--output-split-ctrace <statements> Split tracing functions
-P Disable line numbers and blanks with -E
--pins-bv <bits> Specify types for top-level ports
--pins-inout-enables Specify that __en and __out signals be created for inouts
--pins-sc-biguint Specify types for top-level ports
--pins-sc-uint Specify types for top-level ports
--pins-sc-uint-bool Specify types for top-level ports
--pins-uint8 Specify types for top-level ports
--no-pins64 Don't use uint64_t's for 33-64 bit sigs
--pipe-filter <command> Filter all input through a script
--pp-comments Show preprocessor comments with -E
--prefix <topname> Name of top-level class
--preproc-resolve Include all found modules in the output with -E
--preproc-token-limit Maximum tokens on a line allowed by preprocessor
--private Debugging; see docs
--prof-c Compile C++ code with profiling
--prof-cfuncs Name functions for profiling
@@ -403,22 +438,32 @@ detailed descriptions of these arguments.
--protect-ids Hash identifier names for obscurity
--protect-key <key> Key for symbol protection
--protect-lib <name> Create a DPI protected library
--public Debugging; see docs
--public Mark signals as public; see docs
--public-depth <level> Mark public to specified module depth
--public-flat-rw Mark all variables, etc as public_flat_rw
--public-ignore Ignore all public comment markings
--public-params Mark all parameters as public_flat
-pvalue+<name>=<value> Overwrite toplevel parameter
--quiet Minimize additional printing
--quiet-exit Don't print the command on failure
--quiet-stats Don't print statistics
--relative-includes Resolve includes relative to current file
--reloop-limit Minimum iterations for forming loops
--report-unoptflat Extra diagnostics for UNOPTFLAT
--rr Run Verilator and record with rr
--runtime-debug Enable model runtime debugging
--savable Enable model save-restore
--sc Create SystemC output
--no-skip-identical Disable skipping identical output
--stats Create statistics file
--stats-vars Provide statistics on variables
--no-std Prevent loading standard files
--no-std-package Prevent parsing standard package
--no-std-waiver Prevent parsing standard lint waivers
--no-stop-fail Do not call $stop when assertion fails
--structs-packed Convert all unpacked structures to packed structures
-sv Enable SystemVerilog parsing
+systemverilogext+<ext> Synonym for +1800-2017ext+<ext>
+systemverilogext+<ext> Synonym for +1800-2023ext+<ext>
--threads <threads> Enable multithreading
--threads-dpi <mode> Enable multithreaded DPI
--threads-max-mtasks <mtasks> Tune maximum mtask partitioning
@@ -432,11 +477,12 @@ detailed descriptions of these arguments.
--trace-coverage Enable tracing of coverage
--trace-depth <levels> Depth of tracing
--trace-fst Enable FST waveform creation
--trace-max-array <depth> Maximum bit width for tracing
--trace-max-width <width> Maximum array depth for tracing
--trace-max-array <depth> Maximum array depth for tracing
--trace-max-width <width> Maximum bit width for tracing
--trace-params Enable tracing of parameters
--trace-structs Enable tracing structure names
--trace-threads <threads> Enable FST waveform creation on separate threads
--no-trace-top Do not emit traces for signals in the top module generated by verilator
--trace-underscore Enable tracing of _signals
-U<var> Undefine preprocessor define
--no-unlimited-stack Don't disable stack size limit
@@ -445,12 +491,15 @@ detailed descriptions of these arguments.
--unused-regexp <regexp> Tune UNUSED lint signals
-V Verbose version and config
-v <filename> Verilog library
--valgrind Run Verilator under valgrind
--verilate-jobs Job threads for Verilation stage
--no-verilate Skip Verilation and just compile previously Verilated code
+verilog1995ext+<ext> Synonym for +1364-1995ext+<ext>
+verilog2001ext+<ext> Synonym for +1364-2001ext+<ext>
--version Displays program version and exits
--version Show program version and exits
--vpi Enable VPI compiles
--waiver-output <filename> Create a waiver file based on the linter warnings
--waiver-multiline Create multiline --match for waivers
--waiver-output <filename> Create a waiver file based on linter warnings
-Wall Enable all style warnings
-Werror-<message> Convert warnings to errors
-Wfuture-<message> Disable unknown message warnings
@@ -477,26 +526,28 @@ description of these arguments.
=for VL_SPHINX_EXTRACT "_build/gen/args_verilated.rst"
+verilator+debug Enable debugging
+verilator+debugi+<value> Enable debugging at a level
+verilator+error+limit+<value> Set error limit
+verilator+help Display help
+verilator+noassert Disable assert checking
+verilator+debug Enable debugging
+verilator+debugi+<value> Enable debugging at a level
+verilator+coverage+file+<filename> Set coverage output filename
+verilator+error+limit+<value> Set error limit
+verilator+help Show help
+verilator+noassert Disable assert checking
+verilator+prof+exec+file+<filename> Set execution profile filename
+verilator+prof+exec+start+<value> Set execution profile starting point
+verilator+prof+exec+window+<value> Set execution profile duration
+verilator+prof+vlt+file+<filename> Set PGO profile filename
+verilator+rand+reset+<value> Set random reset technique
+verilator+seed+<value> Set random seed
+verilator+V Verbose version and config
+verilator+version Show version and exit
+verilator+quiet Minimize additional printing
+verilator+rand+reset+<value> Set random reset technique
+verilator+seed+<value> Set random seed
+verilator+V Show verbose version and config
+verilator+version Show version and exit
=head1 DISTRIBUTION
The latest version is available from L<https://verilator.org>.
Copyright 2003-2023 by Wilson Snyder. This program is free software; you can
Copyright 2003-2025 by Wilson Snyder. This program is free software; you can
redistribute it and/or modify the Verilator internals under the terms of
either the GNU Lesser General Public License Version 3 or the Perl Artistic
License Version 2.0.
+9 -17
View File
@@ -16,8 +16,7 @@ parser = argparse.ArgumentParser(
For documentation see
https://verilator.org/guide/latest/exe_verilator_ccache_report.html""",
epilog=
"""Copyright 2002-2023 by Wilson Snyder. This program is free software; you
epilog="""Copyright 2002-2025 by Wilson Snyder. This program is free software; you
can redistribute it and/or modify it under the terms of either the GNU
Lesser General Public License Version 3 or the Perl Artistic License
Version 2.0.
@@ -67,30 +66,23 @@ else:
wnames = max(len(_) for _ in results) + 1
wresults = max(len(_) for _ in results.values()) + 1
for k in sorted(results.keys()):
args.o.write("{:{wnames}} : {:{wresults}} : {}s\n".format(
k,
results[k],
elapsed[k].total_seconds(),
wnames=wnames,
wresults=wresults))
args.o.write("{:{wnames}} : {:{wresults}} : {}s\n".format(k,
results[k],
elapsed[k].total_seconds(),
wnames=wnames,
wresults=wresults))
args.o.write("\nSummary:\n")
counts = collections.Counter(_ for _ in results.values())
total = sum(counts.values())
for k in sorted(counts.keys()):
c = counts[k]
args.o.write("{:{width}}| {} ({:.2%})\n".format(k,
c,
c / total,
width=wresults))
args.o.write("{:{width}}| {} ({:.2%})\n".format(k, c, c / total, width=wresults))
args.o.write("\nLongest:\n")
longest = sorted(list(elapsed.items()),
key=lambda kv: -kv[1].total_seconds())
longest = sorted(list(elapsed.items()), key=lambda kv: -kv[1].total_seconds())
for i, (k, v) in enumerate(longest):
args.o.write("{:{width}}| {}s\n".format(k,
v.total_seconds(),
width=wnames))
args.o.write("{:{width}}| {}s\n".format(k, v.total_seconds(), width=wnames))
if i > 4:
break
+11 -10
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
######################################################################
#
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
# Copyright 2003-2025 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
@@ -154,9 +154,9 @@ verilator_coverage - Verilator coverage analyzer
verilator_coverage --annotate <obj>
verilator_coverage -write merged.dat -read <datafiles>...
verilator_coverage -write merged.dat <datafiles>...
verilator_coverage -write-info merged.info -read <datafiles>...
verilator_coverage -write-info merged.info <datafiles>...
Verilator_coverage processes Verilated model-generated coverage reports.
@@ -169,6 +169,7 @@ L<https://verilator.org/guide/latest/exe_verilator_coverage.html>.
--annotate <output_dir> Directory name for source annotation.
--annotate-all All files should be shown.
--annotate-min <count> Minimum occurrence count for uncovered.
--annotate-points Annotates info from each coverage point.
--help Displays this message and version and exits.
--rank Compute relative importance of tests.
--unlink With --write, unlink all inputs
@@ -176,18 +177,18 @@ L<https://verilator.org/guide/latest/exe_verilator_coverage.html>.
--write <filename> Write aggregate coverage results.
--write-info <filename.info> Write lcov .info.
+libext+I<ext>+I<ext>... Extensions for Verilog files.
+define+I<var>+I<value> Defines the given variable.
-DI<var>=I<value> Defines the given variable.
+incdir+I<dir> Add directory for finding include files.
-II<dir> Add directory for finding include files.
-y I<dir> Specifies module search directory.
+libext+<ext>+<ext>... Extensions for Verilog files.
+define+<var>+<value> Defines the given variable.
-D<var>=<value> Defines the given variable.
+incdir+<dir> Add directory for finding include files.
-I<dir> Add directory for finding include files.
-y <dir> Specifies module search directory.
=head1 DISTRIBUTION
The latest version is available from L<https://verilator.org>.
Copyright 2003-2023 by Wilson Snyder. This program is free software; you
Copyright 2003-2025 by Wilson Snyder. This program is free software; you
can redistribute it and/or modify the Verilator internals under the terms
of either the GNU Lesser General Public License Version 3 or the Perl
Artistic License Version 2.0.
+5 -10
View File
@@ -42,13 +42,12 @@ def diff_dir(a, b):
continue
a = files[base]['a']
b = files[base]['b']
print("=" * 70)
print("= %s <-> %s" % (a, b))
print("=" * 70, flush=True)
print("= %s <-> %s" % (a, b), flush=True)
diff_file(a, b)
anyfile = True
if not anyfile:
sys.stderr.write(
"%Warning: No .tree files found that have similar base names\n")
sys.stderr.write("%Warning: No .tree files found that have similar base names\n")
def diff_file(a, b):
@@ -109,18 +108,14 @@ parser = argparse.ArgumentParser(
Verilator_difftree is used for debugging Verilator tree output files.
It performs a diff between two files, or all files common between two
directories, ignoring irrelevant pointer differences.""",
epilog=
"""Copyright 2005-2023 by Wilson Snyder. This program is free software; you
epilog="""Copyright 2005-2025 by Wilson Snyder. This program is free software; you
can redistribute it and/or modify it under the terms of either the GNU
Lesser General Public License Version 3 or the Perl Artistic License
Version 2.0.
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0""")
parser.add_argument('--debug',
action='store_const',
const=9,
help='enable debug')
parser.add_argument('--debug', action='store_const', const=9, help='enable debug')
parser.add_argument('--no-lineno',
action='store_false',
help='do not show differences in line numbering')
+342 -300
View File
@@ -1,52 +1,49 @@
#!/usr/bin/env python3
# pylint: disable=C0103,C0114,C0116,C0209,C0301,R0914,R0912,R0915,W0511,eval-used
# pylint: disable=C0103,C0114,C0116,C0209,C0301,R0914,R0912,R0915,W0511,W0603,eval-used
######################################################################
import argparse
import bisect
import collections
import math
import re
import statistics
# from pprint import pprint
Threads = collections.defaultdict(lambda: collections.defaultdict(lambda: {}))
Mtasks = collections.defaultdict(lambda: {})
Evals = collections.defaultdict(lambda: {})
EvalLoops = collections.defaultdict(lambda: {})
Global = {
'args': {},
'cpuinfo': collections.defaultdict(lambda: {}),
'rdtsc_cycle_time': 0,
'stats': {}
}
Sections = []
LongestVcdStrValueLength = 0
Threads = collections.defaultdict(lambda: []) # List of records per thread id
Mtasks = collections.defaultdict(lambda: {'elapsed': 0, 'end': 0})
Cpus = collections.defaultdict(lambda: {'mtask_time': 0})
Global = {'args': {}, 'cpuinfo': collections.defaultdict(lambda: {}), 'stats': {}}
ElapsedTime = None # total elapsed time
ExecGraphTime = 0 # total elapsed time excuting an exec graph
ExecGraphIntervals = [] # list of (start, end) pairs
######################################################################
def process(filename):
read_data(filename)
report()
def read_data(filename):
with open(filename, "r", encoding="utf8") as fh:
re_thread = re.compile(r'^VLPROFTHREAD (\d+)$')
re_record = re.compile(r'^VLPROFEXEC (\S+) (\d+)(.*)$')
re_payload_mtaskBegin = re.compile(
r'id (\d+) predictStart (\d+) cpu (\d+)')
re_payload_mtaskBegin = re.compile(r'id (\d+) predictStart (\d+) cpu (\d+)')
re_payload_mtaskEnd = re.compile(r'id (\d+) predictCost (\d+)')
re_arg1 = re.compile(r'VLPROF arg\s+(\S+)\+([0-9.]*)\s*')
re_arg2 = re.compile(r'VLPROF arg\s+(\S+)\s+([0-9.]*)\s*$')
re_stat = re.compile(r'VLPROF stat\s+(\S+)\s+([0-9.]+)')
re_time = re.compile(r'rdtsc time = (\d+) ticks')
re_proc_cpu = re.compile(r'VLPROFPROC processor\s*:\s*(\d+)\s*$')
re_proc_dat = re.compile(r'VLPROFPROC ([a-z_ ]+)\s*:\s*(.*)$')
cpu = None
thread = None
thread = 0
execGraphStart = None
lastEvalBeginTick = None
lastEvalLoopBeginTick = None
global LongestVcdStrValueLength
global ExecGraphTime
SectionStack = []
mTaskThread = {}
for line in fh:
recordMatch = re_record.match(line)
@@ -54,47 +51,53 @@ def read_data(filename):
kind, tick, payload = recordMatch.groups()
tick = int(tick)
payload = payload.strip()
if kind == "EVAL_BEGIN":
Evals[tick]['start'] = tick
lastEvalBeginTick = tick
elif kind == "EVAL_END":
Evals[lastEvalBeginTick]['end'] = tick
lastEvalBeginTick = None
elif kind == "EVAL_LOOP_BEGIN":
EvalLoops[tick]['start'] = tick
lastEvalLoopBeginTick = tick
elif kind == "EVAL_LOOP_END":
EvalLoops[lastEvalLoopBeginTick]['end'] = tick
lastEvalLoopBeginTick = None
if kind == "SECTION_PUSH":
LongestVcdStrValueLength = max(LongestVcdStrValueLength, len(payload))
SectionStack.append(payload)
Sections[thread].append((tick, tuple(SectionStack)))
elif kind == "SECTION_POP":
assert SectionStack, "SECTION_POP without SECTION_PUSH"
SectionStack.pop()
Sections[thread].append((tick, tuple(SectionStack)))
elif kind == "MTASK_BEGIN":
mtask, predict_start, ecpu = re_payload_mtaskBegin.match(
payload).groups()
mtask, predict_start, ecpu = re_payload_mtaskBegin.match(payload).groups()
mtask = int(mtask)
predict_start = int(predict_start)
ecpu = int(ecpu)
Threads[thread][tick]['mtask'] = mtask
Threads[thread][tick]['predict_start'] = predict_start
Threads[thread][tick]['cpu'] = ecpu
if 'elapsed' not in Mtasks[mtask]:
Mtasks[mtask] = {'end': 0, 'elapsed': 0}
mTaskThread[mtask] = thread
records = Threads[thread]
assert not records or records[-1]['start'] <= records[-1]['end'] <= tick
records.append({
'start': tick,
'mtask': mtask,
'predict_start': predict_start,
'cpu': ecpu
})
Mtasks[mtask]['begin'] = tick
Mtasks[mtask]['thread'] = thread
Mtasks[mtask]['predict_start'] = predict_start
elif kind == "MTASK_END":
mtask, predict_cost = re_payload_mtaskEnd.match(
payload).groups()
mtask, predict_cost = re_payload_mtaskEnd.match(payload).groups()
mtask = int(mtask)
predict_cost = int(predict_cost)
begin = Mtasks[mtask]['begin']
Threads[thread][begin]['end'] = tick
Threads[thread][begin]['predict_cost'] = predict_cost
record = Threads[mTaskThread[mtask]][-1]
record['end'] = tick
record['predict_cost'] = predict_cost
Mtasks[mtask]['elapsed'] += tick - begin
Mtasks[mtask]['predict_cost'] = predict_cost
Mtasks[mtask]['end'] = max(Mtasks[mtask]['end'], tick)
elif kind == "EXEC_GRAPH_BEGIN":
execGraphStart = tick
elif kind == "EXEC_GRAPH_END":
ExecGraphTime += tick - execGraphStart
ExecGraphIntervals.append((execGraphStart, tick))
execGraphStart = None
elif Args.debug:
print("-Unknown execution trace record: %s" % line)
elif re_thread.match(line):
thread = int(re_thread.match(line).group(1))
Sections.append([])
elif re.match(r'^VLPROF(THREAD|VERSION)', line):
pass
elif re_arg1.match(line):
@@ -109,7 +112,7 @@ def read_data(filename):
elif re_proc_cpu.match(line):
match = re_proc_cpu.match(line)
cpu = int(match.group(1))
elif cpu and re_proc_dat.match(line):
elif cpu is not None and re_proc_dat.match(line):
match = re_proc_dat.match(line)
term = match.group(1)
value = match.group(2)
@@ -121,11 +124,6 @@ def read_data(filename):
pass
elif Args.debug:
print("-Unk: %s" % line)
# TODO -- this is parsing text printed by a client.
# Really, verilator proper should generate this
# if it's useful...
if re_time.match(line):
Global['rdtsc_cycle_time'] = re_time.group(1)
def re_match_result(regexp, line, result_to):
@@ -144,34 +142,50 @@ def report():
plus = "+" if re.match(r'^\+', arg) else " "
print(" %s%s%s" % (arg, plus, Global['args'][arg]))
nthreads = int(Global['stats']['threads'])
Global['cpus'] = {}
for thread in Threads:
# Make potentially multiple characters per column
for start in Threads[thread]:
if not Threads[thread][start]:
continue
cpu = Threads[thread][start]['cpu']
elapsed = Threads[thread][start]['end'] - start
if cpu not in Global['cpus']:
Global['cpus'][cpu] = {'cpu_time': 0}
Global['cpus'][cpu]['cpu_time'] += elapsed
for records in Threads.values():
for record in records:
cpu = record['cpu']
elapsed = record['end'] - record['start']
Cpus[cpu]['mtask_time'] += elapsed
measured_mt_mtask_time = 0
predict_mt_mtask_time = 0
long_mtask_time = 0
measured_last_end = 0
predict_last_end = 0
for mtask in Mtasks:
measured_mt_mtask_time += Mtasks[mtask]['elapsed']
predict_mt_mtask_time += Mtasks[mtask]['predict_cost']
measured_last_end = max(measured_last_end, Mtasks[mtask]['end'])
predict_last_end = max(
predict_last_end,
Mtasks[mtask]['predict_start'] + Mtasks[mtask]['predict_cost'])
long_mtask_time = max(long_mtask_time, Mtasks[mtask]['elapsed'])
Global['measured_last_end'] = measured_last_end
Global['predict_last_end'] = predict_last_end
global ElapsedTime
ElapsedTime = int(Global['stats']['ticks'])
nthreads = int(Global['stats']['threads'])
ncpus = max(len(Cpus), 1)
print("\nSummary:")
print(" Total elapsed time = {} rdtsc ticks".format(ElapsedTime))
print(" Parallelized code = {:.2%} of elapsed time".format(ExecGraphTime / ElapsedTime))
print(" Total threads = %d" % nthreads)
print(" Total CPUs used = %d" % ncpus)
print(" Total mtasks = %d" % len(Mtasks))
print(" Total yields = %d" % int(Global['stats'].get('yields', 0)))
report_mtasks()
report_cpus()
report_sections()
if nthreads > ncpus:
print()
print("%%Warning: There were fewer CPUs (%d) than threads (%d)." % (ncpus, nthreads))
print(" : See docs on use of numactl.")
else:
if 'cpu_socket_cores_warning' in Global:
print()
print("%Warning: Multiple threads scheduled on same hyperthreaded core.")
print(" : See docs on use of numactl.")
if 'cpu_sockets_warning' in Global:
print()
print("%Warning: Threads scheduled on multiple sockets.")
print(" : See docs on use of numactl.")
print()
def report_mtasks():
if not Mtasks:
return
nthreads = int(Global['stats']['threads'])
# If we know cycle time in the same (rdtsc) units,
# this will give us an actual utilization number,
@@ -181,130 +195,110 @@ def report():
# serial mode, to estimate the overhead of data sharing,
# which will show up in the total elapsed time. (Overhead
# of synchronization and scheduling should not.)
print("\nAnalysis:")
print(" Total threads = %d" % nthreads)
print(" Total mtasks = %d" % len(Mtasks))
ncpus = max(len(Global['cpus']), 1)
print(" Total cpus used = %d" % ncpus)
print(" Total yields = %d" %
int(Global['stats'].get('yields', 0)))
print(" Total evals = %d" % len(Evals))
print(" Total eval loops = %d" % len(EvalLoops))
if Mtasks:
print(" Total eval time = %d rdtsc ticks" %
Global['measured_last_end'])
print(" Longest mtask time = %d rdtsc ticks" % long_mtask_time)
print(" All-thread mtask time = %d rdtsc ticks" %
measured_mt_mtask_time)
long_efficiency = long_mtask_time / (Global.get(
'measured_last_end', 1) or 1)
print(" Longest-thread efficiency = %0.1f%%" %
(long_efficiency * 100.0))
mt_efficiency = measured_mt_mtask_time / (
Global.get('measured_last_end', 1) * nthreads or 1)
print(" All-thread efficiency = %0.1f%%" %
(mt_efficiency * 100.0))
print(" All-thread speedup = %0.1f" %
(mt_efficiency * nthreads))
if Global['rdtsc_cycle_time'] > 0:
ut = measured_mt_mtask_time / Global['rdtsc_cycle_time']
print("tot_mtask_cpu=" + measured_mt_mtask_time + " cyc=" +
Global['rdtsc_cycle_time'] + " ut=" + ut)
total_mtask_time = 0
thread_mtask_time = collections.defaultdict(lambda: 0)
long_mtask_time = 0
long_mtask = None
predict_mtask_time = 0
predict_elapsed = 0
for mtaskId in Mtasks:
record = Mtasks[mtaskId]
predict_mtask_time += record['predict_cost']
total_mtask_time += record['elapsed']
thread_mtask_time[record['thread']] += record['elapsed']
predict_end = record['predict_start'] + record['predict_cost']
predict_elapsed = max(predict_elapsed, predict_end)
if record['elapsed'] > long_mtask_time:
long_mtask_time = record['elapsed']
long_mtask = mtaskId
Global['predict_last_end'] = predict_elapsed
predict_mt_efficiency = predict_mt_mtask_time / (
Global.get('predict_last_end', 1) * nthreads or 1)
print("\nPrediction (what Verilator used for scheduling):")
print(" All-thread efficiency = %0.1f%%" %
(predict_mt_efficiency * 100.0))
print(" All-thread speedup = %0.1f" %
(predict_mt_efficiency * nthreads))
serialTime = ElapsedTime - ExecGraphTime
p2e_ratios = []
min_p2e = 1000000
min_mtask = None
max_p2e = -1000000
max_mtask = None
def subReport(elapsed, work):
print(" Thread utilization = {:7.2%}".format(work / (elapsed * nthreads)))
print(" Speedup = {:6.3}x".format(work / elapsed))
for mtask in sorted(Mtasks.keys()):
if Mtasks[mtask]['elapsed'] > 0:
if Mtasks[mtask]['predict_cost'] == 0:
Mtasks[mtask]['predict_cost'] = 1 # don't log(0) below
p2e_ratio = math.log(Mtasks[mtask]['predict_cost'] /
Mtasks[mtask]['elapsed'])
p2e_ratios.append(p2e_ratio)
print("\nParallelized code, measured:")
subReport(ExecGraphTime, total_mtask_time)
if p2e_ratio > max_p2e:
max_p2e = p2e_ratio
max_mtask = mtask
if p2e_ratio < min_p2e:
min_p2e = p2e_ratio
min_mtask = mtask
print("\nParallelized code, predicted during static scheduling:")
subReport(predict_elapsed, predict_mtask_time)
print("\nMTask statistics:")
print(" min log(p2e) = %0.3f" % min_p2e, end="")
print(" from mtask %d (predict %d," %
(min_mtask, Mtasks[min_mtask]['predict_cost']),
end="")
print(" elapsed %d)" % Mtasks[min_mtask]['elapsed'])
print(" max log(p2e) = %0.3f" % max_p2e, end="")
print(" from mtask %d (predict %d," %
(max_mtask, Mtasks[max_mtask]['predict_cost']),
end="")
print(" elapsed %d)" % Mtasks[max_mtask]['elapsed'])
print("\nAll code, measured:")
subReport(ElapsedTime, serialTime + total_mtask_time)
stddev = statistics.pstdev(p2e_ratios)
mean = statistics.mean(p2e_ratios)
print(" mean = %0.3f" % mean)
print(" stddev = %0.3f" % stddev)
print(" e ^ stddev = %0.3f" % math.exp(stddev))
print("\nAll code, measured, scaled by predicted speedup:")
expectedParallelSpeedup = predict_mtask_time / predict_elapsed
scaledElapsed = serialTime + total_mtask_time / expectedParallelSpeedup
subReport(scaledElapsed, serialTime + total_mtask_time)
report_cpus()
p2e_ratios = []
min_p2e = 1000000
min_mtask = None
max_p2e = -1000000
max_mtask = None
if nthreads > ncpus:
print()
print("%%Warning: There were fewer CPUs (%d) then threads (%d)." %
(ncpus, nthreads))
print(" : See docs on use of numactl.")
else:
if 'cpu_socket_cores_warning' in Global:
print()
print(
"%Warning: Multiple threads scheduled on same hyperthreaded core."
)
print(" : See docs on use of numactl.")
if 'cpu_sockets_warning' in Global:
print()
print("%Warning: Threads scheduled on multiple sockets.")
print(" : See docs on use of numactl.")
print()
for mtask in sorted(Mtasks.keys()):
if Mtasks[mtask]['elapsed'] > 0:
if Mtasks[mtask]['predict_cost'] == 0:
Mtasks[mtask]['predict_cost'] = 1 # don't log(0) below
p2e_ratio = math.log(Mtasks[mtask]['predict_cost'] / Mtasks[mtask]['elapsed'])
p2e_ratios.append(p2e_ratio)
if p2e_ratio > max_p2e:
max_p2e = p2e_ratio
max_mtask = mtask
if p2e_ratio < min_p2e:
min_p2e = p2e_ratio
min_mtask = mtask
print("\nMTask statistics:")
print(" Longest mtask id = {}".format(long_mtask))
print(" Longest mtask time = {:.2%} of time elapsed in parallelized code".format(
long_mtask_time / ExecGraphTime))
print(" min log(p2e) = %0.3f" % min_p2e, end="")
print(" from mtask %d (predict %d," % (min_mtask, Mtasks[min_mtask]['predict_cost']), end="")
print(" elapsed %d)" % Mtasks[min_mtask]['elapsed'])
print(" max log(p2e) = %0.3f" % max_p2e, end="")
print(" from mtask %d (predict %d," % (max_mtask, Mtasks[max_mtask]['predict_cost']), end="")
print(" elapsed %d)" % Mtasks[max_mtask]['elapsed'])
stddev = statistics.pstdev(p2e_ratios)
mean = statistics.mean(p2e_ratios)
print(" mean = %0.3f" % mean)
print(" stddev = %0.3f" % stddev)
print(" e ^ stddev = %0.3f" % math.exp(stddev))
def report_cpus():
print("\nCPUs:")
print("\nCPU info:")
Global['cpu_sockets'] = collections.defaultdict(lambda: 0)
Global['cpu_socket_cores'] = collections.defaultdict(lambda: 0)
for cpu in sorted(Global['cpus'].keys()):
print(" cpu %d: " % cpu, end='')
print("cpu_time=%d" % Global['cpus'][cpu]['cpu_time'], end='')
socket = None
print(" Id | Time spent executing MTask | Socket | Core | Model")
print(" | % of elapsed ticks / ticks | | |")
print(" ====|============================|========|======|======")
for cpu in sorted(Cpus):
socket = ""
core = ""
model = ""
if cpu in Global['cpuinfo']:
cpuinfo = Global['cpuinfo'][cpu]
if 'physical_id' in cpuinfo and 'core_id' in cpuinfo:
socket = int(cpuinfo['physical_id'])
socket = cpuinfo['physical_id']
Global['cpu_sockets'][socket] += 1
print(" socket=%d" % socket, end='')
core = int(cpuinfo['core_id'])
Global['cpu_socket_cores'][str(socket) + "__" + str(core)] += 1
print(" core=%d" % core, end='')
core = cpuinfo['core_id']
Global['cpu_socket_cores'][socket + "__" + core] += 1
if 'model_name' in cpuinfo:
model = cpuinfo['model_name']
print(" %s" % model, end='')
print()
print(" {:3d} | {:7.2%} / {:16d} | {:>6s} | {:>4s} | {}".format(
cpu, Cpus[cpu]['mtask_time'] / ElapsedTime, Cpus[cpu]['mtask_time'], socket, core,
model))
if len(Global['cpu_sockets']) > 1:
Global['cpu_sockets_warning'] = True
@@ -313,25 +307,72 @@ def report_cpus():
Global['cpu_socket_cores_warning'] = True
def report_sections():
for thread, section in enumerate(Sections):
if section:
print(f"\nSection profile for thread {thread}:")
report_section(section)
def report_section(section):
totalTime = collections.defaultdict(lambda: 0)
selfTime = collections.defaultdict(lambda: 0)
sectionTree = [0, {}, 1] # [selfTime, childTrees, numberOfTimesEntered]
prevTime = 0
prevStack = ()
for time, stack in section:
if len(stack) > len(prevStack):
scope = sectionTree
for item in stack:
scope = scope[1].setdefault(item, [0, {}, 0])
scope[2] += 1
dt = time - prevTime
assert dt >= 0
scope = sectionTree
for item in prevStack:
scope = scope[1].setdefault(item, [0, {}, 0])
scope[0] += dt
if prevStack:
for name in prevStack:
totalTime[name] += dt
selfTime[prevStack[-1]] += dt
prevTime = time
prevStack = stack
def treeSum(tree):
n = tree[0]
for subTree in tree[1].values():
n += treeSum(subTree)
return n
# Make sure the tree sums to the elapsed time
sectionTree[0] += ElapsedTime - treeSum(sectionTree)
def printTree(prefix, name, entries, tree):
print(" {:7.2%} | {:7.2%} | {:8} | {:10.2f} | {}".format(
treeSum(tree) / ElapsedTime, tree[0] / ElapsedTime, tree[2], tree[2] / entries,
prefix + name))
for k in sorted(tree[1], key=lambda _: -treeSum(tree[1][_])):
printTree(prefix + " ", k, tree[2], tree[1][k])
print(" Total | Self | Total | Relative | Section")
print(" time | time | entries | entries | name ")
print("==========|=========|==========|============|========")
printTree("", "*TOTAL*", 1, sectionTree)
######################################################################
def write_vcd(filename):
print("Writing %s" % filename)
with open(filename, "w", encoding="utf8") as fh:
vcd = {
'values':
collections.defaultdict(lambda: {}), # {<time>}{<code>} = value
'sigs': {
'predicted_threads': {},
'measured_threads': {},
'cpus': {},
'evals': {},
'mtasks': {},
'Stats': {}
} # {<module>}{<sig}} = code
}
code = 0
# dict of dicts of hierarchy elements/signal name -> (code, width)
scopeSigs = {}
# map from time -> code -> value
values = collections.defaultdict(lambda: {})
parallelism = {
'measured': collections.defaultdict(lambda: 0),
@@ -340,132 +381,137 @@ def write_vcd(filename):
parallelism['measured'][0] = 0
parallelism['predicted'][0] = 0
# Measured graph
for thread in sorted(Threads.keys()):
sig = "thread%d_mtask" % thread
if sig not in vcd['sigs']['measured_threads']:
vcd['sigs']['measured_threads'][sig] = code
code += 1
mcode = vcd['sigs']['measured_threads'][sig]
nextFreeCode = 0
for start in sorted(Threads[thread]):
mtask = Threads[thread][start]['mtask']
end = Threads[thread][start]['end']
cpu = Threads[thread][start]['cpu']
vcd['values'][start][mcode] = mtask
vcd['values'][end][mcode] = None
def getCode(width, *names):
nonlocal nextFreeCode
scope = scopeSigs
*path, name = names
for item in path:
scope = scope.setdefault(item, {})
code, oldWidth = scope.setdefault(name, (nextFreeCode, width))
assert oldWidth == width
if code == nextFreeCode:
nextFreeCode += 1
return code
def addValue(code, time, val):
if isinstance(val, str):
buf = ""
for c in val:
buf += bin(ord(c))[2:].rjust(8, "0")
val = buf.ljust(LongestVcdStrValueLength * 8, "0")
values[time][code] = val
# Measured graph
for thread in sorted(Threads):
mcode = getCode(32, 'measured', 't%d_mtask' % thread)
for record in Threads[thread]:
start = record['start']
mtask = record['mtask']
end = record['end']
cpu = record['cpu']
addValue(mcode, start, mtask)
addValue(mcode, end, None)
parallelism['measured'][start] += 1
parallelism['measured'][end] -= 1
sig = "cpu%d_thread" % cpu
if sig not in vcd['sigs']['cpus']:
vcd['sigs']['cpus'][sig] = code
code += 1
ccode = vcd['sigs']['cpus'][sig]
vcd['values'][start][ccode] = thread
vcd['values'][end][ccode] = None
code = getCode(32, 'measured', 'cpu%d_thread' % cpu)
addValue(code, start, thread)
addValue(code, end, None)
sig = "mtask%d_cpu" % mtask
if sig not in vcd['sigs']['mtasks']:
vcd['sigs']['mtasks'][sig] = code
code += 1
ccode = vcd['sigs']['mtasks'][sig]
vcd['values'][start][ccode] = cpu
vcd['values'][end][ccode] = None
code = getCode(32, 'measured', 'cpu%d_mtask' % cpu)
addValue(code, start, mtask)
addValue(code, end, None)
# Eval graph
vcd['sigs']['evals']["eval"] = code
elcode = code
code += 1
n = 0
for eval_start in Evals:
eval_end = Evals[eval_start]['end']
n += 1
vcd['values'][eval_start][elcode] = n
vcd['values'][eval_end][elcode] = None
tStart = sorted(_['start'] for records in Threads.values() for _ in records)
tEnd = sorted(_['end'] for records in Threads.values() for _ in records)
# Eval_loop graph
vcd['sigs']['evals']["eval_loop"] = code
elcode = code
code += 1
n = 0
for eval_start in EvalLoops:
eval_end = EvalLoops[eval_start]['end']
n += 1
vcd['values'][eval_start][elcode] = n
vcd['values'][eval_end][elcode] = None
# Predicted graph
for start, end in ExecGraphIntervals:
# Find the earliest MTask start after the start point, and the
# latest MTask end before the end point, so we can scale to the
# same range
start = tStart[bisect.bisect_left(tStart, start)]
end = tEnd[bisect.bisect_right(tEnd, end) - 1]
# Compute scale so predicted graph is of same width as interval
measured_scaling = (end - start) / Global['predict_last_end']
# Predict mtasks that fill the time the execution occupied
for mtask in Mtasks:
thread = Mtasks[mtask]['thread']
pred_scaled_start = start + int(Mtasks[mtask]['predict_start'] * measured_scaling)
pred_scaled_end = start + int(
(Mtasks[mtask]['predict_start'] + Mtasks[mtask]['predict_cost']) *
measured_scaling)
if pred_scaled_start == pred_scaled_end:
continue
if Mtasks:
# Predicted graph
for eval_start in EvalLoops:
eval_end = EvalLoops[eval_start]['end']
# Compute scale so predicted graph is of same width as eval
measured_scaling = (eval_end -
eval_start) / Global['predict_last_end']
# Predict mtasks that fill the time the eval occupied
for mtask in Mtasks:
thread = Mtasks[mtask]['thread']
pred_scaled_start = eval_start + int(
Mtasks[mtask]['predict_start'] * measured_scaling)
pred_scaled_end = eval_start + int(
(Mtasks[mtask]['predict_start'] +
Mtasks[mtask]['predict_cost']) * measured_scaling)
if pred_scaled_start == pred_scaled_end:
continue
mcode = getCode(32, 'predicted', 't%d_mtask' % thread)
addValue(mcode, pred_scaled_start, mtask)
addValue(mcode, pred_scaled_end, None)
sig = "predicted_thread%d_mtask" % thread
if sig not in vcd['sigs']['predicted_threads']:
vcd['sigs']['predicted_threads'][sig] = code
code += 1
mcode = vcd['sigs']['predicted_threads'][sig]
parallelism['predicted'][pred_scaled_start] += 1
parallelism['predicted'][pred_scaled_end] -= 1
vcd['values'][pred_scaled_start][mcode] = mtask
vcd['values'][pred_scaled_end][mcode] = None
# Parallelism graph
for measpred in ('measured', 'predicted'):
pcode = getCode(32, 'stats', '%s_parallelism' % measpred)
value = 0
for time in sorted(parallelism[measpred].keys()):
value += parallelism[measpred][time]
addValue(pcode, time, value)
parallelism['predicted'][pred_scaled_start] += 1
parallelism['predicted'][pred_scaled_end] -= 1
# Parallelism graph
for measpred in ('measured', 'predicted'):
vcd['sigs']['Stats']["%s_parallelism" % measpred] = code
pcode = code
code += 1
value = 0
for time in sorted(parallelism[measpred].keys()):
value += parallelism[measpred][time]
vcd['values'][time][pcode] = value
# Section graph
for thread, section in enumerate(Sections):
if section:
scode = getCode(LongestVcdStrValueLength * 8, "section", f"t{thread}_trace")
dcode = getCode(32, "section", f"t{thread}_depth")
for time, stack in section:
addValue(scode, time, stack[-1] if stack else None)
addValue(dcode, time, len(stack))
# Create output file
fh.write("$version Generated by verilator_gantt $end\n")
fh.write("$timescale 1ns $end\n")
fh.write("\n")
all_codes = {}
all_codes = set()
def writeScope(scope):
assert isinstance(scope, dict)
for key in sorted(scope):
val = scope[key]
if isinstance(val, dict):
fh.write(" $scope module %s $end\n" % key)
writeScope(val)
fh.write(" $upscope $end\n")
else:
(code, width) = val
all_codes.add(code)
fh.write(" $var wire %d v%x %s [%d:0] $end\n" %
(width, code, key, width - 1))
fh.write(" $scope module gantt $end\n")
for module in sorted(vcd['sigs'].keys()):
fh.write(" $scope module %s $end\n" % module)
for sig in sorted(vcd['sigs'][module].keys()):
code = vcd['sigs'][module][sig]
fh.write(" $var wire 32 v%x %s [31:0] $end\n" % (code, sig))
all_codes[code] = 1
fh.write(" $upscope $end\n")
writeScope(scopeSigs)
fh.write(" $upscope $end\n")
fh.write("$enddefinitions $end\n")
fh.write("\n")
first = True
for time in sorted(vcd['values']):
for time in sorted(values):
if first:
first = False
# Start with Z for any signals without time zero data
for code in sorted(all_codes.keys()):
if code not in vcd['values'][time]:
vcd['values'][time][code] = None
for code in sorted(all_codes):
if code not in values[time]:
addValue(code, time, None)
fh.write("#%d\n" % time)
for code in sorted(vcd['values'][time].keys()):
value = vcd['values'][time][code]
for code in sorted(values[time]):
value = values[time][code]
if value is None:
fh.write("bz v%x\n" % code)
elif isinstance(value, str):
fh.write("b%s v%x\n" % (value, code))
else:
fh.write("b%s v%x\n" % (format(value, 'b'), code))
@@ -475,7 +521,7 @@ def write_vcd(filename):
parser = argparse.ArgumentParser(
allow_abbrev=False,
formatter_class=argparse.RawDescriptionHelpFormatter,
description="""Create Gantt chart of multi-threaded execution.
description="""Create Gantt chart of Verilator multi-threaded execution
Verilator_gantt creates a visual representation to help analyze Verilator
#xmultithreaded simulation performance, by showing when each macro-task
@@ -483,8 +529,7 @@ Verilator_gantt creates a visual representation to help analyze Verilator
For documentation see
https://verilator.org/guide/latest/exe_verilator_gantt.html""",
epilog=
"""Copyright 2018-2023 by Wilson Snyder. This program is free software; you
epilog="""Copyright 2018-2025 by Wilson Snyder. This program is free software; you
can redistribute it and/or modify it under the terms of either the GNU
Lesser General Public License Version 3 or the Perl Artistic License
Version 2.0.
@@ -492,19 +537,16 @@ Version 2.0.
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0""")
parser.add_argument('--debug', action='store_true', help='enable debug')
parser.add_argument('--no-vcd',
help='disable creating vcd',
action='store_true')
parser.add_argument('--vcd',
help='filename for vcd outpue',
default='profile_exec.vcd')
parser.add_argument('--no-vcd', help='disable creating vcd', action='store_true')
parser.add_argument('--vcd', help='filename for vcd outpue', default='profile_exec.vcd')
parser.add_argument('filename',
help='input profile_exec.dat filename to process',
default='profile_exec.dat')
Args = parser.parse_args()
process(Args.filename)
read_data(Args.filename)
report()
if not Args.no_vcd:
write_vcd(Args.vcd)
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# pylint: disable=C0114,C0209
#
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
# Copyright 2003-2025 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify the Verilator internals under the terms
# of either the GNU Lesser General Public License Version 3 or the Perl
# Artistic License Version 2.0.
+12 -23
View File
@@ -34,9 +34,8 @@ def profcfunc(filename):
# Older gprofs have no call column for single-call functions
# %time cumesec selfsec {stuff} name
match = re.match(
r'^\s*([0-9.]+)\s+[0-9.]+\s+([0-9.]+)\s+[^a-zA-Z_]*([a-zA-Z_].*)$',
line)
match = re.match(r'^\s*([0-9.]+)\s+[0-9.]+\s+([0-9.]+)\s+[^a-zA-Z_]*([a-zA-Z_].*)$',
line)
if match:
pct = float(match.group(1))
sec = float(match.group(2))
@@ -136,19 +135,15 @@ def profcfunc(filename):
design_width = 1
for func, func_item in vfuncs.items():
if design_width < len(func_item['design']):
design_width = len(func_item['design'])
design_width = max(design_width, len(func_item['design']))
print("Verilog code profile:")
print(" These are split into three categories:")
print(" C++: Time in non-Verilated C++ code")
print(" Prof: Time in profile overhead")
print(" VBlock: Time attributable to a block in a" +
" Verilog file and line")
print(" VCommon: Time in a Verilated module," +
" due to all parts of the design")
print(" VLib: Time in Verilated common libraries," +
" called by the Verilated code")
print(" VBlock: Time attributable to a block in a" + " Verilog file and line")
print(" VCommon: Time in a Verilated module," + " due to all parts of the design")
print(" VLib: Time in Verilated common libraries," + " called by the Verilated code")
print()
print(" % cumulative self ")
@@ -156,13 +151,11 @@ def profcfunc(filename):
"s type filename and line number") % "design")
cume = 0
for func in sorted(vfuncs.keys(),
key=lambda f: vfuncs[f]['sec'],
reverse=True):
for func in sorted(vfuncs.keys(), key=lambda f: vfuncs[f]['sec'], reverse=True):
cume += vfuncs[func]['sec']
print(("%6.2f %9.2f %8.2f %10d %-" + str(design_width) + "s %s") %
(vfuncs[func]['pct'], cume, vfuncs[func]['sec'],
vfuncs[func]['calls'], vfuncs[func]['design'], func))
(vfuncs[func]['pct'], cume, vfuncs[func]['sec'], vfuncs[func]['calls'],
vfuncs[func]['design'], func))
######################################################################
@@ -171,7 +164,7 @@ def profcfunc(filename):
parser = argparse.ArgumentParser(
allow_abbrev=False,
formatter_class=argparse.RawDescriptionHelpFormatter,
description="""Read gprof report created with --prof-cfuncs.
description="""Read gprof report created with Verilator --prof-cfuncs
Verilator_profcfunc reads a profile report created by gprof. The names of
the functions are then transformed, assuming the user used Verilator's
@@ -180,18 +173,14 @@ in each Verilog block.
For documentation see
https://verilator.org/guide/latest/exe_verilator_profcfunc.html""",
epilog=
"""Copyright 2002-2023 by Wilson Snyder. This program is free software; you
epilog="""Copyright 2002-2025 by Wilson Snyder. This program is free software; you
can redistribute it and/or modify it under the terms of either the GNU
Lesser General Public License Version 3 or the Perl Artistic License
Version 2.0.
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0""")
parser.add_argument('--debug',
action='store_const',
const=9,
help='enable debug')
parser.add_argument('--debug', action='store_const', const=9, help='enable debug')
parser.add_argument('filename', help='input gprof output to process')
Args = parser.parse_args()
+1
View File
@@ -26,4 +26,5 @@ if git log --format=%B -n 1 "$COMMIT" | grep -q -i '\[CI\s\+ccache\s\+clear\]';
fi
# Dump stats, then zero stats
# 22.04: ccache -s -v -z
ccache -s -z
+16 -32
View File
@@ -27,12 +27,6 @@ fatal() {
echo "ERROR: $(basename "$0"): $1" >&2; exit 1;
}
if [ "$CI_M32" = "0" ]; then
unset CI_M32
elif [ "$CI_M32" != "1" ]; then
fatal "\$CI_M32 must be '0' or '1'";
fi
if [ "$CI_OS_NAME" = "linux" ]; then
MAKE=make
elif [ "$CI_OS_NAME" = "osx" ]; then
@@ -61,21 +55,18 @@ if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
sudo apt-get update
sudo apt-get install ccache help2man libfl-dev ||
sudo apt-get install ccache help2man libfl-dev
if [ "$CI_RUNS_ON" != "ubuntu-22.04" ]; then
if [ "$CI_RUNS_ON" = "ubuntu-20.04" ]; then
# Some conflict of libunwind verison on 22.04, can live without it for now
sudo apt-get install libgoogle-perftools-dev ||
sudo apt-get install libgoogle-perftools-dev
fi
if [ "$CI_RUNS_ON" = "ubuntu-20.04" ] || [ "$CI_RUNS_ON" = "ubuntu-22.04" ]; then
if [ "$CI_RUNS_ON" = "ubuntu-20.04" ] || [ "$CI_RUNS_ON" = "ubuntu-22.04" ] || [ "$CI_RUNS_ON" = "ubuntu-24.04" ]; then
sudo apt-get install libsystemc libsystemc-dev ||
sudo apt-get install libsystemc libsystemc-dev
fi
if [ "$COVERAGE" = 1 ]; then
yes yes | sudo cpan -fi Parallel::Forker
fi
if [ "$CI_M32" = 1 ]; then
sudo apt-get install gcc-multilib g++-multilib ||
sudo apt-get install gcc-multilib g++-multilib
if [ "$CI_RUNS_ON" = "ubuntu-22.04" ] || [ "$CI_RUNS_ON" = "ubuntu-24.04" ]; then
sudo apt-get install bear mold ||
sudo apt-get install bear mold
fi
elif [ "$CI_OS_NAME" = "osx" ]; then
brew update
@@ -98,38 +89,31 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
sudo apt-get update ||
sudo apt-get update
# libfl-dev needed for internal coverage's test runs
sudo apt-get install gdb gtkwave lcov libfl-dev ccache ||
sudo apt-get install gdb gtkwave lcov libfl-dev ccache
# Required for test_regress/t/t_dist_attributes.pl
if [ "$CI_RUNS_ON" = "ubuntu-22.04" ]; then
sudo apt-get install libclang-dev ||
sudo apt-get install libclang-dev
pip3 install clang==14.0
sudo apt-get install gdb gtkwave lcov libfl-dev ccache jq z3 ||
sudo apt-get install gdb gtkwave lcov libfl-dev ccache jq z3
# Required for test_regress/t/t_dist_attributes.py
if [ "$CI_RUNS_ON" = "ubuntu-22.04" ] || [ "$CI_RUNS_ON" = "ubuntu-24.04" ]; then
sudo apt-get install python3-clang mold ||
sudo apt-get install python3-clang mold
fi
if [ "$CI_RUNS_ON" = "ubuntu-20.04" ] || [ "$CI_RUNS_ON" = "ubuntu-22.04" ]; then
if [ "$CI_RUNS_ON" = "ubuntu-20.04" ] || [ "$CI_RUNS_ON" = "ubuntu-22.04" ] || [ "$CI_RUNS_ON" = "ubuntu-24.04" ]; then
sudo apt-get install libsystemc-dev ||
sudo apt-get install libsystemc-dev
fi
if [ "$CI_M32" = 1 ]; then
sudo apt-get install lib32z1-dev gcc-multilib g++-multilib ||
sudo apt-get install lib32z1-dev gcc-multilib g++-multilib
fi
elif [ "$CI_OS_NAME" = "osx" ]; then
brew update
# brew cask install gtkwave # fst2vcd hangs at launch, so don't bother
brew install ccache perl
brew install ccache perl jq z3
elif [ "$CI_OS_NAME" = "freebsd" ]; then
# fst2vcd fails with "Could not open '<input file>', exiting."
sudo pkg install -y ccache gmake perl5 python3
sudo pkg install -y ccache gmake perl5 python3 jq z3
else
fatal "Unknown os: '$CI_OS_NAME'"
fi
# Common installs
if [ "$CI_RUNS_ON" != "ubuntu-14.04" ]; then
CI_CPAN_REPO=https://cpan.org
fi
yes yes | sudo cpan -M $CI_CPAN_REPO -fi Parallel::Forker
install-vcddiff
# Workaround -fsanitize=address crash
sudo sysctl -w vm.mmap_rnd_bits=28
else
##############################################################################
# Unknown build stage
+32 -18
View File
@@ -21,12 +21,6 @@ fatal() {
echo "ERROR: $(basename "$0"): $1" >&2; exit 1;
}
if [ "$CI_M32" = "0" ]; then
unset CI_M32
elif [ "$CI_M32" != "1" ]; then
fatal "\$CI_M32 must be '0' or '1'";
fi
if [ "$CI_OS_NAME" = "linux" ]; then
export MAKE=make
NPROC=$(nproc)
@@ -39,6 +33,7 @@ elif [ "$CI_OS_NAME" = "freebsd" ]; then
else
fatal "Unknown os: '$CI_OS_NAME'"
fi
NPROC=$(expr $NPROC '+' 1)
if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
##############################################################################
@@ -46,9 +41,10 @@ if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
if [ "$COVERAGE" != 1 ]; then
autoconf
./configure --enable-longtests --enable-ccwarn ${CI_M32:+--enable-m32}
./configure --enable-longtests --enable-ccwarn --prefix="$INSTALL_DIR"
ccache -z
"$MAKE" -j "$NPROC" -k
# 22.04: ccache -s -v
ccache -s
if [ "$CI_OS_NAME" = "osx" ]; then
file bin/verilator_bin
@@ -66,6 +62,7 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
# Run tests
export VERILATOR_TEST_NO_CONTRIBUTORS=1 # Separate workflow check
export VERILATOR_TEST_NO_LINT_PY=1 # Separate workflow check
if [ "$CI_OS_NAME" = "osx" ]; then
export VERILATOR_TEST_NO_GDB=1 # Pain to get GDB to work on OS X
@@ -89,26 +86,43 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
export VERILATOR_TEST_NO_GPROF=1 # gprof is a bit different on FreeBSD, disable
fi
# Run sanitize on Ubuntu 20.04 only
[ "$CI_RUNS_ON" = 'ubuntu-20.04' ] && [ "$CI_M32" = "" ] && sanitize='--sanitize' || sanitize=''
# Run sanitize on Ubuntu 22.04 only
( [ "$CI_RUNS_ON" = 'ubuntu-22.04' ] || [ "$CI_RUNS_ON" = 'ubuntu-24.04' ] ) && sanitize='--sanitize' || sanitize=''
TEST_REGRESS=test_regress
if [ "$CI_RELOC" == 1 ]; then
# Testing that the installation is relocatable.
"$MAKE" install
mkdir -p "$RELOC_DIR"
mv "$INSTALL_DIR" "$RELOC_DIR/relocated-install"
export VERILATOR_ROOT="$RELOC_DIR/relocated-install/share/verilator"
TEST_REGRESS="$RELOC_DIR/test_regress"
mv test_regress "$TEST_REGRESS"
# Feeling brave?
find . -delete
ls -la .
fi
# Run the specified test
ccache -z
case $TESTS in
dist-vlt-0)
"$MAKE" -C test_regress SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=0/3
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=0/4
;;
dist-vlt-1)
"$MAKE" -C test_regress SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=1/3
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=1/4
;;
dist-vlt-2)
"$MAKE" -C test_regress SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=2/3
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=2/4
;;
dist-vlt-3)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=3/4
;;
vltmt-0)
"$MAKE" -C test_regress SCENARIOS=--vltmt DRIVER_HASHSET=--hashset=0/2
"$MAKE" -C "$TEST_REGRESS" SCENARIOS=--vltmt DRIVER_HASHSET=--hashset=0/2
;;
vltmt-1)
"$MAKE" -C test_regress SCENARIOS=--vltmt DRIVER_HASHSET=--hashset=1/2
"$MAKE" -C "$TEST_REGRESS" SCENARIOS=--vltmt DRIVER_HASHSET=--hashset=1/2
;;
coverage-all)
nodist/code_coverage --stages 1-
@@ -180,12 +194,12 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
fatal "Unknown test: $TESTS"
;;
esac
# To see load average (1 minute, 5 minute, 15 minute)
uptime
# 22.04: ccache -s -v
ccache -s
# Upload coverage data
if [[ $TESTS == coverage-* ]]; then
bash <(cat ci/coverage-upload.sh) -f nodist/obj_dir/coverage/app_total.info
fi
else
##############################################################################
# Unknown build stage
+22 -9
View File
@@ -1,15 +1,28 @@
# DESCRIPTION: Verilator: CI Windows Power Shell - Compile Verilator
#
# Copyright 2024 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
#
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
################################################################################
Set-PSDebug -Trace 1
if (-Not (Test-Path $PWD/../.ccache/win_bison.exe)) {
git clone --depth 1 https://github.com/lexxmark/winflexbison
cd winflexbison
mkdir build
cd build
cmake .. --install-prefix $PWD/../../../.ccache
cmake --build . --config Release
cmake --install . --prefix $PWD/../../../.ccache
cd ../..
git clone --depth 1 https://github.com/lexxmark/winflexbison
cd winflexbison
mkdir build
cd build
cmake .. --install-prefix $PWD/../../../.ccache
cmake --build . --config Release -j 3
cmake --install . --prefix $PWD/../../../.ccache
cd ../..
}
mkdir build
cd build
cmake .. --install-prefix $PWD/../install
cmake --build . --config Release
cmake --build . --config Release -j 3
cmake --install . --prefix $PWD/../install
+18 -2
View File
@@ -1,10 +1,26 @@
# DESCRIPTION: Verilator: CI Windows Power Shell - Verilate a test
#
# Copyright 2024 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
#
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
################################################################################
Set-PSDebug -Trace 1
cd install
$Env:VERILATOR_ROOT=$PWD
cd examples/cmake_tracing_c
mkdir build
cd build
cmake ..
cmake --build . --config Release
Release/example.exe
cmake --build . --config Release -j 3
# TODO put this back in, see issue# 5163
# Release/example.exe
cd ..
Remove-Item -path build -recurse
Executable
BIN
View File
Binary file not shown.
File diff suppressed because it is too large Load Diff
+13 -3
View File
@@ -8,6 +8,16 @@
FROM ubuntu:22.04
# Create the user
RUN groupadd verilator \
&& useradd -g verilator -m verilator -s /bin/bash \
&& apt-get update \
&& apt-get install --no-install-recommends -y sudo \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& echo verilator ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/verilator \
&& chmod 0440 /etc/sudoers.d/verilator
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends -y \
@@ -33,7 +43,7 @@ RUN apt-get update \
perl \
python3 \
wget \
zlibc \
z3 \
zlib1g \
zlib1g-dev \
&& apt-get clean \
@@ -41,8 +51,6 @@ RUN apt-get update \
WORKDIR /tmp
RUN cpan install -fi Parallel::Forker
RUN git clone https://github.com/veripool/vcddiff.git && \
make -C vcddiff && \
cp -p vcddiff/vcddiff /usr/local/bin/vcddiff && \
@@ -52,6 +60,8 @@ COPY build.sh /tmp/build.sh
ENV VERILATOR_AUTHOR_SITE=1
USER verilator
WORKDIR /work
ENTRYPOINT [ "/tmp/build.sh" ]
+3 -1
View File
@@ -1,6 +1,8 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Verilator Build Docker Container:
Verilator Build Docker Container
================================
+7 -1
View File
@@ -19,10 +19,16 @@ RUN apt-get update \
ccache \
flex \
git \
help2man \
libfl2 \
libfl-dev \
libgoogle-perftools-dev \
numactl \
perl \
perl-doc \
python3 \
zlib1g \
zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
@@ -39,7 +45,7 @@ RUN git clone "${REPO}" verilator && \
git checkout "${SOURCE_COMMIT}" && \
autoconf && \
./configure && \
make -j "$(nproc)" && \
make && \
make install && \
cd .. && \
rm -r verilator
+4 -3
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
Verilator Executable Docker Container
@@ -11,10 +11,11 @@ easily as a docker image, e.g.:
docker run -ti verilator/verilator:latest --version
This will install the container, run the latest Verilator and print
This will pull the container from `docker hub
<https://hub.docker.com/r/verilator/verilator>`_, run the latest Verilator and print
Verilator's version.
Containers are automatically built for all released versions, so you may
Containers are automatically built and pushed to docker hub for all released versions, so you may
easily compare results across versions, e.g.:
::
+16 -18
View File
@@ -1,6 +1,7 @@
---
# DESCRIPTION: codecov.io config
#
# Copyright 2020-2023 by Wilson Snyder. This program is free software; you
# Copyright 2020-2025 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
@@ -8,31 +9,28 @@
####################
# Validate:
# curl --data-binary @codecov.yml https://codecov.io/validate
#
codecov:
require_ci_to_pass: no
require_ci_to_pass: false
coverage:
precision: 2
round: down
range: "50...100"
range: 50...100
ignore:
- "ci"
- "docs"
- "examples"
- "include/gtkwave"
- "include/vltstd"
- "test_regress"
- "ci" #
- "docs" #
- "examples" #
- "include/gtkwave" #
- "include/vltstd" #
- "test_regress" #
parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no
conditional: true
loop: true
method: false
macro: false
comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: yes
require_changes: true
+135 -75
View File
@@ -1,20 +1,20 @@
# DESCRIPTION: Process this file with autoconf to produce a configure script.
#
# Copyright 2003-2023 by Wilson Snyder. Verilator is free software; you
# Copyright 2003-2025 by Wilson Snyder. Verilator is free software; you
# can redistribute it and/or modify it under the terms of either the GNU Lesser
# General Public License Version 3 or the Perl Artistic License Version 2.0.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
# When releasing, also update header of Changes file
# When releasing, also update header of Changes file, and CMakeLists.txt,
# and commit using "devel release" or "Version bump" message
# Then 'make maintainer-dist'
#AC_INIT([Verilator],[#.### YYYY-MM-DD])
#AC_INIT([Verilator],[#.### devel])
AC_INIT([Verilator],[5.006 2023-01-22],
AC_INIT([Verilator],[5.034 2025-02-24],
[https://verilator.org],
[verilator],[https://verilator.org])
AC_CONFIG_HEADERS(src/config_build.h)
AC_CONFIG_HEADERS(src/config_package.h)
AC_CONFIG_FILES(Makefile src/Makefile src/Makefile_obj include/verilated.mk include/verilated_config.h verilator.pc verilator-config.cmake verilator-config-version.cmake)
# Version
@@ -24,6 +24,13 @@ AC_SUBST(PACKAGE_VERSION_NUMBER)
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_NUMBER_STRING],["$PACKAGE_VERSION_NUMBER"],[Package version as a number])
VERILATOR_VERSION_INTEGER=`AS_ECHO("$PACKAGE_VERSION") | [sed 's/\([0-9]\)\.\([0-9][0-9][0-9]\) .*/\1\2000/g']`
AC_SUBST(VERILATOR_VERSION_INTEGER)
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_STRING_CHAR],
[static const char* const PACKAGE_STRING_UNUSED = "$PACKAGE_STRING";],
[Package version as a number])
AC_SUBST(PACKAGE_VERSION_STRING_CHAR)
######################################################################
## Arguments/flag checking
# Ignore automake flags passed by Ubuntu builds
AC_ARG_ENABLE([dependency-tracking],
@@ -63,20 +70,6 @@ AC_ARG_ENABLE([tcmalloc],
[CFG_WITH_TCMALLOC=check;])
AC_MSG_RESULT($CFG_WITH_TCMALLOC)
# Flag to enable -m32 build
AC_MSG_CHECKING(whether to use -m32)
AC_ARG_ENABLE([m32],
[AS_HELP_STRING([--enable-m32],
[Use -m32 for all compilation and link,
including Verialtor and generated models.])],
[case "${enableval}" in
yes) CFG_ENABLE_M32=yes ;;
no) CFG_ENABLE_M32=no ;;
*) AC_MSG_ERROR([bad value '${enableval}' for --enable-m32]) ;;
esac],
CFG_ENABLE_M32=no)
AC_MSG_RESULT($CFG_ENABLE_M32)
# Flag to enable coverage build
AC_MSG_CHECKING(whether to build for coverage collection)
AC_ARG_ENABLE([coverage],
@@ -144,6 +137,33 @@ AC_ARG_ENABLE([longtests],
AC_SUBST(CFG_WITH_LONGTESTS)
AC_MSG_RESULT($CFG_WITH_LONGTESTS)
AC_CHECK_PROG(HAVE_Z3,z3,yes)
AC_CHECK_PROG(HAVE_CVC5,cvc5,yes)
AC_CHECK_PROG(HAVE_CVC4,cvc4,yes)
# Special Substitutions - CFG_WITH_SOLVER
AC_MSG_CHECKING(for SMT solver)
AC_ARG_WITH([solver],
[AS_HELP_STRING([--with-solver='z3 --in'],
[set default SMT solver for constrained randomization])],
[CFG_WITH_SOLVER="${withval}"],
[CFG_WITH_SOLVER=no
if test "x$HAVE_Z3" = "xyes"; then
CFG_WITH_SOLVER="z3 --in"
elif test "x$HAVE_CVC5" = "xyes"; then
CFG_WITH_SOLVER="cvc5 --incremental"
elif test "x$HAVE_CVC4" = "xyes"; then
CFG_WITH_SOLVER="cvc4 --lang=smt2 --incremental"
fi]
)
AC_SUBST(CFG_WITH_SOLVER)
AC_MSG_RESULT($CFG_WITH_SOLVER)
######################################################################
## Compiler checks
AC_MSG_RESULT([compiler CXX inbound is set to... $CXX])
# Compiler flags (ensure they are not empty to avoid configure defaults)
CFLAGS="$CFLAGS "
CPPFLAGS="$CPPFLAGS "
@@ -156,8 +176,10 @@ AC_PROG_CXX
AC_PROG_INSTALL
AC_LANG_PUSH(C++)
cxx_version=$($CXX --version | head -1)
AC_MSG_RESULT([compiler is $CXX --version = $cxx_version])
CFG_CXX_VERSION=`$CXX --version | head -1`
AC_MSG_RESULT([compiler $CXX --version = $CFG_CXX_VERSION])
AC_SUBST(CFG_CXX_VERSION)
AC_MSG_CHECKING([that C++ compiler can compile simple program])
AC_RUN_IFELSE(
[AC_LANG_SOURCE([int main() { return 0; }])],
@@ -170,24 +192,26 @@ if test "x$AR" = "x" ; then
AC_MSG_ERROR([Cannot find "ar" in your PATH, please install it])
fi
AC_PATH_PROG(PERL,perl)
AC_CHECK_PROG(PERL,perl,perl)
if test "x$PERL" = "x" ; then
AC_MSG_ERROR([Cannot find "perl" in your PATH, please install it])
fi
AC_PATH_PROG(PYTHON3,python3)
AC_CHECK_PROG(PYTHON3,python3,python3)
if test "x$PYTHON3" = "x" ; then
AC_MSG_ERROR([Cannot find "python3" in your PATH, please install it])
fi
python3_version=$($PYTHON3 --version | head -1)
AC_MSG_RESULT([$PYTHON3 --version = $python3_version])
AC_PATH_PROG(LEX,flex)
AC_CHECK_PROG(LEX,flex,flex)
if test "x$LEX" = "x" ; then
AC_MSG_ERROR([Cannot find "flex" in your PATH, please install it])
fi
flex_version=$($LEX --version | head -1)
AC_MSG_RESULT([$LEX --version = $flex_version])
AC_PATH_PROG(YACC,bison)
AC_CHECK_PROG(YACC,bison,bison)
if test "x$YACC" = "x" ; then
AC_MSG_ERROR([Cannot find "bison" in your PATH, please install it])
fi
@@ -276,6 +300,43 @@ AC_DEFUN([_MY_CXX_CHECK_OPT],
_MY_CXX_CHECK_IFELSE($2, $1="$$1 $2")
])
AC_DEFUN([_MY_CXX_CHECK_CORO_SET],
[# _MY_CXX_CHECK_CORO_SET(variable,option)
# Check if compiler supports coroutines with specific option. If it does,
# set variable to option, only if not previously set.
# Define HAVE_COROUTINES if supported.
if test "$$1" = ""; then
if test "$2" != ""; then
_my_msg_opt=" with $2"
else
_my_msg_opt=""
fi
AC_MSG_CHECKING([whether coroutines are supported by $CXX$_my_msg_opt])
ACO_SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $2"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([
#if defined(__clang__) && !defined(__cpp_impl_coroutine)
#define __cpp_impl_coroutine 1
#endif
#include <coroutine>
],[[std::coroutine_handle<> h;]])],
[_my_result=yes],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[#include <experimental/coroutine>],
[[std::experimental::coroutine_handle<> h;]])],
[_my_result=yes],
[_my_result=no])])
AC_MSG_RESULT($_my_result)
CXXFLAGS="$ACO_SAVE_CXXFLAGS"
if test "$_my_result" = "yes" ; then
$1="$2"
AC_DEFINE([HAVE_COROUTINES],[1],[Defined if coroutines are supported by $CXX])
fi
fi
])
AC_DEFUN([_MY_LDLIBS_CHECK_FLAG],
[# _MY_LDLIBS_CHECK_FLAG(flag) -- Check if linker supports specific options
# Set $_my_result appropriately
@@ -315,15 +376,7 @@ AC_DEFUN([_MY_LDLIBS_CHECK_OPT],
_MY_LDLIBS_CHECK_IFELSE($2, $1="$$1 $2")
])
# When using -m32. Check this first as later checks may fail with the -m32 flag.
if test "$CFG_ENABLE_M32" = "yes"; then
_MY_CXX_CHECK_IFELSE(
-m32,
[CXX="$CXX -m32"],
[AC_MSG_ERROR([--enable-m32 was given but compiler does not support -m32])])
fi
# Similarly, add the coverage flags early as they influence later checks.
# Add the coverage flags early as they influence later checks.
if test "$CFG_ENABLE_COVERAGE" = "yes"; then
_MY_CXX_CHECK_OPT(CXX,--coverage)
# Otherwise inline may not show as uncovered
@@ -350,7 +403,7 @@ AC_SUBST(CFG_CXXFLAGS_PROFILE)
# Macros work such that first option that passes is the one we take
# Currently enable c++17/c++14 due to packaged SystemC dependency
# c++17 is the newest that Verilator is regularly tested to support
# c++11 is the oldest that Verilator supports
# c++14 is the oldest that Verilator supports
# gnu is required for Cygwin to compile verilated.h successfully
#_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++20)
#_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++20)
@@ -358,8 +411,6 @@ _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++17)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++17)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++14)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++14)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++11)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++11)
AC_SUBST(CFG_CXXFLAGS_STD_NEWEST)
# Flags for compiling Verilator internals including parser, and Verilated files
@@ -371,33 +422,12 @@ _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_WEXTRA,-Wthread-safety)
AC_SUBST(CFG_CXXFLAGS_WEXTRA)
# Flags for coroutine support for dynamic scheduling
_MY_CXX_CHECK_IFELSE(
-fcoroutines-ts,
[CFG_CXXFLAGS_COROUTINES="-fcoroutines-ts"],
[CFG_CXXFLAGS_COROUTINES="-fcoroutines"])
_MY_CXX_CHECK_CORO_SET(CFG_CXXFLAGS_COROUTINES, "")
_MY_CXX_CHECK_CORO_SET(CFG_CXXFLAGS_COROUTINES,-fcoroutines-ts)
_MY_CXX_CHECK_CORO_SET(CFG_CXXFLAGS_COROUTINES,-fcoroutines)
_MY_CXX_CHECK_CORO_SET(CFG_CXXFLAGS_COROUTINES,-fcoroutines-ts -Wno-deprecated-experimental-coroutine)
_MY_CXX_CHECK_CORO_SET(CFG_CXXFLAGS_COROUTINES,-std=gnu++20)
AC_SUBST(CFG_CXXFLAGS_COROUTINES)
# HAVE_COROUTINES
# Check if coroutines are supported at all
AC_MSG_CHECKING([whether coroutines are supported by $CXX])
ACO_SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $CFG_CXXFLAGS_COROUTINES"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([
#ifdef __clang__
#define __cpp_impl_coroutine 1
#endif
#include <coroutine>
],[[]])],
[_my_result=yes
AC_DEFINE([HAVE_COROUTINES],[1],[Defined if coroutines are supported by $CXX])],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <experimental/coroutine>],[[]])],
[_my_result=yes
AC_DEFINE([HAVE_COROUTINES],[1],[Defined if coroutines are supported by $CXX])],
[_my_result=no])])
AC_MSG_RESULT($_my_result)
CXXFLAGS="$ACO_SAVE_CXXFLAGS"
AC_SUBST(HAVE_COROUTINES)
# Flags for compiling Verilator internals including parser always
@@ -442,14 +472,20 @@ m4_foreach([cflag],[
[-mno-cet],
[-Qunused-arguments],
[-Wno-bool-operation],
[-Wno-tautological-bitwise-compare],
[-Wno-c++11-narrowing],
[-Wno-constant-logical-operand],
[-Wno-non-pod-varargs],
[-Wno-parentheses-equality],
[-Wno-shadow],
[-Wno-sign-compare],
[-Wno-subobject-linkage],
[-Wno-tautological-bitwise-compare],
[-Wno-tautological-compare],
[-Wno-uninitialized],
[-Wno-unused-but-set-parameter],
[-Wno-unused-but-set-variable],
[-Wno-unused-parameter],
[-Wno-unused-variable],
[-Wno-shadow]],[
[-Wno-unused-variable]],[
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,cflag)
# CMake will test what flags work itself, so pass all flags through to it
CFG_CXX_FLAGS_CMAKE="$CFG_CXX_FLAGS_CMAKE cflag"
@@ -470,6 +506,10 @@ m4_foreach([ldflag], [
AC_SUBST(CFG_LDLIBS_THREADS)
AC_SUBST(CFG_LDFLAGS_THREADS_CMAKE)
# If 'mold' is installed, use it to link for faster buildtimes
_MY_LDLIBS_CHECK_OPT(CFG_LDFLAGS_SRC, -fuse-ld=mold)
_MY_LDLIBS_CHECK_OPT(CFG_LDFLAGS_VERILATED, -fuse-ld=mold)
# When linking partially statically
if test "$CFG_ENABLE_PARTIAL_STATIC" = "yes"; then
_MY_LDLIBS_CHECK_OPT(CFG_LDFLAGS_SRC, -static-libgcc)
@@ -480,12 +520,14 @@ else
LTCMALLOC=-ltcmalloc_minimal
fi
AC_SUBST(CFG_LDFLAGS_SRC)
AC_SUBST(CFG_LDFLAGS_VERILATED)
# The pthread library is required by tcmalloc, so add it if it exists. If it
# does not, the tcmalloc check below will fail anyway, and linking against
# pthreads is harmless otherwise.
CFG_LIBS="$LIBS $CFG_LIBS"
_MY_LDLIBS_CHECK_OPT(CFG_LIBS, -lpthread)
_MY_LDLIBS_CHECK_OPT(CFG_LIBS, -latomic)
# Check libraries for MingW
_MY_LDLIBS_CHECK_OPT(CFG_LIBS, -lbcrypt)
@@ -497,7 +539,7 @@ _MY_LDLIBS_CHECK_IFELSE(
[if test "$CFG_WITH_TCMALLOC" != "no"; then
CFG_LIBS="$LTCMALLOC $CFG_LIBS";
# If using tcmalloc, add some extra options to make the compiler not assume
# it is using it's own versions of the standard library functions
# it is using its own versions of the standard library functions
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-malloc)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-calloc)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-realloc)
@@ -508,14 +550,14 @@ _MY_LDLIBS_CHECK_IFELSE(
fi])
AC_SUBST(CFG_LIBS)
# Need C++11 at least
#Alternative: AX_CXX_COMPILE_STDCXX([11])
# Need C++14 at least
#Alternative: AX_CXX_COMPILE_STDCXX([14])
AC_DEFUN([_MY_CXX_CHECK_CXX_VER],
[# _MY_CXX_CHECK_CXX_VER(flag) -- Check if compiler runs C++11
[# _MY_CXX_CHECK_CXX_VER(flag) -- Check if compiler runs C++14
# Set $_my_result
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <thread>
#if (__cplusplus < 201103L)
#if (__cplusplus < 201402L)
# error "Too old"
#endif
], [[ ]])],
@@ -531,13 +573,13 @@ AC_DEFUN([_MY_CXX_CHECK_CXX_VER],
# Add $CFG_CXXFLAGS_STD only if can't compile correctly otherwise,
# as adding std= when not needed can cause errors with the C++ std library.
CFG_CXXFLAGS_STD=$CFG_CXXFLAGS_STD_NEWEST
AC_MSG_CHECKING(whether $CXX supports C++11)
AC_MSG_CHECKING(whether $CXX supports C++14)
_MY_CXX_CHECK_CXX_VER()
AC_MSG_RESULT($_my_result)
if test "$_my_result" = "no" ; then
CXXFLAGS="$CXXFLAGS $CFG_CXXFLAGS_STD"
CFG_CXX_FLAGS_CMAKE="$CFG_CXX_FLAGS_CMAKE $CFG_CXXFLAGS_STD"
AC_MSG_CHECKING(whether $CXX supports C++11 with $CFG_CXXFLAGS_STD)
AC_MSG_CHECKING(whether $CXX supports C++14 with $CFG_CXXFLAGS_STD)
_MY_CXX_CHECK_CXX_VER()
AC_MSG_RESULT($_my_result)
else
@@ -547,13 +589,28 @@ else
fi
if test "$_my_result" = "no" ; then
AC_MSG_NOTICE([[]])
AC_MSG_ERROR([[the $CXX compiler appears to not support C++11.
AC_MSG_ERROR([[the $CXX compiler appears to not support C++14.
Verilator requires a C++11 or newer compiler.]])
Verilator requires a C++14 or newer compiler.]])
fi
AC_SUBST(CFG_CXXFLAGS_STD)
# Compiler precompiled header options (assumes either gcc or clang++)
AC_MSG_CHECKING([for $CXX precompile header include option])
if $CXX --help | grep include-pch >/dev/null 2>/dev/null ; then
# clang
CFG_CXXFLAGS_PCH_I=-include-pch
CFG_GCH_IF_CLANG=.gch
else
# GCC
CFG_CXXFLAGS_PCH_I=-include
CFG_GCH_IF_CLANG=
fi
AC_MSG_RESULT($CFG_CXXFLAGS_PCH_I)
AC_SUBST(CFG_CXXFLAGS_PCH_I)
AC_SUBST(CFG_GCH_IF_CLANG)
# Checks for library functions.
AC_CHECK_MEMBER([struct stat.st_mtim.tv_nsec],
[AC_DEFINE([HAVE_STAT_NSEC],[1],[Defined if struct stat has st_mtim.tv_nsec])],
@@ -568,7 +625,7 @@ ACO_SAVE_LIBS="$LIBS"
LIBS="$LIBS -lsystemc"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <systemc.h>
extern "C" int sc_main(int argc, char* argv[]) {}
extern "C" int sc_main(int argc, char* argv[]) { return 0; }
]],[[sc_version()]])],
[_my_result=yes
AC_DEFINE([HAVE_SYSTEMC],[1],[Defined if have SystemC library])],
@@ -579,6 +636,9 @@ AC_SUBST(HAVE_SYSTEMC)
# Checks for system services
######################################################################
## Output
# Other install directories
pkgdatadir=${datadir}/verilator
AC_SUBST(pkgdatadir)
+27 -20
View File
@@ -7,12 +7,15 @@ This contributing document contains some suggestions that may make
contributions flow more efficiently.
Did you find a bug?
-------------------
Did you find a Verilator bug?
-----------------------------
- Please **Ensure the bug was not already reported** by searching
- Please **ensure the bug was not already reported** by searching
`Verilator Issues <https://verilator.org/issues>`__.
- Please **download the latest development GitHub version**, build, and see
if the issue has been fixed.
- If you're unable to find an open issue addressing the problem, `open a
new Verilator issue <https://verilator.org/issues/new>`__.
@@ -20,21 +23,28 @@ Did you find a bug?
demonstrating the bug and expected behavior that is not occurring.
- The ideal example works against other simulators, and is in the
test_regress/t test format, as described in `docs/internals
<internals.rst>`__.
test_regress/t test format, as described in
`Verilator Internals Documentation
<https://github.com/verilator/verilator/blob/master/docs/internals.rst>`__.
Did you write a patch that fixes a bug?
---------------------------------------
Did you write a patch that fixes a Verilator bug?
-------------------------------------------------
- Please `Open a new issue <https://verilator.org/issues/new>`__.
- Please `Open a new Verilator issue <https://verilator.org/issues/new>`__
if there is not one already describing the bug.
- You may attach a patch to the issue, or (preferred) may request a
GitHub pull request.
- Please `Open a Verilator pull request
<https://github.com/verilator/verilator/pulls>`__.
- Verilator uses GitHub Actions to provide continuous integration. You
may want to enable Actions on your GitHub branch to ensure your changes
keep the tests passing. See `docs/internals <internals.rst>`__.
- See the coding conventions, and other developer information in
``docs/internals.rst`` in the distribution, or as rendered at
`Verilator Internals Documentation
<https://github.com/verilator/verilator/blob/master/docs/internals.rst>`__.
- Verilator uses GitHub Actions to provide continuous integration. You
may want to enable Actions on your GitHub branch to ensure your changes
keep the tests passing.
- Your source-code contributions must be certified as open source,
under the `Developer Certificate of
@@ -56,17 +66,14 @@ Did you write a patch that fixes a bug?
contribution.
- Your test contributions are generally considered released into the
Creative Commons Public Domain (CC0), unless you request otherwise or
Creative Commons Public Domain (CC0), unless you request otherwise, or
put a GNU/Artistic license on your file.
- Most important is we get your patch. If you'd like to clean up
indentation and related issues ahead of our feedback, that is
appreciated; please see the coding conventions in `docs/internals
<internals.rst>`__.
- Most important is we get your patch.
Do you have questions?
----------------------
Do you have questions on Verilator?
-----------------------------------
- Please see FAQ section and rest of the `Verilator
manual <https://verilator.org/verilator_doc.html>`__, or `Verilator
+101 -3
View File
@@ -3,52 +3,90 @@ under the Developer Certificate of Origin (https://developercertificate.org/).
Please see the Verilator manual for 200+ additional contributors. Thanks to all.
Adam Bagley
Adrian Sampson
Adrien Le Masle
Ahmed El-Mahmoudy
Aidan McNay
Aleksander Kiryk
Alex Chadwick
Alex Solomatnikov
Àlex Torregrosa
Aliaksei Chapyzhenka
Ameya Vikram Singh
Andrea Calabrese
Andreas Kuster
Andrei Kostovski
Andrew Miloradovsky
Andrew Nolte
Anthony Donlon
Anthony Moore
Arkadiusz Kozdra
Arthur Rosa
Aylon Chaim Porat
Bartłomiej Chmiel
Cameron Kirk
Chih-Mao Chen
Chris Bachhuber
Chris Randall
Christopher Taylor
Chuxuan Wang
Chykon
Conor McCullough
Dan Petrisko
Daniel Bates
David Horton
David Ledger
David Metz
Dave Sargeant
David Stanford
David Turner
Dercury
Diego Roux
Don Williamson
Drew Ranck
Drew Taussig
Driss Hafdi
Edgar E. Iglesias
Eric Müller
Eric Rippey
Ethan Sifferman
Eyck Jentzsch
Furqan Nadir
Fabian Keßler
Fan Shupei
february cozzocrea
Felix Neumärker
Felix Yan
Frans Skarman
Fuad Ismail
G-A. Kamendje
Garrett Smith
Geza Lore
Gianfranco Costamagna
Gijs Burghoorn
Glen Gibb
Gökçe Aydos
Graham Rushton
Greg Davill
Guokai Chen
Gus Smith
Gustav Svensk
G-A. Kamendje
Han Qi
Harald Heckmann
Hennadii Chernyshchyk
Howard Su
Huang Rui
Huanghuang Zhou
HungMingWu
HyungKi Jeong
Ícaro Lima
Ilya Barkov
Iru Cai
Ivan Vnučec
Ilya Barkov
Iztok Jeras
Jake Merdich
James Bailey
James Hanlon
James Hutchinson
James Pallister
@@ -56,27 +94,48 @@ James Shi
Jamey Hicks
Jamie Iles
Jan Van Winkel
Jiangjie Weng
Jean Berniolles
Jeremy Bennett
Jesse Taube
Jevin Sweval
Jiacheng Qian
Jiamin Zhu
Jitesh Nayak
Jinyan Xu
Jiuyang Liu
Joey Liu
John Coiner
John Demme
John Wehle
Jonathan Drolet
Jonathan Schröter
Jordan McConnon
Jose Loyola
Josep Sans
Joseph Nwabueze
Josh Redford
Julian Daube
Julie Schwartz
Julien Margetts
Justin Thiel
Kaleb Barrett
Kamil Rakoczy
Kanad Kanhere
Kefa Chen
Keith Colbert
Kevin Kiningham
Kevin Nygaard
Kritik Bhimani
Krzysztof Bieganski
Krzysztof Boronski
Krzysztof Boroński
Krzysztof Obłonczek
Krzysztof Starecki
Kuba Ober
Larry Doolittle
Liam Braun
Luca Colagrande
Ludwig Rogiers
Lukasz Dalek
Maarten De Braekeleer
@@ -90,61 +149,100 @@ Marshal Qiao
Martin Schmidt
Martin Stadler
Matthew Ballance
Michael Bikovitsky
Michael Killough
Michaël Lefebvre
Michal Czyz
Mike Popoloski
Miodrag Milanović
Mladen Slijepcevic
Morten Borup Petersen
Mostafa Gamal
Moubarak Jeje
Nandu Raj
Natan Kreimer
Nathan Graybeal
Nathan Kohagen
Nathan Myers
Nick Brereton
Nolan Poe
Oleh Maksymenko
Patrick Stewart
Paul Bowen-Huggett
Paul Swirhun
Paul Wright
Pawel Jewstafjew
Pawel Sagan
Pengcheng Xu
Peter Debacker
Peter Horvath
Peter Monsson
Philip Axer
Philipp Wagner
Pierre-Henri Horrein
Pieter Kapsenberg
Piotr Binkowski
Qingyao Sun
Quentin Corradi
Rafal Kapuscik
Rasfunk
Raynard Qiao
Ricardo Barbedo
Richard Myers
Risto Pejašinović
Robert Balas
Rupert Swarbrick
Ryan Ziegler
Ryszard Rozak
Samuel Riedel
Sean Cross
Sebastien Van Cauwenberghe
Sergi Granell
Seth Pellegrino
Srinivasan Venkataramanan
Stefan Wallentowitz
Stephen Henry
Steven Hugg
sumpster
Szymon Gizler
Sören Tempel
Teng Huang
Tom Manner
Tim Hutt
Tim Snyder
Tobias Rosenkranz
Tobias Wölfel
Todd Strader
Tomasz Gorochowik
Topa Topino
Toru Niina
Trung Nguyen
Tudor Timi
Tymoteusz Blazejczyk
Udi Finkelstein
Unai Martinez-Corral
Udaya Raj Subedi
Valentin Atepalikhin
Varun Koyyalagunta
Vassilis Papaefstathiou
Veripool API Bot
Victor Besyakov
Vito Gamberini
William D. Jones
Wilson Snyder
Xi Zhang
Yan Xu
Yangyu Chen
Yilou Wang
Yinan Xu
Yoda Lee
Yossi Nivin
Yu-Sheng Lin
Yuri Victorovich
Yutetsu TAKATSUKASA
Yu-Sheng Lin
Yves Mathieu
Zhanglei Wang
Zhou Shen
Zixi Li
أحمد المحمودي
404allen404
+6 -2
View File
@@ -5,7 +5,7 @@
#
# Code available from: https://verilator.org
#
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
# Copyright 2003-2025 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
@@ -18,12 +18,16 @@
RST2HTML = rst2html
PYTHON3 = python3
DOXYGEN = doxygen
SPHINXOPTS ?= -c guide
SPHINXBUILD ?= sphinx-build
SOURCEDIR = guide
BUILDDIR = _build
SPHINXOPTS ?= -c guide -j 4
ifneq ($(VERILATOR_ANALYTICS_ID),)
SPHINXOPTS += -D html_theme_options.analytics_id=$(VERILATOR_ANALYTICS_ID)
endif
######################################################################
.SUFFIXES:
+21
View File
@@ -0,0 +1,21 @@
Verilator Documentation
=======================
This folder contains sources for Verilator documentation.
For formatted documentation see:
- `Verilator README <https://github.com/verilator/verilator>`_
- `Verilator installation and package directory structure
<https://verilator.org/install>`_
- `Verilator manual (HTML) <https://verilator.org/verilator_doc.html>`_,
or `Verilator manual (PDF) <https://verilator.org/verilator_doc.pdf>`_
- `Subscribe to Verilator announcements
<https://github.com/verilator/verilator-announce>`_
- `Verilator forum <https://verilator.org/forum>`_
- `Verilator issues <https://verilator.org/issues>`_
+4 -10
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# pylint: disable=C0112,C0114,C0115,C0116,C0209,C0301,R0201,R0903
# pylint: disable=C0112,C0114,C0115,C0116,C0209,C0301,R0903
# -*- Python -*- See copyright, etc below
######################################################################
@@ -23,9 +23,7 @@ class VlSphinxExtract:
outname = match.group(1)
print("Writing %s" % outname)
fhw = open(outname, "w", encoding="utf8") # pylint: disable=consider-using-with
fhw.write(
".. comment: generated by vl_sphinx_extract from " +
filename + "\n")
fhw.write(".. comment: generated by vl_sphinx_extract from " + filename + "\n")
fhw.write(".. code-block::\n")
elif re.match(r'^[=a-zA-Z0-9_]', line):
fhw = None
@@ -39,18 +37,14 @@ parser = argparse.ArgumentParser(
allow_abbrev=False,
formatter_class=argparse.RawDescriptionHelpFormatter,
description="""Read a file and extract documentation data.""",
epilog=
""" Copyright 2021-2023 by Wilson Snyder. This package is free software;
epilog=""" Copyright 2021-2025 by Wilson Snyder. This package is free software;
you can redistribute it and/or modify it under the terms of either the GNU
Lesser General Public License Version 3 or the Perl Artistic License
Version 2.0.
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0""")
parser.add_argument('--debug',
action='store_const',
const=9,
help='enable debug')
parser.add_argument('--debug', action='store_const', const=9, help='enable debug')
parser.add_argument('path', help='path to extract from')
Args = parser.parse_args()
+3 -8
View File
@@ -18,8 +18,7 @@ class VlSphinxFix:
if os.path.isdir(path):
for basefile in os.listdir(path):
file = os.path.join(path, basefile)
if ((basefile != ".") and (basefile != "..")
and basefile not in self.SkipBasenames
if ((basefile != ".") and (basefile != "..") and basefile not in self.SkipBasenames
and not os.path.islink(file)):
self.process(file)
elif re.search(r'\.(html|tex)$', path):
@@ -54,18 +53,14 @@ parser = argparse.ArgumentParser(
allow_abbrev=False,
formatter_class=argparse.RawDescriptionHelpFormatter,
description="""Post-process Sphinx HTML.""",
epilog=
""" Copyright 2021-2023 by Wilson Snyder. This package is free software;
epilog=""" Copyright 2021-2025 by Wilson Snyder. This package is free software;
you can redistribute it and/or modify it under the terms of either the GNU
Lesser General Public License Version 3 or the Perl Artistic License
Version 2.0.
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0""")
parser.add_argument('--debug',
action='store_const',
const=9,
help='enable debug')
parser.add_argument('--debug', action='store_const', const=9, help='enable debug')
parser.add_argument('path', help='path to edit')
Args = parser.parse_args()
+11
View File
@@ -0,0 +1,11 @@
.. comment: generated by t_lint_pinmissing_bad
.. code-block:: sv
:linenos:
:emphasize-lines: 2
module t;
sub sub(); // <--- Warning
endmodule
module sub
(output port);
endmodule
+4
View File
@@ -0,0 +1,4 @@
.. comment: generated by t_lint_pinmissing_bad
.. code-block::
%Warning-PINMISSING: example.v:1:8 Cell has missing pin: 'port'
+11
View File
@@ -0,0 +1,11 @@
.. comment: generated by t_lint_pkgnodecl_bad
.. code-block:: sv
:linenos:
:emphasize-lines: 2
module t;
initial Pkg::hello(); //<--- Warning
endmodule
package Pkg;
function void hello(); endfunction
endpackage
+4
View File
@@ -0,0 +1,4 @@
.. comment: generated by t_lint_pkgnodecl_bad
.. code-block::
%Error-PKGNODECL: example.v:1:12 Package/class 'Pkg' not found, and needs to be predeclared (IEEE 1800-2023 26.3)
+8
View File
@@ -0,0 +1,8 @@
.. comment: generated by t_lint_widthexpand_docs_bad
.. code-block:: sv
:linenos:
:emphasize-lines: 3
int array[5];
bit [1:0] rd_addr;
wire int rd_value = array[rd_addr]; //<--- Warning
+5
View File
@@ -0,0 +1,5 @@
.. comment: generated by t_lint_widthexpand_docs_bad
.. code-block:: sv
:emphasize-lines: 1
wire int rd_value = array[{1'b0, rd_addr}]; //<--- Fixed
+4
View File
@@ -0,0 +1,4 @@
.. comment: generated by t_lint_widthexpand_docs_bad
.. code-block::
%Warning-WIDTHEXPAND: example.v:3:29 Bit extraction of array[4:0] requires 3 bit index, not 2 bits.
-8
View File
@@ -1,8 +0,0 @@
.. comment: generated by t_lint_width_docs_bad
.. code-block:: sv
:linenos:
:emphasize-lines: 3
int array[5];
bit [1:0] rd_addr;
wire int rd_value = array[rd_addr]; //<--- Warning
-5
View File
@@ -1,5 +0,0 @@
.. comment: generated by t_lint_width_docs_bad
.. code-block:: sv
:emphasize-lines: 1
wire int rd_value = array[{1'b0, rd_addr}]; //<--- Fixed
-4
View File
@@ -1,4 +0,0 @@
.. comment: generated by t_lint_width_docs_bad
.. code-block::
%Warning-WIDTH: example.v:3:29 Bit extraction of array[4:0] requires 3 bit index, not 2 bits.
+1 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
****************
+16 -15
View File
@@ -1,7 +1,7 @@
# pylint: disable=C0103,C0114,C0116,C0301,E0402,W0622
#
# Configuration file for Verilator's Sphinx documentation builder.
# Copyright 2003-2023 by Wilson Snyder.
# Copyright 2003-2025 by Wilson Snyder.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
#
# This file only contains overridden options. For a full list:
@@ -10,7 +10,6 @@
# ----------------------------------------------------------------------
# -- Path setup
from datetime import datetime
import os
import re
import sys
@@ -24,10 +23,17 @@ def get_vlt_version():
filename = "../../Makefile"
with open(filename, "r", encoding="utf8") as fh:
for line in fh:
match = re.search(r"PACKAGE_VERSION_NUMBER *= *([a-z0-9.]+)", line)
match = re.search(r"PACKAGE_VERSION *= *([a-z0-9.]+) +([-0-9]+)", line)
if match:
return match.group(1)
return "unknown"
return match.group(1), match.group(2)
match = re.search(r"PACKAGE_VERSION *= *([a-z0-9.]+) +devel", line)
if match:
try:
data = os.popen('git log -n 1 --pretty=%cs').read()
except Exception: # pylint: disable=broad-except
data = "" # fallback, and Sphinx will fill in today's date
return "Devel " + match.group(1), data
return "unknown", "unknown"
def setup(app):
@@ -38,14 +44,14 @@ def setup(app):
# -- Project information
project = 'Verilator'
copyright = '2022 by Wilson Snyder, under LGPL-3.0 or Artistic-2.0'
copyright = '2024 by Wilson Snyder, under LGPL-3.0 or Artistic-2.0'
author = 'Wilson Snyder'
# The master toctree document.
master_doc = "index"
version = get_vlt_version()
release = get_vlt_version()
version, today_fmt = get_vlt_version()
release = version
rst_prolog = """
.. role:: vlopt(option)
@@ -68,8 +74,7 @@ extensions = []
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = [
'_build', 'Thumbs.db', '.DS_Store', 'internals.rst', 'xml.rst', 'gen/ex_*',
'CONTRIBUTING.rst'
'_build', 'Thumbs.db', '.DS_Store', 'internals.rst', 'xml.rst', 'gen/ex_*', 'CONTRIBUTING.rst'
]
# Warn about refs
@@ -89,9 +94,6 @@ source_suffix = [".rst"]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# Date format to ISO
today_fmt = datetime.now().strftime("%F")
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
@@ -111,7 +113,6 @@ html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_theme_options = {
'analytics_id': 'G-D27B0C9QEB',
'logo_only': True,
'style_nav_header_background': "#45acf8", # Default is #2980B9
# 'canonical_url':
@@ -227,4 +228,4 @@ spelling_ignore_contributor_names = True
breathe_projects = {"verilated": "_build/doxygen/verilated/xml/"}
breathe_default_project = "verilated"
breathe_default_members = ('members')
breathe_default_members = 'members'
+72 -11
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Connecting:
@@ -120,6 +120,52 @@ code. This is a feature, as using the SystemC pin interconnect scheme
everywhere would reduce performance by an order of magnitude.
Verilated API
=============
The API to a Verilated model is the C++ headers in the include/ directory
in the distribution. These headers use Doxygen comments, `///` and `//<`,
to indicate and document those functions that are part of the Verilated
public API.
Process-Level Clone APIs
--------------------------
Modern operating systems support process-level clone (a.k.a copying, forking)
with system call interfaces in C/C++, e.g., :code:`fork()` in Linux.
However, after cloning a parent process, some resources cannot be inherited
in the child process. For example, in POSIX systems, when you fork a process,
the child process inherits all the memory of the parent process. However,
only the thread that called fork is replicated in the child process. Other
threads are not.
Therefore, to support the process-level clone mechanisms, Verilator supports
:code:`prepareClone()` and :code:`atClone()` APIs to allow the user to manually
re-construct the model in the child process. The two APIs handle all necessary
resources required for releasing and re-initializing before and after cloning.
The two APIs are supported in the verilated models. Here is an example of usage
with Linux :code:`fork()` and :code:`pthread_atfork` APIs:
.. code-block:: C++
// static function pointers to fit pthread_atfork
static auto prepareClone = [](){ topp->prepareClone(); };
static auto atClone = [](){ topp->atClone(); };
// in main function, register the handlers:
pthread_atfork(prepareClone, atClone, atClone);
For better flexibility, you can also manually call the handlers before and
after :code:`fork()`.
With the process-level clone APIs, users can create process-level snapshots
for the verilated models. While the Verilator save/restore option provides
persistent and circuit-dependent snapshots, the process-level clone APIs
enable in-memory, circuit-transparent, and highly efficient snapshots.
Direct Programming Interface (DPI)
==================================
@@ -361,6 +407,16 @@ only a couple of instructions.
For signal callbacks to work the main loop of the program must call
:code:`VerilatedVpi::callValueCbs()`.
Verilator also tracks when the model state has been modified via the VPI with
an :code:`evalNeeded` flag. This flag can be checked with :code:`VerilatedVpi::evalNeeded()`
and it can be cleared with :code:`VerilatedVpi::clearEvalNeeded()`. Used together
it is possible to skip :code:`eval()` calls if no model state has been changed
since the last :code:`eval()`.
Any data written via :code:`vpi_put_value` with :code:`vpiInertialDelay` will
be deferred for later. These delayed values can be flushed to the model with
:code:`VerilatedVpi::doInertialPuts()`.
.. _VPI Example:
@@ -374,9 +430,11 @@ changed on the specified clock edge.
.. code-block:: bash
cat >our.v <<'EOF'
module our (input clk);
reg readme /*verilator public_flat_rd*/;
reg writeme /*verilator public_flat_rw @(posedge clk) */;
module our #(
parameter WIDTH /*verilator public_flat_rd*/ = 32
) (input clk);
reg [WIDTH-1:0] readme /*verilator public_flat_rd*/;
reg [WIDTH-1:0] writeme /*verilator public_flat_rw @(posedge clk) */;
initial $finish;
endmodule
EOF
@@ -398,12 +456,14 @@ accesses the above signal "readme" would be:
vpiHandle vh1 = vpi_handle_by_name((PLI_BYTE8*)"TOP.our.readme", NULL);
if (!vh1) vl_fatal(__FILE__, __LINE__, "sim_main", "No handle found");
const char* name = vpi_get_str(vpiName, vh1);
printf("Module name: %s\n", name); // Prints "readme"
const char* type = vpi_get_str(vpiType, vh1);
const int size = vpi_get(vpiSize, vh1);
printf("register name: %s, type: %s, size: %d\n", name, type, size); // Prints "register name: readme, type: vpiReg, size: 32"
s_vpi_value v;
v.format = vpiIntVal;
vpi_get_value(vh1, &v);
printf("Value of v: %d\n", v.value.integer); // Prints "readme"
printf("Value of %s: %d\n", name, v.value.integer); // Prints "Value of readme: 0"
}
int main(int argc, char** argv) {
@@ -450,7 +510,7 @@ the user should call:
any delayed events pending,
* :code:`designp->nextTimeSlot()`, which returns the simulation time of the
next delayed event. This method can only be called if
:code:`designp->nextTimeSlot()` returned :code:`true`.
:code:`designp->eventsPending()` returned :code:`true`.
Call :code:`eventsPending()` to check if you should continue with the
simulation, and then :code:`nextTimeSlot()` to move simulation time forward.
@@ -479,11 +539,12 @@ distribution.
Verilated and VerilatedContext
==============================
Multiple Verilated models may be part of the same simulation context, that
is share a VPI interface, sense of time, and common settings. This common
simulation context information is stored in a ``VerilatedContext``
Multiple C++ Verilated models may be part of the same simulation context,
that is share a VPI interface, sense of time, and common settings. This
common simulation context information is stored in a ``VerilatedContext``
structure. If a ``VerilatedContext`` is not created prior to creating a
model, a default global one is created automatically.
model, a default global one is created automatically. SystemC requires
using only the single, default VerilatedContext.
The ``Verilated::`` methods, including the ``Verilated::commandArgs`` call
shown above, call VerilatedContext methods using the default global
+30 -12
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
*******************************
@@ -23,24 +23,24 @@ Next, try the :vlopt:`--debug` option. This will enable additional
internal assertions, and may help identify the problem.
Finally, reduce your code to the smallest possible routine that exhibits
the bug. Even better, create a test in the :file:`test_regress/t`
directory, as follows:
the bug (see: :ref:`Minimizing bug-inducing code`). Even better, create
a test in the :file:`test_regress/t` directory, as follows:
.. code-block:: bash
cd test_regress
cp -p t/t_EXAMPLE.pl t/t_BUG.pl
cp -p t/t_EXAMPLE.py t/t_BUG.py
cp -p t/t_EXAMPLE.v t/t_BUG.v
There are many hints on how to write a good test in the
:file:`test_regress/driver.pl` documentation which can be seen by running:
:file:`test_regress/driver.py` documentation which can be seen by running:
.. code-block:: bash
cd $VERILATOR_ROOT # Need the original distribution kit
test_regress/driver.pl --help
test_regress/driver.py --help
Edit :file:`t/t_BUG.pl` to suit your example; you can do anything you want
Edit :file:`t/t_BUG.py` to suit your example; you can do anything you want
in the Verilog code there; just make sure it retains the single clk input
and no outputs. Now, the following should fail:
@@ -48,20 +48,38 @@ and no outputs. Now, the following should fail:
cd $VERILATOR_ROOT # Need the original distribution kit
cd test_regress
t/t_BUG.pl # Run on Verilator
t/t_BUG.pl --debug # Run on Verilator, passing --debug to Verilator
t/t_BUG.pl --vcs # Run on VCS simulator
t/t_BUG.pl --nc|--iv|--ghdl # Likewise on other simulators
t/t_BUG.py # Run on Verilator
t/t_BUG.py --debug # Run on Verilator, passing --debug to Verilator
t/t_BUG.py --vcs # Run on VCS simulator
t/t_BUG.py --nc|--iv|--ghdl # Likewise on other simulators
The test driver accepts a number of options, many of which mirror the main
Verilator options. For example the previous test could have been run with
debugging enabled. The full set of test options can be seen by running
:command:`driver.pl --help` as shown above.
:command:`driver.py --help` as shown above.
Finally, report the bug at `Verilator Issues
<https://verilator.org/issues>`_. The bug will become publicly visible; if
this is unacceptable, mail the bug report to ``[email protected]``.
.. _Minimizing bug-inducing code:
Minimizing bug-inducing code
============================
In some cases, the part of the code that causes the bug is clearly visible
and the design can be easily manually reduced. In other cases, the bug is
caused by a complex interaction of many parts of the design, and it is not
clear which parts are necessary to reproduce the bug. In these cases, an
Open Source tool called `sv-bugpoint
<https://github.com/antmicro/sv-bugpoint>_` can be used to automatically
reduce a SystemVerilog design to the smallest possible reproducer.
It can be used to automatically reduce a design with hundreds of thousands of
lines to a minimal test case while preserving the bug-inducing behavior.
Please refer to the `README
<https://github.com/antmicro/sv-bugpoint/blob/main/README.md>`_ file for more
information on how to use `sv-bugpoint`.
.. Contributing
.. ============
+136 -96
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
************************
@@ -27,107 +27,147 @@ Alliance <https://chipsalliance.org>`_, `Antmicro Ltd
<https://antmicro.com>`_ and `Shunyao CAD <https://shunyaocad.com>`_.
Previous major corporate sponsors of Verilator, by providing significant
contributions of time or funds include: Atmel Corporation, Cavium
Inc., Compaq Corporation, Digital Equipment Corporation, Embecosm Ltd.,
Hicamp Systems, Intel Corporation, Mindspeed Technologies Inc., MicroTune
Inc., picoChip Designs Ltd., Sun Microsystems Inc., Nauticus Networks Inc.,
SiCortex Inc, and Shunyao CAD.
contributions of time or funds include: Antmicro Ltd., Atmel Corporation,
Compaq Corporation, Digital Equipment Corporation, Embecosm Ltd., Hicamp
Systems, Intel Corporation, Marvell Inc., Mindspeed Technologies Inc.,
MicroTune Inc., picoChip Designs Ltd., Sun Microsystems Inc., Nauticus
Networks Inc., SiCortex Inc, Shunyao CAD, and Western Digital Inc.
The contributors of major functionality are: Krzysztof
Bieganski, Byron Bradley, Jeremy Bennett, Lane Brooks, John Coiner, Duane
Galbi, Geza Lore, Todd Strader, Stefan Wallentowitz, Paul Wasson, Jie Xu,
and Wilson Snyder. Major testers included Jeff Dutton, Jonathon Donaldson,
Ralf Karge, David Hewson, Iztok Jeras, Wim Michiels, Alex Solomatnikov,
Sebastien Van Cauwenberghe, Gene Weber, and Clifford Wolf.
The contributors of major functionality are: Jeremy Bennett, Krzysztof
Bieganski, Byron Bradley, Lane Brooks, John Coiner, Duane Galbi, Arkadiusz
Kozdra, Geza Lore, Todd Strader, Yutetsu Takatsukasa, Stefan Wallentowitz,
Paul Wasson, Jie Xu, and Wilson Snyder.
Some of the people who have provided ideas, and feedback for Verilator
include:
David Addison, Tariq B. Ahmad, Nikana Anastasiadis, Vasu Arasanipalai, Jens
Arm, Sharad Bagri, Matthew Ballance, Andrew Bardsley, Matthew Barr, Geoff
Barrett, Kaleb Barrett, Julius Baxter, Jeremy Bennett, Michael Berman, Jean
Berniolles, Victor Besyakov, Moinak Bhattacharyya, Krzysztof Bieganski,
David Binderman, Piotr Binkowski, Johan Bjork, David Black, Tymoteusz
Blazejczyk, Daniel Bone, Gregg Bouchard, Christopher Boumenot, Nick Bowler,
Byron Bradley, Bryan Brady, Maarten De Braekeleer, Charlie Brej, J Briquet,
Lane Brooks, John Brownlee, Jeff Bush, Lawrence Butcher, Tony Bybell, Iru
Cai, Ted Campbell, Chris Candler, Lauren Carlson, Donal Casey, Alex
Chadwick, Marcel Chang, Aliaksei Chapyzhenka, Guokai Chen, Terry Chen,
Yi-Chung Chen, Enzo Chi, Robert A. Clark, Ryan Clarke, Allan Cochrane, John
Coiner, Keith Colbert, Gianfranco Costamagna, Sean Cross, George Cuan, Joe
DErrico, Lukasz Dalek, Gunter Dannoritzer, Ashutosh Das, Bernard Deadman,
John Demme, Mike Denio, John Deroo, Philip Derrick, John Dickol, Ruben
Diez, Danny Ding, Jacko Dirks, Ivan Djordjevic, Jonathon Donaldson, Larry
Doolittle, Sebastian Dressler, Jonathan Drolet, Alex Duller, Jeff Dutton,
David Addison, Tariq B. Ahmad, Nikana Anastasiadis, John David Anglin,
Frederic Antonin, Hans Van Antwerpen, Vasu Arasanipalai, Jens Arm, Rohan
Arshid, Valentin Atepalikhin, Philip Axer, Gökçe Aydos, Chris Bachhuber,
Filip Badáň, Adam Bagley, Sharad Bagri, James Bailey, Robert Balas, Marco
Balboni, Matthew Ballance, Ricardo Barbedo, Andrew Bardsley, Ilya Barkov,
Matthew Barr, Geoff Barrett, Kaleb Barrett, Daniel Bates, Julius Baxter,
Michael Berman, Jean Berniolles, Victor Besyakov, Narayan Bhagavatula,
Moinak Bhattacharyya, Kritik Bhimani, David Biancolin, Krzysztof Bieganski,
Michael Bikovitsky, David Binderman, Piotr Binkowski, Johan Björk, David
Black, Tymoteusz Blazejczyk, Scott Bleiweiss, David van der Bokke, Daniel
Bone, Guy Bonneau, Krzysztof Boroński, Gregg Bouchard, Christopher
Boumenot, Paul Bowen-Huggett, Nick Bowler, Bryan Brady, Maarten De
Braekeleer, Liam Braun, Charlie Brej, J Briquet, John Brownlee, KC
Buckenmaier, Gijs Burghoorn, Jeff Bush, Lawrence Butcher, Tony Bybell, Iru
Cai, Ted Campbell, Anthony Campos, Chris Candler, Lauren Carlson, Gregory
Carver, Donal Casey, Sebastien Van Cauwenberghe, Alex Chadwick, Greg
Chadwick, Marcel Chang, Aliaksei Chapyzhenka, Chih-Mao Chen, Guokai Chen,
Kefa Chen, Terry Chen, Yangyu Chen, Yi-Chung Chen, Yurii Cherkasov,
Hennadii Chernyshchyk, Enzo Chi, Bartłomiej Chmiel, Robert A. Clark, Ryan
Clarke, Allan Cochrane, Keith Colbert, Quentin Corradi, Nassim Corteggiani,
Gianfranco Costamagna, February Cozzocrea, Sean Cross, George Cuan, Michal
Czyz, Joe DErrico, Jim Dai, Lukasz Dalek, Laurens van Dam, Gunter
Dannoritzer, Ashutosh Das, Julian Daube, Greg Davill, Bernard Deadman,
Peter Debacker, Josse Van Delm, John Demme, Mike Denio, John Deroo, Philip
Derrick, Aadi Desai, John Dickol, Ruben Diez, Danny Ding, Jacko Dirks, Ivan
Djordjevic, Brad Dobbie, Paul Donahue, Jonathon Donaldson, Anthony Donlon,
Caleb Donovick, Larry Doolittle, Leendert van Doorn, Sebastian Dressler,
Jonathan Drolet, Justin Yao Du, Maciej Dudek, Alex Duller, Jeff Dutton,
Tomas Dzetkulic, Usuario Eda, Charles Eddleston, Chandan Egbert, Joe Eiler,
Ahmed El-Mahmoudy, Trevor Elbourne, Mats Engstrom, Robert Farrell, Eugen
Fekete, Fabrizio Ferrandi, Udi Finkelstein, Brian Flachs, Bill Flynn,
Andrea Foletto, Bob Fredieu, Duane Galbi, Mostafa Gamal, Benjamin Gartner,
Christian Gelinek, Richard E George, Peter Gerst, Glen Gibb, Michael
Gielda, Barbara Gigerl, Shankar Giri, Dan Gisselquist, Petr Gladkikh, Sam
Gladstone, Mariusz Glebocki, Andrew Goessling, Amir Gonnen, Chitlesh
Goorah, Tomasz Gorochowik, Kai Gossner, Sergi Granell, Al Grant, Nathan
Graybeal, Alexander Grobman, Graham Rushton, Xuan Guo, Driss Hafdi, Neil
Hamilton, James Hanlon, Oyvind Harboe, Jannis Harder, Junji Hashimoto,
Thomas Hawkins, Mitch Hayenga, Harald Heckmann, Robert Henry, Stephen
Henry, David Hewson, Jamey Hicks, Joel Holdsworth, Andrew Holme, Hiroki
Honda, Alex Hornung, Pierre-Henri Horrein, David Horton, Peter Horvath, Jae
Hossell, Kuoping Hsu, Teng Huang, Steven Hugg, Alan Hunter, James
Hutchinson, Ehab Ibrahim, Edgar E. Iglesias, Jamie Iles, Vighnesh Iyer, Ben
Jackson, Shareef Jalloq, Marlon James, Krzysztof Jankowski, HyungKi Jeong,
Iztok Jeras, Alexandre Joannou, James Johnson, Christophe Joly, Franck
Jullien, James Jung, Mike Kagen, Arthur Kahlich, Kaalia Kahn, Guy-Armand
Kamendje, Vasu Kandadi, Kanad Kanhere, Patricio Kaplan, Pieter Kapsenberg,
Rafal Kapuscik, Ralf Karge, Per Karlsson, Dan Katz, Sol Katzman, Ian
Kennedy, Michael Killough, Sun Kim, Jonathan Kimmitt, Olof Kindgren, Kevin
Kiningham, Dan Kirkham, Aleksander Kiryk, Sobhan Klnv, Gernot Koch, Jack
Koenig, Soon Koh, Nathan Kohagen, Steve Kolecki, Brett Koonce, Will
Korteland, Wojciech Koszek, Varun Koyyalagunta, Arkadiusz Kozdra, Markus
Krause, David Kravitz, Roland Kruse, Andreas Kuster, Sergey Kvachonok,
Charles Eric LaForest, Ed Lander, Steve Lang, Stephane Laurent, Walter
Lavino, Christian Leber, Larry Lee, Yoda Lee, Michaël Lefebvre, Igor Lesik,
John Li, Eivind Liland, Yu Sheng Lin, Charlie Lind, Andrew Ling, Jiuyang
Liu, Paul Liu, Derek Lockhart, Jake Longo, Geza Lore, Arthur Low, Stefan
Ludwig, Dan Lussier, Fred Ma, Duraid Madina, Affe Mao, Julien Margetts,
Mark Marshall, Alfonso Martinez, Unai Martinez-Corral, Adrien Le Masle,
Yves Mathieu, Patrick Maupin, Conor McCullough, Jason McMullan, Elliot
Mednick, David Metz, Wim Michiels, Miodrag Milanovic, Kevin Millis, Wai Sum
Mong, Peter Monsson, Sean Moore, Dennis Muhlestein, John Murphy, Matt
Myers, Nathan Myers, Richard Myers, Dimitris Nalbantis, Peter Nelson, Bob
Newgard, Rachit Nigam, Paul Nitza, Yossi Nivin, Pete Nixon, Lisa Noack,
Mark Nodine, Kuba Ober, Andreas Olofsson, Baltazar Ortiz, Aleksander Osman,
Don Owen, James Pallister, Vassilis Papaefstathiou, Brad Parker, Morten
Borup Petersen, Dan Petrisko, Maciej Piechotka, David Pierce, Cody
Piersall, Michael Platzer, Dominic Plunkett, David Poole, Mike Popoloski,
Roman Popov, Rich Porter, Stefan Post, Niranjan Prabhu, Damien Pretet, Usha
Priyadharshini, Mark Jackson Pulver, Prateek Puri, Marshal Qiao, Nandu Raj,
Kamil Rakoczy, Danilo Ramos, Drew Ranck, Chris Randall, Anton Rapp, Josh
Redford, Odd Magne Reitan, Frederic Requin, Dustin Richmond, Samuel Riedel,
Alberto Del Rio, Eric Rippey, Oleg Rodionov, Ludwig Rogiers, Paul Rolfe,
Arjen Roodselaar, Tobias Rosenkranz, Ryszard Rozak, Huang Rui, Graham
Rushton, Jan Egil Ruud, Denis Rystsov, John Sanguinetti, Martin Schmidt,
Julie Schwartz, Galen Seitz, Joseph Shaker, Salman Sheikh, Hao Shi, Mike
Shinkarovsky, Rafael Shirakawa, Jeffrey Short, Fan Shupei, Anderson Ignacio
da Silva, Rodney Sinclair, Ameya Vikram Singh, Steven Slatter, Mladen
Slijepcevic, Brian Small, Garrett Smith, Tim Snyder, Wilson Snyder, Maciej
Sobkowski, Stan Sokorac, Alex Solomatnikov, Flavien Solt, Wei Song, Trefor
Southwell, Martin Stadler, Art Stamness, David Stanford, John Stevenson,
Pete Stevenson, Patrick Stewart, Rob Stoddard, Todd Strader, John Stroebel,
Sven Stucki, Howard Su, Emerson Suguimoto, Gene Sullivan, Qingyao Sun,
Renga Sundararajan, Gustav Svensk, Rupert Swarbrick, Yutetsu Takatsukasa,
Thierry Tambe, Drew Taussig, Jose Tejada, Peter Tengstrand, Wesley
Terpstra, Rui Terra, Stefan Thiede, Gary Thomas, Ian Thompson, Kevin
Thompson, Mike Thyer, Hans Tichelaar, Viktor Tomov, Steve Tong, Topa
Topino, Alex Torregrosa, Michael Tresidder, David Turner, Neil Turton, Mike
Urbach, Hans Van Antwerpen, Sebastien Van Cauwenberghe, Laurens van Dam,
Leendert van Doorn, Cong Van Nguyen, Jan Van Winkel, Srini Vemuri, Yuri
Victorovich, Bogdan Vukobratovic, Holger Waechtler, Philipp Wagner, Stefan
Wallentowitz, Shawn Wang, Zhanglei Wang, Paul Wasson, Greg Waters, Thomas
Watts, Eugene Weber, David Welch, Thomas J Whatson, Martin Whitaker, Marco
Widmer, Leon Wildman, Daniel Wilkerson, Gerald Williams, Trevor Williams,
Jeff Winston, Joshua Wise, Clifford Wolf, Tobias Wolfel, Johan Wouters,
Paul Wright, Junyi Xi, Ding Xiaoliang, Jie Xu, Mandy Xu, Yinan Xu, Luke
Yang, Amir Yazdanbakhsh, Keyi Zhang, and Xi Zhang.
Ahmed El-Mahmoudy, Trevor Elbourne, Mats Engstrom, Robert Farrell, Julien
Faucher, Olivier Faure, Eugene Feinberg, Eugen Fekete, Fabrizio Ferrandi,
Udi Finkelstein, Brian Flachs, Bill Flynn, Andrea Foletto, Alex Forencich,
Aurelien Francillon, Bob Fredieu, Manuel Freiberger, Mostafa Gamal, Vito
Gamberini, Mostafa Garnal, Benjamin Gartner, Christian Gelinek, Richard E
George, Peter Gerst, Glen Gibb, Michael Gielda, Barbara Gigerl, Nimrod
Gileadi, Shankar Giri, Dan Gisselquist, Szymon Gizler, Petr Gladkikh, Sam
Gladstone, Mariusz Glebocki, Embedded Go, Andrew Goessling, Amir Gonnen,
Chitlesh Goorah, Tomasz Gorochowik, Kai Gossner, Tarik Graba, Sergi
Granell, Al Grant, Nathan Graybeal, Alexander Grobman, Qian Gu, Xuan Guo,
Prabhat Gupta, Deniz Güzel, Driss Hafdi, Abdul Hameed, Neil Hamilton, James
Hanlon, Tang Haojin, Øyvind Harboe, Jannis Harder, David Harris, Junji
Hashimoto, Thomas Hawkins, Mitch Hayenga, Harald Heckmann, Robert Henry,
Stephen Henry, Sebastian Hesselbarth, David Hewson, Jamey Hicks, Joel
Holdsworth, Andrew Holme, Peter Holmes, Hiroki Honda, Alex Hornung,
Pierre-Henri Horrein, David Horton, Peter Horvath, Jae Hossell, Kuoping
Hsu, Shou-Li Hsu, Teng Huang, Steven Hugg, Alan Hunter, James Hutchinson,
Tim Hutt, Ehab Ibrahim, Edgar E. Iglesias, Shahid Ikram, Jamie Iles, Fuad
Ismail, Vighnesh Iyer, Ben Jackson, Daniel Jacques, Shareef Jalloq, Marlon
James, Krzysztof Jankowski, Eyck Jentzsch, HyungKi Jeong, Iztok Jeras,
Pawel Jewstafjew, Alexandre Joannou, James Johnson, Christophe Joly, Justin
Jones, William D. Jones, Abe Jordan, Larry Darryl Lee Jr., Franck Jullien,
James Jung, Mike Kagen, Arthur Kahlich, Kaalia Kahn, Guy-Armand Kamendje,
Vasu Kandadi, Yoshitomo Kaneda, Kanad Kanhere, Patricio Kaplan, Pieter
Kapsenberg, Rafal Kapuscik, Ralf Karge, Per Karlsson, Dan Katz, Sol
Katzman, Ian Kennedy, Ami Keren, Fabian Keßler, Michael Killough, Sun Kim,
Jonathan Kimmitt, Olof Kindgren, Kevin Kiningham, Cameron Kirk, Dan
Kirkham, Aleksander Kiryk, Sobhan Klnv, Gernot Koch, Jack Koenig, Soon Koh,
Nathan Kohagen, Steve Kolecki, Brett Koonce, Will Korteland, Andrei
Kostovski, Wojciech Koszek, Varun Koyyalagunta, Arkadiusz Kozdra, Markus
Krause, David Kravitz, Adam Krolnik, Roland Kruse, Mahesh Kumashikar,
Andreas Kuster, Sergey Kvachonok, Charles Eric LaForest, Kevin Laeufer, Ed
Lander, Steve Lang, Pierre Laroche, Stephane Laurent, Walter Lavino,
Christian Leber, David Ledger, Alex Lee, Larry Lee, Yoda Lee, Michaël
Lefebvre, Dag Lem, Igor Lesik, John Li, Kay Li, Zixi Li, Davide Libenzi,
Nandor Licker, Eivind Liland, Ícaro Lima, Kevin Lin, Yu-Sheng Lin, Charlie
Lind, Andrew Ling, Jiuyang Liu, Joey Liu, Paul Liu, Derek Lockhart, Jake
Longo, Geza Lore, Arthur Low, Jose Loyola, Stefan Ludwig, Dan Lussier,
Konstantin Lübeck, Fred Ma, Liwei Ma, Duraid Madina, Oleh Maksymenko, Affe
Mao, Julien Margetts, Chick Markley, Alexis Marquet, Mark Marshall, Alfonso
Martinez, Unai Martinez-Corral, Adrien Le Masle, Yves Mathieu, Vladimir
Matveyenko, Patrick Maupin, Stan Mayer, Jordan McConnon, Conor McCullough,
Jason McMullan, Elliot Mednick, Yuan Mei, Andy Meier, Luiza de Melo,
Rodrigo A. Melo, Benjamin Menküc, Jake Merdich, David Metz, Wim Michiels,
Miodrag Milanović, Darryl Miles, Kevin Millis, Andrew Miloradovsky, David
Moberg, Wai Sum Mong, Peter Monsson, Anthony Moore, Sean Moore, Stuart
Morris, Dennis Muhlestein, John Murphy, Matt Myers, Nathan Myers, Richard
Myers, Alex Mykyta, Eric Müller, Dimitris Nalbantis, Peter Nelson, Felix
Neumärker, Bob Newgard, Cong Van Nguyen, Rachit Nigam, Toru Niina, Paul
Nitza, Yossi Nivin, Pete Nixon, Lisa Noack, Mark Nodine, Michael Nolan,
Andrew Nolte, Joseph Nwabueze, Kevin Nygaard, Kuba Ober, Krzysztof
Obłonczek, Andreas Olofsson, Baltazar Ortiz, Aleksander Osman, Don Owen,
Tim Paine, Deepa Palaniappan, James Pallister, Vassilis Papaefstathiou,
Sanggyu Park, Brad Parker, Risto Pejašinović, Seth Pellegrino, Morten Borup
Petersen, Dan Petrisko, Wesley Piard, Maciej Piechotka, David Pierce, Cody
Piersall, T. Platz, Michael Platzer, Dominic Plunkett, Nolan Poe, David
Poole, Michael Popoloski, Roman Popov, Aylon Chaim Porat, Oron Port, Rich
Porter, Rick Porter, Stefan Post, Niranjan Prabhu, Damien Pretet, Harald
Pretl, Bill Pringlemeir, Usha Priyadharshini, Mark Jackson Pulver, Prateek
Puri, Han Qi, Jiacheng Qian, Marshal Qiao, Raynard Qiao, Yujia Qiao, Jasen
Qin, Frank Qiu, Nandu Raj, Kamil Rakoczy, Danilo Ramos, Drew Ranck, Chris
Randall, Anton Rapp, Josh Redford, Odd Magne Reitan, Frédéric Requin,
Dustin Richmond, Samuel Riedel, Alberto Del Rio, Eric Rippey, Narcis Rodas,
Oleg Rodionov, Ludwig Rogiers, Paul Rolfe, Michail Rontionov, Arjen
Roodselaar, Arthur Rosa, Tobias Rosenkranz, Yernagula Roshit, Ryszard
Rozak, Huang Rui, Graham Rushton, Jan Egil Ruud, Denis Rystsov, Pawel
Sagan, Robert Sammelson, Adrian Sampson, John Sanguinetti, Josep Sans, Luca
Sasselli, Martin Scharrer, Martin Schmidt, Jonathan Schröter, Julie
Schwartz, Galen Seitz, Sam Shahrestani, Joseph Shaker, Mark Shaw, Salman
Sheikh, Zhou Shen, Hao Shi, James Shi, Michael Shinkarovsky, Rafael
Shirakawa, Jeffrey Short, S Shuba, Fan Shupei, Ethan Sifferman, Anderson
Ignacio da Silva, Rodney Sinclair, Ameya Vikram Singh, Sanjay Singh, Frans
Skarman, Nate Slager, Steven Slatter, Mladen Slijepcevic, Brian Small,
Garrett Smith, Gus Smith, Tim Snyder, Maciej Sobkowski, Stan Sokorac, Alex
Solomatnikov, Flavien Solt, Wei Song, Trefor Southwell, Martin Stadler, Art
Stamness, David Stanford, Krzysztof Starecki, Baruch Sterin, John
Stevenson, Pete Stevenson, Patrick Stewart, Rob Stoddard, Tood Strader,
John Stroebel, Ray Strouble, Sven Stucki, Howard Su, Udaya Raj Subedi,
Emerson Suguimoto, Gene Sullivan, Qingyao Sun, Renga Sundararajan, Kuba
Sunderland-Ober, Gustav Svensk, Rupert Swarbrick, Jevin Sweval, Paul
Swirhun, Shinya T-Y, Thierry Tambe, Jesse Taube, Drew Taussig, Christopher
Taylor, Greg Taylor, Jose Tejada, Sören Tempel, Peter Tengstrand, Wesley
Terpstra, Rui Terra, Stefan Thiede, Justin Thiel, Gary Thomas, Ian
Thompson, Kevin Thompson, Mike Thyer, Hans Tichelaar, Tudor Timi, Viktor
Tomov, Steve Tong, Topa Topino, Àlex Torregrosa, Topa Tota, Michael
Tresidder, Lenny Truong, David Turner, Neil Turton, Hideto Ueno, Mike
Urbach, Joel Vandergriendt, Srini Vemuri, Srinivasan Venkataramanan, Yuri
Victorovich, Ivan Vnučec, Bogdan Vukobratovic, Holger Waechtler, Philipp
Wagner, Stefan Wallentowitz, Johannes Walter, CY Wang, Chuxuan Wang, Shawn
Wang, Yilou Wang, Zhanglei Wang, Greg Waters, Thomas Watts, Eugene Weber,
John Wehle, Tianrui Wei, David Welch, Thomas J Whatson, Martin Whitaker,
Marco Widmer, Leon Wildman, Daniel S. Wilkerson, Daniel Wilkerson, Gerald
Williams, Trevor Williams, Don Williamson, Jan Van Winkel, Jeff Winston,
Joshua Wise, Clifford Wolf, Johan Wouters, Paul Wright, Tobias Wölfel,
Junyi Xi, Ding Xiaoliang, Liu Xiaoyi, Jinyan Xu, Mandy Xu, Pengcheng Xu,
Shanshan Xu, Yan Xu, Yinan Xu, SU YANG, Felix Yan, Jiaxun Yang, Luke Yang,
Amir Yazdanbakhsh, Chentai (Seven) Yuan, Florian Zaruba, Mat Zeno, Keyi
Zhang, Xi Zhang, Huanghuang Zhou, Yike Zhou, Jiamin Zhu, Ryan Ziegler.
Thanks to them, and all those we've missed mentioning above, and to those
whom have wished to remain anonymous.
+2 -2
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
*********
@@ -8,7 +8,7 @@ Copyright
The latest version of Verilator is available from `https://verilator.org
<https://verilator.org>`_.
Copyright 2003-2023 by Wilson Snyder. This program is free software; you
Copyright 2003-2025 by Wilson Snyder. This program is free software; you
can redistribute it and/or modify the Verilator internals under the terms
of either the GNU Lesser General Public License Version 3 or the Perl
Artistic License Version 2.0.
+11 -32
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
Deprecations
@@ -6,38 +6,17 @@ Deprecations
The following deprecated items are scheduled for future removal:
C++11 compiler support
C++14 compiler support
Verilator currently requires a C++20 or newer compiler for timing, and a
C++11 or newer compiler for no-timing.
Verilator will require C++14 or newer compilers for both compiling
Verilator and compiling Verilated models with --no-timing no sooner than
January 2023.
C++14 or newer compiler for both compiling Verilator and compiling
Verilated models with --no-timing.
Verilator will require C++20 or newer compilers for both compiling
Verilator and compiling all Verilated models no sooner than January 2025.
Verilator and compiling all Verilated models no sooner than May 2025.
(Likely to be removed shortly after GitHub removes Ubuntu 20.04
continuous-integration action runners, which are used to test the older
C++ standard).
Verilated_heavy.h
The legacy "verilated_heavy.h" include was replaced with just including
"verilated.h". Verilated_heavy.h is planned for removal no sooner than
July 2022.
Option `--cdc`
The experimental `--cdc` option is believed to be generally unused and is
planned for removal no sooner than January 2023.
Option `-O<letter>`
The debug `-O<letter>` options have been replaced with
`-fno-<optimization>` debug options to match GCC. The old options are
planned for removal no sooner than June 2023.
Option `--prof-threads`
The `--prof-threads` option has been superseded by the `--prof-exec` and
`--prof-pgo` options and is planned for removal no sooner than April 2023.
Verilated model options `+verilator+prof+threads+*`
The `+verilator+prof+threads+start`, `+verilator+prof+threads+window` and
`+verilator+prof+threads+file` options have been superseded by the
`+verilator+prof+exec+start`, `+verilator+prof+exec+window` and
`+verilator+prof+exec+file` options respectively and are planned for removal
no sooner than April 2023.
XML output
Verilator currently supports XML parser output (enabled with `--xml-only`).
Support for `--xml-*` options will be deprecated no sooner than January 2026.
+82 -8
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
Environment
@@ -29,7 +29,7 @@ associated programs.
.. option:: OBJCACHE
Optionally specifies a caching or distribution program to place in front
of all runs of the C++ compiler. For example, "ccache". If using
of all runs of the C++ compiler. For example, "ccache" or "sccache". If using
:command:`distcc` or :command:`icecc`/:command:`icecream`, they would
generally be run under :command:`ccache`; see the documentation for
those programs. If OBJCACHE is not set, and at configure time ccache
@@ -91,9 +91,83 @@ associated programs.
.. option:: VERILATOR_ROOT
Specifies the directory containing the distribution kit. This is used
to find the executable, Perl library, and include files. If not
specified, it will come from a default optionally specified at configure
time (before Verilator was compiled). It should not be specified if
using a pre-compiled Verilator package as the hard-coded value should be
correct. See :ref:`Installation`.
The ``VERILATOR_ROOT`` environment variable is used in several places:
* At ``./configure`` time: If set, it is embedded into the binary, and
at runtime if ``VERILATOR_ROOT`` is not set, the embedded value is
used for the runtime default.
* When ``verilator`` is run: If ``VERILATOR_ROOT`` is set it will be
used to find the ``verilator_bin`` executable (this is the actual
Verilator binary; ``verilator`` is a Perl wrapper). If not set, the
``verilator`` script uses other methods to find ``verilator_bin``
(looking in the same directory and falling back to ``$PATH``).
* When ``make`` is run on the Makefile generated by ``verilator``: The
value of ``VERILATOR_ROOT`` (falling back to the value embedded in the
binary if not set) is used to find the include files
(``include/verilated.mk``).
If you are using a pre-compiled Verilator package, you should not need
to set ``VERILATOR_ROOT`` - the value embedded in the binary should be
correct. In fact this option *does not work* with Verilator packages
that have been installed with ``make install``. If a Verilator package
has been installed using ``./configure --prefix=/some/path && make
install`` and then moved to another location, you cannot use
``VERILATOR_ROOT`` to point to the new version.
See :ref:`Installation` for more details.
.. option:: VERILATOR_SOLVER
If set, the command to run as a constrained randomization backend, such
as :command:`cvc4 --lang=smt2 --incremental`. If not specified, it will use
the one supplied or found during configure, or :command:`z3 --in` if empty.
.. option:: VERILATOR_VALGRIND
If set, the command to run when using the :vlopt:`--valgrind` option, such as
"valgrind --tool=callgrind". If not specified, it will use "valgrind".
Make Variables
==============
This section describes the make variables used by Verilator. These may be
set by passing them to make e.g. ``make CXX=my-gcc ...``.
.. option:: AR
Optionally overrides the default :command:`ar` (archive) binary used by
the Verilated makefiles. If AR is not set, the version found at
configure time is used.
.. option:: CXX
Optionally overrides the default compiler binary used by the Verilated
makefiles. If CXX is not set, the version found at configure time is
used. Note the default flags passed to the compiler are determined at
configuration time, so changing the CXX compiler version using this
variable, as opposed to passing it at configuration time, may not give
desired results.
.. option:: LINK
Optionally overrides the default linker binary used by the Verilated
makefiles. If LINK is not set, the version found at configure time is
used. Note the default flags passed to the linker are determined at
configuration time, so changing the LINK version using this variable, as
opposed to passing it at configuration time, may not give desired
results.
.. option:: PERL
Optionally overrides the default :command:`perl` binary used by the
Verilated makefiles. If PERL is not set, the version found at configure
time, and compiled into the Verilator binary, is used.
.. option:: PYTHON3
Optionally overrides the default :command:`python3` binary used by the
Verilated makefiles. If PYTHON3 is not set, the version found at
configure time is used.
+1 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Example Create-Binary Execution:
+1 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Example C++ Execution:
+1 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
First you need Verilator installed, see :ref:`Installation`. In brief, if
+1 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Examples in the Distribution:
+2 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Example SystemC Execution:
@@ -28,6 +28,7 @@ Now, let's create an example Verilog, and SystemC wrapper file:
cat >sc_main.cpp <<'EOF'
#include "Vour.h"
using namespace sc_core;
int sc_main(int argc, char** argv) {
Verilated::commandArgs(argc, argv);
sc_clock clk{"clk", 10, SC_NS, 0.5, 3, SC_NS, true};
+2 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Examples:
@@ -9,6 +9,7 @@ Examples
This section covers the following examples:
* :ref:`Example Create-Binary Execution`
* :ref:`Example C++ Execution`
* :ref:`Example SystemC Execution`
* :ref:`Examples in the Distribution`
+23 -6
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Simulation Runtime Arguments:
@@ -19,11 +19,20 @@ Summary:
.. include:: ../_build/gen/args_verilated.rst
.. option:: +verilator+coverage+file+<filename>
When a model was Verilated using :vlopt:`--coverage`, sets the filename
to write coverage data into. Defaults to :file:`coverage.dat`.
.. option:: +verilator+debug
Enable simulation runtime debugging. Equivalent to
:vlopt:`+verilator+debugi+4 <+verilator+debugi+\<value\>>`.
To be useful, the model typically must first be compiled with debug
capabilities by Verilating with :vlopt:`--runtime-debug` or `-CFLAGS
-DVL_DEBUG=1`.
.. option:: +verilator+debugi+<value>
Enable simulation runtime debugging at the provided level.
@@ -31,8 +40,8 @@ Summary:
.. option:: +verilator+error+limit+<value>
Set number of non-fatal errors (e.g. assertion failures) before exiting
simulation runtime. Also affects number of $stop calls needed before
exit. Defaults to 1.
simulation runtime. Also affects number of `$stop` calls needed before
exit. Does not affect `$fatal`. Defaults to 1.
.. option:: +verilator+help
@@ -64,15 +73,18 @@ Summary:
.. option:: +verilator+prof+threads+file+<filename>
Deprecated. Alias for :vlopt:`+verilator+prof+exec+file+\<filename\>`
Removed in 5.020. Was an alias for
:vlopt:`+verilator+prof+exec+file+\<filename\>`
.. option:: +verilator+prof+threads+start+<value>
Deprecated. Alias for :vlopt:`+verilator+prof+exec+start+\<value\>`
Removed in 5.020. Was an alias for
:vlopt:`+verilator+prof+exec+start+\<value\>`
.. option:: +verilator+prof+threads+window+<value>
Deprecated. Alias for :vlopt:`+verilator+prof+exec+window+\<value\>`
Removed in 5.020. Was an alias for
:vlopt:`+verilator+prof+exec+window+\<value\>`
.. option:: +verilator+prof+vlt+file+<filename>
@@ -80,6 +92,11 @@ Summary:
profile-guided optimization data runtime filename to dump to. Defaults
to :file:`profile.vlt`.
.. option:: +verilator+quiet
Disable printing the simulation summary report, see :ref:`Simulation
Summary Report`.
.. option:: +verilator+rand+reset+<value>
When a model was Verilated using
+424 -84
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
verilator Arguments
@@ -51,6 +51,8 @@ Summary:
.. option:: +1800-2017ext+<ext>
.. option:: +1800-2023ext+<ext>
Specifies the language standard to be used with a specific filename
extension, <ext>.
@@ -85,7 +87,11 @@ Summary:
.. option:: --assert
Enable all assertions.
Enable all assertions. Implies :vlopt:`--assert-case`.
.. option:: --assert-case
Enable unique/unique0/priority case related checks.
.. option:: --autoflush
@@ -125,9 +131,12 @@ Summary:
After generating the SystemC/C++ code, Verilator will invoke the
toolchain to build the model library (and executable when :vlopt:`--exe`
is also used). Verilator manages the build itself, and for this --build
is also used). Verilator manages the build itself, and for this --build
requires GNU Make to be available on the platform.
:vlopt:`--build` cannot be specified when using :vlopt:`-E`,
:vlopt:`--dpi-hdr-only`, :vlopt:`--lint-only`, or :vlopt:`--xml-only`.
.. option:: --build-dep-bin <filename>
Rarely needed. When a dependency (.d) file is created, this filename
@@ -155,18 +164,6 @@ Summary:
Specify C++ without SystemC output mode; see also the :vlopt:`--sc`
option.
.. option:: --cdc
Permanently experimental. Perform some clock domain crossing checks and
issue related warnings (CDCRSTLOGIC) and then exit; if warnings other
than CDC warnings are needed, make a second run with
:vlopt:`--lint-only`. Additional warning information is also written to
the file :file:`<prefix>__cdc.txt`.
Currently only checks some items that other CDC tools missed; if you are
interested in adding more traditional CDC checks, please contact the
authors.
.. option:: -CFLAGS <flags>
Add specified C compiler argument to the generated makefiles. For
@@ -204,9 +201,10 @@ Summary:
.. option:: --compiler <compiler-name>
Enables workarounds for the specified C++ compiler (list below).
This does not change any performance tuning options, but it may
in the future.
Enables workarounds for the specified C++ compiler (list below). This
does not change any performance tuning options, but it may in the
future. This also does not change default compiler flags; these are
determined when Verilator was configured.
clang
Tune for clang. This may reduce execution speed as it enables several
@@ -224,6 +222,13 @@ Summary:
expressions into sub-expressions to avoid error C1009, and breaking
deep blocks into functions to avoid error C1061.
.. option:: --compiler-include <header-path>
Specifies additional headers to be included in the final PCH header.
It is required to add them to this header, due to compilers'
limitation that allow only one precompiled header per compilation.
Use this instead of ::vlopt:`-CFLAGS` with `-include <header-path>`.
.. option:: --converge-limit <loops>
Rarely needed. Specifies the maximum number of runtime iterations
@@ -232,7 +237,17 @@ Summary:
.. option:: --coverage
Enables all forms of coverage, an alias for :vlopt:`--coverage-line`
:vlopt:`--coverage-toggle` :vlopt:`--coverage-user`.
:vlopt:`--coverage-toggle` :vlopt:`--coverage-expr` :vlopt:`--coverage-user`.
.. option:: --coverage-expr
Enables expression coverage analysis. See :ref:`Expression Coverage`.
.. option:: --coverage-expr-max <value>
Rarely needed. Specifies the maximum number of permutations able to be
covered for a given expression. Defaults to 32. Increasing may slow
coverage simulations and make analyzing the results unwieldy.
.. option:: --coverage-line
@@ -313,19 +328,47 @@ Summary:
detailed messages. See :vlopt:`--debug` for other implications of
enabling debug.
.. option:: --decorations none
.. option:: --decorations medium
.. option:: --decorations node
When creating output Verilated code, set level of comment and whitespace
decoration.
With "--decorations none",
Minimize comments, white space, symbol names, and other decorative
items, at the cost of reduced readability. This may assist C++ compile
times. This will not typically change the ultimate model's
performance, but may in some cases. See also :vlopt:`--no-decoration`
option.
With "--decorations medium",
The default, put a small amount of comments and white space, for
typical level of readability.
With "--decorations node",
Include comments indicating what caused generation of the following
text, including what node pointer (corresponding to
:vlopt:`--dump-tree` .tree printed data), and the source Verilog
filename and line number. If subsequent following statements etc have
the same filename/line number these comments are omitted. This
enables easy debug when looking at the C++ code to determine what
Verilog source may be related. As node pointers are not stable
between different Verilator runs, this may harm compile caching and
should only be used for debug.
.. option:: --no-decoration
When creating output Verilated code, minimize comments, white space,
symbol names, and other decorative items, at the cost of reduced
readability. This may assist C++ compile times. This will not typically
change the ultimate model's performance, but may in some cases.
Alias for ``--decorations none``.
.. option:: --default-language <value>
Select the language used by default when first processing each
Verilog file. The language value must be "VAMS", "1364-1995",
"1364-2001", "1364-2001-noconfig", "1364-2005", "1800-2005",
"1800-2009", "1800-2012", "1800-2017", or "1800+VAMS".
"1800-2009", "1800-2012", "1800-2017", "1800-2023", or "1800+VAMS".
Any language associated with a particular file extension (see the
various +<lang>*\ ext+ options) will be used in preference to the
@@ -338,7 +381,7 @@ Summary:
``+<lang>ext+`` options should be used.
If no language is specified, either by this option or ``+<lang>ext+``
options, then the latest SystemVerilog language (IEEE 1800-2017) is
options, then the latest SystemVerilog language (IEEE 1800-2023) is
used.
.. option:: +define+<var>=<value>
@@ -387,6 +430,12 @@ Summary:
:vlopt:`--debug --no-dump-tree <--dump-tree>` may be useful if the dump
files are large and not desired.
.. option:: --dump-tree-json
Rarely needed. Enable dumping Ast .json.tree debug files with dumping level 3,
which dumps the standard critical stages. For details on the format, see
the Verilator Internals manual.
.. option:: --dump-tree-dot
Rarely needed. Enable dumping Ast .tree.dot debug files in Graphviz
@@ -422,6 +471,11 @@ Summary:
Rarely needed - for developer use. Set internal Ast dumping level
globally to the specified value.
.. option:: --dumpi-tree-json <level>
Rarely needed - for developer use. Set internal Ast JSON dumping level
globally to the specified value.
.. option:: --dumpi-<srcfile> <level>
Rarely needed - for developer use. Set the dumping level in the
@@ -434,10 +488,16 @@ Summary:
Preprocess the source code, but do not compile, similar to C++
preprocessing using :command:`gcc -E`. Output is written to standard
out. Beware of enabling debugging messages, as they will also go to
standard out.
standard out. See :vlopt:`--no-std`, which is implied by this.
See also :vlopt:`--dump-defines`, :vlopt:`-P`, and
:vlopt:`--pp-comments` options.
See also :vlopt:`--dump-defines`, :vlopt:`-P`, :vlopt:`--pp-comments`
and :vlopt:`--preproc-resolve` options.
.. option:: --emit-accessors
Emit getter and setter methods for each top-level signal in the
model top class. Signals are still available as public members,
but with the `__Vm_sig_` prefix.
.. option:: --error-limit <value>
@@ -539,10 +599,18 @@ Summary:
.. option:: -fno-expand
.. option:: -fno-func-opt
.. option:: -fno-func-opt-balance-cat
.. option:: -fno-func-opt-split-cat
.. option:: -fno-gate
.. option:: -fno-inline
.. option:: -fno-inline-funcs
.. option:: -fno-life
.. option:: -fno-life-post
@@ -559,6 +627,8 @@ Summary:
.. option:: -fno-reorder
.. option:: -fno-slice
.. option:: -fno-split
.. option:: -fno-subst
@@ -673,6 +743,13 @@ Summary:
:option:`/*verilator&32;hier_block*/` metacomment is ignored. See
:ref:`Hierarchical Verilation`.
.. option:: --hierarchical-params-file <filename>
Internal flag inserted used during :vlopt:`--hierarchical`; specifies
name of hierarchical parameters file for deparametrized modules with
:option:`/*verilator&32;hier_block*/` metacomment. See
:ref:`Hierarchical Verilation`.
.. option:: -I<dir>
See :vlopt:`-y`.
@@ -684,7 +761,10 @@ Summary:
.. option:: +incdir+<dir>
See :vlopt:`-y`.
See :vlopt:`-y`. Unlike with :vlopt:`-y`, multiple directories may be
specified separated with a `+` symbol; this is for Verilog-XL
compatibility and is not recommended usage as this is not supported by
some third-party tools.
.. option:: --inline-mult <value>
@@ -707,9 +787,42 @@ Summary:
.. option:: -j [<value>]
Specify the level of parallelism for :vlopt:`--build` if
:vlopt:`--build-jobs` isn't provided. If zero, uses the number of threads
in the current hardware. Otherwise, the <value> must be a positive
integer specifying the maximum number of parallel build jobs.
:vlopt:`--build-jobs` isn't provided, and the internal compilation steps
of Verilator if :vlopt:`--verilate-jobs` isn't provided. If zero, uses
the number of threads in the current hardware. Otherwise, must be a
positive integer specifying the maximum number of parallel build jobs.
.. option:: --json-only
Create JSON output only, do not create any other output.
The JSON format is intended to be used to leverage Verilator's parser and
elaboration to feed to other downstream tools. For details on the format, see
the Verilator Internals manual. Be aware that the JSON
format is still evolving; there will be some changes in future versions.
This option disables some more aggressive transformations and dumps only
the final state of the AST. For more granular and unaltered dumps, meant
mainly for debugging see :vlopt:`--dump-tree-json`.
.. option:: --json-only-meta-output <filename>
Specifies the filename for the metadata output file (`.tree.meta.json`) of --json-only.
Using this option automatically sets :vlopt:`--json-only`.
.. option:: --json-only-output <filename>
Specifies the filename for the main output file (`.tree.json`) of --json-only.
Using this option automatically sets :vlopt:`--json-only`.
.. option:: --no-json-edit-nums
Don't dump edit number in .tree.json files. This may make the file more
run-to-run stable for easier comparison.
.. option:: --no-json-ids
Don't use short identifiers instead of addresses/paths in .tree.json.
.. option:: --l2-name <value>
@@ -779,6 +892,11 @@ Summary:
If the design is not to be completely Verilated, see also the
:vlopt:`--bbox-sys` and :vlopt:`--bbox-unsup` options.
.. option:: --localize-max-size <value>
Rarely needed. Set the maximum variable size in bytes for it to be
subject to localizing-to-stack optimization. Defaults to 1024.
.. option:: --make <build-tool>
Generates a script for the specified build tool.
@@ -819,6 +937,13 @@ Summary:
See also :vlopt:`--binary`.
.. option:: --main-top-name <string>
Specify the name passed to the Verilated model being constructed, in the
generated C++ main() function.
If the string ``"-"`` is used, no top level scope is added.
.. option:: --max-num-width <value>
Set the maximum number literal width (e.g., in 1024'd22 this
@@ -888,6 +1013,22 @@ Summary:
delayed assignments. This option should only be used when suggested by
the developers.
.. option:: --output-groups <numfiles>
Enables concatenating the output .cpp files into the given number of
effective output .cpp files. This is useful if the compiler startup
overhead from compiling many small files becomes unacceptable,
which can happen in designs making extensive use of SystemVerilog classes,
templates or generate blocks.
Using :vlopt:`--output-groups` can adversely impact caching and stability
(as in reproducibility) of compiled code. Compilation of larger .cpp
files also has higher memory requirements. Too low values might result in
swap thrashing with large designs, high values give no benefits. The
value should range from 2 to 20 for small to medium designs.
Default is zero, which disables this feature.
.. option:: --output-split <statements>
Enables splitting the output .cpp files into multiple outputs. When a
@@ -940,6 +1081,13 @@ Summary:
:option:`/*verilator&32;sc_bv*/` metacomment to select specific ports to
be sc_bv.
.. option:: --pins-inout-enables
Specifies that the __en and __out outputs will always be created for
inouts in the top-level module. The __en variable has a one in a bit
position to indicate the corresponding bit of the __out variable has
a value being driven from within the Verilated model.
.. option:: --pins-sc-uint
Specifies SystemC inputs/outputs greater than 2 bits wide should use
@@ -947,6 +1095,10 @@ Summary:
:vlopt:`--pins-sc-biguint` combination, it results in sc_uint being used
between 2 and 64 and sc_biguint being used between 65 and 512.
.. option:: --pins-sc-uint-bool
Specifies SystemC inputs/outputs one bit wide should use sc_uint<1>.
.. option:: --pins-sc-biguint
Specifies SystemC inputs/outputs greater than 65 bits wide should use
@@ -1000,6 +1152,20 @@ Summary:
prepended to the name of the :vlopt:`--top` option, or V prepended to
the first Verilog filename passed on the command line.
.. option:: --preproc-resolve
With :vlopt:`-E`, resolve referenced instance modules, to include
preprocessed output of submodules. Used to convert a multi-file design
into a single output file.
See :vlopt:`-E`.
.. option:: --preproc-token-limit <value>
Rarely needed. Configure the limit of the number of tokens Verilator
can process on a single line to prevent infinite loops and other hangs.
Defaults to 40000 tokens.
.. option:: --private
Opposite of :vlopt:`--public`. This is the default; this option exists for
@@ -1037,7 +1203,7 @@ Summary:
.. option:: --prof-threads
Deprecated. Same as --prof-exec and --prof-pgo together.
Removed in 5.020. Was an alias for --prof-exec and --prof-pgo together.
.. option:: --protect-ids
@@ -1101,6 +1267,13 @@ Summary:
module specifically enabled it with
:option:`/*verilator&32;inline_module*/`.
.. option:: --public-depth <level>
Enables public as with :vlopt:`--public-flat-rw`, but only to the specified depth of modules.
It operates at the module maximum level, so if a module's cells are A.B.X and A.X, the
a --public-depth 3 must be used to make module X public, and both A.B.X and A.X will be public.
.. option:: --public-flat-rw
Declares all variables, ports, and wires public as if they had
@@ -1112,16 +1285,39 @@ Summary:
marking only those signals that need public_flat_rw is typically
significantly better performing.
.. option:: --public-ignore
Ignore all :code:`/*verilator public* */` metacomments. This is useful
for speed-optimizing VPI builds where VPI is not being used. This only
affects metacomments; options such as :vlopt:`--public`,
:vlopt:`--public-depth`, etc. work normally.
.. option:: --public-params
Declares all parameters public as if they had
:code:`/*verilator public_flat_rd*/`
metacomments.
.. option:: -pvalue+<name>=<value>
Overwrites the given parameter(s) of the top-level module. See
:vlopt:`-G <-G<name>>` for a detailed description.
.. option:: --quiet
Alias for :vlopt:`--quiet-exit` :vlopt:`--quiet-stats`.
.. option:: --quiet-exit
When exiting due to an error, do not display the "Exiting due to Errors"
nor "Command Failed" messages.
.. option:: --quiet-stats
Disable printing the Verilation statistics report, see :ref:`Verilation
Summary Report`.
.. option:: --relative-includes
When a file references an include file, resolve the filename relative to
@@ -1172,6 +1368,40 @@ Summary:
Run Verilator and record with the :command:`rr` command. See
`https://rr-project.org <https://rr-project.org>`_.
.. option:: --runtime-debug
Enable including debug assertions in the generated model. This may
significantly decrease model performance. This option will only work
with gcc/clang.
This option has the same effect as the following flags:
:vlopt:`--decorations node <--decorations>`
Instructs Verilator to add comments to the Verilated C++ code to
assist determining what Verilog code was responsible for each C++
statement.
``-CFLAGS -ggdb -LDFLAGS -ggdb``
Instructs the compiler and linker to enable debugger symbols.
``-CFLAGS -fsanitize=address,undefined -LDFLAGS -fsanitize=address,undefined``
Instructs the compiler and linker to enable the address sanitizer, and
undefined behavior sanitizer.
``-CFLAGS -D_GLIBCXX_DEBUG``
Instructs the compiler to enable C++ library (glibc) internal
assertions to find library-misuse issues.
``-CFLAGS -DVL_DEBUG=1``
Instructs the compiler to enable Verilator's runtime assertions and
debug capabilities. To enable debug print messages at runtime, see
:vlopt:`+verilator+debug`.
The :vlopt:`-CFLAGS` and/or :vlopt:`-LDFLAGS` options used here pass the
following argument into the generated Makefile for use as compiler or
linker options respectively. If you are using your own Makefiles, adapt
appropriately to pass the suggested flags to the compiler and linker.
.. option:: --savable
Enable including save and restore functions in the generated model. See
@@ -1194,6 +1424,8 @@ Summary:
Creates a dump file with statistics on the design in
:file:`<prefix>__stats.txt`.
Also dumps DFG patterns to
:file:`<prefix>__stats_dfg_patterns__*.txt`.
.. option:: --stats-vars
@@ -1201,6 +1433,24 @@ Summary:
by size (plain :vlopt:`--stats` just gives a count). See
:vlopt:`--stats`, which is implied by this.
.. option:: --no-std
Prevents parsing standard input files, alias for
:vlopt:`--no-std-package`, :vlopt:`--no-std-waiver`. This may be extended
to prevent reading other standardized files in future versions.
.. option:: --no-std-package
Prevents parsing standard `std::` package file.
.. option:: --no-std-waiver
Prevents parsing standard lint waivers (`verilated_std_waiver.vlt`).
.. option:: --no-stop-fail
Don't call $stop when assertion fails. Simulation will continue.
.. option:: --structs-packed
Converts all unpacked structures to packed structures, and issues an
@@ -1211,12 +1461,12 @@ Summary:
.. option:: -sv
Specifies SystemVerilog language features should be enabled; equivalent
to :vlopt:`--language 1800-2017 <--language>`. This option is selected
to :vlopt:`--language 1800-2023 <--language>`. This option is selected
by default; it exists for compatibility with other simulators.
.. option:: +systemverilogext+<ext>
A synonym for :vlopt:`+1800-2017ext+\<ext\>`.
A synonym for :vlopt:`+1800-2023ext+\<ext\>`.
.. option:: --threads <threads>
@@ -1302,6 +1552,7 @@ Summary:
This is not needed with standard designs with only one top. See also
:option:`MULTITOP` warning.
.. option:: --trace
Adds waveform tracing code to the model using VCD format. This overrides
@@ -1347,13 +1598,13 @@ Summary:
Enable FST waveform tracing in the model. This overrides
:vlopt:`--trace`. See also :vlopt:`--trace-threads` option.
.. option:: --trace-max-array *depth*
.. option:: --trace-max-array <depth>
Rarely needed. Specify the maximum array depth of a signal that may be
traced. Defaults to 32, as tracing large arrays may greatly slow traced
simulations.
.. option:: --trace-max-width *width*
.. option:: --trace-max-width <width>
Rarely needed. Specify the maximum bit width of a signal that may be
traced. Defaults to 256, as tracing large vectors may greatly slow
@@ -1370,7 +1621,7 @@ Summary:
format constraints, this may result in significantly slower trace times
and larger trace files.
.. option:: --trace-threads *threads*
.. option:: --trace-threads <threads>
Enable waveform tracing using separate threads. This is typically faster
in simulation runtime but uses more total compute. This option only
@@ -1380,6 +1631,17 @@ Summary:
This option is accepted, but has absolutely no effect with
:vlopt:`--trace`, which respects :vlopt:`--threads` instead.
.. option:: --no-trace-top
Disables tracing for the input and output signals in the top wrapper which
Verilator adds to the design. The signals are still traced in the original
verilog top modules.
When combined with :option:`--main-top-name` set to "-" or when the name of
the top module is set to "" in its constructor, the generated trace file
will have the verilog top module as its root, rather than another module
added by Verilator.
.. option:: --trace-underscore
Enable tracing of signals or modules that start with an
@@ -1397,15 +1659,19 @@ Summary:
.. option:: --unroll-count <loops>
Rarely needed. Specifies the maximum number of loop iterations that may be
unrolled. See also :option:`BLKLOOPINIT` warning.
Rarely needed. Specifies the maximum number of loop iterations that may
be unrolled. See also :option:`BLKLOOPINIT` warning, and
:option:`/*verilator&32;unroll_disable*/` and
:option:`/*verilator&32;unroll_full*/` metacomments.
.. option:: --unroll-stmts *statements*
.. option:: --unroll-stmts <statements>
Rarely needed. Specifies the maximum number of statements in a loop for
that loop to be unrolled. See also :option:`BLKLOOPINIT` warning.
that loop to be unrolled. See also :option:`BLKLOOPINIT` warning, and
:option:`/*verilator&32;unroll_disable*/` and
:option:`/*verilator&32;unroll_full*/` metacomments.
.. option:: --unused-regexp *regexp*
.. option:: --unused-regexp <regexp>
Rarely needed. Specifies a simple regexp with \* and ? that, if a signal
name matches, will suppress the :option:`UNUSED` warning. Defaults to
@@ -1417,18 +1683,32 @@ Summary:
into Verilator. (Similar to :command:`perl -V`.) See also
:vlopt:`--getenv` option.
.. option:: -v *filename*
.. option:: -v <filename>
Read the filename as a Verilog library. Any modules in the file may be
used to resolve instances in the top-level module, otherwise, they are
ignored. Note "-v" is relatively standard across Verilog tools.
.. option:: --valgrind
Run Verilator under `Valgrind <https://valgrind.org/>`_. The command may be
changed with :option:`VERILATOR_VALGRIND`.
.. option:: --no-verilate
When using :vlopt:`--build`, disable the generation of C++/SystemC code, and
execute only the build. This can be useful for rebuilding the Verilated code
produced by a previous invocation of Verilator.
.. option:: --verilate-jobs [<value>]
Specify the level of parallelism for the internal compilation steps of
Verilator. If zero, uses the number of threads in the current hardware.
Otherwise, must be a positive integer specifying the maximum number of
parallel build jobs.
See also :vlopt:`-j`.
.. option:: +verilog1995ext+<ext>
Synonym for :vlopt:`+1364-1995ext+\<ext\>`.
@@ -1445,7 +1725,16 @@ Summary:
Enable the use of VPI and linking against the :file:`verilated_vpi.cpp` files.
.. option:: --waiver-output *filename*
.. option:: --waiver-multiline
When using :vlopt:`--waiver-output \<filename\> <--waiver-output>`,
include a match expression that includes the entire multiline error
message as a match regular expression, as opposed to the default of only
matching the first line of the error message. This provides a starting
point for creating complex waivers, but such generated waivers will
likely require editing for brevity before being reused.
.. option:: --waiver-output <filename>
Generate a waiver file that contains all waiver statements to suppress
the warnings emitted during this Verilator run. This, in particular, is
@@ -1453,8 +1742,11 @@ Summary:
them systematically.
The generated file is in the Verilator Configuration format, see
:ref:`Configuration Files`, and can directly be consumed by
Verilator. The standard file extension is ".vlt".
:ref:`Configuration Files`. The standard file extension is ".vlt".
These files can directly be consumed by Verilator, typically by placing
the filename as part of the Verilator command line options. Waiver files
need to be listed on the command line before listing the files they are
waiving.
.. option:: -Wall
@@ -1499,13 +1791,15 @@ Summary:
.. option:: -Wno-lint
Disable all lint-related warning messages, and all style warnings. This is
equivalent to ``-Wno-ALWCOMBORDER -Wno-BSSPACE -Wno-CASEINCOMPLETE
-Wno-CASEOVERLAP -Wno-CASEX -Wno-CASTCONST -Wno-CASEWITHX -Wno-CMPCONST -Wno-COLONPLUS
-Wno-IMPLICIT -Wno-IMPLICITSTATIC -Wno-LITENDIAN -Wno-PINCONNECTEMPTY
-Wno-PINMISSING -Wno-SYNCASYNCNET -Wno-UNDRIVEN -Wno-UNSIGNED
-Wno-UNUSEDGENVAR -Wno-UNUSEDPARAM -Wno-UNUSEDSIGNAL
-Wno-WIDTH`` plus the list shown for Wno-style.
Disable all lint-related warning messages, and all style warnings. This
is equivalent to ``-Wno-ALWCOMBORDER`` ``-Wno-ASCRANGE``
``-Wno-BSSPACE`` ``-Wno-CASEINCOMPLETE`` ``-Wno-CASEOVERLAP``
``-Wno-CASEX`` ``-Wno-CASTCONST`` ``-Wno-CASEWITHX`` ``-Wno-CMPCONST``
``-Wno-COLONPLUS`` ``-Wno-IMPLICIT`` ``-Wno-IMPLICITSTATIC``
``-Wno-PINCONNECTEMPTY`` ``-Wno-PINMISSING`` ``-Wno-STATICVAR``
``-Wno-SYNCASYNCNET`` ``-Wno-UNDRIVEN`` ``-Wno-UNSIGNED``
``-Wno-UNUSEDGENVAR`` ``-Wno-UNUSEDPARAM`` ``-Wno-UNUSEDSIGNAL``
``-Wno-WIDTH``, plus the list shown for :vlopt:`-Wno-style`.
It is strongly recommended that you clean up your code rather than using this
option; it is only intended to be used when running test-cases of code
@@ -1513,12 +1807,13 @@ Summary:
.. option:: -Wno-style
Disable all code style related warning messages (note that by default, they are
already disabled). This is equivalent to ``-Wno-DECLFILENAME -Wno-DEFPARAM
-Wno-EOFNEWLINE -Wno-IMPORTSTAR -Wno-INCABSPATH -Wno-PINCONNECTEMPTY
-Wno-PINNOCONNECT -Wno-SYNCASYNCNET -Wno-UNDRIVEN
-Wno-UNUSEDGENVAR -Wno-UNUSEDPARAM -Wno-UNUSEDSIGNAL
-Wno-VARHIDDEN``.
Disable all code style related warning messages (note that by default,
they are already disabled). This is equivalent to ``-Wno-DECLFILENAME``
``-Wno-DEFPARAM`` ``-Wno-EOFNEWLINE`` ``-Wno-GENUNNAMED``
``-Wno-IMPORTSTAR`` ``-Wno-INCABSPATH`` ``-Wno-PINCONNECTEMPTY``
``-Wno-PINNOCONNECT`` ``-Wno-SYNCASYNCNET`` ``-Wno-UNDRIVEN``
``-Wno-UNUSEDGENVAR`` ``-Wno-UNUSEDPARAM`` ``-Wno-UNUSEDSIGNAL``
``-Wno-VARHIDDEN``.
.. option:: -Wpedantic
@@ -1528,25 +1823,34 @@ Summary:
:command:`gcc -Wpedantic`. Rarely used, and intended only for strict
compliance tests.
This option changes :option:`ASSIGNIN` from an error to a warning.
.. option:: -Wwarn-<message>
Enables the specified warning message.
.. option:: -Wwarn-lint
Enable all lint-related warning messages (note that by default, they are already
enabled), but do not affect style messages. This is equivalent to
``-Wwarn-ALWCOMBORDER -Wwarn-BSSPACE -Wwarn-CASEINCOMPLETE
-Wwarn-CASEOVERLAP -Wwarn-CASEX -Wwarn-CASTCONST -Wwarn-CASEWITHX -Wwarn-CMPCONST
-Wwarn-COLONPLUS -Wwarn-IMPLICIT -Wwarn-LITENDIAN
-Wwarn-PINMISSING -Wwarn-REALCVT -Wwarn-UNSIGNED -Wwarn-WIDTH``.
Enable all lint-related warning messages (note that by default, they are
already enabled), but do not affect style messages. This is equivalent
to ``-Wwarn-ALWCOMBORDER`` ``-Wwarn-ASCRANGE`` ``-Wwarn-BSSPACE``
``-Wwarn-CASEINCOMPLETE`` ``-Wwarn-CASEOVERLAP`` ``-Wwarn-CASEWITHX``
``-Wwarn-CASEX`` ``-Wwarn-CASTCONST`` ``-Wwarn-CMPCONST``
``-Wwarn-COLONPLUS`` ``-Wwarn-IMPLICIT`` ``-Wwarn-IMPLICITSTATIC``
``-Wwarn-LATCH`` ``-Wwarn-MISINDENT`` ``-Wwarn-NEWERSTD``
``-Wwarn-PREPROCZERO`` ``-Wwarn-PINMISSING`` ``-Wwarn-REALCVT``
``-Wwarn-STATICVAR`` ``-Wwarn-UNSIGNED`` ``-Wwarn-WIDTHTRUNC``
``-Wwarn-WIDTHEXPAND`` ``-Wwarn-WIDTHXZEXPAND``.
.. option:: -Wwarn-style
Enable all code style-related warning messages. This is equivalent to
``-Wwarn ASSIGNDLY -Wwarn-DECLFILENAME -Wwarn-DEFPARAM -Wwarn-EOFNEWLINE
-Wwarn-INCABSPATH -Wwarn-PINNOCONNECT -Wwarn-SYNCASYNCNET -Wwarn-UNDRIVEN
-Wwarn-UNUSEDGENVAR -Wwarn-UNUSEDPARAM -Wwarn-UNUSEDSIGNAL -Wwarn-VARHIDDEN``.
``-Wwarn-ASSIGNDLY`` ``-Wwarn-BLKSEQ`` ``-Wwarn-DECLFILENAME``
``-Wwarn-DEFPARAM`` ``-Wwarn-EOFNEWLINE`` ``-Wwarn-GENUNNAMED``
``-Wwarn-IMPORTSTAR`` ``-Wwarn-INCABSPATH`` ``-Wwarn-PINCONNECTEMPTY``
``-Wwarn-PINNOCONNECT`` ``-Wwarn-SYNCASYNCNET`` ``-Wwarn-UNDRIVEN``
``-Wwarn-UNUSEDGENVAR`` ``-Wwarn-UNUSEDLOOP`` ``-Wwarn-UNUSEDPARAM``
``-Wwarn-UNUSEDSIGNAL`` ``-Wwarn-VARHIDDEN``.
.. option:: --x-assign 0
@@ -1578,9 +1882,9 @@ Summary:
.. note::
This option applies only to values explicitly written as X
in modules (not classes) in the Verilog source code. Initial values
of clocks are set to 0 unless `--x-initial-edge` is
This option applies only to values explicitly written as X in modules
(not classes, nor parameters) in the Verilog source code. Initial
values of clocks are set to 0 unless `--x-initial-edge` is
specified. Initial values of all other state holding variables are
controlled with `--x-initial`.
@@ -1650,14 +1954,21 @@ Summary:
Create XML output only, do not create any other output.
The XML format is intended to be used to leverage Verilator's parser and
elaboration to feed to other downstream tools. Be aware that the XML
format is still evolving; there will be some changes in future versions.
elaboration to feed to other downstream tools.
.. note::
This feature is deprecated in favor of :vlopt:`--json-only`.
.. option:: --xml-output <filename>
Specifies the filename for the XML output file. Using this option
automatically sets :vlopt:`--xml-only`.
.. note::
This feature is deprecated in favor of :vlopt:`--json-only`.
.. option:: -y <dir>
Add the directory to the list of directories that should be searched to find
@@ -1680,8 +1991,12 @@ Configuration Files
In addition to the command line, warnings and other features for the
:command:`verilator` command may be controlled with configuration files,
typically named with the .vlt extension (what makes it a configuration file
is the :option:`\`verilator_config` directive). An example:
typically named with the `.vlt` extension (what makes it a configuration
file is the :option:`\`verilator_config` directive). These files, when
named `.vlt`, are read before source code files; if this behavior is
undesired, name the config file with a `.v` suffix.
An example:
.. code-block:: sv
@@ -1774,6 +2089,13 @@ The grammar of configuration commands is as follows:
that the setting is ignored unless the :vlopt:`--hierarchical` option is
specified. See :ref:`Hierarchical Verilation`.
.. option:: hier_params -module "<modulename>"
Specifies that the module contains parameters a :vlopt:`--hierarchical` block. This option
is used internally to specify parameters for deparametrized hier block instances.
This option should not be used directly.
See :ref:`Hierarchical Verilation`.
.. option:: inline -module "<modulename>"
Specifies the module may be inlined into any modules that use this
@@ -1811,7 +2133,7 @@ The grammar of configuration commands is as follows:
.. option:: lint_off [-rule <message>] [-file "<filename>" [-lines <line> [ - <line>]]]
.. option:: lint_off [-rule <message>] [-file "<filename>"] [-match "<string>"]
.. option:: lint_off [-rule <message>] [-file "<filename>"] [-contents "<wildcard>"] [-match "<wildcard>"]
Enable/disables the specified lint warning, in the specified filename
(or wildcard with '\*' or '?', or all files if omitted) and range of
@@ -1820,17 +2142,28 @@ The grammar of configuration commands is as follows:
With lint_off using "\*" will override any lint_on directives in the
source, i.e. the warning will still not be printed.
If the -rule is omitted, all lint warnings (see list in
If the :code:`-rule` is omitted, all lint warnings (see list in
:vlopt:`-Wno-lint`) are enabled/disabled. This will override all later
lint warning enables for the specified region.
If -match is set, the linter warnings are matched against this
(wildcard) string and are waived in case they match, provided with the
rule and file also match.
If :code:`-contents` is provided, the input files must contain the given
wildcard (with '\*' or '?'), and are waived in case they match, provided
the :code:`-rule`, :code:`-file`, and :code:`-contents` also match. The
wildcard should be designed to match a single line; it is unspecified if
the wildcard is allowed to match across multiple lines. The input
contents does not include :vlopt:`--std <--no-std>` standard files, nor
configuration files (with :code:`verilator_config`). Typical use for
this is to match a version number present in the Verilog sources, so
that the waiver will only apply to that version of the sources.
In previous versions -rule was named -msg. The latter is deprecated, but
still works with a deprecation info; it may be removed in future
versions.
If :code:`-match` is provided, the linter warnings are matched against
the given wildcard (with '\*' or '?'), and are waived in case they
match, provided the :code:`-rule`, :code:`-file`, and :code:`-contents`
also match. The wildcard is compared across the entire multi-line
message; see :vlopt:`--waiver-multiline`.
Before version 4.026, :code:`-rule` was named :code:`-msg`, and
:code:`-msg` remained a deprecated alias until Version 5.000.
.. option:: public [-module "<modulename>"] [-task/-function "<taskname>"] -var "<signame>"
@@ -1845,6 +2178,13 @@ The grammar of configuration commands is as follows:
:option:`/*verilator&32;public_flat*/`, etc., metacomments. See
also :ref:`VPI Example`.
.. option:: profile_data -hier-dpi "<function_name>" -cost <cost_value>
Internal profiling data inserted during :vlopt:`--hierarchical`; specifies
execution cost of a hierarchical DPI wrappers for modules with
:option:`/*verilator&32;hier_block*/` metacomment. See
:ref:`Hierarchical Verilation`.
.. option:: profile_data -mtask "<mtask_hash>" -cost <cost_value>
Feeds profile-guided optimization data into the Verilator algorithms in
+68 -19
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
verilator_coverage
@@ -6,10 +6,10 @@ verilator_coverage
Verilator_coverage processes Verilated model-generated coverage reports.
With --annotate, it reads the specified coverage data file and generates
annotated source code with coverage metrics annotated. If multiple
coverage points exist on the same source code line, additional lines will
be inserted to report the additional points.
With `--annotate`, it reads the specified coverage data file and generates
annotated source code with coverage metrics annotated. With
`--annotate-points` the coverage points corresponding to each line are also
shown.
Additional Verilog-XL-style standard arguments specify the search paths
necessary to find the source code on which the coverage analysis was
@@ -35,11 +35,11 @@ verilator_coverage Example Usage
verilator_coverage --help
verilator_coverage --version
verilator_coverage --annotate <obj>
verilator_coverage --annotate obj_dir coverage.dat
verilator_coverage -write merged.dat -read <datafiles>...
verilator_coverage --write merged.dat coverage.dat ...
verilator_coverage -write-info merged.info -read <datafiles>...
verilator_coverage --write-info merged.info coverage.dat ...
verilator_coverage Arguments
@@ -58,17 +58,69 @@ to read multiple inputs. If no data file is specified, by default,
Specifies the directory name to which source files with annotated coverage
data should be written.
Points are children of each line coverage- branches, expressions or toggle points.
When point counts are aggregated into a line, the minimum and maximum counts
are used to determine the status of the line (complete, partial, failing)
The count is equal to the maximum of the points.
Coverage data is annotated at the beginning of the line and is formatted
as a special character followed by the number of coverage hits. The special
characters " ,%,~,+,-" indicate summary of the coverage, and allow use of grep
to filter the report.
* " " (whitespace) indicates that all points on the line are above the coverage min.
* "%" indicates that all points on the line are below the coverage min.
* "~" indicates that some points on the line are above the coverage min and some are below.
* "+" coverage point was at or above the min. Only used with :option:`--annotate-points`.
* "-" coverage point was below the min. Only used with :option:`--annotate-points`.
.. code-block::
100000 input logic a; // Begins with whitespace, because
// number of hits (100000) is above the min.
+100000 point: comment=a // Begins with +, because
// number of hits (100000) is above the min.
%000000 input logic b; // Begins with %, because
// number of hits (0) is below the min.
-000000 point: comment=b // Begins with -, because
// number of hits (0) is below the min.
~000010 if (cyc!=0) begin // Begins with ~, because
// branches are below and above the min.
+000010 point: comment=if // The if branch is above the min.
-000000 point: comment=else // The else branch is below the min.
.. option:: --annotate-all
Specifies all files should be shown. By default, only those source files
with low coverage are written to the output directory.
This option should be used together with :option:`--annotate`.
.. option:: --annotate-min <count>
Specifies if the coverage point does not include the count number of
coverage hits, then the coverage point will be considered above the
threshold, and the coverage report will put a "%" to indicate the coverage
is insufficient. Defaults to 10.
Specifies the threshold (<count>) below which coverage point is considered
sufficient. If the threshold is not exceeded, then the annotation will begin
with a "%" symbol to indicate the coverage is insufficient.
The <count> threshold defaults to 10.
This option should be used together with :option:`--annotate`.
.. option:: --annotate-points
Specifies all coverage points should be shown after each line of text. By
default, only source lines are shown.
.. code-block::
100000 input logic a, b, c;
+100000 point: comment=a // These lines are only shown
+200000 point: comment=b // with option --annotate-points
+300000 point: comment=c // enabled.
This option should be used together with :option:`--annotate`.
.. option:: --help
@@ -106,10 +158,7 @@ generated from random test runs) into one master coverage file.
Specifies the aggregate coverage results, summed across all the files,
should be written to the given filename in :command:`lcov` .info format.
This may be used to feed into :command:`lcov` to aggregate or generate
reports.
Converting from the Verilator coverage data format to the info format is
lossy; the info will have all forms of coverage merged line coverage, and
if there are multiple coverage points on a single line they will merge.
The minimum coverage across all merged points will be used to report
coverage of the line.
reports. This format lacks the comments for cover points that the
verilator_coverage format has. It can be used with :command:`genhtml`
to generate an HTML report. :command:`genhtml --branch-coverage` will
also display the branch coverage, analogous to :option:`--annotate-points`
+18 -9
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
verilator_gantt
@@ -30,15 +30,13 @@ Gantt Chart VCD Signals
In waveforms, there are the following signals. In GTKWave, use "decimal"
data format to remove the leading zeros and make the traces easier to read.
evals
Increments each time when eval_step was measured to be active. This
allow visualization of how much time eval_step was active.
trace/section
Shows the name of the current top of the execution section stack.
Set GTKWave data format to "ASCII".
eval_loop
Increments each time when the evaluation loop within eval_step was
measured to be active. For best performance, there is only a single
evaluation loop within each eval_step call; that is, the eval_loop
waveform looks identical to the evals waveform.
trace/depth
Shows the depth of the execution section stack.
Set GTKWave data format to "Analog".
measured_parallelism
The number of mtasks active at this time, for best performance, this will
@@ -64,6 +62,17 @@ predicted_thread#_mtask
executing.
verilator_gantt Example Usage
-----------------------------
..
verilator_gantt --help
verilator_gantt --version
verilator_gantt profile_exec.dat
verilator_gantt Arguments
-------------------------
+12 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
verilator_profcfunc
@@ -15,6 +15,17 @@ reported as a rounding error.
For an overview of the use of verilator_profcfunc, see :ref:`Profiling`.
verilator_profcfunc Example Usage
---------------------------------
..
verilator_profcfunc --help
verilator_profcfunc --version
verilator_profcfunc gprof.out
verilator_profcfunc Arguments
-----------------------------
+1 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
*********************************
+63 -8
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
*******************
@@ -17,19 +17,26 @@ or "`ifdef`"'s may break other tools.
.. option:: `__LINE__
The :option:`\`__LINE__` define expands to the current filename as a
string, like C++'s __LINE__. This Verilator feature added in 2006 was
incorporated into IEEE 1800-2009.
The :option:`\`__LINE__` define expands to the current line number like
C++'s __LINE__. This Verilator feature added in 2006 was incorporated
into IEEE 1800-2009.
.. option:: `error [string]
This will report an error when encountered, like C++'s #error.
This will report an error when the preprocessor emits it, similar to
C++'s #error.
.. option:: `line
As a special case `\`line \`__LINE__ "filename"` allows setting the
filename, without changing the line number. This is used for some
internal tests, so that debugging can leave the line numbers correctly
referring to the test file's line numbers.
.. option:: """ [string] """
A triple-quoted block specifies a string that may include newlines and
single quotes. This extension is experimental and may be removed
without deprecation.
single quotes. This extension was standardized in IEEE 1800-2023.
.. option:: $c([string], ...);
@@ -446,6 +453,33 @@ or "`ifdef`"'s may break other tools.
Same as :option:`public_flat_rw` configuration file option.
.. option:: /*verilator&32;public_[|flat|flat_rd|flat_rw]_on [@(<edge_list>)]*/ (as scope)
Used to wrap multiple signals and parameters with the respective public attribute.
See attribute above for their respective behavior. Cannot be nested. e.g:
.. code-block:: sv
/*verilator public_flat_rw_on*/
logic clk;
logic rst;
parameter width = 8;
/* verilator public_off*/
logic data;
Is equivalent to:
.. code-block:: sv
logic clk /*verilator public_flat_rw*/;
logic rst /*verilator public_flat_rw*/;
parameter width /*verilator public_flat_rw*/ = 8;
logic data;
.. option:: /*verilator&32;public_off*/
Terminates the previous `/*verilator public*_on*/` directive; see above.
.. option:: /*verilator&32;public_module*/
Used after a module statement to indicate the module should not be
@@ -542,6 +576,10 @@ or "`ifdef`"'s may break other tools.
.. option:: /*verilator&32;trace_init_task*/
Removed.
In versions before 5.024:
Attached to a DPI import to indicate that function should be called when
initializing tracing. This attribute is indented only to be used
internally in code that Verilator generates when :vlopt:`--lib-create`
@@ -559,6 +597,23 @@ or "`ifdef`"'s may break other tools.
Re-enable waveform tracing for all future signals or instances that are
declared.
.. option:: /*verilator&32;unroll_disable*/
Used in a statement position to indicate the immediately following loop
at the same statement level should not be unrolled by Verilator,
ignoring :vlopt:`--unroll-count`. This is similar to clang's ``#pragma
clang loop unroll(disable)``.
This option does not currently disable the C++ compiler's unrolling (or
not) of any loops that make it through to the Verilated C++ code.
.. option:: /*verilator&32;unroll_full*/
Rarely needed. Used in a statement position to indicate the immediately
following loop at the same statement level should always be fully
unrolled by Verilator, ignoring :vlopt:`--unroll-count`. This is
similar to clang's ``#pragma clang loop unroll(full)``.
.. option:: $stacktrace
Called as a task, print a stack trace. Called as a function, return a
@@ -567,4 +622,4 @@ or "`ifdef`"'s may break other tools.
symbols. Also, the data represents the C++ stack; the SystemVerilog
functions/tasks involved may be renamed and/or inlined before becoming
the C++ functions that may be visible in the stack trace. This
extension is experimental and may be removed without deprecation.
extension was standardized in IEEE 1800-2023.
+25 -24
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
******************************
@@ -128,10 +128,13 @@ How do I generate waveforms (traces) in C++?
See also the next question for tracing in SystemC mode.
A. Pass the :vlopt:`--trace` option to Verilator, and in your top-level C
code, call ``Verilated::traceEverOn(true)``. Then you may use
``$dumpfile`` and ``$dumpvars`` to enable traces, the same as with any
Verilog simulator. See ``examples/make_tracing_c`` in the distribution.
A. Pass the :vlopt:`--trace` option to Verilator. Then you may use ``$dumpfile`` and
``$dumpvars`` to enable traces, the same as with any Verilog simulator,
although Verilator ignores the arguments to ``$dumpvars``. See
``examples/make_tracing_c`` in the distribution.
If writing the top-level C code, call ``Verilated::traceEverOn(true)``;
this is done for you if using :vlopt:`--binary`.
B. Or, for finer-grained control, or C++ files with multiple Verilated
modules, you may also create the trace purely from C++. Create a
@@ -220,24 +223,20 @@ This is done for you if you are using the Verilator :vlopt:`--binary` or
You can call :code:`->trace()` on multiple Verilated objects with the same
trace file if you want all data to land in the same output file.
When using SystemC 2.3, the SystemC library must have been built with the
experimental simulation phase callback-based tracing disabled. This is
disabled by default when building SystemC with its configure based build
system, but when building SystemC with CMake, you must pass
``-DENABLE_PHASE_CALLBACKS_TRACING=OFF`` to disable this feature.
How do I generate FST waveforms (traces) in C++ or SystemC?
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
FST is a trace file format developed by GTKWave. Verilator provides basic
FST support. To dump traces in FST format, add the :vlopt:`--trace-fst`
option to Verilator and either A. use :code:`$dumpfile & $dumpvars` in
Verilog as described in the VCD example above,
option to Verilator and either:
Use :code:`$dumpfile & $dumpvars` in Verilog as described in the VCD
example above,
Or, in C++ change the include described in the VCD example above:
.. code-block:: C++
.. code-block:: C++
#include "verilated_fst_c.h"
VerilatedFstC* tfp = new VerilatedFstC;
@@ -245,14 +244,14 @@ Or, in C++ change the include described in the VCD example above:
Or, in SystemC, change the include described in the VCD example above:
.. code-block:: C++
.. code-block:: C++
#include "verilated_fst_sc.h"
VerilatedFstC* tfp = new VerilatedFstSc;
Currently, supporting FST and VCD in a single simulation is impossible, but
such requirement should be rare. You can however ifdef around the trace
Currently, supporting FST and VCD in a single simulation is not supported,
but such usage should be unlikely. You can however ifdef around the trace
format in your C++ main loop, and select VCD or FST at compile time.
@@ -260,9 +259,11 @@ How do I view waveforms (aka dumps or traces)?
""""""""""""""""""""""""""""""""""""""""""""""
Verilator creates standard VCD (Value Change Dump) and FST files. VCD
files are viewable with the open-source GTKWave (recommended), or Dinotrace
(legacy) programs, or any of the many closed-source offerings; FST is
supported only by GTKWave.
files are viewable with the open-source
`GTKWave <http://gtkwave.sourceforge.net/>`_,
`Surfer <https://surfer-project.org/>`_, Dinotrace (legacy), or any of the
many closed-source viewer offerings; FST is supported only by GTKWave and
Surfer.
How do I speed up writing large waveform (trace) files?
@@ -356,8 +357,8 @@ Why do I get "undefined reference to \`VL_RAND_RESET_I' or \`Verilated::...'"?
You need to link your compiled Verilated code against the
:code:`verilated.cpp` file found in the include directory of the Verilator
kit. This is one target in the ``$(VK_GLOBAL_OBJS)`` make variable, which
should be part of your Makefile's link rule. If you use :vlopt:`--exe`,
this is done for you.
should be part of your Makefile's link rule. If you use :vlopt:`--exe` or
:vlopt:`--binary`, this is done for you.
Is the PLI supported?
@@ -401,7 +402,7 @@ How do I get faster build times?
* Use a recent compiler. Newer compilers tend to be faster.
* Compile in parallel on many machines and use caching; see the web for the
ccache, distcc, and icecream packages. ccache will skip GCC runs between
ccache, sccache, distcc, or icecream packages. ccache will skip GCC runs between
identical source builds, even across different users. If ccache was
installed when Verilator was built, it is used, or see OBJCACHE
environment variable to override this. Also see the
@@ -486,7 +487,7 @@ From the sc_main.cpp file, you'd then:
#include "Vour.h"
#include "Vour_our.h"
cout << "clock is " << top->our->clk << endl;
std::cout << "clock is " << top->our->clk << std::endl;
In this example, clk is a bool you can read or set as any other variable.
+25 -13
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
*****
@@ -48,12 +48,6 @@ For --cc/--sc, it creates:
- Make include file for compiling (from --make gmake)
* - *{prefix}*\ _classes.mk
- Make include file with class names (from --make gmake)
* - *{prefix}*\ _hier.mk
- Make file for hierarchy blocks (from --make gmake)
* - *{prefix}*\ _hierMkArgs.f
- Arguments for hierarchical Verilation (from --make gmake)
* - *{prefix}*\ _hierCMakeArgs.f
- Arguments for hierarchical Verilation (from --make cmake)
* - *{prefix}*\ .h
- Model header
* - *{prefix}*\ .cpp
@@ -95,16 +89,24 @@ For --cc/--sc, it creates:
* - *{prefix}{each_verilog_module}{__DepSet_hash__n}*\ .cpp
- Additional lower C++ files (hashed to reduce build times)
For --hierarchy mode, it creates:
For --hierarchical mode, it creates:
.. list-table::
* - V\ *{hier_block}*\ /
- Directory to Verilate each hierarchy block (from --hierarchy)
- Directory to Verilate each hierarchical block (from --hierarchical)
* - *{prefix}*\ __hierVer.d
- Make dependencies of the top module (from --hierarchy)
- Make dependencies of the top module (from --hierarchical)
* - *{prefix}*\ _hier.mk
- Make file for hierarchical blocks (from --make gmake)
* - *{prefix}*\ __hierCMakeArgs.f
- Arguments for hierarchical Verilation (from --make cmake)
* - *{prefix}*\ __hierMkArgs.f
- Arguments for hierarchical Verilation (from --make gmake)
* - *{prefix}*\ __hierParameters.v
- Module parameters for hierarchical blocks
* - *{prefix}*\ __hier.dir
- Directory to store .dot, .vpp, .tree of top module (from --hierarchy)
- Directory to store .dot, .vpp, .tree of top module (from --hierarchical)
In specific debug and other modes, it also creates:
@@ -112,6 +114,10 @@ In specific debug and other modes, it also creates:
* - *{prefix}*\ .xml
- XML tree information (from --xml)
* - *{prefix}*\ .tree.json
- JSON tree information (from --json-only)
* - *{prefix}*\ .tree.meta.json
- JSON tree metadata (from --json-only)
* - *{prefix}*\ __cdc.txt
- Clock Domain Crossing checks (from --cdc)
* - *{prefix}*\ __stats.txt
@@ -126,8 +132,10 @@ In specific debug and other modes, it also creates:
- Debugging graph files (from --debug)
* - *{prefix}{misc}*\ .tree
- Debugging files (from --debug)
* - {mod_prefix}_{each_verilog_base_filename}*\ .vpp
- Pre-processed verilog (from --debug)
* - *{prefix}*\ __inputs\ .vpp
- Pre-processed verilog for all files (from --debug)
* - *{prefix}*\ _ *{each_verilog_base_filename}*\ .vpp
- Pre-processed verilog for each file (from --debug)
After running Make, the C++ compiler may produce the following:
@@ -143,6 +151,10 @@ After running Make, the C++ compiler may produce the following:
- Intermediate objects
* - *{prefix}*\
- Final executable (from --exe)
* - lib\ *{prefix}*\ .a
- Final archive (default lib mode)
* - libverilated.a
- Runtime for verilated model (default lib mode)
* - *{prefix}*\ __ALL.a
- Library of all Verilated objects
* - *{prefix}*\ __ALL.cpp
+1 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
######################
+1 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _CMakeInstallation:
+76 -56
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Installation:
@@ -19,13 +19,33 @@ started. (Note packages are unlikely to have the most recent version, so
:ref:`Git Install` might be a better alternative.) To install as a
package:
::
.. code-block:: shell
apt-get install verilator # On Ubuntu
For other distributions, refer to `Repology Verilator Distro Packages
<https://repology.org/project/verilator>`__.
.. _pre-commit Quick Install:
pre-commit Quick Install
=============================
You can use Verilator's `pre-commit <https://pre-commit.com/>`__ hook to
lint your code before committing it. It encapsulates the :ref:`Verilator
Build Docker Container`, so you need docker on your system to use it. The
verilator image will be downloaded automatically.
To use the hook, add the following entry to your :code:`.pre-commit-config.yaml`:
.. code-block:: yaml
repos:
- repo: https://github.com/verilator/verilator
rev: v5.026 # or later
hooks:
- id: verilator
.. _Git Install:
Git Quick Install
@@ -36,10 +56,10 @@ options and details, see :ref:`Detailed Build Instructions` below.
In brief, to install from git:
::
.. code-block:: shell
# Prerequisites:
#sudo apt-get install git perl python3 make autoconf g++ flex bison ccache
#sudo apt-get install git help2man perl python3 make autoconf g++ flex bison ccache
#sudo apt-get install libgoogle-perftools-dev numactl perl-doc
#sudo apt-get install libfl2 # Ubuntu only (ignore if gives error)
#sudo apt-get install libfl-dev # Ubuntu only (ignore if gives error)
@@ -89,7 +109,7 @@ Install Prerequisites
To build or run Verilator, you need these standard packages:
::
.. code-block:: shell
sudo apt-get install git help2man perl python3 make
sudo apt-get install g++ # Alternatively, clang
@@ -101,34 +121,35 @@ To build or run Verilator, you need these standard packages:
To build or run Verilator, the following are optional but should be installed
for good performance:
::
.. code-block:: shell
sudo apt-get install ccache # If present at build, needed for run
sudo apt-get install mold # If present at build, needed for run
sudo apt-get install libgoogle-perftools-dev numactl
The following is optional but is recommended for nicely rendered command line
help when running Verilator:
::
.. code-block:: shell
sudo apt-get install perl-doc
To build Verilator you will need to install these packages; these do not
need to be present to run Verilator:
::
.. code-block:: shell
sudo apt-get install git autoconf flex bison
Those developing Verilator itself may also want these (see internals.rst):
::
.. code-block:: shell
sudo apt-get install gdb graphviz cmake clang clang-format-14 gprof lcov
sudo apt-get install libclang-dev yapf3
sudo pip3 install clang sphinx sphinx_rtd_theme sphinxcontrib-spelling breathe
sudo apt-get install clang clang-format-14 cmake gdb gprof graphviz lcov
sudo apt-get install python3-clang yapf3 bear jq
sudo pip3 install sphinx sphinx_rtd_theme sphinxcontrib-spelling breathe ruff
sudo pip3 install git+https://github.com/antmicro/astsee.git
cpan install Pod::Perldoc
cpan install Parallel::Forker
Install SystemC
@@ -150,6 +171,17 @@ To make use of Verilator FST tracing you will want `GTKwave
required at Verilator build time.
Install Z3
^^^^^^^^^^
In order to use constrained randomization the `Z3 Theorem Prover
<https://github.com/z3prover/z3#readme>`__ must be installed, however this is
not required at Verilator build time. There are other compatible SMT solvers,
like CVC5/CVC4, but they are not guaranteed to work. Since different solvers are
faster for different scenarios, the solver to use at run-time can be specified
by the environment variable :option:`VERILATOR_SOLVER`.
.. _Obtain Sources:
Obtain Sources
@@ -158,14 +190,14 @@ Obtain Sources
Get the sources from the git repository: (You need to do this only once,
ever.)
::
.. code-block:: shell
git clone https://github.com/verilator/verilator # Only first time
## Note the URL above is not a page you can see with a browser; it's for git only
Enter the checkout and determine what version/branch to use:
::
.. code-block:: shell
cd verilator
git pull # Make sure we're up-to-date
@@ -180,7 +212,7 @@ Auto Configure
Create the configuration script:
::
.. code-block:: shell
autoconf # Create ./configure script
@@ -191,8 +223,9 @@ Eventual Installation Options
Before configuring the build, you must decide how you're going to
eventually install Verilator onto your system. Verilator will be compiling
the current value of the environment variables :option:`VERILATOR_ROOT`,
:option:`SYSTEMC_INCLUDE`, and :option:`SYSTEMC_LIBDIR` as defaults into
the executable, so they must be correct before configuring.
:option:`VERILATOR_SOLVER`, :option:`SYSTEMC_INCLUDE`, and
:option:`SYSTEMC_LIBDIR` as defaults into the executable, so they must be
correct before configuring.
These are the installation options:
@@ -201,42 +234,45 @@ These are the installation options:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Our personal favorite is to always run Verilator in-place from its Git
directory. This allows the easiest experimentation and upgrading, and
allows many versions of Verilator to co-exist on a system.
directory (don't run ``make install``). This allows the easiest
experimentation and upgrading, and allows many versions of Verilator to
co-exist on a system.
::
.. code-block:: shell
export VERILATOR_ROOT=`pwd` # if your shell is bash
setenv VERILATOR_ROOT `pwd` # if your shell is csh
./configure
# Running will use files from $VERILATOR_ROOT, so no install needed
Note after installing (below steps), a calling program or shell must set
the environment variable :option:`VERILATOR_ROOT` to point to this Git
directory, then execute ``$VERILATOR_ROOT/bin/verilator``, which will find
the path to all needed files.
Note after installing (see `Installation`_), a calling program or shell
must set the environment variable :option:`VERILATOR_ROOT` to point to this
Git directory, then execute ``$VERILATOR_ROOT/bin/verilator``, which will
find the path to all needed files.
2. Install into a specific location
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2. Install into a Specific Prefix
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You may eventually be installing onto a project/company-wide "CAD" tools
disk that may support multiple versions of every tool. Tell configure the
You may be an OS package maintainer building a Verilator package, or you
may eventually be installing onto a project/company-wide "CAD" tools disk
that may support multiple versions of every tool. Tell configure the
eventual destination directory name. We recommend that the destination
location include the Verilator version name:
::
.. code-block:: shell
unset VERILATOR_ROOT # if your shell is bash
unsetenv VERILATOR_ROOT # if your shell is csh
# For the tarball, use the version number instead of git describe
./configure --prefix /CAD_DISK/verilator/`git describe | sed "s/verilator_//"`
Note after installing (below steps), if you use `modulecmd
Note after installing (see `Installation`_), you need to add the path to
the ``bin`` directory to your ``PATH``. Or, if you use `modulecmd
<http://modules.sourceforge.net/>`__, you'll want a module file like the
following:
::
.. code-block:: shell
set install_root /CAD_DISK/verilator/{version-number-used-above}
unsetenv VERILATOR_ROOT
@@ -245,36 +281,20 @@ following:
prepend-path PKG_CONFIG_PATH $install_root/share/pkgconfig
3. Install into a Specific Path
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You may eventually install Verilator into a specific installation prefix,
as most GNU tools support:
::
unset VERILATOR_ROOT # if your shell is bash
unsetenv VERILATOR_ROOT # if your shell is csh
./configure --prefix /opt/verilator-VERSION
Then after installing (below steps), you will need to add
``/opt/verilator-VERSION/bin`` to your ``$PATH`` environment variable.
4. Install System Globally
3. Install System Globally
^^^^^^^^^^^^^^^^^^^^^^^^^^
The final option is to eventually install Verilator globally, using
configure's default system paths:
::
.. code-block:: shell
unset VERILATOR_ROOT # if your shell is bash
unsetenv VERILATOR_ROOT # if your shell is csh
./configure
Then after installing (below), the binaries should be in a location
already in your ``$PATH`` environment variable.
Then after installing (see `Installation`_), the binaries should be in a
location already in your ``$PATH`` environment variable.
Configure
@@ -284,7 +304,7 @@ The command to configure the package was described in the previous step.
Developers should configure to have more complete developer tests.
Additional packages may be required for these tests.
::
.. code-block:: shell
export VERILATOR_AUTHOR_SITE=1 # Put in your .bashrc
./configure --enable-longtests ...above options...
@@ -295,7 +315,7 @@ Compile
Compile Verilator:
::
.. code-block:: shell
make -j `nproc` # Or if error on `nproc`, the number of CPUs in system
@@ -305,7 +325,7 @@ Test
Check the compilation by running self-tests:
::
.. code-block:: shell
make test
@@ -317,7 +337,7 @@ If you used any install option other than the `1. Run-in-Place from
VERILATOR_ROOT <#_1_run_in_place_from_verilator_root>`__ scheme, install
the files:
::
.. code-block:: shell
make install
+35 -39
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
***************
@@ -62,12 +62,23 @@ Verilator supports the 2017 "for" loop constructs and several cleanups IEEE
made in 1800-2017.
SystemVerilog 2023 (IEEE 1800-2023) Support
-------------------------------------------
Verilator supports some of the 2023 improvements, including triple-quoted
string blocks that may include newlines and single quotes.
Verilator implements a full IEEE 1800-2023 compliant preprocessor,
including triple-quoted strings, and \`ifdef expressions.
Verilog AMS Support
-------------------
Verilator implements a very small subset of Verilog AMS (Verilog Analog and
Mixed-Signal Extensions) with the subset corresponding to those VMS
keywords with near-equivalents in Verilog 2005 or SystemVerilog 2017.
keywords with near-equivalents in Verilog IEEE 1364 or SystemVerilog
IEEE 1800.
AMS parsing is enabled with :vlopt:`--language VAMS <--language>` or
:vlopt:`--language 1800+VAMS <--language>`.
@@ -237,11 +248,9 @@ optimizations will be disabled around the latch.
Structures and Unions
---------------------
Presently Verilator only supports packed structs and packed unions. Rand
and randc tags on members are ignored. All structures and unions are
represented as a single vector, which means that generating one member of a
structure from blocking, and another from non-blocking assignments is
unsupported.
All structures and unions are scheduled together, which means that
generating one member of a structure from blocking, and another from
non-blocking assignments is unsupported.
.. _Unknown States:
@@ -320,20 +329,6 @@ there will be considered a two-state variable that is read and written
instead of a four-state variable.
Functions & Tasks
-----------------
All functions and tasks will be inlined (will not become functions in C.)
The only support provided is simple statements in tasks (which may
affect global variables).
Recursive functions and tasks are not supported. All inputs and outputs
are automatic as if they had the Verilog 2001 "automatic" keyword
prepended. (If you don't know what this means, Verilator will do what you
probably expect, what C does. The default behavior of Verilog is
different.)
Gate Primitives
---------------
@@ -383,24 +378,6 @@ Verilator does not support SEREs yet. All assertion and coverage
statements must be simple expressions that complete in one cycle.
Force statement
---------------
Verilator supports the procedural `force` (and corresponding `release`)
statement. However, the behavior of the `force` statement does not entirely
comply with IEEE 1800. According to the standard,
when a procedural statement of the form `force a = b;` is executed, the
simulation should behave as if, from that point forwards, a continuous
assignment `assign a = b;` has been added to override the drivers of `a`.
More specifically: the value of `a` should be updated whenever the value of
`b` changes, until a `release a;` statement is executed.
Verilator instead evaluates the current value of `b` when the `force`
statement is executed, and forces `a` to that value, without updating it
until a new `force` or `release` statement is encountered that applies to
`a`. This non-standard behavior is nevertheless consistent with some other
simulators.
Encrypted Verilog
-----------------
@@ -461,12 +438,31 @@ chandle
Treated as a "longint"; does not yet warn about operations specified as
illegal on chandles.
checker
Treated as a "module"; does not yet warn about many constructs illegal
inside a checker.
disable
Disable statements may be used only if the block being disabled is a
block the disable statement itself is inside. This was commonly used to
provide loop break and continue functionality before SystemVerilog added
the break and continue keywords.
force, release
Verilator supports the procedural `force` (and corresponding `release`)
statement. However, the behavior of the `force` statement does not
entirely comply with IEEE 1800. According to the standard, when a
procedural statement of the form `force a = b;` is executed, the
simulation should behave as if, from that point forwards, a continuous
assignment `assign a = b;` has been added to override the drivers of `a`.
More specifically: the value of `a` should be updated whenever the value
of `b` changes, until a `release a;` statement is executed. Verilator
instead evaluates the current value of `b` when the `force` statement is
executed, and forces `a` to that value, without updating it until a new
`force` or `release` statement is encountered that applies to `a`. This
non-standard behavior is nevertheless consistent with some other
simulators.
inside
Inside expressions may not include unpacked array traversal or $ as an
upper bound. Case inside and case matches are also unsupported.
+7 -7
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
********
@@ -23,12 +23,12 @@ resulting model's C++ or SystemC code is output as .cpp and .h files. This
is referred to as "Verilating", and the process is "to Verilate"; the
output is a "Verilated" model.
2. For simulation, a small-user written C++ wrapper file is required, the
2. For simulation, a small user-written C++ wrapper file is required, the
"wrapper". This wrapper defines the C++ standard function "main()", which
instantiates the Verilated model as a C++/SystemC object.
3. The user C++ wrapper, the files created by Verilator, a "runtime
library" provided by Verilator, and, if applicable SystemC libraries are
library" provided by Verilator, and, if applicable, SystemC libraries are
then compiled using a C++ compiler to create a simulation executable.
4. The resulting executable will perform the actual simulation during
@@ -44,12 +44,12 @@ The best place to get started is to try the :ref:`Examples`.
.. [#] Verilog is defined by the `Institute of Electrical and Electronics
Engineers (IEEE) Standard for Verilog Hardware Description
Language`, Std. 1364, released in 1995, 2001, and 2005. The
Verilator documentation uses the shorthand, e.g., "IEEE 1394-2005",
Verilator documentation uses the shorthand, e.g., "IEEE 1364-2005",
to refer to the, e.g., 2005 version of this standard.
.. [#] SystemVerilog is defined by the `Institute of Electrical and
Electronics Engineers (IEEE) Standard for SystemVerilog - Unified
Hardware Design, Specification, and Verification Language`, Standard
1800, released in 2005, 2009, 2012, and 2017. The Verilator
documentation uses the shorthand e.g., "IEEE 1800-2017", to refer to
the, e.g., 2017 version of this standard.
1800, released in 2005, 2009, 2012, 2017, and 2023. The Verilator
documentation uses the shorthand e.g., "IEEE 1800-2023", to refer to
the, e.g., 2023 version of this standard.
+166 -22
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Simulating:
@@ -12,6 +12,62 @@ Verilated model's executable. For the runtime arguments to a simulated
model, see :ref:`Simulation Runtime Arguments`.
.. _Simulation Summary Report:
Simulation Summary Report
=========================
When simulation finishes, it will print a report to stdout summarizing the
simulation. This requires the model being Verilated with :vlopt:`--main`,
or the user's `main()` calling `VerilatedContext->statsPrintSummary()`.
The report may be disabled with :vlopt:`+verilator+quiet`.
For example:
.. code-block::
- S i m u l a t i o n R e p o r t: Verilator ...
- Verilator: End at simtime 123 ns; walltime 1234.001 s; speed 123 ns/s
- Verilator: cpu 22.001 s on 4 threads; alloced 123 MB
The information in this report is:
.. describe:: "Verilator ..."
Program version.
.. describe:: "End at simtime 123 ns"
Verilog $time at which the model finished or stopped.
.. describe:: "walltime 1234.001 s"
Real elapsed wall time in seconds.
.. describe:: "speed 123.1 ns/s"
Simulated time (if non-zero) divided by wall time. e.g. `123 ns/s` means
123 simulated nanoseconds took 1 second of wall time; for a model with
only a 1 GHz clock that would be equivalent to 123.1 cycles per
second. The units are automatically selected to give a number between 1
and 1000. The wall time includes initialization, initial and final
process blocks, so indicates a slower speed than if the model had a
longer runtime.
.. describe:: "cpu 22 s"
CPU time used total across all CPU threads in seconds.
.. describe:: "4 threads"
Number of simultaneous threads used.
.. describe:: "alloced 123 MB"
Total memory used during simulation in megabytes.
.. _Benchmarking & Optimization:
Benchmarking & Optimization
@@ -143,7 +199,7 @@ Functional Coverage
-------------------
With :vlopt:`--coverage` or :vlopt:`--coverage-user`, Verilator will
translate functional coverage points the user has inserted manually win
translate functional coverage points the user has inserted manually in
SystemVerilog code through into the Verilated model.
Currently, all functional coverage points are specified using SystemVerilog
@@ -168,14 +224,6 @@ at branches). At each such branch, a counter is incremented. At the end
of a test, the counters, filename, and line number corresponding to each
counter are written into the coverage file.
Verilator automatically disables coverage of branches with a $stop in
them, as it is assumed that $stop branches contain an error check that should
not occur. A :option:`/*verilator&32;coverage_block_off*/` metacomment
will perform a similar function on any code in that block or below, or
:option:`/*verilator&32;coverage_off*/` and
:option:`/*verilator&32;coverage_on*/` will disable and enable coverage
respectively around a block of code.
Verilator may over-count combinatorial (non-clocked) blocks when those
blocks receive signals which have had the :option:`UNOPTFLAT` warning
disabled; for the most accurate results, do not disable this warning when
@@ -222,6 +270,58 @@ A :option:`/*verilator&32;coverage_off*/`
signals that do not need toggle analysis, such as RAMs and register files.
.. _Expression Coverage:
Expression Coverage
-------------------
With :vlopt:`--coverage` or :vlopt:`--coverage-expr`, Verilator will
automatically add coverage analysis at each expression, indicating with a
truth table how every Boolean truth-table possibility in the expression
occurred.
Multi-bit expressions are ignored, but sub-expressions with are entirely
Boolean are analyzed. Expression coverage does not fully explore the truth
table of an expression, rather is looks at each term's contribution. E.g.
an AND operation will check coverage for TT, XF and FX.
Some expressions may produce too many cover points. Verilator limits the
maximum number of cover points per expression to 32, but this may be
controlled with :vlopt:`--coverage-expr-max`.
Below is an example showing expression coverage produced from `verilator_coverage`
as applied to the condition expression inside an if statement. Each line
shows the minimum number of terms and their values (e.g. `(t1==0 && t2==1)`) needed
to reach a result for the overall expression (e.g. `=> 1`). Each line also
shows the number of times this combination was hit. Note that individual lines
are not mutually exclusive.
.. code-block::
%000004 if ((~t1 && t2) || (~t3 && t4)) $write("");
-000002 point: comment=(t1==0 && t2==1) => 1 hier=top.t
-000002 point: comment=(t1==1 && t3==1) => 0 hier=top.t
-000004 point: comment=(t1==1 && t4==0) => 0 hier=top.t
-000002 point: comment=(t2==0 && t3==1) => 0 hier=top.t
-000003 point: comment=(t2==0 && t4==0) => 0 hier=top.t
-000002 point: comment=(t3==0 && t4==1) => 1 hier=top.t
.. _Suppressing Coverage:
Suppressing Coverage
--------------------
Using :option:`/*verilator&32;coverage_off*/` and
:option:`/*verilator&32;coverage_on*/` around a block of code will disable
and enable coverage respectively around that block. Or, use the
:option:`coverage_block_off` configuration file option.
Verilator automatically disables coverage of lines and branches with a
$stop in them, as it is assumed that $stop branches contain an error check
that should not occur. A :option:`/*verilator&32;coverage_block_off*/`
metacomment will perform a similar function on any code in that block or
below.
.. _Coverage Collection:
Coverage Collection
@@ -230,14 +330,20 @@ Coverage Collection
When any coverage flag is used to Verilate, Verilator will add appropriate
coverage point insertions into the model and collect the coverage data.
To get the coverage data from the model, in the user wrapper code,
typically at the end once a test passes, call
:code:`Verilated::threadContextp()->coveragep()->write` with an argument of the filename for
the coverage data file to write coverage data to (typically
"logs/coverage.dat").
To get the coverage data from the model, write the coverage with either:
1. Using :vlopt:`--binary` or :vlopt:`--main`, and Verilator will dump
coverage when the test completes to the filename specified with
:vlopt:`+verilator+coverage+file+\<filename\>`.
2. In the user wrapper code, typically at the end once a test passes, call
:code:`Verilated::threadContextp()->coveragep()->write` with an argument
of the filename for the coverage data file to write coverage data to
(typically "logs/coverage.dat").
Run each of your tests in different directories, potentially in parallel.
Each test will create a :file:`logs/coverage.dat` file.
Each test will create the file specified above,
e.g. :file:`logs/coverage.dat`.
After running all of the tests, execute the :command:`verilator_coverage`
command, passing arguments pointing to the filenames of all the
@@ -273,13 +379,17 @@ profiled C++ code functions.
To use profiling:
#. Use Verilator's :vlopt:`--prof-cfuncs`.
#. Make sure the Verilog code will call `$finish` at the end of simulation
(otherwise the C library may not correctly create the `gmon.out` file in
the later steps below).
#. Run Verilator, adding the :vlopt:`--prof-cfuncs` option.
#. Build and run the simulation model.
#. The model will create gmon.out.
#. Run :command:`gprof` to see where in the C++ code the time is spent.
#. Run the gprof output through the :command:`verilator_profcfunc` program,
and it will tell you what Verilog line numbers on which most of the time
is being spent.
#. The model will create `gmon.out`.
#. Run :command:`gprof gmon.out > gprof.log` to see where in the C++ code
the time is spent.
#. Run :command:`verilator_profcfunc gprof.log > profcfunc.log` to take the
gprof output and translate into output showing the Verilog line numbers
on which most of the time is being spent.
.. _Execution Profiling:
@@ -498,3 +608,37 @@ Clang. The process in GCC 10 was as follows:
Clang and GCC also support -fauto-profile, which uses sample-based
feedback-directed optimization. See the appropriate compiler
documentation.
.. _Runtime Debugging:
Runtime Debugging
=================
To debug a Verilated executable, Verilate with :vlopt:`--runtime-debug`.
This will instruct the compiler to insert debugger, and enable various
library assertions. These options slow down the executable, so do this
only when debugging.
If you are using your own Makefiles, adapt appropriately to pass the
options documented under :vlopt:`--runtime-debug` to the compiler and
linker.
Once you have a debugging-enabled executable, run it using the the standard
GNU debugger ``gdb`` or a similar tool, and create a backtrace; e.g.:
.. code-block:: bash
gdb obj_dir/Vtop
run {Vtop_command_arguments}
{Vtop prints output, perhaps a segmentation faults}
bt
Rarely the bug may disappear with :vlopt:`--runtime-debug`; if so, try
instead using the sub-options that :vlopt:`--runtime-debug` documents, to
find the maximum subset that still shows the issue. E.g. it is likely that
using `-CFLAGS -D_GLIBCXX_DEBUG` will not hide any bug, so may be used.
Using :vlopt:`--runtime-debug` or `-CFLAGS -DVL_DEBUG=1` will only print a
message if something goes wrong. To enable debug print messages at
runtime, additionally use the :vlopt:`+verilator+debug` runtime option.
+102 -16
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
**********
@@ -7,9 +7,13 @@ Verilating
Verilator may be used in five major ways:
* With the :vlopt:`--binary` option, Verilator will translate the design
into an executable, via generating C++ and compiling it. See
:ref:`Binary, C++ and SystemC Generation`.
* With the :vlopt:`--cc` or :vlopt:`--sc` options, Verilator will translate
the design into C++ or SystemC code, respectively. See :ref:`C++ and
SystemC Generation`.
the design into C++ or SystemC code, respectively. See :ref:`Binary, C++
and SystemC Generation`.
* With the :vlopt:`--lint-only` option, Verilator will lint the design to
check for warnings but will not typically create any output files.
@@ -24,13 +28,15 @@ Verilator may be used in five major ways:
expanded.
.. _C++ and SystemC Generation:
.. _Binary, C++ and SystemC Generation:
C++ and SystemC Generation
==========================
Binary, C++ and SystemC Generation
==================================
Verilator will translate a SystemVerilog design into C++ with the
:vlopt:`--cc` option, or into SystemC with the :vlopt:`--sc` option.
:vlopt:`--cc` option, or into SystemC with the :vlopt:`--sc` option. It
will translate into C++ and compile it into an executable binary with the
:vlopt:`--binary` option.
When using these options:
@@ -45,14 +51,19 @@ When using these options:
The prefix is set with :vlopt:`--prefix`, or defaults to the name of the
top module.
#. If :vlopt:`--exe` is used, Verilator creates makefiles to generate a
simulation executable, otherwise, it creates makefiles to generate an
archive (.a) containing the objects.
#. If :vlopt:`--binary` or :vlopt:`--main` is used, Verilator creates a C++
top wrapper to read command line arguments, create the model, and
execute the model.
#. If :vlopt:`--build` option was used, it calls :ref:`GNU Make` or
:ref:`CMake` to build the model.
#. If :vlopt:`--binary` or :vlopt:`--exe` is used, Verilator creates
makefiles to generate a simulation executable, otherwise, it creates
makefiles to generate an archive (.a) containing the objects.
Once a model is built, it is then typically run, see :ref:`Simulating`.
#. If :vlopt:`--binary` or :vlopt:`--build` is used, it calls :ref:`GNU
Make` or :ref:`CMake` to build the model.
Once a model is built, the next step is typically for the user to run it,
see :ref:`Simulating`.
.. _Hierarchical Verilation:
@@ -165,7 +176,7 @@ compiled on the different target system.
To support this, none of the files that Verilator produces will reference
any configure-generated build-system-specific files, such as
:file:`config.h` (which is renamed in Verilator to :file:`config_build.h`
:file:`config.h` (which is renamed in Verilator to :file:`config_package.h`
to reduce confusion.) The disadvantage of this approach is that
:file:`include/verilatedos.h` must self-detect the requirements of the
target system, rather than using configure.
@@ -293,9 +304,9 @@ GNU Make
========
Verilator defaults to creating GNU Make makefiles for the model. Verilator
will call make automatically when the :vlopt:'--build' option is used.
will call make automatically when the :vlopt:`--build` option is used.
If calling Verilator from a makefile, the :vlopt:'-MMD' option will create
If calling Verilator from a makefile, the :vlopt:`--MMD` option will create
a dependency file, allowing Make to only run Verilator if input Verilog
files change.
@@ -487,3 +498,78 @@ The search paths can be configured by setting some variables:
Sets the installation prefix of an installed SystemC library. (Same as
SYSTEMC_ROOT).
.. _Verilation Summary Report:
Verilation Summary Report
=========================
When Verilator generates code, unless :vlopt:`--quiet-stats` is used, it
will print a report to stdout summarizing the build. For example:
.. code-block::
- V e r i l a t i o n R e p o r t: Verilator ....
- Verilator: Built from 354 MB sources in 247 modules,
into 74 MB in 89 C++ files needing 0.192 MB
- Verilator: Walltime 26.580 s (elab=2.096, cvt=18.268,
bld=2.100); cpu 26.548 s on 1 threads; alloced 2894.672 MB
The information in this report is:
.. describe:: "Verilator ..."
Program version.
.. describe:: "234 MB sources"
Characters of post-preprocessed text in all input
Verilog and Verilator Control files in megabytes.
.. describe:: "247 modules"
Number of interfaces/modules/classes/packages in design before
elaboration.
.. describe:: "into 74 MB"
Characters of output C++ code, including comments in megabytes.
.. describe:: "89 C++ files"
Number of .cpp files created.
.. describe:: "needing 192MB"
Verilation-time minimum-bound estimate of memory needed to run model in
megabytes. (Expect to need significantly more.)
.. describe:: "Walltime 26.580 s"
Real elapsed wall time for Verilation and build.
.. describe:: "elab=2.096"
Wall time to read in files and complete elaboration.
.. describe:: "cvt=18.268"
Wall time for Verilator to process and write output.
.. describe:: "bld=2.1"
Wall time to compile gcc/clang (if using :vlopt:`--build`).
.. describe:: "cpu 22.548 s"
CPU time used, total across all CPU threads.
.. describe:: "4 threads"
Number of simultaneous threads used.
.. describe:: "alloced 123 MB"
Total memory used during build by Verilator executable (excludes
:vlopt:`--build` compiler's usage) in megabytes.
+510 -72
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2023 by Wilson Snyder.
.. Copyright 2003-2025 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
*******************
@@ -12,10 +12,18 @@ Disabling Warnings
Warnings may be disabled in multiple ways:
#. Disable the warning in the source code. When the warning is printed, it
will include a warning code. Surround the offending line with a
:code:`/*verilator&32;lint_off*/` and :code:`/*verilator&32;lint_on*/`
metacomment pair:
#. Disable the warning globally by invoking Verilator with the
:code:`-Wno-{warning-code}` option.
Global disables should be avoided, as they removes all checking across
the source files, and prevents other users from compiling the sources
without knowing the magic set of disables needed to compile those
sources successfully.
#. Disable the warning in the design source code. When the warning is
printed, it will include a warning code. Surround the offending line
with a :code:`/*verilator&32;lint_off*/` and
:code:`/*verilator&32;lint_on*/` metacomment pair:
.. code-block:: sv
@@ -23,6 +31,12 @@ Warnings may be disabled in multiple ways:
if (`DEF_THAT_IS_EQ_ZERO <= 3) $stop;
// verilator lint_on UNSIGNED
A lint_off in the design source code will propagate down to any child
files (files later included by the file with the lint_off), but will not
propagate upwards to any parent file (file that included the file with
the lint_off).
#. Disable the warning using :ref:`Configuration Files` with a
:option:`lint_off` command. This is useful when a script suppresses
warnings, and the Verilog source should not be changed. This method also
@@ -30,13 +44,7 @@ Warnings may be disabled in multiple ways:
.. code-block:: sv
lint_off -rule UNSIGNED -file "*/example.v" -line 1
#. Disable the warning globally invoking Verilator with the
:code:`-Wno-{warning-code}` option. This should be avoided, as it
removes all checking across the designs, and prevents other users from
compiling your code without knowing the magic set of disables needed to
compile your design successfully.
lint_off -rule UNSIGNED -file "*/example.v" -lines 1
Error And Warning Format
@@ -74,7 +82,8 @@ List Of Warnings
.. option:: Unsupported: ....
This error indicates that the code uses a Verilog language construct
that is not yet supported in Verilator. See the Limitations chapter.
that is not yet supported in Verilator. See also :ref:`Language
Limitations`.
.. option:: ALWCOMBORDER
@@ -96,6 +105,24 @@ List Of Warnings
simulate correctly.
.. option:: ASCRANGE
.. TODO better example
Warns that a packed vector is declared with ascending bit range
(i.e. [0:7]). Descending bit range is now the overwhelming standard,
and ascending ranges are now thus often due to simple oversight
instead of intent (a notable exception is the OpenPOWER code base).
It also warns that an instance is declared with ascending range
(i.e. [0:7] or [7]) and is connected to an N-wide signal.
The bits will likely be in the reversed order from what people may expect
(i.e., instance [0] will connect to signal bit [N-1] not bit [0]).
Ignoring this warning will only suppress the lint check; it will
simulate correctly.
.. option:: ASSIGNDLY
.. TODO better example
@@ -134,8 +161,8 @@ List Of Warnings
.. option:: BADSTDPRAGMA
An error that a pragma is badly formed, for pragmas defined by IEEE
1800-2017. For example, an empty pragma line, or an incorrectly used
'pragma protect'. Third-party pragmas not defined by IEEE 1800-2017 are
1800-2023. For example, an empty pragma line, or an incorrectly used
'pragma protect'. Third-party pragmas not defined by IEEE 1800-2023 are
ignored.
@@ -183,22 +210,35 @@ List Of Warnings
.. option:: BLKLOOPINIT
.. TODO better example
This indicates that the initialization of an array needs to use
non-delayed assignments. This is done in the interest of speed; if
delayed assignments were used, the simulator would have to copy large
arrays every cycle. (In smaller loops, loop unrolling allows the
delayed assignment to work, though it's a bit slower than a non-delayed
assignment.) Here's an example
Indicates certain constructs where non-blocking assignments to unpacked
arrays (memories) are not supported inside loops. These typically appear in
initialization/reset code:
.. code-block:: sv
always @(posedge clk)
if (~reset_l)
for (i=0; i<`ARRAY_SIZE; i++)
array[i] = 0; // Non-delayed for verilator
array[i] <= 0; // Non-blocking assignment inside loop
else
array[address] <= data;
While this is supported in typical synthesizeable code (including the
example above), some complicated cases are not supported. Namely:
1. If the above loop is inside a suspendable process or fork statement.
2. If the variable is also the target of a '<=' non-blocking assignment
in a suspendable process or fork statement (in addition to a synthesizable
loop).
3. If the element type of the array is a compound type.
4. In versions before 5.026, any delayed assignment to an array.
It might slightly improve run-time performance if you change the
non-blocking assignment inside the loop into a blocking assignment
(that is: use '=' instead of '<='), if possible.
This message is only seen on large or complicated loops because
Verilator generally unrolls small loops. You may want to try increasing
@@ -256,7 +296,7 @@ List Of Warnings
Unique case statements that select on an enumerated variable, where all
of the enumerated values are covered by case items, are considered
complete even if the case statement does not cover illegal
non-enumerated values (IEEE 1800-2017 12.5.3). To check that illegal
non-enumerated values (IEEE 1800-2023 12.5.3). To check that illegal
values are not hit, use :vlopt:`--assert`.
Ignoring this warning will only suppress the lint check; it will
@@ -317,9 +357,11 @@ List Of Warnings
.. option:: CDCRSTLOGIC
With :vlopt:`--cdc` only, it warns that asynchronous flop reset terms come
from other than primary inputs or flopped outputs, creating the
potential for reset glitches.
Historical, never issued since version 5.008.
Warned with a no longer supported clock domain crossing option that
asynchronous flop reset terms came from other than primary inputs or
flopped outputs, creating the potential for reset glitches.
.. option:: CLKDATA
@@ -375,6 +417,16 @@ List Of Warnings
simulators.
.. option:: CONSTRAINTIGN
Warns that Verilator does not support certain forms of
:code:`constraint`, :code:`constraint_mode`, or :code:`rand_mode`, and
the construct was are ignored.
Ignoring this warning may make Verilator randomize() simulations differ
from other simulators.
.. option:: CONTASSREG
.. TODO better example
@@ -393,6 +445,18 @@ List Of Warnings
correctly.
.. option:: COVERIGN
Warns that Verilator does not support certain forms of
:code:`covergroup`, :code:`coverpoint`, and coverage options, and the
construct was are ignored.
Disabling the :option:`UNSUPPORTED` error also disables this warning.
Ignoring this warning may make Verilator ignore lint checking on the
construct, and collect coverage data differently from other simulators.
.. option:: DECLFILENAME
.. TODO better example
@@ -440,7 +504,7 @@ List Of Warnings
.. code-block::
%Warning-DEFPARAM: example.v:5:15: defparam is deprecated (IEEE 1800-2017 C.4.1)
%Warning-DEFPARAM: example.v:5:15: defparam is deprecated (IEEE 1800-2023 C.4.1)
: ... Suggest use instantiation with #(.MY_PARAM(...etc...))
To repair use :code:`#(.PARAMETER(...))` syntax. Repaired Example:
@@ -639,6 +703,52 @@ List Of Warnings
used as a clock.
.. option:: GENUNNAMED
Warns that a generate block was unnamed and "genblk" will be used per
IEEE.
The potential issue is that adding additional generate blocks will
renumber the assigned names, which may cause eventual problems with
synthesis constraints or other tools that depend on hierarchical paths
remaining consistent.
Blocks that are empty may not be reported with this warning, as no
scopes are created for empty blocks, so there is no harm in having them
unnamed.
Disabled by default as this is a code-style warning; it will simulate
correctly.
.. code-block:: sv
:linenos:
:emphasize-lines: 2
generate
if (PARAM == 1) begin //<--- Warning
end
Results in:
.. code-block::
%Warning-GENUNNAMED: example.v:2:9: Unnamed generate block (IEEE 1800-2023 27.6)
To fix this assign a label (often with the naming convention prefix of
:code:`gen_` or :code:`g_`), for example:
.. code-block:: sv
:linenos:
:emphasize-lines: 2
generate
if (PARAM == 1) begin : gen_param_1 //<--- Repaired
end
Other tools with similar warnings: Verible's generate-label, "All
generate block statements must have a label."
.. option:: HIERBLOCK
Warns that the top module is marked as a hierarchy block by the
@@ -678,7 +788,7 @@ List Of Warnings
.. code-block::
%Warning-IGNOREDRETURN: example.v:5:9: Ignoring return value of non-void function (IEEE 1800-2017 13.4.1)
%Warning-IGNOREDRETURN: example.v:5:9: Ignoring return value of non-void function (IEEE 1800-2023 13.4.1)
The portable way to suppress this warning (in SystemVerilog) is to use a
void cast, for example:
@@ -735,14 +845,17 @@ List Of Warnings
This is a warning because the static default differs from C++, differs
from class member function/tasks. Static is a more dangerous default
then automatic as static prevents the function from being reinterant,
then automatic as static prevents the function from being reentrant,
which may be a source of bugs, and/or performance issues.
If the function does not require static behavior, change it to "function
automatic".
If the function is in a module, and does not require static behavior,
change it to "function automatic".
If the function requires static behavior, change it to "function
static".
If the function is in a module, and requires static behavior, change it
to "function static".
If the function is in a package, it defaults to static, and label the
function's variables as static.
Ignoring this warning will only suppress the lint check; it will
simulate correctly.
@@ -842,23 +955,111 @@ List Of Warnings
Ignoring this warning will only suppress the lint check; it will
simulate correctly.
.. option:: LIFETIME
Error when a variable is referenced in a process that can outlive the process
in which it was declared. This can happen when using 'fork..join_none' or
'fork..join_any' blocks, which spawn process that can outlive their parents.
This error occurs only when Verilator can't replace the reference with a
reference to copy of this variable, local to the forked process. For example:
.. code-block:: sv
:linenos:
:emphasize-lines: 3
task foo(int local_var);
fork
#10 local_var++;
#20 $display("local_var = %d", local_var);
join_none
endtask
In the example above 'local_var' exists only within scope of 'foo', once foo
finishes, the stack frame containing 'i' gets removed. However, the process
forked from foo continues, as it contains a delay. After 10 units of time
pass, this process attempts to modify 'local_var'. However, this variable no
longer exits. It can't be made local to the forked process upon spawning, because
it's modified and can be referenced somewhere else, for example in the other
forked process, that was delayed by 20 units of time in this example. Thus,
there's no viable stack allocation for it.
In order to fix it, if the intent is not to share the variable's state outside
of the process, then create a local copy of the variable.
For example:
.. code-block:: sv
:linenos:
:emphasize-lines: 4
task foo(int local_var);
fork
#10 begin
int forked_var = local_var;
forked_var++;
end
#20 begin
// Note that we are going to print the original value here,
// as `forked_var`is a local copy that was initialized while
// `foo` was still alive.
int forked_var = local_var;
$display("forked_var = %d", forked_var)
end
join_none
endtask
If you need to share its state, another strategy is to ensure it's allocated
statically:
.. code-block:: sv
:linenos:
:emphasize-lines: 1
int static_var;
task foo();
fork
#10 static_var++;
#20 $display("static_var = %d", static_var);
join_none
endtask
However, if you need to be able to instantiate at runtime, the solution would be to
wrap it in an object, since the forked process can hold a reference to that object
and ensure that the variable stays alive this way:
.. code-block:: sv
:linenos:
:emphasize-lines: 2
class Wrapper;
int m_var;
// Here we implicitly hold a reference to `this`
task foo();
fork
#10 m_var++;
#20 $display("this.m_var = %d", m_var);
join_none
endtask
endclass
// Here we explicitly hold a handle to an object
task bar(Wrapper wrapper);
fork
#10 wrapper.m_var++;
#20 $display("wrapper.m_var = %d", wrapper.m_var);
join_none
endtask
.. option:: LITENDIAN
.. TODO better example
Warns that a packed vector is declared with little endian bit numbering
(i.e. [0:7]). Big endian bit numbering is now the overwhelming
standard, and little numbering is now thus often due to simple oversight
instead of intent.
It also warns that an instance is declared with little endian range
(i.e. [0:7] or [7]) and is connected to an N-wide signal. Based on IEEE
the bits will likely be backward from what people may expect
(i.e., instance [0] will connect to signal bit [N-1] not bit [0]).
Ignoring this warning will only suppress the lint check; it will
simulate correctly.
The naming of this warning is in contradiction with the common
interpretation of little endian. It was therefore renamed to
:option:`ASCRANGE`. While :option:`LITENDIAN` remains for
backwards compatibility, new projects should use :option:`ASCRANGE`.
.. option:: MINTYPMAX
@@ -871,6 +1072,51 @@ List Of Warnings
unsupported. Verilator uses only the typical delay value.
.. option:: MISINDENT
Warns that the indentation of a statement is misleading, suggesting the
statement is part of a previous :code:`if` or :code:`while` block while
it is not.
Verilator suppresses this check when there is an inconsistent mix of
spaces and tabs, as it cannot ensure the width of tabs. Verilator also
ignores blocks with :code:`begin`/:code:`end`, as the :code:`end`
visually indicates the earlier statement's end.
Ignoring this warning will only suppress the lint check; it will
simulate correctly.
For example
.. code-block:: sv
:linenos:
:emphasize-lines: 3
if (something)
statement_in_if;
statement_not_in_if; //<--- Warning
Results in:
.. code-block::
%Warning-MISINDENT: example.v:3:9: Misleading indentation
To fix this repair the indentation to match the correct earlier
statement, for example:
.. code-block:: sv
:linenos:
:emphasize-lines: 3
if (something)
statement_in_if;
statement_not_in_if; //<--- Repaired
Other tools with similar warnings: GCC -Wmisleading-indentation,
clang-tidy readability-misleading-indentation.
.. option:: MODDUP
.. TODO better example
@@ -949,6 +1195,21 @@ List Of Warnings
(neither :vlopt:`--timing` nor :vlopt:`--no-timing` option was provided).
.. option:: NEWERSTD
Warns that a feature requires a newer standard of Verilog or SystemVerilog
than the one specified by the :vlopt:`--language` option. For example, unsized
unbased literals (`'0`, `'1`, `'z`, `'x`) require IEEE 1800-2005 or later.
To avoid this warning, use a Verilog or SystemVerilog standard that
supports the feature. Alternatively, modify your code to use a different
syntax that is supported by the Verilog/SystemVerilog standard specified
by the :vlopt:`--language` option.
Ignoring this warning will only suppress the lint check; it will
simulate correctly.
.. option:: NOLATCH
.. TODO better example
@@ -968,6 +1229,14 @@ List Of Warnings
:vlopt:`--no-timing` option.
.. option:: NONSTD
Warns when a non-standard language feature is used that has a standard
equivalent, which might behave differently in corner cases. For example
:code:`$psprintf` system function is replaced by its standard equivalent
:code:`$sformatf`.
.. option:: NULLPORT
Warns that a null port was detected in the module definition port
@@ -1007,7 +1276,7 @@ List Of Warnings
.. option:: PINMISSING
.. TODO better example
.. TODO better example (frequent)
Warns that a module has a pin that is not mentioned in an instance. If
a pin is not missing it should still be specified on the instance
@@ -1016,6 +1285,22 @@ List Of Warnings
Ignoring this warning will only suppress the lint check; it will
simulate correctly.
Faulty example:
.. include:: ../../docs/gen/ex_PKGNODECL_faulty.rst
Results in:
.. include:: ../../docs/gen/ex_PKGNODECL_msg.rst
Repaired example:
.. code-block:: sv
:emphasize-lines: 2
sub sub (
.port());
Other tools with similar warnings: Icarus Verilog's portbind, "warning:
Instantiating module ... with dangling input port (...)". Slang's
unconnected-port, "port '...' has no connection".
@@ -1047,7 +1332,7 @@ List Of Warnings
generate
if (A==0) begin
b b_inst1 (.x(1'b0)); //<--- error nonexistent port
b #(.PX(1'b0)) b_inst2 (); //<--- error nonexistent parameter
b #(.PX(1'b0)) b_inst2 (); //<--- error nonexistent parameter
end
endgenerate
endmodule
@@ -1089,11 +1374,47 @@ List Of Warnings
.. option:: PKGNODECL
.. TODO better example
An error that a package/class appears to have been referenced that has
not yet been declared. According to IEEE 1800-2023 26.3, all packages
must be declared before being used.
An error that a package/class appears to have been referenced that has not
yet been declared. According to IEEE 1800-2017 26.3, all packages must
be declared before being used.
Faulty example:
.. include:: ../../docs/gen/ex_PKGNODECL_faulty.rst
Results in:
.. include:: ../../docs/gen/ex_PKGNODECL_msg.rst
Often the package is declared in its own header file. In this case add
an include of that package header file to the referencing file. (And
make sure you have header guards in the package's header file to prevent
multiple declarations of the package.)
.. option:: PREPROCZERO
Warns that a preprocessor \`ifdef/\`ifndef expression (added in IEEE
1800-2023) evaluates a define value which has a value of :code:`0`.
This will evaluate in the expression as :code:`1` because the define has
a definition, unlike in the C preprocessor, which evaluates using the
define's value (of :code:`1`).
Referring to a define with an empty value does not give this warning, as
in C, the preprocessor will give an error on a preprocessor expression
of a define that is empty.
.. code-block:: sv
:linenos:
:emphasize-lines: 2
`define ZERO 0
`ifdef (ZERO || ZERO) //<--- warning PREPROCZERO
`error This_will_error_which_might_be_not_the_intent
`endif
The portable way to suppress this warning is to use a define value other
than zero, when it is to be used in a preprocessor expression.
.. option:: PROCASSWIRE
@@ -1132,7 +1453,10 @@ List Of Warnings
.. option:: RANDC
Warns that the :code:`randc` keyword is unsupported and being converted
Historical, never issued since version 5.018, when :code:`randc` became
fully supported.
Warned that the :code:`randc` keyword was unsupported and was converted
to :code:`rand`.
@@ -1275,6 +1599,39 @@ List Of Warnings
modeled values, or DPI calls.
.. option:: SIDEEFFECT
Warns that an expression has a side effect that might not properly be
executed by Verilator.
This often represents a bug in Verilator, as opposed to a bad code
construct, however the Verilog code can typically be changed to avoid
the warning.
Faulty example:
.. code-block:: sv
:linenos:
:emphasize-lines: 1
x = y[a++];
This example warns because Verilator does not currently handle side
effects inside array subscripts; the a++ may be executed multiple times.
Rewrite the code to avoid expression side effects, typically by using a
temporary:
.. code-block:: sv
:linenos:
temp = a++;
x = y[temp];
Ignoring this warning may make Verilator simulations differ from other
simulators.
.. option:: SPLITVAR
Warns that a variable with a :option:`/*verilator&32;split_var*/`
@@ -1299,6 +1656,17 @@ List Of Warnings
* The variable is tristate or bidirectional. (e.g., :code:`inout`).
.. option:: STATICVAR
Warns that a static variable declared in a loop with declaration assignment
was converted to automatic. Often such variables were intended to
instead be declared "automatic".
Ignoring this warning may make Verilator differ from other simulators,
which will treat the variable as static. Verilator may in future versions also
treat the variable as static.
.. option:: STMTDLY
Warns that the code has a statement with a delayed time in front of it.
@@ -1336,6 +1704,9 @@ List Of Warnings
Warning that a symbol matches a C++ reserved word, and using this as a
symbol name would result in odd C++ compiler errors. You may disable
this warning, but Verilator will rename the symbol to avoid conflict.
If you are using `--vpi` and only mark things as public for VPI access
(and not C++ access) then it is advisable to disable this warning with
:code:`-Wno-SYMRSVDWORD`.
.. option:: SYNCASYNCNET
@@ -1424,7 +1795,7 @@ List Of Warnings
.. code-block::
%Warning-TIMESCALEMOD: example.v:1:8: Timescale missing on this module as other modules have it (IEEE 1800-2017 3.14.2.3)
%Warning-TIMESCALEMOD: example.v:1:8: Timescale missing on this module as other modules have it (IEEE 1800-2023 3.14.2.3)
Recommend using :vlopt:`--timescale` argument, or in front of all
modules use:
@@ -1568,7 +1939,8 @@ List Of Warnings
.. option:: UNPACKED
Warns that unpacked structs and unions are not supported.
Warns that unpacked structs and unions are not supported because
:vlopt:`--structs-packed` was used, or by up through version 5.004.
Ignoring this warning will make Verilator treat the structure as packed,
which may make Verilator simulations differ from other simulators. This
@@ -1619,14 +1991,16 @@ List Of Warnings
.. TODO better example
Warns that the specified genvar is never used/consumed.
Warns that the specified genvar is never used/consumed. See similar
:option:`UNUSEDSIGNAL`.
.. option:: UNUSEDPARAM
.. TODO better example
Warns that the specified parameter is never used/consumed.
Warns that the specified parameter is never used/consumed. See similar
:option:`UNUSEDSIGNAL`.
.. option:: UNUSEDSIGNAL
@@ -1647,12 +2021,12 @@ List Of Warnings
.. code-block:: sv
wire _unused_ok = &{1'b0,
wire _unused_ok = 1'b0 && &{1'b0,
sig_not_used_a,
sig_not_used_yet_b, // To be fixed
1'b0};
The reduction AND and constant zeros mean the net will always be zero,
The AND with constant zero mean the net will always be zero,
so won't use simulation runtime. The redundant leading and trailing
zeros avoid syntax errors if there are no signals between them. The
magic name "unused" (controlled by the :vlopt:`--unused-regexp` option)
@@ -1666,7 +2040,7 @@ List Of Warnings
.. option:: USERERROR
A SystemVerilog elaboration-time assertion error was executed.
IEEE 1800-2017 20.11 requires this error.
IEEE 1800-2023 20.11 requires this error.
Faulty example:
@@ -1682,7 +2056,7 @@ List Of Warnings
.. option:: USERFATAL
A SystemVerilog elaboration-time assertion fatal was executed.
IEEE 1800-2017 20.11 requires this error.
IEEE 1800-2023 20.11 requires this error.
Faulty example:
@@ -1698,7 +2072,7 @@ List Of Warnings
.. option:: USERINFO
A SystemVerilog elaboration-time assertion print was executed. This is
not an error or warning, and IEEE 1800-2017 20.11 requires this
not an error or warning, and IEEE 1800-2023 20.11 requires this
behavior.
Example:
@@ -1713,7 +2087,7 @@ List Of Warnings
.. option:: USERWARN
A SystemVerilog elaboration-time assertion warning was executed.
IEEE 1800-2017 20.11 requires this warning.
IEEE 1800-2023 20.11 requires this warning.
Faulty example:
@@ -1749,13 +2123,19 @@ List Of Warnings
.. option:: WAITCONST
.. code-block:: sv
wait(0); // Blocks forever
Warns that a `wait` statement awaits a constant condition, which means it
either blocks forever or never blocks.
As a special case `wait(0)` with the literal constant `0` (as opposed to
something that elaborates to zero), does not warn, as it is presumed the
code is making the intent clear.
Faulty example:
.. code-block:: sv
wait(1); // Blocks forever
.. option:: WIDTH
@@ -1790,17 +2170,32 @@ List Of Warnings
For example, this is a missized index:
.. include:: ../../docs/gen/ex_WIDTH_1_faulty.rst
.. include:: ../../docs/gen/ex_WIDTHEXPAND_1_faulty.rst
Results in:
Results in a :option:`WIDTHEXPAND` warning:
.. include:: ../../docs/gen/ex_WIDTH_1_msg.rst
.. include:: ../../docs/gen/ex_WIDTHEXPAND_1_msg.rst
One possible fix:
.. include:: ../../docs/gen/ex_WIDTH_1_fixed.rst
.. include:: ../../docs/gen/ex_WIDTHEXPAND_1_fixed.rst
.. option:: WIDTHTRUNC
A more granular :option:`WIDTH` warning, for when a value is
truncated. See :option:`WIDTH`.
.. option:: WIDTHEXPAND
A more granular :option:`WIDTH` warning, for when a value is zero
expanded. See :option:`WIDTH`.
.. option:: WIDTHXZEXPAND
A more granular :option:`WIDTH` warning, for when a value is X/Z
expanded. See :option:`WIDTH`.
.. option:: WIDTHCONCAT
Warns that based on the width rules of Verilog, a concatenate, or
@@ -1832,3 +2227,46 @@ List Of Warnings
Inactive region. Such processes do get resumed in the same time slot
somewhere in the Active region. Issued only if Verilator is run with the
:vlopt:`--timing` option.
.. option:: ZEROREPL
Warns that zero is used as the replication value in the replication
operator. This is specified as an error by IEEE 1800-2023 11.4.12.1.
Faulty example:
.. code-block:: sv
:linenos:
:emphasize-lines: 5
module dut
#(parameter int MY_PARAM = 0);
reg [7:0] data;
always @* begin
data = {MY_PARAM{1'b1}}; //<--- Warning
end
endmodule
Results in the following error:
.. code-block::
%Error-ZEROREPL: test.v:5:22: Replication value of 0 is only legal under a concatenation (IEEE 1800-2023 11.4.12.1)
Note that in some cases, this warning may be false, when a condition
upstream or downstream of the access means the zero replication will
never execute or be used.
Repaired example:
.. code-block:: sv
:linenos:
:emphasize-lines: 2
module dut
#(parameter int MY_PARAM = 1); //<--- REPAIRED
reg [7:0] data;
always @* begin
data = {MY_PARAM{1'b1}};
end
endmodule
+302 -102
View File
@@ -224,7 +224,7 @@ Scheduling
----------
Verilator implements the Active and NBA regions of the SystemVerilog scheduling
model as described in IEEE 1800-2017 chapter 4, and in particular sections
model as described in IEEE 1800-2023 chapter 4, and in particular sections
4.5 and Figure 4.1. The static (Verilation time) scheduling of SystemVerilog
processes is performed by code in the ``V3Sched`` namespace. The single
entry point to the scheduling algorithm is ``V3Sched::schedule``. Some
@@ -312,7 +312,7 @@ Scheduling of clocked and combinational logic
For performance, clocked and combinational logic needs to be ordered.
Conceptually this minimizes the iterations through the evaluation loop
presented in the reference algorithm in the SystemVerilog standard (IEEE
1800-2017 section 4.5), by evaluating logic constructs in data-flow order.
1800-2023 section 4.5), by evaluating logic constructs in data-flow order.
Without going into a lot of detail here, accept that well thought out ordering
is crucial to good simulation performance, and also enables further
optimizations later on.
@@ -407,7 +407,7 @@ triggered due to a combinational signal change from the previous evaluation
pass, and a combinational loop settling due to hybrid logic, if the clocked
logic reads the not yet settled combinationally driven signal. Such a race
is indeed possible, but our evaluation is consistent with the SystemVerilog
scheduling semantics (IEEE 1800-2017 chapter 4), and therefore any program
scheduling semantics (IEEE 1800-2023 chapter 4), and therefore any program
that exhibits such a race has non-deterministic behavior according to the
SystemVerilog semantics, so we accept this.
@@ -628,21 +628,32 @@ coroutines ``co_await`` its ``join`` function, and forked ones call ``done``
when they're finished. Once the required number of coroutines (set using
``setCounter``) finish execution, the forking coroutine is resumed.
Awaitable Utilities
~~~~~~~~~~~~~~~~~~~
``VlForever``
~~~~~~~~~~~~~
There are also two small utility awaitable types:
* ``VlNow`` is an awaitable that suspends and immediately resumes coroutines.
It is used for forcing a coroutine to be moved onto the heap. See the `Forks`
section for more detail.
* ``VlForever`` is used for blocking a coroutine forever. See the `Timing pass`
section for more detail.
A small utility awaitable type. It allows for blocking a coroutine forever. It
is currently only used for ``wait`` statements that await a constant false
condition. See the `Timing Pass` section for more details.
Timing Pass
~~~~~~~~~~~
The visitor in ``V3Timing.cpp`` transforms each timing control into a ``co_await``.
There are two visitors in ``V3Timing.cpp``.
The first one, ``TimingSuspendableVisitor``, does not perform any AST
transformations. It is responsible for marking processes and C++ functions that
contain timing controls as suspendable. Processes that call suspendable
functions are also marked as suspendable. Functions that call, are overridden
by, or override suspendable functions are marked as suspendable as well.
The visitor keeps a dependency graph of functions and processes to handle such
cases. A function or process is dependent on a function if it calls it. A
virtual class method is dependent on another class method if it calls it,
overrides it, or is overriden by it.
The second visitor in ``V3Timing.cpp``, ``TimingControlVisitor``, uses the
information provided by ``TimingSuspendableVisitor`` and transforms each timing
control into a ``co_await``.
* event controls are turned into ``co_await`` on a trigger scheduler's
``trigger`` method. The awaited trigger scheduler is the one corresponding to
@@ -674,14 +685,9 @@ Each sub-statement of a ``fork`` is put in an ``AstBegin`` node for easier
grouping. In a later step, each of these gets transformed into a new, separate
function. See the `Forks` section for more detail.
Processes that use awaits are marked as suspendable. Later, during ``V3Sched``,
they are transformed into coroutines. Functions that use awaits get the return
type of ``VlCoroutine``. This immediately makes them coroutines. Note that if a
process calls a function that is a coroutine, the call gets wrapped in an
await, which means the process itself will be marked as suspendable. A virtual
function is a coroutine if any of its overriding or overridden functions are
coroutines. The visitor keeps a dependency graph of functions and processes to
handle such cases.
Suspendable functions get the return type of ``VlCoroutine``, which makes them
coroutines. Later, during ``V3Sched``, suspendable processes are also
transformed into coroutines.
Scheduling with timing
~~~~~~~~~~~~~~~~~~~~~~
@@ -749,9 +755,7 @@ doesn't suspend the forking process.
In forked processes, references to local variables are only allowed in
``fork..join``, as this is the only case that ensures the lifetime of these
locals are at least as long as the execution of the forked processes. This is
where ``VlNow`` is used, to ensure the locals are moved to the heap before they
are passed by reference to the forked processes.
locals are at least as long as the execution of the forked processes.
Multithreaded Mode
@@ -1027,15 +1031,100 @@ the evaluation process records a bitmask of variables that might have
changed; if clear, checking those signals for changes may be skipped.
Constrained randomization
-------------------------
Because general constrained randomization is a co-NP-hard problem, not all
cases are implemented in Verilator, and an external specialized SMT solver is
used for any non-obvious ones.
The ``randomize()`` method spawns an SMT solver in a sub-process. Then the
solver gets a setup query, then the definition of variables, then all the
constraints (SMT assertions) about the variables. Since the solver has no
information about the class' PRNG state, if the problem is satisfiable,
the solution space is further constrained by adding extra random constraints,
and querying the values satisfying the problem statement.
The constraint is currently constructed as fixing a simple xor of randomly
chosen bits of the variables being randomized.
The runtime classes used for handling the randomization are defined in
``verilated_random.h`` and ``verilated_random.cpp``.
``VlSubprocess``
~~~~~~~~~~~~~~~~
Subprocess handle, responsible for keeping track of the resources like child
PID, read and write file descriptors, and presenting them as a C++ iostream.
``VlRandomizer``
~~~~~~~~~~~~~~~~
Randomizer class, responsible for keeping track of variables and constraints,
and communicating with the solver subprocess.
The solver gets the constraints in `SMT-LIB2
<https://smtlib.cs.uiowa.edu/>`__ textual format in the following syntax:
::
(set-info :smt-lib-version 2.0)
(set-option :produce-models true)
(set-logic QF_BV)
(declare-fun v () (_ BitVec 16))
(declare-fun w () (_ BitVec 64))
(declare-fun x () (_ BitVec 48))
(declare-fun z () (_ BitVec 24))
(declare-fun t () (_ BitVec 23))
(assert (or (= v #x0003) (= v #x0008)))
(assert (= w #x0000000000000009))
(assert (or (or (= x #x000000000001) (= x #x000000000002)) (or (= x #x000000000004) (= x #x000000000009))))
(assert (bvult ((_ zero_extend 8) z) #x00000015))
(assert (bvugt ((_ zero_extend 8) z) #x0000000d))
(check-sat)
The solver responds with either ``sat`` or ``unsat``. Then the initial solution
is queried with:
::
(get-value (v w x z t ))
The solver then responds with e.g.:
::
((v #x0008)
(w #x0000000000000005)
(x #x000000000002)
(z #x000010)
(t #b00000000000000000000000))
And then a follow-up query (or a series thereof) is asked, and the solver gets
reset, so that it can be reused by subsequent randomization attempts:
::
(assert (= (bvxor (bvxor <...> (bvxor ((_ extract 21 21) z) ((_ extract 39 39) x)) ((_ extract 5 5) w)) <...> ((_ extract 10 10) w)) #b0))
(check-sat)
(get-value)
...
(reset)
Coding Conventions
==================
Compiler Version and C++11
Compiler Version and C++14
--------------------------
Verilator requires C11. Verilator does not require any newer versions, but
is maintained to build successfully with C14/C17/C20.
Verilator requires C14. Verilator does not require any newer versions, but
is maintained to build successfully with C17/C20.
Indentation and Naming Style
@@ -1218,9 +1307,9 @@ There are three ways data is passed between visitor functions.
2. User attributes. Each ``AstNode`` (**Note.** The AST node, not the
visitor) has five user attributes, which may be accessed as an
integer using the ``user1()`` through ``user5()`` methods, or as a
integer using the ``user1()`` through ``user4()`` methods, or as a
pointer (of type ``AstNUser``) using the ``user1p()`` through
``user5p()`` methods (a common technique lifted from graph traversal
``user4p()`` methods (a common technique lifted from graph traversal
packages).
A visitor first clears the one it wants to use by calling
@@ -1383,9 +1472,6 @@ For all tests to pass, you must install the following packages:
- SystemC to compile the SystemC outputs, see http://systemc.org
- Parallel::Forker from CPAN to run tests in parallel; you can install
this with e.g. "sudo cpan install Parallel::Forker".
- vcddiff to find differences in VCD outputs. See the readme at
https://github.com/veripool/vcddiff
@@ -1395,8 +1481,8 @@ For all tests to pass, you must install the following packages:
Controlling the Test Driver
---------------------------
The test driver script `driver.pl` runs tests; see the `Test Driver`
section. The individual test drivers are written in PERL; see `Test
The test driver script `driver.py` runs tests; see the `Test Driver`
section. The individual test drivers are written in Perl; see `Test
Language`.
@@ -1408,7 +1494,7 @@ A specific regression test can be executed manually. To start the
::
test_regress/t/t_EXAMPLE.pl
test_regress/t/t_EXAMPLE.py
Regression Testing for Developers
@@ -1428,13 +1514,6 @@ Developers will also want to call ./configure with two extra flags:
disabled by default, as SystemC installation problems would otherwise
falsely indicate a Verilator problem.
When enabling the long tests, some additional PERL modules are needed,
which you can install using cpan.
::
cpan install Parallel::Forker
There are some traps to avoid when running regression tests
- When checking the MANIFEST, the test will fail on unexpected code in the
@@ -1458,6 +1537,19 @@ There are some traps to avoid when running regression tests
system-dependent, but on Fedora Linux it would require editing the
``/etc/security/limits.conf`` file as root.
Diffing generated code after changes
------------------------------------
When making a change in the code generation area that should not change the
actual emitted code, it is useful to perform a diff to make sure the emitted
code really did not change. To do this, the top level Makefile provides the
*test-snap* and *test-diff* targets:
- Run the test suite with ``make test``
- Take a snapshot with ``make test-snap``
- Apply your changes
- Run the test suite again with ``make test``
- See the changes in the output with ``make test-diff``
Continuous Integration
----------------------
@@ -1509,8 +1601,19 @@ debug level 5, with the V3Width.cpp file at level 9.
--debug
-------
When you run with ``--debug``, there are two primary output file types
placed into the obj_dir, .tree and .dot files.
When you run with ``--debug``, there are three primary output file types
placed into the obj_dir, .vpp, .tree and .dot files.
.vpp Output
-----------
Verilator creates a *{mod_prefix}*\ __inputs\ .vpp file containing all the
files that were read, filtered by preprocessing. This file can be fed back
into Verilator, replacing on the command line all of the previous input
files, to enable simplification of test cases.
Verilator also creates .vpp files for each individual file passed on the
command line.
.dot Output
@@ -1553,7 +1656,7 @@ field in the section below.
+---------------+--------------------------------------------------------+
| ``1:2:`` | The hierarchy of the ``VAR`` is the ``op2p`` |
| | pointer under the ``MODULE``, which in turn is the |
| | ``op1p`` pointer under the ``NETLIST`` |
| | ``op1p`` pointer under the ``NETLIST``. |
+---------------+--------------------------------------------------------+
| ``VAR`` | The AstNodeType (e.g. ``AstVar``). |
+---------------+--------------------------------------------------------+
@@ -1567,7 +1670,7 @@ field in the section below.
| | and "aa" the 27th. Then line 22 in that file, then |
| | column 8 (aa=0, az=25, ba=26, ...). |
+---------------+--------------------------------------------------------+
| ``@dt=0x...`` | The address of the data type this node contains. |
| ``@dt=0x...`` | The address of the data type this node references. |
+---------------+--------------------------------------------------------+
| ``w32`` | The data-type width() is 32 bits. |
+---------------+--------------------------------------------------------+
@@ -1575,7 +1678,7 @@ field in the section below.
| | variable. |
+---------------+--------------------------------------------------------+
| ``[O]`` | Flags which vary with the type of node, in this |
| | case, it means the variable is an output. |
| | case of a VAR, it means the variable is an output. |
+---------------+--------------------------------------------------------+
In more detail, the following fields are dumped common to all nodes. They
@@ -1625,7 +1728,7 @@ Source file and line
file is ``a``, the 26th is ``z``, the 27th is ``aa``, and so on.
User pointers
Shows the value of the node's user1p...user5p, if non-NULL.
Shows the value of the node's user1p...user4p, if non-NULL.
Data type
Many nodes have an explicit data type. "@dt=0x..." indicates the
@@ -1668,6 +1771,84 @@ Similarly, the ``NETLIST`` has a list of modules referred to by its
``op1p()`` pointer.
.tree.json Output
-----------------
``.tree.json``` is an alternative dump format to ``.tree`` that is meant for
programmatic processing (e.g. with `astsee <https://github.com/antmicro/astsee>`_).
To enable this dump format, use :vlopt:`--dump-tree-json` or :vlopt:`--json-only`.
Structure:
::
{
/* Attributes that are common to all types of nodes */
"type": "VAR",
"name": "cyc",
/* By default addresses and filenames use short/stable ids rather than real value */
"addr": "(H)",
"loc": "a,25:12,26:15", /* "fileid,firstLine:firstCol,lastLine:endCol" (endCol is right exclusive) */
"editNum": 602,
/* Fields that are specific to AstVar nodes: */
"origName": "cyc",
"isSc": false,
"ioDirection": "NONE",
"isConst": false,
"isPullup": false,
"isPulldown": false,
"isUsedClock": false,
"isSigPublic": false,
"isLatched": false,
"isUsedLoopIdx": false,
"noReset": false,
"attrIsolateAssign": false,
"attrFileDescr": false,
"isDpiOpenArray": false,
"isFuncReturn": false,
"isFuncLocal": false,
"attrClocker": "UNKNOWN",
"lifetime": "NONE",
"varType": "VAR",
/* Lists of child nodes (which use similar structure as their parent): */
"childDTypep": [ /* ... */ ],
"delayp": [ /* ... */ ],
"valuep": [ /* ... */ ],
"attrsp": [ /* ... */ ]
}
.tree.meta.json Output
----------------
.tree.meta.json contains metadata that is common across the whole AST tree
(in case of --dump-tree-json, multiple trees share one meta file).
Besides de-duplication of data shared between multiple stages, .meta.json enables offloading
unstable data (that can vary from machine-to-machine or run-to-run) from main .tree.json.
This offloading allows, for example, to use byte-to-byte comparisons of AST dumps in tests.
::
{"files": {
/* Map id to filename, and other metadata */
"d": {"filename":"/home/ant/tmp/verilator/include/verilated_std.sv", "realpath":"/home/ant/tmp/verilator/include/verilated_std.sv", "language":"1800-2023"},
"a": {"filename":"<built-in>", "realpath":"<built-in>", "language":"1800-2023"},
"b": {"filename":"<command-line>", "realpath":"<command-line>", "language":"1800-2023"},
"c": {"filename":"input.vc", "realpath":"/home/ant/tmp/verilator/test_regress/input.vc", "language":"1800-2023"},
"e": {"filename":"t/t_EXAMPLE.v", "realpath":"/home/ant/tmp/verilator/test_regress/t/t_EXAMPLE.v", "language":"1800-2023"}
},"pointers": {
/* Map id to real address */
"(AG)": "0x562997289180",
"(YF)": "0x5629971c50b0",
"(WF)": "0x5629971e7ae0",
/* ... /*
},"ptrFieldNames": [
/* List of fields that are used for storing pointers */
"aboveScopep",
"voidp",
"addr",
/* ... */
]}
.tree.dot Output
----------------
@@ -1680,7 +1861,7 @@ represent the pointers (``op1p``, ``op2p``, etc) between the nodes.
Debugging with GDB
------------------
The `driver.pl` script accepts ``--debug --gdb`` to start
The `driver.py` script accepts ``--debug --gdb`` to start
Verilator under gdb and break when an error is hit, or the program is about
to exit. You can also use ``--debug --gdbbt`` to just backtrace and then
exit gdb. To debug the Verilated executable, use ``--gdbsim``.
@@ -1691,7 +1872,7 @@ can use ``--debug`` and look at the underlying invocation of
::
t/t_alw_dly.pl --debug
t/t_alw_dly.py --debug
shows it invokes the command:
@@ -1740,6 +1921,20 @@ To print a node:
pnt nodep
# or: call dumpTreeGdb(nodep) # aliased to "pnt" in src/.gdbinit
``src/.gdbinit`` and ``src/.gdbinit.py`` define handy utilities for working with
JSON AST dumps. For example:
* ``jstash nodep`` - Perform a JSON AST dump and save it into GDB value history (e.g. ``$1``)
* ``jtree nodep`` - Perform a JSON AST dump and pretty print it using ``astsee_verilator``.
* ``jtree $1`` - Pretty print a dump that was previously saved by ``jstash``.
* ``jtree nodep -d '.file, .timeunit'`` - Perform a JSON AST dump, filter out some fields and pretty print it.
* ``jtree 0x55555613dca0`` - Pretty print using address literal (rather than actual pointer).
* ``jtree $1 nodep`` - Diff ``nodep`` against an older dump.
A detailed description of ``jstash`` and ``jtree`` can be displayed using ``gdb``'s ``help`` command.
These commands require `astsee <https://github.com/antmicro/astsee>`_ to be installed.
When GDB halts, it is useful to understand that the backtrace will commonly
show the iterator functions between each invocation of ``visit`` in the
backtrace. You will typically see a frame sequence something like:
@@ -1774,7 +1969,7 @@ Generally, what would you do to add a new feature?
Follow the convention described above about the AstNode type hierarchy.
Ordering of definitions is enforced by ``astgen``.
5. Now you can run ``test_regress/t/t_<newtestcase>.pl --debug`` and it'll
5. Now you can run ``test_regress/t/t_<newtestcase>.py --debug`` and it'll
probably fail, but you'll see a
``test_regress/obj_dir/t_<newtestcase>/*.tree`` file which you can examine
to see if the parsing worked. See also the sections above on debugging.
@@ -1801,23 +1996,21 @@ Verilator ideally would support all of IEEE, and has the goal to get close
to full support. However the following IEEE sections and features are not
anticipated to be ever implemented for the reasons indicated.
IEEE 1800-2017 3.3 modules within modules
IEEE 1800-2023 3.3 modules within modules
Little/no tool support, and arguably not a good practice.
IEEE 1800-2017 6.12 "shortreal"
IEEE 1800-2023 6.12 "shortreal"
Little/no tool support, and easily promoted to real.
IEEE 1800-2017 11.11 Min, typ, max
IEEE 1800-2023 11.11 Min, typ, max
No SDF support, so will always use typical.
IEEE 1800-2017 11.12 "let"
Little/no tool support, makes it difficult to implement parsers.
IEEE 1800-2017 20.16 Stochastic analysis
IEEE 1800-2023 20.16 Stochastic analysis
Little industry use.
IEEE 1800-2017 20.17 PLA modeling
IEEE 1800-2023 20.17 PLA modeling
Little industry use and outdated technology.
IEEE 1800-2017 31 Timing checks
IEEE 1800-2023 31 Timing checks
No longer relevant with static timing analysis tools.
IEEE 1800-2017 32 SDF annotation
IEEE 1800-2023 32 SDF annotation
No longer relevant with static timing analysis tools.
IEEE 1800-2017 33 Config
IEEE 1800-2023 33 Config
Little industry use.
@@ -1825,7 +2018,7 @@ IEEE 1800-2017 33 Config
Test Driver
===========
This section documents the test driver script, `driver.pl`. driver.pl
This section documents the test driver script, `driver.py`. driver.py
invokes Verilator or another simulator on each test file. For test file
contents description see `Test Language`.
@@ -1837,7 +2030,7 @@ the regression tests with OBJCACHE enabled and in parallel on a machine
with many cores. See the -j option and OBJCACHE environment variable.
driver.pl Non-Scenario Arguments
driver.py Non-Scenario Arguments
--------------------------------
--benchmark [<cycles>]
@@ -1858,6 +2051,10 @@ driver.pl Non-Scenario Arguments
files with dumping level 3, which dumps the standard critical stages.
For details on the format see `.tree Output`.
--fail-max <numtests>
Set the number of failing tests, after which the driver will stop running
additional tests. Defaults to 20, 0 disables.
--gdb
Same as ``verilator --gdb``: Run Verilator under the debugger.
@@ -1903,13 +2100,16 @@ driver.pl Non-Scenario Arguments
memory leaks.
--site
Run site specific tests also.
Run site-specific tests also.
--stop
Stop on the first error.
--trace
Set the simulator specific flags to request waveform tracing.
Set the simulator-specific flags to request waveform tracing.
--valgrind
Same as ``verilator --valgrind``: Run Verilator under `Valgrind <https://valgrind.org/>`_.
--verbose
Compile and run the test in verbose mode. This means ``TEST_VERBOSE``
@@ -1919,7 +2119,7 @@ driver.pl Non-Scenario Arguments
For tests using the standard C++ wrapper, enable runtime debug mode.
driver.pl Scenario Arguments
driver.py Scenario Arguments
----------------------------
The following options control which simulator is used, and which tests are
@@ -1954,11 +2154,14 @@ simultaneously.
--vltmt
Run Verilator tests in multithreaded mode.
--xrun
Run Cadence Xcelium simulator tests.
--xsim
Run Xilinx XSim simulator tests.
driver.pl Environment
driver.py Environment
---------------------
HARNESS_UPDATE_GOLDEN
@@ -1997,6 +2200,10 @@ VERILATOR_ROOT
Standard path to Verilator distribution root; see primary Verilator
documentation.
VERILATOR_SOLVER
SMT solver command for constrained randomization; see primary Verilator
documentation.
VERILATOR_TESTS_SITE
Used with ``--site``, a colon-separated list of directories with tests to
be added to testlist.
@@ -2014,30 +2221,30 @@ VERILATOR_XVLOG
Test Language
=============
This section describes the format of the ``test_regress/t/*.pl`` test
language files, executed by `driver.pl`.
This section describes the format of the ``test_regress/t/*.py`` test
language files, executed by `driver.py`.
Test Language Summary
---------------------
For convenience, a summary of the most commonly used features is provided
here, with a reference in a later section. All test files typically have a
call to the ``lint`` or ``compile`` subroutine to compile the test. For
run-time tests, this is followed by a call to the ``execute``
subroutine. Both of these functions can optionally be provided with
arguments specifying additional options.
call to the ``test.lint`` or ``test.compile`` methods to compile the
test. For run-time tests, this is followed by a call to the
``test.execute`` method. Both of these functions can optionally be provided
with arguments specifying additional options.
If those complete, the script calls ``ok`` to increment the count of
successful tests and then returns 1 as its result.
If those complete, the script calls ``test.passes`` to increment the count
of successful tests.
The driver.pl script assumes by default that the source Verilog file name
The driver.py script assumes by default that the source Verilog file name
matches the test script name. So a test whose driver is
``t/t_mytest.pl`` will expect a Verilog source file ``t/t_mytest.v``.
``t/t_mytest.py`` will expect a Verilog source file ``t/t_mytest.v``.
This can be changed using the ``top_filename`` subroutine, for example
::
top_filename("t/t_myothertest.v");
test.top_filename = "t/t_myothertest.v"
By default, all tests will run with major simulators (Icarus Verilog, NC,
VCS, ModelSim, etc.) as well as Verilator, to allow results to be
@@ -2046,26 +2253,25 @@ can use the following:
::
scenarios(vlt => 1);
test.scenarios('vlt')
Of the many options that can be set through arguments to ``compiler`` and
``execute``, the following are particularly useful:
Of the many options that can be set through arguments to ``test.compiler``
and ``test.execute``, the following are particularly useful:
``verilator_flags2``
A list of flags to be passed to verilator when compiling.
``fails``
Set to 1 to indicate that the compilation or execution is intended to fail.
Set true to indicate that the compilation or execution is intended to fail.
For example, the following would specify that compilation requires two
defines and is expected to fail.
::
compile(
test.compile(
verilator_flags2 => ["-DSMALL_CLOCK -DGATED_COMMENT"],
fails => 1,
);
fails = True)
Hints On Writing Tests
----------------------
@@ -2078,10 +2284,10 @@ same name as the test, but with .cpp as suffix
::
compile(
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--exe $Self->{t_dir}/$Self->{name}.cpp"], );
test.compile(
make_top_shell=False,
make_main=False,
verilator_flags2=["--exe", test.t_dir + "/" + test.name + ".cpp"])
Tests should be self-checking, rather than producing lots of output. If a
test succeeds it should print ``*-* All Finished *-*`` to standard output
@@ -2110,7 +2316,7 @@ Or in a hand-written C++ wrapper:
::
#ifdef TEST_VERBOSE
cout << "Read a=" << a << endl;
std::cout << "Read a=" << a << std::endl;
#endif
A filename that should be used to check the output results is given with
@@ -2121,9 +2327,8 @@ compile time, it is the only option. For example:
::
compile(
fails => 1,
expect_filename => $Self->{golden_filename},
);
fails=True,
expect_filename=test.golden_filename)
Note ``expect_filename`` strips some debugging information from the logfile
when comparing.
@@ -2132,9 +2337,9 @@ when comparing.
Test Language Compile/Lint/Run Arguments
----------------------------------------
This section describes common arguments to ``compile()``, ``lint()``, and
``run()``. The full list of arguments can be found by looking at the
``driver.pl`` source code.
This section describes common arguments to ``test.compile``, ``test.lint``,
and ``test.run``. The full list of arguments can be found by looking at
the ``driver.py`` source code.
all_run_flags
A list of flags to be passed when running the simulator (Verilated model
@@ -2145,11 +2350,6 @@ check_finished
string ``*-* All Finished *-*`` being printed on standard output. This is
the normal way for successful tests to finish.
expect
A quoted list of strings or regular expression to be matched in the
output. See `Hints On Writing Tests` for more detail on how this argument
should be used.
fails
True to indicate this step is expected to fail. Tests that are expected
to fail generally have _bad in their filename.
@@ -2211,7 +2411,7 @@ xsim_flags / xsim_flags2 / xsim_run_flags
Distribution
============
Copyright 2008-2023 by Wilson Snyder. Verilator is free software; you can
Copyright 2008-2025 by Wilson Snyder. Verilator is free software; you can
redistribute it and/or modify it under the terms of either the GNU Lesser
General Public License Version 3 or the Perl Artistic License Version 2.0.
+198 -1
View File
@@ -1,4 +1,5 @@
ABCp
Aadi
Accellera
Affe
Aleksander
@@ -6,57 +7,78 @@ Alexandre
Ami
Amir
Anastasiadis
Anglin
Anikin
Antmicro
Antonin
Antwerpen
Arasanipalai
Arjen
Arshid
Asciidoc
Ashutosh
Ast
Atmel
Aurelien
Badáň
Bagri
Balboni
Baltazar
Bardsley
Benchmarking
Berman
Bhagavatula
Bhattacharyya
Biancolin
Binderman
Björk
Bleiweiss
Bogdan
Bonneau
Bouchard
Boumenot
Brej
Briquet
Brownlee
Buckenmaier
Burghoorn
Bybell
CLang
CMake
Cai
Cavium
Cfuncs
Chandan
Chentai
Cherkasov
Chih
Chitlesh
Christophe
Cochrane
Conda
Corteggiani
Cozzocrea
Cuan
Cygwin
DErrico
DFG
Da
Dai
Danilo
Dannoritzer
Das
Davide
Dcache
Deadman
Debacker
Deepa
Defparams
Delm
Denio
Deniz
Deprecations
Deroo
Desai
Dickol
Diez
Dimitris
@@ -65,9 +87,11 @@ Djordjevic
Dobbie
Dockerfile
Donal
Donovick
Doorn
Doxygen
Dressler
Dudek
Duraid
Dutton
Dzetkulic
@@ -80,22 +104,32 @@ Eiler
Eivind
El
Elbourne
Elzeftawi
Embecosm
Engstrom
Enzo
Eugen
Fabrizio
Faucher
Faure
Feinberg
Fekete
Ferrandi
Filip
Flachs
Flavien
Florian
Foletto
Forencich
Forker
Francillon
Fredieu
Freiberger
Frédéric
GTKWave
Galbi
Gantt
Garnal
Gartner
Gelinek
Geoff
@@ -103,6 +137,7 @@ Gernot
Gerst
Gielda
Gigerl
Gijs
Gileadi
Giri
Gisselquist
@@ -111,18 +146,25 @@ Goessling
Gonnen
Goorah
Gossner
Graba
Graphviz
Graybeal
Grobman
Grulfen
Gu
Gunter
Guo
Güzel
Hameed
Hao
Haojin
Harboe
Hashimoto
Hayenga
Hesselbarth
Hewson
Hicamp
Hideto
Hiroki
Holdsworth
Holme
@@ -130,8 +172,11 @@ Homebrew
Hornung
Hossell
Hsu
Huggett
Hutt
Hyperthreading
Ibrahim
Ikram
Iles
Inlines
Inout
@@ -143,11 +188,14 @@ Jae
Jalloq
Jankowski
Jannis
Jasen
Jens
Jeras
Jiaxun
Jiuyang
Joannou
Joly
Josse
Jullien
Junji
Junyi
@@ -158,6 +206,7 @@ Kahn
Kai
Kamendje
Kandadi
Kaneda
Kaplan
Karge
Karlsson
@@ -173,6 +222,7 @@ Klnv
Koenig
Koh
Kolecki
Konstantin
Koonce
Korteland
Koszek
@@ -184,16 +234,24 @@ Kumashikar
Kuoping
Kurachi
Laeufer
Laroche
Laurens
Lavino
Leber
Leendert
Lem
Lesik
Libenzi
Licker
Liland
Liu
Liwei
Lockhart
Longo
Luca
Luiza
Lussier
Lübeck
MMD
MODDUP
MTasks
@@ -203,10 +261,17 @@ Mahesh
Mahmoudy
Makefile
Makefiles
Maksymenko
Markley
Marquet
Matveyenko
Maupin
Mdir
Mednick
Mei
Melo
Menküc
Michail
Michiels
Microsystems
Milanovic
@@ -215,6 +280,8 @@ MinW
Mindspeed
MingW
Miodrag
Moberg
Mobert
ModelSim
Modport
Moinak
@@ -222,9 +289,14 @@ Mong
Muhlestein
Multithreaded
Multithreading
Mykyta
NOUNOPTFLAT
NaN
Nalbantis
Nandor
Narayan
Narcis
Nassim
Nauticus
Newgard
Nigam
@@ -233,15 +305,20 @@ Niranjan
Nitza
Noack
Nodine
Ober
Oleg
Olof
Olofsson
Oron
Oyvind
PLI
Palaniappan
Patricio
Petr
Piard
Piechotka
Piersall
Platz
Platzer
Plunkett
Popolon
@@ -252,10 +329,14 @@ Prateek
Pre
Preprocess
Pretet
Pretl
Pringlemeir
Priyadharshini
Pullup
Pulver
Puri
Qin
Qiu
Questa
Rachit
Ralf
@@ -264,28 +345,42 @@ Redhat
Reitan
Renga
Requin
Rodas
Rodionov
Rohan
Rolfe
Rontionov
Roodselaar
Roshit
Runtime
Ruud
Rystsov
STandarD
Salman
Sammelson
Sanggyu
Sanguinetti
Sanjay
Sasselli
Scharrer
Schless
Seitz
Shahid
Shahrestani
Shankar
Shanshan
Sharad
Shareef
Shen
Sheng
Shi
Shinkarovsky
Shinya
Shirakawa
Shou
Shuba
Shunyao
Slager
Slatter
SoC
Sobhan
@@ -294,9 +389,12 @@ Solaris
Solomatnikov
Solt
Southwell
Spack
Srini
Srinivasan
Stamness
Stephane
Sterin
Stoddard
Stroebel
Strouble
@@ -304,6 +402,7 @@ Stucki
Su
Suguimoto
Sundararajan
Sunderland
Suse
Syms
Synopsys
@@ -311,6 +410,7 @@ SystemC
SystemVerilog
Takatsukasa
Tambe
Tarik
Tariq
Tejada
Tengstrand
@@ -318,7 +418,9 @@ Terpstra
Thiede
Thierry
Thyer
Tianrui
Tichelaar
Timi
Tomov
Tood
Topa
@@ -327,9 +429,11 @@ Trefor
Tresidder
Tri
Tristate
Truong
Turton
UNOPTFLAT
Ubixum
Ueno
Uints
Undefines
Unsized
@@ -338,11 +442,13 @@ Uselib
Usha
Usuario
VERILATOR
Vandergriendt
Vasu
Vdeeptemp
Vdly
Vemumtab
Vemuri
Venkataramanan
Veriable
Verialted
Verilate
@@ -353,6 +459,8 @@ Verilator
Verilog
Vighnesh
Viktor
Vilp
Vlip
Vm
Vukobratovic
Wai
@@ -363,22 +471,32 @@ Wfuture
Whatson
Wildman
Wim
Wmisleading
Wno
Wojciech
Wolfel
Wouters
Wpedantic
Wunused
Wwarn
XSim
Xcelium
Xiaoliang
Xiaoyi
Xuan
Xuanqi
Yao
Yazdanbakhsh
Yernagula
Yi
Yike
Yinan
Yoshitomo
Yosys
Yu
Yujia
Yurii
Zaruba
Zhang
abirkmanis
accessor
@@ -396,7 +514,10 @@ architected
args
arrarys
assertOn
assertcontrol
astgen
async
atClone
ato
atoi
autoconf
@@ -410,6 +531,7 @@ basename
bbox
benchmarking
biguint
bindir
biops
bisonpre
bitOpTree
@@ -425,6 +547,7 @@ buildenv
bv
bvs
callValueCbs
callgrind
casex
casez
casted
@@ -452,16 +575,19 @@ commandArgsPlusMatch
compilable
concat
concats
conf
config
const
constexpr
constpool
coredump
coroutine
coroutines
countbits
countones
cout
cpp
cppstyle
cpu
ctor
ctrace
@@ -475,6 +601,7 @@ datadir
datafiles
david
ddd
de
deassign
debugi
defenv
@@ -482,12 +609,15 @@ defname
defparam
demangling
dep
deparametrized
der
dereference
desassign
destructor
desynchronization
detections
dev
devcontainer
devel
dir
displayb
@@ -496,6 +626,7 @@ doxygen
dpiGetContext
dpic
dsvf
dt
dtor
dumpall
dumpfile
@@ -512,7 +643,9 @@ dumpportson
dumpvars
dut
dx
dynarray
elab
eliasphanna
elike
elsif
endcase
@@ -520,6 +653,7 @@ endcelldefine
endfunction
endgenerate
endian
endianness
endif
endmodule
endprotect
@@ -534,6 +668,7 @@ envvar
eof
errae
erroring
esynr
et
eval
evals
@@ -541,6 +676,7 @@ exe
executables
expr
extern
ezchi
fanin
fasttrace
fauto
@@ -561,9 +697,11 @@ fno
fopen
forceable
foreach
fourstate
fprintf
fprofile
fread
freloop
frewind
fs
fscanf
@@ -585,6 +723,9 @@ genvar
genvars
getenv
getline
getter
ggdb
glibc
gmake
gmon
gotFinish
@@ -596,6 +737,7 @@ hh
hier
hierCMakeArgs
hierMkArgs
hierParameters
hierVer
hx
hyperthreading
@@ -629,16 +771,20 @@ ish
isunbounded
isunknown
jobserver
json
jwoutersymatra
killua
lang
lcov
ld
leavinel
len
libc
libext
libgoogle
libsystemc
libtcmalloc
libverilated
linkers
linter
linux
@@ -653,7 +799,9 @@ logicals
longint
lossy
lsb
lubc
lvalue
lvalues
lxt
macromodule
makefile
@@ -665,6 +813,7 @@ miree
mis
misconnected
misconversion
misoptimized
missized
mk
mno
@@ -678,14 +827,18 @@ mtasks
mulithreaded
mult
multidim
multidriven
multiinterfaces
multiline
multipling
multipoint
multithread
multithreaded
multithreading
musl
mutexes
mux
muzafferkal
myftptoyman
mysignal
namespace
@@ -714,7 +867,10 @@ ortegon
oversubscription
parallelized
param
parameterization
parameterized
parameterized
parameterless
params
parens
pawel
@@ -723,9 +879,11 @@ pdf
perf
perftools
pgo
phelter
picoChip
pinIndex
pinout
pkgdatadir
plusargs
pmos
poping
@@ -740,9 +898,12 @@ pragma
pragmas
pre
precisions
precompiled
predefines
prepareClone
prepend
prepended
preproc
preprocess
preprocessed
preprocessing
@@ -755,17 +916,23 @@ profcfunc
profiler
prototyptes
ps
psprintf
pthread
pthreads
ptr
pulldown
pulldowns
pullup
pvalue
pwd
py
qrq
qrqiuren
radix
randc
randcase
randstate
raphmaster
rarr
rdtsc
reStructuredText
@@ -775,11 +942,14 @@ readmemb
readmemh
realpath
realtime
realtobits
recoding
recrem
redeclaring
regs
reloop
replaceShiftOp
reproducibility
resetall
respecified
rodata
@@ -793,6 +963,7 @@ sVerilator
sawatzke
sc
scalared
sccache
sccanf
seg
setuphold
@@ -807,6 +978,7 @@ specparam
splitme
spp
sqrt
srandom
src
srcdir
srcfile
@@ -816,6 +988,7 @@ stdin
stdout
stime
stmts
str
strcasecmp
stringification
stringified
@@ -829,15 +1002,23 @@ submakes
submodule
submodules
substring
superclass
suspendable
suspendables
sv
svBitVal
svBitVecVal
svGet
svGetTime
svGetTimePrecision
svLogicVal
svdpi
svgGetTimeUnit
swrite
synthesizeable
sys
systemc
tenghtt
testbench
threadsafe
threashold
@@ -853,10 +1034,13 @@ toolchain
topcell
toplevel
toupper
traceCapable
traceEverOn
tran
treei
tri
triand
trior
tristate
tristates
trunc
@@ -869,10 +1053,12 @@ typedefs
typename
uint
un
unbased
undef
undefineall
undriven
ungetc
unhandled
uniquified
unistd
unlink
@@ -887,13 +1073,17 @@ unsup
untyped
urandom
uselib
utimes
uwire
uwires
valgrind
vc
vcd
vcddiff
vcoverage
vdhotre
vec
ventana
ver
verFiles
verible
@@ -909,18 +1099,24 @@ vlt
vltstd
vluint
vpi
vpiConstType
vpiDefName
vpiInertialDelay
vpiInstance
vpiLeftRange
vpiModule
vpiSize
vpiSuppressVal
vpiTimeUnit
vpiType
vpiUndefined
vpm
vpp
warmup
waveforms
whitespace
widthed
wor
wreal
writeb
writeme
@@ -938,4 +1134,5 @@ ypq
yurivict
zdave
Øyvind
Алексеевич
Исаак
+1 -1
View File
@@ -70,7 +70,7 @@ The XML document consists of 4 sections within the top level
Distribution
============
Copyright 2020-2023 by Wilson Snyder. Verilator is free software; you can
Copyright 2020-2025 by Wilson Snyder. Verilator is free software; you can
redistribute it and/or modify it under the terms of either the GNU Lesser
General Public License Version 3 or the Perl Artistic License Version 2.0.
+10 -4
View File
@@ -19,18 +19,24 @@
# cmake ..
# cmake --build .
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.12)
cmake_policy(SET CMP0074 NEW)
project(cmake_hello_c)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
if (NOT verilator_FOUND)
message(FATAL_ERROR "Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable")
if(NOT verilator_FOUND)
message(
FATAL_ERROR
"Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable"
)
endif()
# Create a new executable target that will contain all your sources
add_executable(example ../make_hello_c/sim_main.cpp)
target_compile_features(example PUBLIC cxx_std_14)
# Add the Verilated circuit to the target
verilate(example
INCLUDE_DIRS "../make_hello_c"
SOURCES ../make_hello_c/top.v)
SOURCES ../make_hello_c/top.v
)
+1 -1
View File
@@ -31,7 +31,7 @@ endif
ifeq ($(shell which cmake),)
TARGET := nocmake
else
CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
+11 -8
View File
@@ -19,12 +19,16 @@
# cmake ..
# cmake --build .
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.12)
cmake_policy(SET CMP0074 NEW)
project(cmake_hello_sc CXX)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
if (NOT verilator_FOUND)
message(FATAL_ERROR "Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable")
if(NOT verilator_FOUND)
message(
FATAL_ERROR
"Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable"
)
endif()
# SystemC dependencies
@@ -36,15 +40,14 @@ find_package(SystemCLanguage QUIET)
# Create a new executable target that will contain all your sources
add_executable(example ../make_hello_sc/sc_main.cpp)
target_compile_features(example PUBLIC cxx_std_14)
set_property(
TARGET example
PROPERTY CXX_STANDARD ${SystemC_CXX_STANDARD}
)
set_property(TARGET example PROPERTY CXX_STANDARD ${SystemC_CXX_STANDARD})
# Add the Verilated circuit to the target
verilate(example SYSTEMC
INCLUDE_DIRS "../make_hello_sc"
SOURCES ../make_hello_sc/top.v)
SOURCES ../make_hello_sc/top.v
)
verilator_link_systemc(example)
+1 -1
View File
@@ -31,7 +31,7 @@ endif
ifeq ($(shell which cmake),)
TARGET := nocmake
else
CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
+14 -5
View File
@@ -19,19 +19,26 @@
# cmake ..
# cmake --build .
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.12)
cmake_policy(SET CMP0074 NEW)
project(cmake_protect_lib)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
if (NOT verilator_FOUND)
message(FATAL_ERROR "Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable")
if(NOT verilator_FOUND)
message(
FATAL_ERROR
"Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable"
)
endif()
# Create the main executable target
add_executable(example ../make_protect_lib/sim_main.cpp)
target_compile_features(example PUBLIC cxx_std_14)
# Create a secret library
add_library(verilated_secret STATIC) # or SHARED for a shared library
target_compile_features(verilated_secret PUBLIC cxx_std_14)
target_link_libraries(example PRIVATE verilated_secret)
# To create both libraries on CMake >= 3.12 replace the above 2 lines with the following:
# add_library(verilated_secret OBJECT)
@@ -51,9 +58,11 @@ verilate(verilated_secret
VERILATOR_ARGS --protect-lib verilated_secret
--protect-key ${PROTECT_KEY}
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/verilated_secret
SOURCES ../make_protect_lib/secret_impl.v)
SOURCES ../make_protect_lib/secret_impl.v
)
# Include location of verilated_secret.sv wrapper
verilate(example
VERILATOR_ARGS "-I${CMAKE_CURRENT_BINARY_DIR}/verilated_secret"
SOURCES ../make_protect_lib/top.v)
SOURCES ../make_protect_lib/top.v
)
+1 -1
View File
@@ -31,7 +31,7 @@ endif
ifeq ($(shell which cmake),)
TARGET := nocmake
else
CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
+10 -4
View File
@@ -19,19 +19,25 @@
# cmake ..
# cmake --build .
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.12)
cmake_policy(SET CMP0074 NEW)
project(cmake_tracing_c)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
if (NOT verilator_FOUND)
message(FATAL_ERROR "Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable")
if(NOT verilator_FOUND)
message(
FATAL_ERROR
"Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable"
)
endif()
# Create a new executable target that will contain all your sources
add_executable(example ../make_tracing_c/sim_main.cpp)
target_compile_features(example PUBLIC cxx_std_14)
# Add the Verilated circuit to the target
verilate(example COVERAGE TRACE
INCLUDE_DIRS "../make_tracing_c"
VERILATOR_ARGS -f ../make_tracing_c/input.vc -x-assign fast
SOURCES ../make_tracing_c/top.v)
SOURCES ../make_tracing_c/top.v
)
+1 -1
View File
@@ -31,7 +31,7 @@ endif
ifeq ($(shell which cmake),)
TARGET := nocmake
else
CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)

Some files were not shown because too many files have changed in this diff Show More