Commit Graph

488 Commits

Author SHA1 Message Date
Wilson Snyder 3658e5f0f1 Internals: Rename widthToFit, no functional change. 2025-04-28 21:54:58 -04:00
Ryszard Rozak 6bb57e4630
Fix assignments with stream expressions and unpacked arrays (#5915) 2025-04-09 06:37:52 -04:00
Wilson Snyder f5312b83b9 Fix %% on elaboration severity tasks (#5922). 2025-04-07 08:38:05 -04:00
Wilson Snyder 45add07205 Internals: Minor V3Param cleanups. No functional change. 2025-03-12 07:58:26 -04:00
Geza Lore fc302a5207
Fix sorting of wide SenItems (#5816)
This used to throw Error: Value too wide for 64-bits expected in this context
2025-03-01 22:11:43 +00:00
Wilson Snyder 05c7a3b90b Optimize labels as final `if` block statements (#5744). 2025-01-25 10:29:35 -05:00
Wilson Snyder d8080008b4 Commentary 2025-01-24 07:47:32 -05:00
Wilson Snyder 8fbb725f34 Copyright year update. 2025-01-01 08:30:25 -05:00
Wilson Snyder 990ccd6763 Internals: Standardize on `template<typename`. No functional change. 2024-11-29 18:01:50 -05:00
Wilson Snyder 8db9db7e25 Internals: Rename same() function. No functional change. 2024-11-28 15:01:58 -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 8f1ea09558
Add lsb index to V3Number::setMask (#5522) 2024-10-08 13:15:36 +01: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 8741fd17ad Internals: cppcheck cleanups. No functional change intended. 2024-08-23 18:24:34 -04:00
Krzysztof Bieganski 97e9996f0b
Fix optimized-out sentrees with `--timing` (#5080) (#5349)
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2024-08-08 21:57:12 +01:00
Arkadiusz Kozdra a32b8d80f9
Support streaming operator on arrays and wide data (#5326)
Signed-off-by: Arkadiusz Kozdra <akozdra@antmicro.com>
2024-08-06 08:48:46 -04:00
Yutetsu TAKATSUKASA 095b1ccb67
Fix incorrect result of width mismatch (#5186) (#5189) 2024-07-17 11:54:58 +02:00
Wilson Snyder 3315a6e431 Internals: Also cleanup gettes/setters in .cpp. No functional change intended. 2024-06-22 19:50:59 -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
Geza Lore 9b729b80e0
Plug memory leaks (#5016) 2024-03-23 22:12:43 +00:00
Fuad Ismail 1c79df8630
Support stream operation on unpacked array (#4714) (#5006) 2024-03-21 18:26:42 -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
Bartłomiej Chmiel 32f288084a
Add UNUSEDLOOP when unused loop is removed (#4926) 2024-03-07 08:33:49 -05:00
Wilson Snyder efff630763 Fix tautological-compare warnings. 2024-02-07 22:16:08 -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
Yutetsu TAKATSUKASA e4a0e5aad6
Fix #4857 consider NOT when checking EQ/NEQ under AND/OR tree (#4863) 2024-01-28 22:36:09 +09: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 89cfa0737f Internals: Fix cppcheck warnings 2024-01-17 19:48: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
Mariusz Glebocki 719954a24a
Internals: Make V3Const.cpp parseable by non-compilers (#4796) 2024-01-02 14:51:40 -05:00
Wilson Snyder e76f29e5ba Copyright year update 2024-01-01 03:19:59 -05:00
Wilson Snyder 55ad950609 Fix power operator with wide numbers and constants (#4721) (#4763) 2023-12-19 19:22:54 -05:00
Krzysztof Bieganski ea2084392f
Support --timing triggers for virtual interfaces (#4673) 2023-12-04 22:11:07 -05:00
Wilson Snyder 7167d4bdc0 Fix shift of > 32-bit number (#4719). 2023-11-27 21:41:32 -05:00
Wilson Snyder 58d9a5ebac Use newline instead of endl, for fewer stream flushes 2023-11-24 11:45:52 -05:00
Wilson Snyder 9fd5634778 Internals: Remove unneeded private's. No functional change 2023-11-13 21:37:45 -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
Wilson Snyder dc10118d3b
Fix C++20 compilation errors (#4670) 2023-11-06 07:13:31 -05:00
Wilson Snyder 5af271cf3a Fix display optimization ignoring side effects (#4585). 2023-10-19 18:33:58 -04:00
Wilson Snyder b7233d063f Internals: Fix same() called outside of sameTree (#4561). 2023-10-18 17:36:21 -04: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
Wilson Snyder 46f8a659b3 Fix shift to remove operation side effects (#4563). 2023-10-14 22:34:37 -04:00
Wilson Snyder 411f563cbe Internals: Remove unneeded pure checks. No functional change. 2023-10-14 22:23:58 -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
Wilson Snyder 800a789f50 Fix inlining of real functions miscasting (#4543). 2023-10-06 21:33:31 -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
Ryszard Rozak 47b3f464a9
Disable conversion of impure logical expressions to bitwise expressions (#487 partial) (#4437) 2023-09-18 09:21:30 -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 19f7279542 Fix false INFINITELOOP on forever..mailbox.get() (#4323). 2023-09-15 22:05:55 -04:00
Wilson Snyder cdd8953085 Disable Subst when not pure 2023-09-08 21:52:33 -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 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
Ryszard Rozak 2daa32b98b
Support assignments of packed values to stream expressions on queues (#4401) 2023-08-25 11:24:12 +02:00
Krzysztof Boroński b752faa107
Fix jumping over object initialization (#4411) 2023-08-11 18:28:37 +02:00
Aleksander Kiryk 9249ffdb84
Fix queue slicing (#4329) 2023-07-03 13:55:24 -04:00
Ryszard Rozak b517fb5ee3
Support some stream operations on queues (#4292) 2023-06-13 22:46:42 -04:00
Ryszard Rozak ba82d43ca1
Support for condition operator on class objects (#4214) 2023-05-30 08:59:00 -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
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 05660d1118 Add CONSTRAINTIGN warning when constraint ignored. Likewise ignore constraint_mode, rand_mode. 2023-04-05 21:27:37 -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
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
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 d6c5d40f9b Internals: Add VNVisitorConst class. 2023-03-17 19:59:09 -04:00
Wilson Snyder 85fd88ace2 Optimize duplicate JumpBlocks away (#4028) 2023-03-16 22:29:06 -04:00
Ryszard Rozak 2c60c5f816
Support recursive methods (#3987) 2023-03-01 21:07:37 -05:00
Krzysztof Boroński 06661ab676
Disallow ++/-- over expressions with potential side effects (#3976). 2023-02-28 15:21:58 -05:00
Wilson Snyder 5aa4f46101 Internals: Add some std::. No functional change intended. 2023-02-10 20:32:39 -05:00
Yutetsu TAKATSUKASA 816cff009a
Fix #3824 of wrong bit op tree optimization (#3825)
* Tests: Add a test to reproduce #3824

* Fix #3824 of wrong bitOpTree optimization. Consider constant 1 in an Or-tree made by shift-out.
2023-01-04 23:10:55 +09:00
Wilson Snyder b24d7c83d3 Copyright year update 2023-01-01 10:18:39 -05:00
Larry Doolittle 80a144797d
Commentary: Fix more spelling (#3828) 2022-12-26 10:30:41 +01:00
Wilson Snyder 45abcb6107 Internals: Some V3LinkInc cleanups. No functional change. 2022-12-23 16:17:08 -05:00
Wilson Snyder c0499da28b Spelling fixes 2022-12-23 11:32:38 -05:00
Larry Doolittle f27cf4c804
Commentary: Fix spelling in C++ comments (#3797) (#3798) 2022-12-02 18:46:38 -05:00
Yutetsu TAKATSUKASA 889a1211f1
Fix 3786 (Internal error in bit op tree optimization) (#3793)
* Tests: Add a test to reproduce 3786

* Fix #3786 (Internal error in bit op tree optimization).
2022-12-01 22:00:24 +09:00
Wilson Snyder b51bb4d0e7 Internal: Add node objects to UASSERT (#3786) 2022-11-29 18:34:44 -05:00
Wilson Snyder 2c7f1ef40f Internals: Cleanup debug dumps so can grep-out leading-dashed lines 2022-11-27 08:31:22 -05:00
Ryszard Rozak 62bdd3ab49
Fix timing control in while-break loops (#3733) (#3769) 2022-11-21 06:27:55 -05:00
Wilson Snyder 2eed4452ad Internals: Fix constructor style. 2022-11-20 20:13:55 -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
Geza Lore 6ae6b16223 V3Const: Fix folding of LogAnd with non-bool operands
Folding an AstLogAnd with a non-zero constant operand used to coerce the
type of the other operand, yielding an ill-typed node that DFG was then
unhappy about. Add a RedOr instead if the width of the replacement
operand is greater than zero.

Fixes #3726
2022-11-05 13:36:21 +00: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 54c4351c39 V3Const: Do not introduce redundant AstExtend
Fixes #3716
2022-10-28 14:54:00 +01:00
HungMingWu 196f3292d5 Improve V3Ast function usage ergonomics (#3650)
Signed-off-by: HungMingWu <u9089000@gmail.com>
2022-10-21 14:12:12 +01:00
Arkadiusz Kozdra 0e4da3b0bf
Support virtual interfaces (#3654) 2022-10-20 06:31:00 -04:00
Geza Lore ddb678cc5b Merge branch 'master' into develop-v5 2022-09-22 17:33:36 +01: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 95145038b4 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 14:05:27 +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
Wilson Snyder a214fd1f78 Internals: Fix constructor syntax in new develop-v5 code 2022-09-17 08:56:41 -04:00