Commit Graph

897 Commits

Author SHA1 Message Date
Geza Lore e0e8503151
Internals: Make all AstBegin constructor arguments explicit (#6464) 2025-09-20 13:16:03 -04:00
Geza Lore d1eda66668
Deprecate clocker attribute and --clk option (#6463)
The only use for the clocker attribute and the AstVar::isUsedClock that
is actually necessary today for correctness is to mark top level inputs
of --lib-create blocks as being (or driving) a clock signal. Correctness
of --lib-create (and hence hierarchical blocks) actually used to depend
on having the right optimizations eliminate intermediate clocks (e.g.:
V3Gate), when the top level port was not used directly in a sensitivity
list, or marking top level signals manually via --clk or the clocker
attribute. However V3Sched::partition already needs to trace through the
logic to figure out what signals might drive a sensitivity list, so it
can very easily mark all top level inputs as such.

In this patch we remove the AstVar::attrClocker and AstVar::isUsedClock
attributes, and replace them with AstVar::isPrimaryClock, automatically
set by V3Sched::partition. This eliminates all need for manual
annotation so we are deprecating the --clk/--no-clk options and the
clocker/no_clocker attributes.

This also eliminates the opportunity for any further mis-optimization
similar to #6453.

Regarding the other uses of the removed AstVar attributes:
- As of 5.000, initial edges are triggered via a separate mechanism
  applied in V3Sched, so the use in V3EmitCFunc.cpp is redundant
- Also as of 5.000, we can handle arbitrary sensitivity expressions, so
  the restriction on eliminating clock signals in V3Gate is unnecessary
- Since the recent change when Dfg is applied after V3Scope, it does
  perform the equivalent of GateClkDecomp, so we can delete that pass.
2025-09-20 15:50:22 +01:00
Wilson Snyder 57c82b9c34 Fix false unique assertions on `else ;` (#6450). 2025-09-17 17:43:36 -04:00
Geza Lore f39d6e6108
Deprecate sensitivity list on public_flat_rw attributes (#6443)
These are no longer required for correct scheduling. They are still
accepted for backward compatibility, but have no effect on simulation
and are dropped in the front-end. Also removed the then redundant
AstAlwaysPublic class.

Fixes #6442
2025-09-16 22:38:53 +01:00
Geza Lore a44907b700
Fix memory leaks - batch 4 (#6439) 2025-09-16 19:22:36 +01:00
Ryszard Rozak c856380fac
Support modports referencing clocking blocks (#4555) (#6436) 2025-09-16 13:25:40 -04:00
Wilson Snyder b455f9b591 Add ASSIGNEQEXPR when use `=` inside expressions (#5567). 2025-09-14 08:28:47 -04:00
Bartłomiej Chmiel 9a6b24fca4
Fix parsing for sequence expressions (#6427)
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
2025-09-12 07:17:26 -04:00
Geza Lore 56927fb955
Fix memory leaks - batch 3 (#6419) 2025-09-11 12:01:36 +01:00
Geza Lore f1396fbced
Fix memory leaks - batch 2 (#6417) 2025-09-10 22:42:45 +01:00
Geza Lore dd11d5a598
Fix memory leaks - batch 1 (#6411) 2025-09-09 22:39:44 +01:00
Geza Lore 83ff8e13ba
Internals: Make bison output have correct debug info (#6409)
1. Move class V3ParseGrammar into V3ParseGrammar.h so editors understand
   it as c++ code
2. Fix #line directives in the bison output file

This together enables us to gdb through V3ParseGrammar, verilog.y, and
the bison generated C code step by step, with all source annotations in
the debug info pointing to the right place (e.g.: you will step to the
right place in verilog.y, then step back to the bison generated switch
statement/loop, and then step into calls in V3ParseGrammar as kind of
expected.
2025-09-09 15:47:45 +01:00
Geza Lore 5ffa05fba0
Fix AddressSanitizer issues (#6406)
These are all genuine bugs, brief descriptions.

1. V3OrderCFuncEmitter.h used to delete a node early that was still
   reference in a graph dump later. Not a big deal, it can be deleted
   later at the end of V3Order.

2. V3Param.cpp: this one is tricky. The variable referenced by
   AstVarXRef was deleted at the end of `visit(AstGenCase*)`, but then
   `visit(AstVarXRef*)` checks `nodep->varp()` (already deleted) to see
   if it's in an interface.

3. V3String::wildMatch is sometimes called with an empty 's' (the string
   we are matching against tha pattern 'p'), in which case it used to go
   off into the woods. Added check on call. An arbitrary number of `*`
   will still match the empty string.

4. V3Task.cpp: There was an error reported for an unsupported construct,
   then a subsequent SEGV. Just signal the error upward so we bail on an
   error in a more graceful way.

5. verylog.y: Some unsupported constructs failed to set the parsed node,
   so some memory thrash made it into some code downstream. Just parse
   these into nullptr.

Also increased the timeout on one test, which sometimes tripped with
asan on GCC during heavy host load.
2025-09-09 13:55:00 +01:00
Wilson Snyder 3549fd1aa0 Add parsing of `$assert*`, `$coverage*` and `$q_*` as still unsupported. 2025-09-06 10:31:08 -04:00
Wilson Snyder 85454f6083 Fix wire array with initial assignment (#6391). 2025-09-05 17:31:17 -04:00
Jakub Wasilewski a364704e3a
Improve `covergroup with function sample` handling (#6387) 2025-09-05 13:16:30 -04:00
Wilson Snyder feea221f39 Fix COVERAGEIGN-ignored `get_inst_coverage` and other covergroup methods (#6383). 2025-09-04 22:18:56 -04:00
Wilson Snyder 33b838f139 Support 'this.super' 2025-09-01 13:07:02 -04:00
Wilson Snyder ac2a75fbb5 Support future sampled value functions. 2025-08-23 21:16:53 -04:00
Igor Zaworski b95a974ff1
Support generic interfaces (#6272) 2025-08-22 06:44:35 -04:00
Geza Lore 327d55d13d
Internals: Fix remaining cppcheck errors (#6319)
Fixed the non const-related issue and added suppressions for the const
ones. With that `make cppcheck` should be clean.
2025-08-21 09:43:37 +01:00
Wilson Snyder bd91b619ad Support `$fread` with missing start (#6125). 2025-08-20 21:19:42 -04:00
Wilson Snyder c90f9e53b7
Add ALWNEVER warning, for `always @*` that never execute (#6291) (#6303) 2025-08-18 12:00:53 -04:00
Wilson Snyder 6a225d5d00 Internals: Remove AstSysFuncAsTask 2025-08-08 05:09:54 -04:00
Wilson Snyder 309129ebcf Add PARAMNODEFAULT error, for parameters without defaults. 2025-08-03 15:27:37 -04:00
Wilson Snyder 36577bb549 Add check for missing 'parameter' on implicit types 2025-08-02 17:02:45 -04:00
Wilson Snyder f3560837ec Add error on missing forward declarations (#6207). 2025-07-26 17:11:35 -04:00
Wilson Snyder 39a5c731ac Tests: Fix missing forward decls (#6202 partial) 2025-07-26 15:48:19 -04:00
Geza Lore 763183f067
Internals: Remove AstWhile::precondsp() (#6219). No functional change intended. 2025-07-23 08:50:39 -04:00
Wilson Snyder 7d43a935bd Add SPECIFYIGN warning for specify constructs that were previously silently ignored. 2025-07-18 19:32:34 -04:00
Wilson Snyder 1f0357ba93 Add NOEFFECT warning, replacing previous `foreach` error. 2025-07-16 08:18:57 -04:00
Wilson Snyder db6b17fdb4 Fix error message 2025-07-15 17:41:08 -04:00
Artur Bieniek f3e109d8c5
Support covergroup extends, etc. (#6160) 2025-07-15 09:31:08 -04:00
Wilson Snyder caf3522364 Support implicit enum declarations with packed dimensions 2025-07-14 19:50:02 -04:00
Ryszard Rozak e2e5d9eaf1
Support disabling a fork from outside that fork (#6174) 2025-07-14 06:51:58 -04:00
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
Ryszard Rozak 8b3a6ba542
Support disable dotted references (#6154) 2025-07-09 16:59:26 -04:00
Wilson Snyder 5a6d5ed96b Support property `iff` and `implies`. 2025-07-03 21:13:04 -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
Wilson Snyder 73ca2ab997 Support `$past_gclk` 2025-07-01 18:00:04 -04:00
Wilson Snyder d455ec6229 Fix `specparam` PATHPULSE broken recent commit (#6142). 2025-06-30 18:33:50 -04:00
Wilson Snyder 916a89761e Add `--work` library-selection option (#5891 partial). 2025-06-29 20:17:27 -04:00
Wilson Snyder 5d32fc56ac Support 'config' parsing, but not functionally 2025-06-28 20:32:19 -04:00
Wilson Snyder f508dadc97 Support `specparam` (#5767). 2025-06-28 08:23:43 -04:00
Wilson Snyder 3defaf8ffb Rename Verilator Config Files to Verilator Control Files.
Avoids conflict with IEEE `config`.  No functional change intended.
2025-06-27 20:38:01 -04:00
Wilson Snyder 6af694b04b Support `$timeformat` with missing arguments (#6113). 2025-06-24 17:30:05 -04:00
Wilson Snyder ad08302e5f Support parameter forward types. 2025-05-19 08:35:38 -04:00
Wilson Snyder 0c8c7fb03c Remove symbol table from parser: Support redeclaring type as non-type; major parsing change (#2412). 2025-05-18 07:13:37 -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