Commit Graph

80 Commits

Author SHA1 Message Date
Wilson Snyder 2f199f20cf Add ENUMITEMWIDTH error, and apply to X-extended and ranged values. 2025-07-12 14:14:17 -04:00
Wilson Snyder f77af4e6f6 Important: Change `--assert` to be the default; use `--no-assert` for legacy behavior and faster runtimes. 2025-07-03 19:36:28 -04:00
Geza Lore bc892deacc
Safely support non-overlapping blocking/non-blocking assignments (#6137)
The manual for the BLKANDNBLK warning describes that it is safe to
disable that error if the updated ranges are non-overlapping. This
however was not true (see the added t_nba_mixed_update* tests).

In this patch we change V3Delayed to use a new ShadowVarMasked
scheme for variables that have mixed blocking and non-blocking 
updates (or the FlagUnique scheme for unpacked variables), which
is in fact safe to use when the updated parts are non-overlapping.

Furthermore, mixed assignments are safe as far as scheduling is
concerned if either:

- They are to independent parts (bits/members/etc) (with this patch)
- Or if the blocking assignment is in clocked (or suspendable) logic.

The risk in scheduling is a race between the Post scheduled NBA
commit, and blocking assignments in combinational logic, which might
order incorrectly.

The second point highlights that we can handle stuff like this safely,
which is sometimes used in testbenches:

```systemverilog
always @(posedge clk) begin
    if ($time == 0) a = 0;
end

always @(posedge clk) begin
    if ($time > 0) a <= 2;
end
````

The only dangerous case is:

```systemverilog
always @(posedge clk) foo[idx] <= val;
assign foo[0] = bar;
```

Whit this patch, this will still resolve fine at run-time if 'idx' is
never zero, but might resolve incorrectly if 'idx' is zero.

With the above in mind, the BLKANDNBLK warning is now only issued if:

- We can't prove that the assignments are to non-overlapping bits
- And the blocking assignment is in combinational logic

These are the cases that genuinely require user attention to resolve.

With this patch, there are no more BLKANDNBLK warnings in the RTLMeter
designs.

Fixes #6122.
2025-06-28 20:45:45 +01:00
Wilson Snyder 189d094202 Commentary 2025-06-27 22:31:51 -04:00
Wilson Snyder 4c2eb8c0b8 Commentary: Fix broken links 2025-06-15 14:51:56 -04:00
Wilson Snyder 1c357ba508 Commentary 2025-06-10 08:17:45 -04:00
Todd Strader 9fc223d3ee
Commentary: FPGA PROCASSINIT guidance (#6067) 2025-06-06 09:59:05 -04:00
Wilson Snyder 8031ca2616 Add `MODMISSING` error, in place of unnamed error (#6054). 2025-05-29 21:02:00 -04:00
Wilson Snyder f8359adcc0 Commentary: Changes update 2025-05-20 22:51:07 -04:00
Wilson Snyder 6bb16d6c52 Disable symbol from parser: Support redeclaring type as non-type; major parsing change (#2412). 2025-05-18 07:13:37 -04:00
Wilson Snyder 66667b6172
Support SARIF JSON diagnostic output with `--diagnostics-sarif`. (#6017) 2025-05-17 15:46:15 -04:00
Wilson Snyder e837f780a2 Commentary 2025-05-03 04:25:01 -04:00
Wilson Snyder 3b8d10cae5 Commentary 2025-05-02 07:35:38 -04:00
Wilson Snyder 8b52bd817f Add PROCINITASSIGN on initial assignments to process variables (#2481). 2025-04-30 22:00:06 -04:00
Wilson Snyder 38dd9a344e Improve documentation for BADVLTPRAGMA 2025-04-30 20:32:30 -04:00
Wilson Snyder 9b3fccdcb7 Add BADVLTPRAGMA on unknown Verilator pragmas (#5945). 2025-04-29 18:18:54 -04:00
Wilson Snyder c9be36911f Cleanup documentated option sort order, and enforce with test 2025-04-26 17:14:49 -04:00
Wilson Snyder 14e7b1076e Commentary: Changes update 2025-04-02 23:17:39 -04:00
Brian Li 559d990e82
Support command-line overriding `define (#5900) (#5908) 2025-04-01 07:33:49 -04: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
Wilson Snyder 8fbb725f34 Copyright year update. 2025-01-01 08:30:25 -05:00
Todd Strader 079a53e820
Commentary: SYMRSVDWORD + VPI documentation (#5696) 2024-12-19 17:14:15 -05:00
Wilson Snyder 8f4490628f Commentary: Clarify some warning messages. 2024-07-20 17:50:14 -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 <akozdra@antmicro.com>

* wording/formatting

Signed-off-by: Arkadiusz Kozdra <akozdra@antmicro.com>

---------

Signed-off-by: Arkadiusz Kozdra <akozdra@antmicro.com>
2024-06-10 08:38:26 -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
Wilson Snyder 3d57256070 Commentary: Changes update 2024-03-04 08:22:36 -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
Pengcheng Xu ec01008fe3
Change zero replication width error to ZEROREPL warning (#4753) (#4762) 2024-01-03 07:11:50 -05:00
Wilson Snyder e76f29e5ba Copyright year update 2024-01-01 03:19:59 -05:00
Wilson Snyder a773a52559 Cleanup some IEEE references 2023-10-19 19:26:36 -04:00
Wilson Snyder c14eae6d56 Add SIDEEFFECT warning on mishandled side effect cases (#487 partial) 2023-10-15 06:44:35 -04: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 7f38414276 Internals: Rename addIgnoreMatch. No functional change. 2023-10-08 01:02:23 -04:00
Wilson Snyder 24ff3155ae Support randc (#4349). 2023-09-18 21:17:21 -04:00
Wilson Snyder 10c1653e72 Fix ZERODLY to not warn on 'wait(0)'. 2023-09-15 08:53:29 -04:00
Wilson Snyder a5eccc199b Commentary: Changes update 2023-07-27 04:01:28 -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
Wilson Snyder 8b1cc3b303 Commentary: Changes update 2023-07-01 07:35:58 -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
Wilson Snyder 4bb876aee5 Fix false IMPLICITSTATIC on package functions. 2023-05-06 19:48:22 -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 fa16eff003 Commentary (#4118) 2023-04-14 06:46:53 -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
Iztok Jeras 2aa6a229ca
Change range order warning from LITENDIAN to ASCRANGE (#4010) 2023-03-20 20:44:11 -04:00
Ryszard Rozak 1ac721af8f
Add STATICVAR warning and convert to automatic (#4027) (#4030)
Signed-off-by: Ryszard Rozak <rrozak@antmicro.com>
2023-03-17 07:48:41 -04:00
Wilson Snyder a8ce272e4a Commentary: spelling 2023-03-14 08:39:54 -04:00
Cameron Kirk faf3804b9a
Fix LITENDIAN warning is backwards (#3966) (#3967). 2023-03-01 11:46:44 -05:00