Commit Graph

3778 Commits

Author SHA1 Message Date
Wilson Snyder d89df33fcd Change control file `public_flat_*` and other signal attributes to support __ in names (#6140). 2025-07-09 20:48:00 -04:00
Wilson Snyder 9fc7143fce Fix genvar error with `-O0` (#6165). 2025-07-09 19:11:48 -04:00
Igor Zaworski dbfbc657e1
Fix class extends dotted error (#6162) 2025-07-09 17:12:11 -04:00
Ryszard Rozak 8b3a6ba542
Support disable dotted references (#6154) 2025-07-09 16:59:26 -04:00
Igor Zaworski 5777ab75c7
Fix crash with --dumpi-V3LinkDot without --debug (#6159) 2025-07-08 10:28:17 -04:00
Geza Lore e494cf22a4
Add DfgPeephole patterns (#6149) 2025-07-07 16:25:29 +01:00
Wilson Snyder 5a6d5ed96b Support property `iff` and `implies`. 2025-07-03 21:13:04 -04:00
Wilson Snyder 26c7f1adb6 Tests: Change default indent to 2 spaces (match edaplayground). No functional change. 2025-07-03 20:43:13 -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
Todd Strader 08fef668cd
Fix more wide ternary + coverage cases (#6155) 2025-07-03 18:00:39 -04:00
Wilson Snyder 4ddc649836 Add UNSUPPORTED rather than syntax error on pullup/pulldown strengths 2025-07-02 20:54:47 -04:00
Wilson Snyder 77908447e6 Support scoped `new` (#4199). 2025-07-02 19:54:57 -04:00
Todd Strader ae0f29ed37
Fix wide non-blocking assignment mis-optimization (#6150) (#6152) 2025-07-02 18:43:10 -04:00
Wilson Snyder 73ca2ab997 Support `$past_gclk` 2025-07-01 18:00:04 -04:00
Geza Lore 7a3f1f16ca
Optimize DFG before V3Gate (#6141) 2025-07-01 17:55:08 -04:00
Wilson Snyder 9598ef9315 Internals: Avoid - in enum name 2025-07-01 05:45:10 -04:00
github action b27bd6526a Apply 'make format' 2025-06-30 01:00:56 +00:00
Wilson Snyder 916a89761e Add `--work` library-selection option (#5891 partial). 2025-06-29 20:17:27 -04:00
Geza Lore c3d86626ee
Internals: Remove unused AstNodeModule 'activesp' child (#6138) 2025-06-29 09:56:44 -04:00
Wilson Snyder 5d32fc56ac Support 'config' parsing, but not functionally 2025-06-28 20:32:19 -04:00
Wilson Snyder 93f447dd4a Support constant functions with left-hand-side concatenates. 2025-06-28 17:12:03 -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 62e5e3aa0c Fix interface array connections with non-zero low declaration index. 2025-06-28 09:43:02 -04:00
Wilson Snyder f508dadc97 Support `specparam` (#5767). 2025-06-28 08:23:43 -04:00
Todd Strader 73696f0a71
Tests: Add coverpoints test (#6118) 2025-06-27 15:47:13 -04:00
Wilson Snyder 75229cc03d Fix `pre_randomize`/`post_randomize` when no randomize (#6122). 2025-06-26 18:34:20 -04:00
Wilson Snyder e422c183ff Fix method calls without parenthesis (#6127). 2025-06-26 18:16:21 -04:00
Kamil Rakoczy d183b4edde
Fix variables declared in fork after taskify (#6126) 2025-06-26 10:28:58 -04:00
Wilson Snyder 3209bee3b3 Fix colon-divide operator without space (#6121). 2025-06-25 04:56:52 -04:00
Wilson Snyder 6af694b04b Support `$timeformat` with missing arguments (#6113). 2025-06-24 17:30:05 -04:00
Geza Lore 916d473eff
Internals: Replace unnecessary AstSel::widthp() child node with const in node (#6117) 2025-06-24 11:59:09 -04:00
Wilson Snyder 544cb4a90f Fix decoding octal string escapes with 1-2 digits (#6108). 2025-06-23 18:37:44 -04:00
Geza Lore 2daa09a255
Optimize constify within Expand and Subst (#6111)
These passes blow up the Ast size on some designs, so delaying running V3Const
until after the whole pass can notably increase peak memory usage. In this
patch we apply V3Const per CFunc within these passes, which saves on memory.
Added -fno-const-eager to disable the intra-pass V3Const application, for
debugging.
2025-06-23 17:58:26 -04:00
Wilson Snyder 49fe129634 Fix `--lib-create` with double-underscore (#6099). 2025-06-18 08:56:32 -04:00
Peter Birch 75df36bc8f
Add hint of the signed rhsval in oversized replication error (#6098) 2025-06-17 16:59:18 -07:00
Geza Lore 48600c77b5
Fix DFG binToOneHot table index missing driver (#6100) 2025-06-17 15:53:47 +01:00
Geza Lore 277611bcdd
Add DFG binToOneHot pass to generate one-hot decoders (#6096)
Somewhat commonly, there is code out there that compares an expression (or
variable) against many different constants, e.g. a one-hot decoder:

```systemverilog
  assign oneHot = {x == 3, x == 2, x == 1, x == 0};
```

If the width of the expression is sufficiently large, this can blow up
a GCC pass and take an egregious amount of memory and time to compile.

Adding a new DFG pass that will generate a cheap one-hot decoder:
to compute:

```systemverilog
  wire [$bits(x)-1:0] idx = <the expression being compared many times>
  reg tab [1<<$bits(x)] = '{default: 0};
  reg [$bits(x)-1:0] pre = '0;

  always_comb begin
    tab[pre] = 0;
    tab[idx] = 1;
    pre = idx ; // This assignment marked to avoid a false UNOPFTLAT
  end
```

We then replace the comparisons `x == CONST` with `tab[CONST]`.

This is generally performance neutral, but avoids the compile time and memory
blowup with GCC (128GB+ -> 1GB in one example).

We do not apply this if the comparisons seem to be part of a `COMPARE ?
val : COND` conditional tree, which the C++ compilers can turn into jump
tables.

This enables all XiangShan configurations from RTLMeter to now build with GCC,
so in this patch we enabled those in the nightly runs.
2025-06-16 23:14:24 +01:00
Todd Strader 47f5a6a52b
Fix unpacked to packed parameter assignment (#6088) (#6081) 2025-06-12 12:47:58 -04:00
Todd Strader 206a0b4fd2
Fix casting reals to large integrals (#6085) 2025-06-12 11:53:10 -04:00
Bartłomiej Chmiel dc307270f7
Fix nested hier blocks workers error (#6087)
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
2025-06-12 07:15:46 -04:00
Wilson Snyder 4990b44120 Fix trace hierarchicalName runtime errors (#5668) (#6076). 2025-06-10 20:17:32 -04:00
Paul Swirhun 4925f9ad73
Support 1-bit params with -G and -pvalue (#6051) (#6082) 2025-06-10 17:39:13 -04:00
Paul Swirhun ac06b6fc4f
Fix streaming operator packing order (#5903) (#6077) 2025-06-10 17:23:16 -04:00
Kamil Rakoczy 58ea7ad361
Fix class typedef elaboration (#6080) 2025-06-10 12:03:26 -04:00
Todd Strader d9534ec626
Fix x assign vs init randomization (#6075) 2025-06-09 17:59:01 -04:00
Wilson Snyder 5b2dc52681 Fix array bounds checking with class member selects (#5996) (#5997). 2025-06-07 17:20:48 -04:00
Todd Strader a044697990
Fix signed cast (#6912) (#6068) 2025-06-06 21:13:31 -04:00
Todd Strader d49efa79df
Fix type operator for interface signals (#6050) (#6049) 2025-06-06 11:29:33 -04:00
Ryszard Rozak 1a3fd92063
Tests: Fix t_interface_array2 tests (#6065) 2025-06-06 06:28:29 -04:00
Wilson Snyder ed46878f7b Fix virtual interface array typedef expressions (#6057). 2025-06-04 21:43:46 -04:00