Commit Graph
47 Commits
Author SHA1 Message Date
Kornel Uriasz 74d12c5b5e Fix 'get-value' for empty constrained arrays (#8138)
Signed-off-by: Kornel Uriasz <[email protected]>
2026-08-18 10:05:00 +02:00
Yilou Wang ace84ef2b3 Fix simulation hang when the solver stops answering (Part2 of #7991) (#8129) 2026-08-17 13:01:41 +02:00
Yilou Wang abf199cf0e Fix randc cycling in a class that also uses solve...before (Part1 of #7991) (#8055) 2026-08-14 07:16:44 -04:00
BRDR LIFE 967b1bae57 Fix unique constraint crash, guards, and size (#8018) (#8018) 2026-07-31 23:37:53 -04:00
Yilou Wang 99b71a37b7 Internals: Refactor randomization next and nextPhased into shared helpers (#7991 prep) (#8009). No functional change intended. 2026-07-30 21:41:37 -04:00
Yilou Wang b5fa4212b0 Fix UNSATCONSTR reporting constraint indices above 9 (#7995) 2026-07-28 18:25:19 -04:00
Yilou Wang f22676eea9 Fix solve-before dropping all soft constraints in randomize() (#7963) 2026-07-20 14:55:49 -04:00
Jeffrey Song 4262aea87c Internals: Use snprintf for random unique indexes (#7925) 2026-07-13 11:35:22 -07:00
Yilou Wang ca83bc50bf Fix solve-before over array variables failing randomization (#7876) 2026-07-11 20:44:37 -04:00
Yilou Wang fa0f814686 Fix biased bit distribution under value < (1 << N) constraints (#7563) (#7684)
Fixes #7563
2026-05-30 13:00:35 -04:00
Geza Lore c99aa8ede5 Fix erroneous implicit conversions of VlWide (#7642)
Change WDataInP/WDataOutP to be opaque handles types instead of aliases
to raw pointers. This subsequently eliminates needing an implicit cast
operator in VlWide, which is replaced with implicit constructors of
WDataInP/WDataOutP that can create a handle from a VlWide. This
eliminates some unsafe conversions that the previous implicit cast
operator unintentionally enabled (e.g. #7618). It also eliminates
having to insert ".data()" in various places int he generated code, which
simplifies internals (the only place ".data()" should be needed is in
calls to variadic functions where the expected type of the argument is
not WDataInP/WDataOutP).

The handles otherwise behave like pointers, implementing the minimal
amount of operators required to code the runtime. The handle is still
only a single pointer, and will be passed in registers as before, so
this patch should be performance neutral.

As part of this removed WData, which used to be an alias for EData.
All uses are now either EData*, WDataInP, WDataOutP, or VlWide directly.
2026-05-22 20:05:08 +01:00
Yilou Wang 4befec4463 Support rand_mode() on static rand class members (#7484) (#7510) 2026-04-29 17:07:27 -04:00
Yilou Wang 76c1b26e3b Support obj.randomize(null) (#7487) (#7509) 2026-04-28 15:31:08 -04:00
Wilson Snyder 5b9cd12530 Internals: Remove mutex, part of last commit 2026-04-04 18:10:47 -04:00
Wilson Snyder 33493cf5b4 Add +verilator+solver+file (#7242).
Fixes #7242.
2026-04-04 17:26:43 -04:00
Wilson Snyder 5036af3d37 Commentary: Refer to latest standard where can 2026-03-29 18:06:12 -04:00
Wilson Snyder 31757df229 Internals: clangtidy cleanups. No functional change intended (#7343) 2026-03-27 23:14:18 -04:00
Yilou Wang 4b34bfffcb Fix soft constraint relaxation dropping compatible constraints (#7271)
* Fix soft constraint relaxation dropping compatible constraints

* patch changes the soft handle ordering so update the out files
2026-03-18 10:15:50 +01:00
Yilou Wang 8925762077 Fix rand_mode(0) on sub-object members not preventing solver write-back (#7272) 2026-03-17 15:09:14 -04:00
Yilou Wang 7cd49a8028 Support dist and solve...before inside foreach constraints (#7245) (#7253) 2026-03-13 11:05:18 -04:00
Yilou Wang e0f1f316aa Fix randc solver hang with wide variables (#7068) (#7248) 2026-03-13 07:53:51 -04:00
Wilson Snyder a787d631ce Internals: Add some missing const/UNLIKELY markers. No functional change 2026-03-12 07:46:21 -04:00
Yilou Wang 3bc73cc768 Support constraint imperfect distributions (#6811) (#7168) 2026-03-03 11:23:14 -05:00
Yilou Wang 108d209bd7 Support soft constraint solving with last-wins priority (#7124) (#7166) 2026-03-01 15:16:55 -05:00
Yilou Wang 1717df0261 Support solve..before constraints (#5647) (#7123) 2026-02-22 11:33:18 -05:00
Yilou Wang 9b1b9a5b3b Fix randc cyclic behavior broken with constraints (#7029) (#7035) 2026-02-12 10:58:04 -05:00
Geza Lore f0afcede10 Internals: Use pure expressions in V3Randomize (#6974) 2026-02-01 05:09:19 +00:00
Wilson Snyder 7c6c6a684b Add SPDX copyright identifiers, and get 'reuse' clean. No functional change. 2026-01-26 20:24:34 -05:00
Wilson Snyder 50b6954cfc Internals: cppcheck cleanups 2026-01-17 23:18:09 -05:00
Srinivasan Venkataramanan 6fc9089a77 Support unique constraints (on 1D static arrays) (#6810) (#6878) 2026-01-16 08:42:09 -05:00
31f8be0b85 Support detailed failure info for constraint violations (#6617) (#6883)
* logging for the unsatisfied constraints

* Apply 'make format'

* fix teh quote error in the array indexing

* Apply 'make format'

* Len change for the hash for randomity when named assertion is used

* seperate name assertion and satisfied case

* Apply 'make format'

* simply comments and display info

* refine code and fix protect case

* format

* update display in test and .out file

* add an enable flag and warning type, add a protect_id version test and update out files

* Apply 'make format'

* simplify some comments

* update out file, ready to be merged.

* update .py file to set the hash key solid

* rename and reformate the warning message to follow the verilator style

* add a nowarn test

* Apply 'make format'

* ordering

---------

Co-authored-by: Udaya Raj Subedi <[email protected]>
Co-authored-by: github action <[email protected]>
2026-01-12 15:53:49 +01:00
Yilou Wang 048c97f0ae Support std::randomize(){...} (#4706) (#6573) 2025-11-14 14:32:01 -05:00
Wilson Snyder 3dc430085d Internals: Misc verilated_random style cleanups. No functional change. 2025-09-21 12:33:38 -04:00
Wilson Snyder f71b8e6195 Internals: Fix up include/ cppcheck issues (#6311) 2025-08-19 21:36:52 -04:00
Wilson Snyder 7191a0ba8b Internals: Favor preincrements. No functional change. 2025-05-09 21:20:35 -04:00
Wilson Snyder fe15171649 Internals: cppcheck cleanups. No functional change. 2025-02-18 01:14:51 -05:00
Yilou Wang 6b4183632c Support Unpacked Structures' Constrained Randomization (#5657) (#5759) 2025-02-03 11:56:00 -05:00
Yilou Wang 0380a36c76 Fix constrained random for > 64-bit associative arrays (#5670) (#5682) 2025-01-09 08:33:38 -05:00
Yilou Wang 54ef9ad31c Support associative array basic constrained randomization (#5658) (#5670) 2024-12-12 11:31:54 -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
Yilou Wang c05c48aaf3 Support unpacked array Constrained Randomization (#5437) (#5489) 2024-10-02 10:29:47 -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 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
Krzysztof Bieganski f623db7d68 Normalize types in constraints (#5407)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-08-27 12:53:44 +02:00
Krzysztof Bieganski 2f5c58b345 Support rand_mode (#5273)
Signed-off-by: Krzysztof Bieganski <[email protected]>
2024-07-31 22:30:48 +01: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 739be2f782 Support constrained randomization with external solvers (#4947) 2024-05-17 10:38:34 -04:00