Commit Graph

2914 Commits

Author SHA1 Message Date
Aleksander Kiryk 7c7c92d2dd
Fix coroutine handle movement during queue manipulation (#4431) 2023-08-21 10:22:09 -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
Frans Skarman e9cc2786b7
Add --no-trace-top option (#4422) 2023-08-19 04:51:29 -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
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
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 1549ff9185
Support more types in wait (#4374) 2023-07-24 08:14:01 -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
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
Wilson Snyder 5be0813893 Explicity reference std:: in header files (#4338). No functional change intended. 2023-07-08 13:20:40 -04:00
Krzysztof Bieganski 5788bc8048
Propagate class timescale to class package (#4348)
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2023-07-07 17:27:33 +02: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
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 cff37f0775 Add GENUNNAMED lint warning.
Also fix generate-for blocks with empty statements getting lost.
2023-07-01 08:31:53 -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
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 7005a65d32 Tests: Attempt 20.04 fix for (#b1aec9b) (#4307) 2023-06-23 07:09:07 -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 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
Krzysztof Boronski 21c01ba97b V3Fork - transform processes that can outlive their parents into separate tasks (#4253)
Signed-off-by: Krzysztof Boronski <kboronski@antmicro.com>
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 0dc887720d Tests: Fix tests, broke in commit 3a9eeabd 2023-06-12 22:38:45 -04:00
Wilson Snyder 81affad2dc Tests: Fix test, broke in previous commit 2023-06-12 20:41:33 -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
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
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 <kbieganski@antmicro.com>
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 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
Ryszard Rozak 4f7e155e59
Fix class parameters of enum types (#4219) 2023-05-24 15:51:03 +02:00
Wilson Snyder fd7515b046 Tests: Cleanup scenarios lines. No test run change. 2023-05-23 22:40:19 -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
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 <kbieganski@antmicro.com>
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
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
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 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 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
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 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 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 <kbieganski@antmicro.com>
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
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
Kamil Rakoczy 49d2eb9a08
Fix initialization order of initial static after function/task (#4159) 2023-05-02 11:50:57 -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
Risto Pejašinović f794180865
Fix hier attribute of --xml-only cell section to respect begin blocks (#4129) (#4133)
Co-authored-by: Risto Pejasinovic <risto.pejasinovic@cern.ch>
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 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 <rrozak@antmicro.com>
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
Wilson Snyder 7f49b6c102 Parse 'let' as unsupported 2023-04-16 17:23:16 -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 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
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 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 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 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