Commit Graph

211 Commits

Author SHA1 Message Date
Ryszard Rozak
a764c70b4a
Fix handling of static keyword in methods (#4649) 2023-10-31 08:15:54 -04:00
Geza Lore
30318a6654 C++11 cleanup 2023-10-28 11:26:48 +01:00
Wilson Snyder
a773a52559 Cleanup some IEEE references 2023-10-19 19:26:36 -04:00
Wilson Snyder
b5828a7ce9 Fix header order botched by clang-format in recent commit. 2023-10-18 06:37:46 -04:00
github action
770cd24f27 Apply 'make format' 2023-10-18 02:50:27 +00:00
Wilson Snyder
431bb1ed16
Support compiling Verilator with gcc/clang precompiled headers (#4579) 2023-10-17 22:49:28 -04:00
Anthony Donlon
60e9827ffe
Support converting parameters inside modules to localparams (#4511) 2023-09-25 11:39:04 -04:00
Mariusz Glebocki
28bd7e5b19
Rework multithreading handling to separate by code units that use/never use it. (#4228) 2023-09-24 22:12:23 -04:00
Wilson Snyder
9f75068059 Cleanup some error messages to properly quote 2023-09-23 08:52:50 -04:00
Wilson Snyder
10c1653e72 Fix ZERODLY to not warn on 'wait(0)'. 2023-09-15 08:53:29 -04:00
Krzysztof Boroński
8d512c3187
Fix variable lifetimes in extern methods (#4414) 2023-08-11 16:52:59 +02:00
Krzysztof Bieganski
9caa79a7ea
Internals: Remove the name field from AstVarRef (#4395) 2023-08-03 02:52:52 -04:00
Wilson Snyder
3c964147be Add MISINDENT lint warning for misleading indentation. 2023-07-01 10:45:25 -04:00
Wilson Snyder
54b4b6b378 Internals: Fix missing calls to cleanFileline. 2023-07-01 08:59:26 -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
4bb876aee5 Fix false IMPLICITSTATIC on package functions. 2023-05-06 19:48:22 -04:00
github action
8a3cb8daa8 Apply 'make format' 2023-05-06 02:37:42 +00: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
add68130b8 Internals: Rename to dumpLevel(), to avoid confusion with make-a-dump() 2023-05-03 18:04:10 -04:00
Peter Monsson
08330bad0b
Fix variables in class methods to be automatic (#4111) (#4137) 2023-04-21 08:07:22 -04:00
Srinivasan Venkataramanan
722ab9306a
Support class method calls without parenthesis (#3902) (#4082) 2023-04-10 19:37:24 -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
Ryszard Rozak
ed1a9309d4
Throw warning if static variable is declared in a loop (#4018)
Signed-off-by: Ryszard Rozak <rrozak@antmicro.com>
2023-03-14 10:03:08 +01:00
Andrew Nolte
fc17ab280a
Add --public-depth to force public to a certain instance depth (#3952) 2023-03-09 21:48:05 -05:00
Andrew Nolte
13c9877099
Add --public-params flag (#3990) 2023-03-08 19:38:26 -05:00
Wilson Snyder
e21198cb2d Add warning on missing class reference #() 2023-03-03 21:06:52 -05:00
Ryszard Rozak
b56e7f6910
Support static function variables (#3830) 2023-01-23 08:35:10 -05:00
Ryszard Rozak
4784daa7dc
Add IMPLICITSTATIC warning when a ftask/function is implicitly static (#3839) 2023-01-05 17:42:05 -05:00
Wilson Snyder
b24d7c83d3 Copyright year update 2023-01-01 10:18:39 -05:00
Krzysztof Bieganski
bb44d4e4f2
Support clocking blocks (#3674) 2022-12-23 07:34:49 -05:00
Larry Doolittle
f27cf4c804
Commentary: Fix spelling in C++ comments (#3797) (#3798) 2022-12-02 18:46:38 -05:00
Wilson Snyder
355c4f76d0 Add error when super.new is not first statement (#3789) 2022-11-30 07:41:57 -05:00
Krzysztof Bieganski
68e1b473e2
Support std::semaphore and typed std::mailbox (#3708)
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2022-11-28 16:53:55 +01:00
Wilson Snyder
25f970eac2 Internals: Fix constructor style. 2022-11-20 15:06:49 -05:00
Geza Lore
3abb65d732 Strengthen AstNode types to AstNodeExpr
Declare every AstNode children and variables as AstNodeExpr where we
statically know this is the appropriate sub-type.
2022-11-20 19:31:28 +00:00
Wilson Snyder
3c77c7bb92 Support and 2022-11-16 21:10:54 -05:00
Krzysztof Bieganski
22243d1e49
Support class type params without defaults (#3693) 2022-10-19 21:59:26 -04:00
Wilson Snyder
880cac2fdd Merge branch 'master' into develop-v5 2022-10-01 11:24:55 -04:00
Kanad Kanhere
159cf0429c
Support linting for top module interfaces (#3635) 2022-10-01 10:48:37 -04:00
Geza Lore
ddb678cc5b Merge branch 'master' into develop-v5 2022-09-22 17:33:36 +01:00
Geza Lore
63c694f65f Streamline dump control options
- Rename `--dump-treei` option to `--dumpi-tree`, which itself is now a
  special case of `--dumpi-<tag>` where tag can be a magic word, or a
  filename
- Control dumping via static `dump*()` functions, analogous to `debug()`
- Make dumping independent of the value of `debug()` (so dumping always
  works even without the debug flag)
- Add separate `--dumpi-graph` for dumping V3Graphs, which is again a
  special case of `--dumpi-<tag>`
- Alias `--dump-<tag>` to `--dumpi-<tag> 3` as before
2022-09-22 17:24:41 +01:00
Geza Lore
95145038b4 Generate AstNode accessors via astgen
Introduce the @astgen directives parsed by astgen, currently used for
the generation child node (operand) accessors. Please see the updated
internal documentation for details.
2022-09-21 14:05:27 +01:00
Geza Lore
ce03293128 Generate AstNode accessors via astgen
Introduce the @astgen directives parsed by astgen, currently used for
the generation child node (operand) accessors. Please see the updated
internal documentation for details.
2022-09-21 13:56:03 +01:00
Geza Lore
7bc7b5372e Merge branch 'master' into develop-v5 2022-09-17 16:12:28 +01:00
Geza Lore
7d88e63bab astgen: generate type specific addNext, remove astNextNull
Generate type specific static overloads of Ast<Node>::addNext, which
return the correct sub-type of the 'this' they were invoked on.

Also remove AstNode::addNextNull, which is now only used in the parser,
implement in verilog.y directly as a template function.
2022-09-17 15:05:22 +01:00
Geza Lore
af305bf280 Merge branch 'master' into develop-v5 2022-09-16 16:24:36 +01:00
Geza Lore
0c70a0dcbf Remove redundant 'virtual' keywords from overridden methods
'virtual' is redundant when 'override' is present, so keep only
'override'.

Add t/t_dist_cppstyle.pl to check for this.
2022-09-16 15:19:38 +01:00
Wilson Snyder
2dc85a5acd Internals: enum constructor cleanups. No functional change intended. 2022-09-15 19:58:10 -04:00
Krzysztof Bieganski
39af5d020e
Timing support (#3363)
Adds timing support to Verilator. It makes it possible to use delays,
event controls within processes (not just at the start), wait
statements, and forks.

Building a design with those constructs requires a compiler that
supports C++20 coroutines (GCC 10, Clang 5).

The basic idea is to have processes and tasks with delays/event controls
implemented as C++20 coroutines. This allows us to suspend and resume
them at any time.

There are five main runtime classes responsible for managing suspended
coroutines:
* `VlCoroutineHandle`, a wrapper over C++20's `std::coroutine_handle`
  with move semantics and automatic cleanup.
* `VlDelayScheduler`, for coroutines suspended by delays. It resumes
  them at a proper simulation time.
* `VlTriggerScheduler`, for coroutines suspended by event controls. It
  resumes them if its corresponding trigger was set.
* `VlForkSync`, used for syncing `fork..join` and `fork..join_any`
  blocks.
* `VlCoroutine`, the return type of all verilated coroutines. It allows
  for suspending a stack of coroutines (normally, C++ coroutines are
  stackless).

There is a new visitor in `V3Timing.cpp` which:
  * scales delays according to the timescale,
  * simplifies intra-assignment timing controls and net delays into
    regular timing controls and assignments,
  * simplifies wait statements into loops with event controls,
  * marks processes and tasks with timing controls in them as
    suspendable,
  * creates delay, trigger scheduler, and fork sync variables,
  * transforms timing controls and fork joins into C++ awaits

There are new functions in `V3SchedTiming.cpp` (used by `V3Sched.cpp`)
that integrate static scheduling with timing. This involves providing
external domains for variables, so that the necessary combinational
logic gets triggered after coroutine resumption, as well as statements
that need to be injected into the design eval function to perform this
resumption at the correct time.

There is also a function that transforms forked processes into separate
functions.

See the comments in `verilated_timing.h`, `verilated_timing.cpp`,
`V3Timing.cpp`, and `V3SchedTiming.cpp`, as well as the internals
documentation for more details.

Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2022-08-22 13:26:32 +01:00
Geza Lore
c266739e9f Merge branch 'master' into develop-v5 2022-08-05 12:17:57 +01:00