verilator/include
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
..
gtkwave Update libfst from upstream 2025-04-12 18:10:40 -04:00
vltstd Commentary: Changes update 2025-05-22 06:45:39 -04:00
.gitignore
verilated.cpp Fix x assign vs init randomization (#6075) 2025-06-09 17:59:01 -04:00
verilated.h Internals: Rename VL_PACK/VL_UNPACK in prep for future fix. No functional change intended. 2025-05-22 06:54:16 -04:00
verilated.mk.in Add `--trace-saif` for SAIF power traces (#5812) 2025-03-07 10:41:29 -05:00
verilated.v Copyright year update. 2025-01-01 08:30:25 -05:00
verilated_config.h.in Copyright year update. 2025-01-01 08:30:25 -05:00
verilated_cov.cpp Add filtering type option in verilator_coverage (#6030) 2025-05-22 02:42:09 -07:00
verilated_cov.h Copyright year update. 2025-01-01 08:30:25 -05:00
verilated_cov_key.h Copyright year update. 2025-01-01 08:30:25 -05:00
verilated_dpi.cpp Support multidimensional array access via VPI (#2812) (#5573) 2025-01-09 19:04:26 -05:00
verilated_dpi.h Copyright year update. 2025-01-01 08:30:25 -05:00
verilated_fst_c.cpp Fix trace hierarchicalName runtime errors (#5668) (#6076). 2025-06-10 20:17:32 -04:00
verilated_fst_c.h Optimize duplicate timestamps out of traces (#4686) 2025-04-05 14:19:58 -04:00
verilated_fst_sc.cpp Copyright year update. 2025-01-01 08:30:25 -05:00
verilated_fst_sc.h Copyright year update. 2025-01-01 08:30:25 -05:00
verilated_funcs.h Fix streaming operator packing order (#5903) (#6077) 2025-06-10 17:23:16 -04:00
verilated_imp.h Copyright year update. 2025-01-01 08:30:25 -05:00
verilated_intrinsics.h Copyright year update. 2025-01-01 08:30:25 -05:00
verilated_probdist.cpp Internals: Favor preincrements. No functional change. 2025-05-09 21:20:35 -04:00
verilated_profiler.cpp Support profiling nested hierarchical mtasks with verilator_gantt (#5956) 2025-04-24 07:50:07 -04:00
verilated_profiler.h Support profiling nested hierarchical mtasks with verilator_gantt (#5956) 2025-04-24 07:50:07 -04:00
verilated_random.cpp Internals: Favor preincrements. No functional change. 2025-05-09 21:20:35 -04:00
verilated_random.h Internals: Favor preincrements. No functional change. 2025-05-09 21:20:35 -04:00
verilated_saif_c.cpp Fix trace hierarchicalName runtime errors (#5668) (#6076). 2025-06-10 20:17:32 -04:00
verilated_saif_c.h Optimize SAIF writes (#5916) 2025-04-05 15:09:32 -04:00
verilated_saif_sc.h Add `--trace-saif` for SAIF power traces (#5812) 2025-03-07 10:41:29 -05:00
verilated_save.cpp Copyright year update. 2025-01-01 08:30:25 -05:00
verilated_save.h Internals: Fix some legacy casts. No functional change. 2025-05-20 22:51:54 -04:00
verilated_sc.h Copyright year update. 2025-01-01 08:30:25 -05:00
verilated_sc_trace.h Copyright year update. 2025-01-01 08:30:25 -05:00
verilated_std.sv Fix process comparisons (#5896). 2025-03-29 07:16:54 -04:00
verilated_std_waiver.vlt Copyright year update. 2025-01-01 08:30:25 -05:00
verilated_sym_props.h Apply 'make format' 2025-01-10 00:05:16 +00:00
verilated_syms.h Copyright year update. 2025-01-01 08:30:25 -05:00
verilated_threads.cpp Apply 'make format' 2025-05-20 23:46:57 +00:00
verilated_threads.h Add numactl-like automatic assignment of processor affinity (#5911) 2025-04-02 08:27:23 -04:00
verilated_timing.cpp Internals: Cleanup 'error error' on fatals 2024-12-11 08:52:41 -05:00
verilated_timing.h Fix 'experimental/coroutine' file not found on macOS (#5030) (#5031) (#5151) 2024-06-08 08:33:50 -04:00
verilated_trace.h Fix trace hierarchicalName runtime errors (#5668) (#6076). 2025-06-10 20:17:32 -04:00
verilated_trace_imp.h Internals: Favor preincrements. No functional change. 2025-05-09 21:20:35 -04:00
verilated_types.h Add DFG binToOneHot pass to generate one-hot decoders (#6096) 2025-06-16 23:14:24 +01:00
verilated_vcd_c.cpp Fix trace hierarchicalName runtime errors (#5668) (#6076). 2025-06-10 20:17:32 -04:00
verilated_vcd_c.h Optimize duplicate timestamps out of traces (#4686) 2025-04-05 14:19:58 -04:00
verilated_vcd_sc.cpp Copyright year update. 2025-01-01 08:30:25 -05:00
verilated_vcd_sc.h Copyright year update. 2025-01-01 08:30:25 -05:00
verilated_vpi.cpp Internals: Favor preincrements. No functional change. 2025-05-09 21:20:35 -04:00
verilated_vpi.h Copyright year update. 2025-01-01 08:30:25 -05:00
verilatedos.h Add numactl-like automatic assignment of processor affinity (#5911) 2025-04-02 08:27:23 -04:00
verilatedos_c.h Add numactl-like automatic assignment of processor affinity (#5911) 2025-04-02 08:27:23 -04:00