Arkadiusz Kozdra
0b7510befa
Support basic dist constraints ( #5431 )
2024-09-12 05:20:36 -07:00
Arkadiusz Kozdra
4a58997604
Support basic constrained queue randomization ( #5413 )
...
Signed-off-by: Arkadiusz Kozdra <akozdra@antmicro.com>
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 <akozdra@antmicro.com>
2024-09-10 07:17:21 -04:00
Krzysztof Bieganski
088862d449
Support appending to queue via `[]` ( #5421 )
2024-09-02 09:45:47 -04:00
Krzysztof Bieganski
f133a2811f
Fix capturing params in `randomize() with` ( #5416 ) ( #5418 )
...
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
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
Krzysztof Bieganski
675d9a641e
Call `pre`/`post_randomize` on `randomize() with` ( #5412 )
...
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2024-08-28 19:42:49 +02:00
Krzysztof Bieganski
155dcc5658
Fix empty `foreach` in `if` in constraints ( #5408 )
...
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2024-08-27 15:39:36 +02:00
Krzysztof Bieganski
f623db7d68
Normalize types in constraints ( #5407 )
...
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2024-08-27 12:53:44 +02:00
Yilou Wang
c4cb26fa9a
Support unconstrained randomization for unions ( #5395 ) ( #5396 )
2024-08-26 11:04:45 -04:00
Wilson Snyder
8741fd17ad
Internals: cppcheck cleanups. No functional change intended.
2024-08-23 18:24:34 -04:00
Krzysztof Bieganski
eb8bbcda05
Internals: Simplify `CaptureVisitor` in `V3Randomize` ( #5397 )
2024-08-23 07:57:57 -04:00
Krzysztof Bieganski
930f35acc9
Support `constraint_mode` ( #5338 )
2024-08-21 06:16:44 -04:00
Krzysztof Bieganski
59d2eea302
Fix capturing fields from superclass in `randomize() with` ( #5389 )
...
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2024-08-20 13:25:58 -04:00
Krzysztof Bieganski
6cb0a41857
Support inline random variable control ( #5317 )
...
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2024-08-13 14:20:31 -04:00
Arkadiusz Kozdra
3e5859e5da
Support constraining AstSel ( #5344 )
...
Signed-off-by: Arkadiusz Kozdra <akozdra@antmicro.com>
2024-08-08 15:37:08 +01:00
Krzysztof Bieganski
f4cb2c8cf2
Add more `rand_mode` unsupported errors ( #5329 )
...
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2024-08-05 17:56:03 -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 <akozdra@antmicro.com>
2024-08-02 10:03:55 -04:00
Krzysztof Bieganski
2f5c58b345
Support `rand_mode` ( #5273 )
...
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2024-07-31 22:30:48 +01:00
Ryszard Rozak
b9e1d55262
Fix handling of rand fields not referenced in constraints ( #5305 )
...
Signed-off-by: Ryszard Rozak <rrozak@antmicro.com>
2024-07-26 05:46:30 -04:00
Krzysztof Bieganski
f5caa4b7dc
Fix randomizing current object with `rand` class instance member ( #5292 )
...
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2024-07-22 14:41:12 +02:00
Krzysztof Bieganski
2bd2b9324f
Fix inline constraints creating class random generator ( #5280 )
2024-07-19 13:03:48 -04:00
Arkadiusz Kozdra
43377ed8b0
Add support for `this.randomize with` ( #5282 )
...
Signed-off-by: Arkadiusz Kozdra <akozdra@antmicro.com>
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
Krzysztof Bieganski
2a30a87580
Fix randomization when used with inheritance ( #5268 )
...
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2024-07-17 08:21:45 +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 <kbieganski@antmicro.com>
2024-07-15 16:42:41 +02:00
Krzysztof Boroński
3cf9606ea9
Support inline constraints for class randomization methods ( #5234 )
...
Signed-off-by: Krzysztof Boronski <kboronski@antmicro.com>
2024-07-12 16:18:18 +02:00
Krzysztof Bieganski
2696a9a5bd
Fix unconstrained randomization of unpacked structs ( #5252 )
...
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2024-07-11 16:43:56 +02:00
Arkadiusz Kozdra
570e1bc35a
Support conditional constraints ( #5245 )
2024-07-10 11:30:18 -04:00
Arkadiusz Kozdra
85356f464f
State-dependent constraints ( #5217 )
...
Signed-off-by: Arkadiusz Kozdra <akozdra@antmicro.com>
2024-07-01 20:19:15 +02:00
Wilson Snyder
708f875b31
Fix MSVC warnings. No functional change intended.
2024-06-07 22:52:56 -04:00
Arkadiusz Kozdra
739be2f782
Support constrained randomization with external solvers ( #4947 )
2024-05-17 10:38:34 -04:00
Kefa Chen
5f1dc73a1b
Support public packed struct / union ( #860 ) ( #4878 )
2024-03-03 10:23:04 -05:00
Wilson Snyder
3786f59e03
Change to IEEE 1800-2023 warning mentions
2024-03-02 10:15:19 -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
e76f29e5ba
Copyright year update
2024-01-01 03:19:59 -05:00
Wilson Snyder
9fd5634778
Internals: Remove unneeded private's. No functional change
2023-11-13 21:37:45 -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
f3ae4b8786
Fix spelling
2023-11-10 23:25:53 -05: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
Ryszard Rozak
64af83161a
Fix rand fields of reference types ( #4627 )
2023-10-26 17:17:23 -04:00
Ryszard Rozak
84125d7c92
Fix virtual methods ( #4616 )
2023-10-24 15:51:46 +02:00
Wilson Snyder
b5828a7ce9
Fix header order botched by clang-format in recent commit.
2023-10-18 06:37:46 -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
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
Wilson Snyder
24ff3155ae
Support randc ( #4349 ).
2023-09-18 21:17:21 -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
05d04a3959
Internals: Fix misnamed member. No functional change.
2023-09-15 23:02:34 -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
Wilson Snyder
250c6950cf
Fix randomize missing simple class rand members.
2023-05-06 18:33:08 -04:00
Wilson Snyder
add68130b8
Internals: Rename to dumpLevel(), to avoid confusion with make-a-dump()
2023-05-03 18:04:10 -04:00
Wilson Snyder
69121633cf
Support class srandom and class random stability.
2023-04-01 10:50:27 -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
Ryszard Rozak
0f6024ef3c
Fix rand fields in base classes ( #4025 )
2023-03-15 11:48:18 -04:00
Ryszard Rozak
80b7b8bbdb
Don't call randomize on null field ( #4023 )
...
Signed-off-by: Ryszard Rozak <rrozak@antmicro.com>
2023-03-14 14:48:06 +01:00
Wilson Snyder
b24d7c83d3
Copyright year update
2023-01-01 10:18:39 -05:00
Wilson Snyder
2c7f1ef40f
Internals: Cleanup debug dumps so can grep-out leading-dashed lines
2022-11-27 08:31:22 -05:00
Geza Lore
3abb65d732
Strengthen AstNode types to AstNodeExpr
...
Declare every AstNode children and variables as AstNodeExpr where we
statically know this is the appropriate sub-type.
2022-11-20 19:31:28 +00:00
Wilson Snyder
de9c92fd14
Internals: Add missing const. No functional change.
2022-11-19 10:48:46 -05:00
Wilson Snyder
0322e9da7e
Fix randcase inside function.
2022-11-18 21:30:34 -05:00
Wilson Snyder
c6ecd60993
Support pre_randomize and post_randomize.
2022-11-13 11:59:40 -05:00
Wilson Snyder
ee26dddfa1
Internals: Fix constructor style.
2022-11-13 11:23:57 -05:00
Wilson Snyder
a427860825
Support randcase.
2022-11-11 21:53:05 -05:00
Geza Lore
65e08f4dbf
Make all expressions derive from AstNodeExpr ( #3721 ).
...
Apart from the representational changes below, this patch renames
AstNodeMath to AstNodeExpr, and AstCMath to AstCExpr.
Now every expression (i.e.: those AstNodes that represent a [possibly
void] value, with value being interpreted in a very general sense) has
AstNodeExpr as a super class. This necessitates the introduction of an
AstStmtExpr, which represents an expression in statement position, e.g :
'foo();' would be represented as AstStmtExpr(AstCCall(foo)). In exchange
we can get rid of isStatement() in AstNodeStmt, which now really always
represent a statement
Peak memory consumption and verilation speed are not measurably changed.
Partial step towards #3420
2022-11-03 16:02:16 +00:00
Geza Lore
63c694f65f
Streamline dump control options
...
- Rename `--dump-treei` option to `--dumpi-tree`, which itself is now a
special case of `--dumpi-<tag>` where tag can be a magic word, or a
filename
- Control dumping via static `dump*()` functions, analogous to `debug()`
- Make dumping independent of the value of `debug()` (so dumping always
works even without the debug flag)
- Add separate `--dumpi-graph` for dumping V3Graphs, which is again a
special case of `--dumpi-<tag>`
- Alias `--dump-<tag>` to `--dumpi-<tag> 3` as before
2022-09-22 17:24:41 +01:00
Geza Lore
ce03293128
Generate AstNode accessors via astgen
...
Introduce the @astgen directives parsed by astgen, currently used for
the generation child node (operand) accessors. Please see the updated
internal documentation for details.
2022-09-21 13:56:03 +01:00
Geza Lore
0c70a0dcbf
Remove redundant 'virtual' keywords from overridden methods
...
'virtual' is redundant when 'override' is present, so keep only
'override'.
Add t/t_dist_cppstyle.pl to check for this.
2022-09-16 15:19:38 +01:00
Geza Lore
96a4b3e5a5
Update clang-format config and apply
...
- Regroup and sort #include directives (like we used to, but automatic)
- Set AlwaysBreakTemplateDeclarations to true
2022-08-05 12:00:24 +01:00
Wilson Snyder
b9d7819faa
Internals: Fix some cppcheck issues. Some dump functions fixed.
2022-07-30 10:01:39 -04:00
Wilson Snyder
441ecfedc9
Internals: Make all .h files compilable
2022-01-08 11:18:23 -05:00
Wilson Snyder
e6857df5c6
Internals: Rename Ast on non-node classes ( #3262 ). No functional change.
...
This commit has the following replacements applied:
s/\bAstUserInUseBase\b/VNUserInUseBase/g;
s/\bAstAttrType\b/VAttrType/g;
s/\bAstBasicDTypeKwd\b/VBasicDTypeKwd/g;
s/\bAstDisplayType\b/VDisplayType/g;
s/\bAstNDeleter\b/VNDeleter/g;
s/\bAstNRelinker\b/VNRelinker/g;
s/\bAstNVisitor\b/VNVisitor/g;
s/\bAstPragmaType\b/VPragmaType/g;
s/\bAstType\b/VNType/g;
s/\bAstUser1InUse\b/VNUser1InUse/g;
s/\bAstUser2InUse\b/VNUser2InUse/g;
s/\bAstUser3InUse\b/VNUser3InUse/g;
s/\bAstUser4InUse\b/VNUser4InUse/g;
s/\bAstUser5InUse\b/VNUser5InUse/g;
s/\bAstVarType\b/VVarType/g;
2022-01-02 14:03:20 -05:00
Wilson Snyder
ca42be982c
Copyright year update.
2022-01-01 08:26:40 -05:00
Wilson Snyder
cd737065f2
Internals: More const. No functional change intended.
2021-11-26 17:55:36 -05:00
Wilson Snyder
2742a8c813
Internals: No need for variable name on immediate visitors. No functional change intended.
2021-11-26 10:52:45 -05:00
Wilson Snyder
05e12ab60e
Internals: More const. No functional change intended.
2021-11-26 10:52:45 -05:00
Wilson Snyder
37e3c6da70
Internals: Add more const. No functional change intended.
2021-11-13 13:50:44 -05:00
Geza Lore
dae9fa5053
Use VN_AS wherever possible and obvious. No functional change.
2021-10-22 14:06:00 +01:00
Wilson Snyder
8ecdc85cf7
Internals: C++11 style cleanups. No functional change.
2021-07-11 18:42:01 -04:00
Wilson Snyder
3a55600913
Internals: Restyle with C++11 using replacing typedef
2021-03-12 18:10:45 -05:00
Wilson Snyder
bd602d0e2d
Copyright year update
2021-01-01 10:29:54 -05:00
Wilson Snyder
b7a533109d
Fix cppcheck warnings. No functional change intended.
2020-12-23 15:22:02 -05:00
Krzysztof Bieganski
cf7ea06b5d
Support randomize() class method and rand
2020-12-07 17:55:22 -05:00