Commit Graph

19 Commits

Author SHA1 Message Date
Aleksander Kiryk
c2b09e35f8
Support unpacked structs (#3802) 2022-12-20 19:22:42 -05:00
Wilson Snyder
86b07423a9 Fix ENUMVALUE on parameter (#3777). 2022-12-11 13:28:24 -05:00
Geza Lore
65e08f4dbf Make all expressions derive from AstNodeExpr (#3721).
Apart from the representational changes below, this patch renames
AstNodeMath to AstNodeExpr, and AstCMath to AstCExpr.

Now every expression (i.e.: those AstNodes that represent a [possibly
void] value, with value being interpreted in a very general sense) has
AstNodeExpr as a super class. This necessitates the introduction of an
AstStmtExpr, which represents an expression in statement position, e.g :
'foo();' would be represented as AstStmtExpr(AstCCall(foo)). In exchange
we can get rid of isStatement() in AstNodeStmt, which now really always
represent a statement

Peak memory consumption and verilation speed are not measurably changed.

Partial step towards #3420
2022-11-03 16:02:16 +00:00
Geza Lore
599d23697d
IEEE compliant scheduler (#3384)
This is a major re-design of the way code is scheduled in Verilator,
with the goal of properly supporting the Active and NBA regions of the
SystemVerilog scheduling model, as defined in IEEE 1800-2017 chapter 4.

With this change, all internally generated clocks should simulate
correctly, and there should be no more need for the `clock_enable` and
`clocker` attributes for correctness in the absence of Verilator
generated library models (`--lib-create`).

Details of the new scheduling model and algorithm are provided in
docs/internals.rst.

Implements #3278
2022-05-15 16:03:32 +01:00
Wilson Snyder
48a098b041 Tests: Fix some force/release coverage holes. 2022-01-16 16:53:06 -05:00
Wilson Snyder
5eded789aa Fix test 2022-01-09 19:29:30 -05:00
Wilson Snyder
2ccf49031b Fix $display of signed/unsigned without format (#3207). 2021-11-17 18:50:52 -05:00
Geza Lore
708abe0dd1 Introduce model interface class, make $root part or Syms (#3036)
This patch implements #3032. Verilator creates a module representing the
SystemVerilog $root scope (V3LinkLevel::wrapTop). Until now, this was
called the "TOP" module, which also acted as the user instantiated model
class. Syms used to hold a pointer to this root module, but hold
instances of any submodule. This patch renames this root scope module
from "TOP" to "$root", and introduces a separate model class which is
now an interface class. As the root module is no longer the user
interface class, it can now be made an instance of Syms, just like any
other submodule. This allows absolute references into the root module to
avoid an additional pointer indirection resulting in a potential speedup
(about 1.5% on OpenTitan). The model class now also contains all non
design specific generated code (e.g.: eval loops, trace config, etc),
which additionally simplifies Verilator internals.

Please see the updated documentation for the model interface changes.
2021-06-30 16:35:40 +01:00
Geza Lore
60d5f0e86b
Emit model implementation as loose methods. (#3006)
This patch introduces the concept of 'loose' methods, which semantically
are methods, but are declared as global functions, and are passed an
explicit 'self' pointer. This enables these methods to be declared
outside the class, only when they are needed, therefore removing the
header dependency. The bulk of the emitted model implementation now uses
loose methods.
2021-06-13 14:33:11 +01:00
Geza Lore
eea7e1bd2a
Do not emit leading spaces on blank lines (#3007) 2021-06-04 15:00:13 +01:00
Wilson Snyder
2ca21c01d2 Internal coverage improvements 2021-03-28 20:03:08 -04:00
Wilson Snyder
c00c26c705 Remove some comments emitted in output.
* Comments were disabling some optimizations.
* Suspect rarely referred to.
* Sometimes incorrectly placed due to other optimizations.
2020-12-15 22:55:17 -05:00
Yutetsu TAKATSUKASA
ff3d35ca61
Support unpacked array port in protect-lib and hierarchical verilation (#2672)
* Add a test to use unpacked array port in hierarchical verilation and protect-lib.

* V3EmitV supports unpacked array variables

* Can Emit local unpacked array properly

* Update golden of t_debug_emitv

* Support unpacked array port in protect-lib

* Remove t_prot_lib_unpacked_bad test as unpacked array is supported now.
2020-12-09 08:29:45 +09:00
Wilson Snyder
8e06b1e925 Misc internal coverage cleanups 2020-12-07 23:15:29 -05:00
Wilson Snyder
b684995292 Support $random and $urandom seeds. 2020-11-19 21:32:33 -05:00
Wilson Snyder
abfee1270f Improve internal code coverage 2020-11-18 22:21:48 -05:00
Wilson Snyder
e3cf5c07e4 Internal coverage improvements. No functional change. 2020-10-13 21:13:52 -04:00
Wilson Snyder
87e4a86fbb Internal coverage improvements 2020-09-18 21:27:36 -04:00
Wilson Snyder
993115d30a Cleanup and test EmitV for internal coverage 2020-09-07 12:58:30 -04:00