Commit Graph

2319 Commits

Author SHA1 Message Date
Wilson Snyder
0f4daa12e4 Ignore sv-test's `pragma protect end 2021-07-29 09:00:10 -04:00
Wilson Snyder
6bad0e14ce Support timeunit/timeprecision in $unit. 2021-07-29 08:40:41 -04:00
Geza Lore
cdeb6e792f Add --instr-count-dpi option, change default to 200
This replaces the former static AstNode::INSTR_COUNT_DPI, and makes it
user adjustable to fit the design.

Fixes #3068.
2021-07-25 16:40:12 +01:00
Wilson Snyder
f937e3282f Tests: Ignore DepSet hash numbers. (#3083) 2021-07-25 11:20:19 -04:00
Steven Hugg
18b0f6387d
Add XML ccall, constpool, initarray, and if/while begins (#3080)
* EmitXml: Added <ccall>, <constpool>, <initarray>/<inititem>, wrapped children of <if> and <while> with <begin> elements to prevent ambiguity
* EmitXml: added signed="true" to signed basicdtypes
2021-07-24 21:06:06 -04:00
Wilson Snyder
b90fce55f4 Includes: Refactor verilated.h and deprecate verilated_heavy.h (#2701). 2021-07-24 10:00:33 -04:00
Geza Lore
1de33b9fb7 Support localparams in tasks/functions 2021-07-23 20:34:49 +01:00
Geza Lore
90c917ee83 Enable now supported tests for string array initializers
Fixes #2895.
2021-07-23 17:21:15 +01:00
Geza Lore
4ab4c0c8ba Emit parameter values as 'static constexpr' instead of enum
All parameters that are required in the output are now emitted as
'static constexpr, except for string or array of strings parameters,
which  are still emitted as 'static const' (required as std::string is
not a literal type, so cannot be constexpr).  This simplifies handling
of parameters and supports 'real' parameters.
2021-07-23 17:20:26 +01:00
Wilson Snyder
13933743ad Suppress creating change_request if not needed. 2021-07-22 20:50:03 -04:00
Geza Lore
ab4063f098 Emit implementations into separate files based on required headers.
This patch partitions AstCFuncs under an AstNodeModule based on which
header files they require for their implementation, and emits them
into separate files based on the distinct dependency sets. This helps
with incremental recompilation of the output C++.
2021-07-22 18:01:07 +01:00
Geza Lore
1166728a8d Tests: make t_trace_*two* tests less sensitive to file names
No functional change intended
2021-07-19 17:48:41 +01:00
Geza Lore
17cc452f79 Add V3VariableOrder pass
A separate V3VariableOrder pass is now used to order module variables
before Emit. All variables are now ordered together, without
consideration for whether they are ports, signals form the design, or
additional internal variables added by Verilator (which used to be
ordered and emitted as separate groups in Emit). For single threaded
models, this is performance neutral. For multi-threaded models, the
MTask affinity based sorting was slightly modified, so variables with no
MTask affinity are emitted last, otherwise the MTask affinity sets are
sorted using the TSP sorter as before, but again, ports, signals, and
internal variables are not differentiated. This yields a 2%+ speedup for
the multithreaded model on OpenTitan.
2021-07-12 14:53:40 +01:00
Geza Lore
8a9d6d225b Internals: Add source file/line info to BROKEN_RTN messages 2021-07-11 16:50:05 +01:00
Wilson Snyder
687dd440a9 Removed deprecated Verilator tarball generation makefile rules. 2021-07-11 10:25:24 -04:00
Wilson Snyder
f1bb0bb725 Tests: Whitespace check all git files 2021-07-11 10:25:13 -04:00
Wilson Snyder
f55177a49f Tests: Fix coverage holes. No functional change. 2021-07-10 07:11:50 -04:00
Wilson Snyder
61e2e55ba5 Internals: Fix coverage holes. No functional change. 2021-07-09 18:11:59 -04:00
Geza Lore
a4f5d95648 Fix -G to treat simple integer literals as signed (#3060)
The -G option now correctly parses simple integer literals as signed
numbers, which is in line with the standard and is significant when
overriding parameters without a type specifier.

Fixes #3060
2021-07-08 13:42:25 +01:00
Wilson Snyder
36599133bf Add --prof-c to pass profiling to compiler (#3059). 2021-07-07 19:12:52 -04:00
Dan Petrisko
8c705ee145
Support middle-of-design nested topmodules (#3026) 2021-07-07 15:00:29 -04:00
Dan Petrisko
c5c5f11e16
Tests: Adding failing test case for source synchronous signals (#3038) 2021-07-07 14:00:17 -04:00
Morten Borup Petersen
fd0446f481
Internals: Add .dot graph visualization of ThreadSchedule (#3048)
* Move MTaskState to ThreadSchedule

MTaskState does not concern itself with sandbagging, and thus solely contains information related to the finalized schedule, i.e., completion time, thread ID and next MTask on thread.

* Add .dot graph visualization of ThreadSchedule

Follow-up to #2779.

This commit adds the creation of .dot files - used by GraphViz - to visualize how mtasks are statically scheduled across the set of specified threads.
We visualize each thread as a row, with nodes of a row being the mtasks scheduled for the given thread. The width of the mtask nodes are proportional to their cost. MTask dependencies are shown using an edge between the source and sink mtasks.
2021-07-06 07:06:00 -04:00
Geza Lore
fb56f4f880 Tests: make t_prot_lib*.pl name mangling deterministic
This is to facilitate diffing generated files in tests.
2021-07-02 00:21:24 +01:00
Geza Lore
d4e73e215e Tests: fail test if vcddiff aborts, fix failing tests
Tests used to silently pass when vcddiff aborted. Now fixed. Updated
large array trace reference files for FST, added same reference files
for VCD.

Developers need to update their local vcddiff.
2021-07-01 23:22:25 +01:00
Geza Lore
af27702188 Fix type parameter resolution with hash collision.
We incorrectly treated two different struct types the same when passed
as an actual parameter to a `parameter type` parameter in an instance,
if the actual parameter expression both hash to the same value and the
structs have the same struct name. This is now corrected.

Fixes #3055.
2021-07-01 16:52:29 +01:00
Morten Borup Petersen
2c813488f4
Tests: Add simulator benchmarking data option for regression tests (#3054)
This commit adds the '--simbenchmark' option to the regression test compile command.
The option is not intended as a fully-fledged benchmarking infrastructure, but rather a
utility for easily generating cycle- and execution time information when executing a verilated test.

As an example use case, the included test file shows how optimization level is varied across
three different builds+simulations, with the statistics for each run output to the same file in
the output directory.

Future work:
- 'sim_time' in the generated top-level main file should be a parameter.
- Given the above, the test execution script from verilog-sim-benchmark can be integrated
to generate better estimates of cycles/second through varying 'sim_time' over multiple executions.
2021-07-01 11:17:55 -04: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
2825940fad Fix dtype when simplifying masked shift.
Fixes #3044
2021-06-25 18:06:43 +01:00
Geza Lore
a198a3c1e1 Add extern "C" to function declarations in VPI tests.
These are necessary to link the executables. So far we have been saved
by one of the generated headers forward declaring these functions with
extern "C", but changing that header would break these tests.
2021-06-24 16:48:58 +01:00
Yutetsu TAKATSUKASA
ec4eb18846
Fiix incorrect result by bit tree opt (#3023) (#3030)
* Add a test to reproduce #3023. Also applied verilog-mode formatting.

* use unique_ptr. No functional change is intended.

* Introduce restorer that reverts changes during iterate() if failed.
2021-06-21 07:28:39 +09:00
Wilson Snyder
2ee52222e2 Tests: Add test (#2912). 2021-06-19 14:39:34 -04:00
Wilson Snyder
c11cd18491 In XML, show pinIndex information (#2877). 2021-06-19 13:41:41 -04:00
Geza Lore
9eafca5e28
Remove deprecated --no-relative-cfuncs (#3024) 2021-06-16 23:17:43 -04:00
Geza Lore
a8f83d5758
Construct AstExecGraph implementation outside of V3EmitC. (#3022)
The goal of this patch is to move functionality related to constructing
the thread entry points and then invoking them out of V3EmitC (and into
V3Partition). The long term goal being enabling V3EmitC to emit
functions partitioned based on header dependencies. V3EmitC having to
deal with only AstCFunc instances and no other magic will facilitate
this.

In this patch:
- We construct AstCFuncs for each thread entry point in
V3Partition::finalize and move AstMTaskBody nodes under these functions.
- Add the invocation of the threads as text statements within the
AstExecGraph, so they are still invoked where the exec graph is located.
(the entry point functions are still referenced via AstCCall or
AstAddOrCFunc, so lazy declarations of referenced functions are created
automatically).
- Explicitly handle MTask state variables (VlMTaskVertex in
verilated_threads.h) within Verilator, so no need to text bash a lot of
these any more (some text refs still remain but they are all created
next to each other within V3Partition.cpp).

The effect of all this on the emitted code should be nothing but some
identifier/ordering changes. No functional change intended.
2021-06-16 12:18:56 +01:00
Geza Lore
c75a686081
Internals: Update to clang-format-11 (#3021) 2021-06-14 14:50:40 -04:00
Geza Lore
24b5215cf9 Add --enable-m32 to configure 2021-06-14 00:37:59 +01:00
Wilson Snyder
13ddd0bc1c Fix error on unsupported recursive functions (#2957). 2021-06-13 12:38:31 -04:00
Wilson Snyder
31121141db Convert pipe filter example to python 2021-06-13 12:03:53 -04:00
Wilson Snyder
9d3e800311 Commentary 2021-06-13 12:03:53 -04:00
Geza Lore
7280307a39 Implement DPI import/export as loose functions 2021-06-13 15:06:28 +01:00
Geza Lore
c207e98306
Implement a distinct constant pool (#3013)
What previously used to be per module static constants created in
V3Table and V3Prelim are now merged globally within the whole model and
emitted as part of a separate constant pool. Members of the constant
pool are global variables which are declared lazily when used (similar to
loose methods).
2021-06-13 15:05:55 +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
c67fe02f06 Do not generate debug info in tests
Pointless and takes up a lot of cache space in CI, so remove -ggdb and
associated debug options from tests.
2021-06-13 02:55:29 +01:00
Geza Lore
5555f20bd2 Improve ccache-report 2021-06-09 19:14:11 +01:00
Geza Lore
0edf1f0c94
Add ccache-report target to standard Makefile (#3011)
Using the standard model Makefile, when in addition to an explicit
target, the target 'ccache-report' is also given, a summary of ccache
hits/misses during this invocation of 'make' will be prited at the end
of the build.
2021-06-07 00:56:30 +01:00
Wilson Snyder
31bb73e3de Fix MCD close also closing stdout (#2931). 2021-06-06 19:32:48 -04:00
Wilson Snyder
1e89392e76 Add --expand-limit argument (#3005). 2021-06-06 10:27:01 -04:00
Wilson Snyder
1f19e8e206 Tests: Add test case for #2895. 2021-06-06 09:17:56 -04:00
Geza Lore
eea7e1bd2a
Do not emit leading spaces on blank lines (#3007) 2021-06-04 15:00:13 +01:00
Julien Margetts
1f331bd94f
Fix part select issues in LATCH warning. (#2948) (#2938) 2021-06-01 09:01:18 -04:00
Wilson Snyder
2143bcfad5 Fix constant function calls with uninit value (#2995). 2021-05-31 22:46:41 -04:00
Geza Lore
e1f9fffb42
Fix --protect-ids when using SV classes (#2994)
A few names were incorrectly mangled, which made --protect-ids produce
invalid output when certain SV class constructs were uses. Now fixed and
added a few extra tests to catch this.
2021-05-31 13:40:22 +01:00
Wilson Snyder
aba3883092 Commentary on MULTIDRIVEN (#2972). 2021-05-19 08:14:14 -04:00
Geza Lore
9699192de8
Don't merge bit select assignments in C code (#2971) 2021-05-18 14:28:48 -04:00
Yutetsu TAKATSUKASA
31779b8b8b
Format time string using integer (#2940)
Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>
2021-05-16 19:01:03 +09:00
Geza Lore
38cab569ed
Add --reloop-limit argument (#2960)
Add --reloop-limit argument
2021-05-15 18:04:40 +01:00
Yutetsu TAKATSUKASA
00cedf3797
Tests: Add a test to check if there is overflow or rounding (#2945) 2021-05-11 22:27:31 +09:00
Geza Lore
267c6f6dce
Improve Reloop to accept constant index offsets. (#2939)
V3Reloop now can roll up indexed assignments between arrays if there is a
constant offset between indices on the left and right hand sides, e.g.:

a[0] = b[2];
a[1] = b[3];
...
a[x] = b[x + 2];
2021-05-10 18:01:11 +01:00
Geza Lore
f6c0108c86
Optimize large lookup tables to static data (#2926)
Implements #2925
2021-05-08 20:04:56 +01:00
Jonathan Drolet
37d68d39c8
Support --trace-fst for SystemC with CMake (#2927) 2021-05-08 08:42:00 -04:00
Yutetsu TAKATSUKASA
5e56f4d11b
Tests: Enable undefined behavior sanitizor when --sanitize is set. (#2923) 2021-05-08 08:20:26 -04:00
Jonathan Drolet
2bf248bf60
Add TRACE_THREADS to CMake (#2934) 2021-05-08 08:18:08 -04:00
Yutetsu TAKATSUKASA
1e4839e5d1
Fix casting to integer not to cause integer overflow. (#2930) 2021-05-07 12:00:36 -04:00
Todd Strader
b2139f65d8
VPI memory access for packed arrays (#2922) 2021-05-07 07:17:54 -04:00
Yutetsu TAKATSUKASA
8624ce6a84
Stop checking dtype for better optimization chance in BitOpTree (#2909)
* Tests: Add more case that does not match native C++ width (8, 16, 32 or 64).

* Use AstVarRef::same() instead of AstNode::sameGateTree() because the latter checks dtype in addition to scope.

AstVarRef may have different minWidth in some cases,
but the difference should be ignored in the context of bitOpTree optimization.
2021-05-04 10:40:16 +09:00
Wilson Snyder
e68788d914 Fix initialization of assoc in assoc array (#2914). 2021-05-03 19:37:04 -04:00
Krzysztof Bieganski
5290062549
Fix bounds check in VL_SEL_IWII (#2910) 2021-05-03 17:59:41 -04:00
Yutetsu TAKATSUKASA
d77c9da983
Tests: Add a case to cover the line using m_frozenNodes. (#2915) 2021-05-02 06:12:38 +09:00
Udi Finkelstein
422c076fec
Support ignoring "`pragma protect ..." (#2886)
This support code merely adds the capability to skip over the encrypted
parts. Many models have unencrypted module interfaces with ports, and
only encrypt the critical parts.
2021-04-26 18:16:24 -04:00
Todd Strader
12416bc0a3
Scope module fix (#2893) 2021-04-26 09:50:25 -04:00
Yutetsu TAKATSUKASA
4351abfe71
Fix assertion failure in bitOpTree opt (#2899)
* Tests: Add another testcase that triggers assertion failure in bitOpTree opt.

* Fix assertion failure in bitOpTree opt reported in #2891. Consider the follwoing case.
CCast -> WordSel -> VarRef(leaf)

* Make sure that m_bitPolarity is expanded enough.
2021-04-25 11:46:05 +09:00
Wilson Snyder
aedd16225a Tests: Don't expose version numbers 2021-04-24 10:33:49 -04:00
Wilson Snyder
8749f545b6 Partial fix to avoid init error on lint-only (#2895) 2021-04-24 09:49:23 -04:00
Todd Strader
f446295274
Public interface params (#2901) 2021-04-21 13:46:13 -04:00
Todd Strader
f450d51de1
expose packed vectors via the VPI (#2900) 2021-04-21 12:35:18 -04:00
Wilson Snyder
dd0c2cac9b Fix V3Premit infinite loop on always read-and-write (#2898). 2021-04-21 09:21:06 -04:00
Graham Rushton
6660627558
Fix concat of long hashed names in traces etc (#2854) 2021-04-20 09:08:29 -04:00
Wilson Snyder
c443e229ee Fix URL references. 2021-04-18 11:52:29 -04:00
Wilson Snyder
2e9e4ae110 Add an URL on warnings to point to the manual's description. 2021-04-18 10:17:05 -04:00
Yutetsu TAKATSUKASA
56dd58d259
Fix assertion failure in bitOpTree (#2892)
* Tests: Add a test to reproduce #2891

* Fix assertion failure in binary op tree opt.
2021-04-17 05:50:30 +09:00
Todd Strader
53a6830f71
Fix cast from packed, typedef'ed interface signal (#2884) 2021-04-16 15:25:47 -04:00
David Metz
f5ad5cf034
Fix dumping waveforms to multiple FST files (#2889) 2021-04-14 16:52:14 -04:00
Todd Strader
70c1eda174
Fix package reported as vpiModule (#2885) 2021-04-12 15:00:36 -04:00
Wilson Snyder
adce7ecf4b Documentation has been rewritten into a book format. 2021-04-11 18:55:06 -04:00
Udi Finkelstein
23c243bb82
Add support for null ports (#2875) 2021-04-09 10:39:46 -04:00
Wilson Snyder
e2c11cceb8 Fix select of with index variable (#2880). 2021-04-08 19:35:03 -04:00
Àlex Torregrosa
2b2680770b
Improve scope types in FST and VCD traces (#2805). 2021-04-07 09:55:11 -04:00
Yutetsu TAKATSUKASA
6a31b19224
Tests: Add a test to improve code coverage of V3Const.cpp (#2878) 2021-04-07 22:37:31 +09:00
Yutetsu TAKATSUKASA
8d0f7cdac8
Tests: Add a test to check if shortcut operators are properly handled. (#2869) 2021-04-07 22:26:40 +09:00
Àlex Torregrosa
a29ac44af9
Add FST SystemC tracing (#2806) 2021-04-06 16:18:58 -04:00
Geza Lore
4f36e3e6c9
Fix incorrect condition in varNotReferenced (#2873)
The intention was to not merge impure assignments, but the actual
predicate failed if the assignment was indeed pure.

This fix gains 1.5% speed on SweRV EH1.
2021-04-03 12:57:06 -04:00
Wilson Snyder
273fcce095 Fix test error in last commit 2021-04-01 19:51:22 -04:00
Udi Finkelstein
0ea5af40c5
Add PINNOTFOUND warning in place of "Pin not found" error (#2868) 2021-04-01 18:17:42 -04:00
Wilson Snyder
a9f4129b6b Tests: Add test for (#1613) 2021-04-01 09:03:38 -04:00
Wilson Snyder
c8d8e95d52 Tests: Honor make_top_shell=>0 (#2847). 2021-04-01 08:52:48 -04:00
Wilson Snyder
c62546c761 Add --coverage-max-width (#2853). 2021-03-29 18:54:51 -04:00
Wilson Snyder
6d3ec160e1 Internal coverage improvements 2021-03-28 20:30:22 -04:00
Wilson Snyder
f26a7c2a5d Fix --comp-limit-parens with real data types 2021-03-28 20:18:18 -04:00
Wilson Snyder
2ca21c01d2 Internal coverage improvements 2021-03-28 20:03:08 -04:00
Rupert Swarbrick
d6c2e2faf6
Allow overlaps in priority case statements (#2864)
This will still warn if a case item is completely covered by previous
items, but will no longer complain about overlaps like this:

    priority casez (foo_i)
      2'b ?1: bar_o = 3'd0;
      2'b 1?: bar_o = 3'd1;

Before, there was a warning for the second statement because the first
two patterns match 2'b11.
2021-03-28 19:57:36 -04:00
Wilson Snyder
05db4e41cd Add better suggestions on some bad options. 2021-03-27 13:14:43 -04:00
Todd Strader
ee25114a00
interface localparam access (#2859) 2021-03-26 18:27:38 -04:00
Todd Strader
87728a9ee3
Fix --public-flat-rw / DPI issue (#2858) 2021-03-26 18:24:31 -04:00
Yutetsu TAKATSUKASA
4e41c13501
Structurize option parser (#2809)
Add V3OptionsParser that can suggest correct option.


Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>
Co-authored-by: github action <action@example.com>
2021-03-26 22:48:24 +09:00
Wilson Snyder
7ea014dab5 Fix false WIDTHCONCAT on casted constant (#2849). 2021-03-23 19:49:57 -04:00
Wilson Snyder
b6c393e9f0 Add VerilatedCovContext::forcePerInstance (#2793). 2021-03-19 22:24:00 -04:00
Wilson Snyder
29505ef013 Support arrayed parameter functions partial (#2846) 2021-03-19 18:44:26 -04:00
Wilson Snyder
a159c41219 Fix USERINFO etc to show message with no arguments 2021-03-18 18:46:07 -04:00
Wilson Snyder
07de647cd7 Tests: On first file_identical miscompare look for others 2021-03-18 18:45:34 -04:00
Wilson Snyder
334e42b38e Cleanup REDEFMACRO to not show two separate warnings 2021-03-17 20:33:31 -04:00
Wilson Snyder
96f9f8558b Mark --no-relative-cfuncs as scheduled for deprecation. 2021-03-17 18:59:45 -04:00
Wilson Snyder
c20bced485 Fix --output-split with class extends (#2839). 2021-03-17 18:25:54 -04:00
Wilson Snyder
dfab80fab1 Fix false TIMESCALEMOD on generate-ignored instances (#2838). 2021-03-16 22:52:29 -04:00
Wilson Snyder
38f6a467e9 Fix --timescale-override not suppressing TIMESCALEMOD (#2838). 2021-03-16 22:44:13 -04:00
Wilson Snyder
26c0fa0a6a Fix --timescale-override not suppressing TIMESCALEMOD (#2838). 2021-03-16 22:42:28 -04:00
Wilson Snyder
12eb4e85ac Changed TIMESCALEMOD from error into a warning. (#2838) 2021-03-16 21:58:15 -04:00
Wilson Snyder
8350c381c2 Add EOFNEWLINE warning when missing a newline at EOF. 2021-03-14 21:23:48 -04:00
Wilson Snyder
ba1f53a070 Improve DEFPARAM warning text. 2021-03-14 20:37:50 -04:00
Wilson Snyder
9dcda6947d Fix unpacked-in-class pattern assignment 2021-03-13 13:39:29 -05:00
Wilson Snyder
e3788e871e Fix unpacked-in-class array reference assignments 2021-03-13 13:04:13 -05:00
Wilson Snyder
ce79c4ebf9 Fix class unpacked-array compile error (#2774). 2021-03-13 12:47:19 -05:00
Wilson Snyder
67853e2f29 Tests: Add t_prof test. 2021-03-13 12:29:14 -05:00
Wilson Snyder
b201b6257b Tests: Improve coverage when not expanding 2021-03-13 10:22:32 -05:00
Wilson Snyder
d1becbb793 Tests: Fix gmon file not always flushing 2021-03-12 23:05:56 -05:00
Wilson Snyder
21e9794fd7 Tests: Mark some tests lint only 2021-03-12 16:06:47 -05:00
Wilson Snyder
b52b063c16 Tests: Use common TEST_ error reporting. 2021-03-12 12:43:28 -05:00
Wilson Snyder
2feb46fc5d Tests: Refactor t_vpi_time_cb to avoid shared object 2021-03-12 12:08:11 -05:00
Wilson Snyder
44478a53c2 comps 2021-03-12 09:44:21 -05:00
Wilson Snyder
29ed866061 Fix range inheritance on port without data type (#2753). 2021-03-11 19:22:19 -05:00
Wilson Snyder
e88dff6929 Tests: Improve t_mod_interface_array4 2021-03-11 13:32:38 -05:00
Wilson Snyder
7469166c38 Fix or-reduction on different scopes broken in 4.110 (#2828). 2021-03-10 18:08:11 -05:00
Wilson Snyder
9483ebefae Internal code coverage cleanups. 2021-03-07 21:05:15 -05:00
Wilson Snyder
6ff1911110 Tests: Cover some internal code coverage issues 2021-03-07 13:52:37 -05:00
Wilson Snyder
2cad22a22a
Add simulation context (VerilatedContext) (#2660). (#2813)
**   Add simulation context (VerilatedContext) to allow multiple fully independent
      models to be in the same process.  Please see the updated examples.
**   Add context->time() and context->timeInc() API calls, to set simulation time.
      These now are recommended in place of the legacy sc_time_stamp().
2021-03-07 11:01:54 -05:00
Wilson Snyder
47dcbd4b8a Internal: Remove deprecated/insecure functions. No functional change intended. 2021-03-06 10:34:03 -05:00
Wilson Snyder
92f02c9db7 Tests: Adjust eta 2021-03-03 18:58:17 -05:00
Wilson Snyder
4fa41c5dd8 Tests: Add default filename check to context tests 2021-03-02 20:31:49 -05:00
David Turner
e81abdb616
Fix slice-assign overflow bug (#2803) (#2811) 2021-03-01 18:20:56 -05:00
Wilson Snyder
81417a2889 Tests: Misc test updates for context prep. 2021-02-28 10:48:27 -05:00
Wilson Snyder
dad86b9a84 Tests: Fix leak found by previous commit 2021-02-25 20:38:38 -05:00
Wilson Snyder
0b501df959 Tests: Rename 2021-02-25 20:05:54 -05:00
Wilson Snyder
57d1404f40 Tests: Cleanup to return instead of exit 2021-02-25 19:26:36 -05:00
Wilson Snyder
2f8fa75691 Tests: On format make tests executable 2021-02-25 19:24:41 -05:00
Wilson Snyder
00c3bafe7d Tests: With --gdbsim build with ggdb 2021-02-25 19:20:11 -05:00
Wilson Snyder
c95e606c0a Fix range inheritance on port without data type (#2753). 2021-02-24 18:21:13 -05:00
Wilson Snyder
8c2ee6c5ab With -DVL_NO_LEGACY hide all outdated API routines 2021-02-22 22:59:23 -05:00
Wilson Snyder
0f8e494c76 Tests: Add t_verilated_legacy 2021-02-21 21:49:55 -05:00
Wilson Snyder
9650aefa42 Internals: Cleanup unneeded {}. No functional change 2021-02-21 21:25:21 -05:00
Yutetsu TAKATSUKASA
bb5384bc50
Optimize bit op tree #2186, #2632, and #2633 (#2751)
* Tests:Add some more signals to t_const_opt_red.v

* Optimize bit op trees such as ~a[2] & a[1] & ~a[0] to 3'b010 == (3'111 & a)

* Update src/V3Const.cpp

Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>

* Update src/V3Const.cpp

Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>

* Update src/V3Const.cpp

Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>

* Apply clang-format

* Don't edit and-or tree.

* Call matchBitOpTree() after V3Expand does its job.

* Internals: Rename newNodep -> newp. No functional change is intended.

* Internals: Remove m_sels. No functional change is intended.

* Internals: Remove stringstream. No functional change is intended.

* Internals: Use V3Number::bitIs1(). No functional change is intended.

* Internals: Use V3Number instead of std::map. Resolved laek. Result should be same.

* Internals: Resolve overload of setPolarity. No functional change is intended.

* Internals: Pass failure reason. No functional change is intended.

* Internals: Add VNUser::toPtr(). No functional change is intended.

* Internals: Use user4 instead of std::map. No functional change is intended.

* Catch up with the AST style aftre V3Expand

* Internals: Rename Context to VarInfo. No functional change is intended.

* Add some more test case

* tests:Add stats to tests
Update stats in t_merge_cond.pl as matchBitopTree does some of them.

* insert CCast if necessary

* small optimization to remove redundant bit mask

* No quick exit even when unoptimizable node is found.

* Simplify removing redundant And

* simplify

* Revert "Internals: Add VNUser::toPtr(). No functional change is intended."

This reverts commit f98dce10db.

* Consider AstWordSel and cleanup

* Update test

* Update src/V3Const.cpp

Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>

* Update src/V3Const.cpp

Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>

* Update src/V3Const.cpp

Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>

* Update src/V3Const.cpp

Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>

* Update src/V3Const.cpp

Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>

* Update src/V3Const.cpp

Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>

* Apply clang-format

* Internals: rename variables. No functional change is intended.

Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>
Co-authored-by: github action <action@example.com>
2021-02-21 18:11:33 +09:00
Wilson Snyder
fd6edd90bc Fix little endian interface pin swizzling (#2475). 2021-02-20 22:11:20 -05:00
Wilson Snyder
191f76dd90 Increase LINE_TOKEN_MAX (#2752). 2021-02-20 20:55:38 -05:00
Wilson Snyder
975c1b39a9 Fix little endian packed array pattern assignment (#2795). 2021-02-20 20:29:28 -05:00
Wilson Snyder
aa99833580 Tests: Show (non-)per-instance coverage 2021-02-18 19:20:53 -05:00
Yutetsu TAKATSUKASA
c1b6faff6d
Add more patterns to t_const_opt_red.v (#2792) 2021-02-18 19:28:30 +09:00
Wilson Snyder
22e299e78e Support concat selection (#2721). 2021-02-17 23:03:47 -05:00
Wilson Snyder
d559190e9e Tests for future concat select (#2721) 2021-02-17 22:57:52 -05:00
Wilson Snyder
c5e5be8e99 Commentary 2021-02-16 22:40:21 -05:00
Wilson Snyder
2b2fe13e79 Tests: Add unsupported test for interface typedef (#2783) 2021-02-16 22:31:30 -05:00
Wilson Snyder
95b0e9eef2 Tests: Add missing sc_time_stamp calls. 2021-02-16 20:34:44 -05:00
Wilson Snyder
e44563fddc Tests: Use vl_time_stamp64 where reasonable 2021-02-16 20:14:30 -05:00
Wilson Snyder
43cf5693d1 Fix shifts by > 32 bit values (#2785). 2021-02-14 11:15:12 -05:00
Wilson Snyder
20b3f0efa0 Fix class extends with VM_PARALLEL_BUILDS (#2775). 2021-02-13 17:29:34 -05:00
Wilson Snyder
36eb952b60 Tests: Fix mising init 2021-02-03 19:43:29 -05:00
Wilson Snyder
99afffa949 Tests: Add some verbose statements. 2021-02-03 19:38:44 -05:00
Wilson Snyder
ae311200bf Tests: Pass tool to allow ifdefs in VPI C code. 2021-02-03 19:29:24 -05:00
Wilson Snyder
828fa80afa Tests: Add common use_libvpi for multiple simulators 2021-02-03 18:59:27 -05:00
Wilson Snyder
fe0a42eaa8 Tests: Cleanup some unused functions. 2021-02-03 18:50:23 -05:00
Wilson Snyder
153335ff35 Tests: Cleanup some DPI warnings. 2021-02-03 18:30:39 -05:00
github action
7bce15b065 Apply clang-format 2021-02-03 22:39:03 +00:00
Wilson Snyder
2225acd3ec Tests: Avoid C++11 requirement in TestVpi.h 2021-02-03 17:37:31 -05:00
Àlex Torregrosa
e77e4e1fe6
Improve struct scopes when dumping structs to VCD (#2776) 2021-02-03 14:40:21 -05:00
Wilson Snyder
05bb24df6c Fix $fread extra semicolon inside statements. 2021-01-26 22:20:16 -05:00
Wilson Snyder
31223d4058 Fix $ in filenames (#2768). 2021-01-26 20:10:38 -05:00
Paul Wright
d891e5ac3a
Fix to exclude strings from toggle coverage (#2766) (#2767) 2021-01-25 07:33:38 -05:00
Wilson Snyder
64941538b7 Fix TIMESCALE warnings on primitives (#2763). 2021-01-23 10:31:41 -05:00
James Hanlon
fadc6776ec
For --flatten, override inlining of public and no_inline modules (#2761) 2021-01-18 08:03:18 -05:00
Pierre-Henri Horrein
3c849d7ce0
Generate SELRANGE instead of errors for potentially unreachable code (#2625) (#2754)
When using a "if" statement inside an always block, part of the code may
be unreachable. This can be used to avoid errors, but it generated an
error, this commit demotes this to a warning. Partly fixes #2625.
2021-01-15 07:31:48 -05:00
Wilson Snyder
3bb8fbe73b Internal coverage improvements 2021-01-13 20:01:10 -05:00
Wilson Snyder
ab5d4bd51d Tests: Abstract out common test comparison 2021-01-12 18:31:23 -05:00
Paul Wright
769c0fa318
Fix to ignore coverage on real ports (#2741) (#2745) 2021-01-10 12:40:03 -05:00
Julien Margetts
a11700271f
Add LATCH and NOLATCH warnings (#1609) (#2740). 2021-01-05 14:26:01 -05:00
Wilson Snyder
6d80e8f856 Test update 2021-01-05 09:04:31 -05:00
Yutetsu TAKATSUKASA
5b280c1911
Fix hierarchical verilation with explicit setting of default parameter value (#2738)
* Test hierarchical block that is explicitly set its default parameter value.

* Fix hierarchical verilation when a hierarchical block is instantiated with explicit setting of the default value.

Parameterized hierarchical block must have mangled name even when all parameters have default value,
otherwise the parameterized module will be hidden by protect-lib wrapper.

* rename variable names. No functional change is intended.
2021-01-03 12:19:37 +09:00
Wilson Snyder
1a073fbf5e Fix vpiLeftRange on little-endian memories (#2696). 2021-01-02 22:00:13 -05:00
Wilson Snyder
83d978c2cd Fix generate for unrolling to be signed (#2730). 2021-01-02 21:43:13 -05:00
Yutetsu TAKATSUKASA
7a18adc716
Emit timescale in hierarchical block only when timescale is specified (#2735)
* Add a test for hierarchical verilation without timescale

* Emit timeunit in hierarchical wrapper only when it is specified in the input design or command line option.

* Update src/V3AstNodes.h

Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>

Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>
2021-01-02 08:31:27 +09:00
Wilson Snyder
bd602d0e2d Copyright year update 2021-01-01 10:29:54 -05:00
Wilson Snyder
72b2df30f8 Fix tracing empty sc module (#2729). 2020-12-28 11:13:58 -05:00
Wilson Snyder
cbd1bd5dad Tests: Fix some VPI coverage holes 2020-12-23 19:15:00 -05:00
Wilson Snyder
97255dc835 Tests: Test future if condition optimization (#2726) 2020-12-23 18:23:47 -05:00
Wilson Snyder
b8b9170f9d Remove Unix::Processors dependency 2020-12-23 16:07:14 -05:00
Nandu Raj
1124829500
Fix $urandom_range maximum value (#2723) 2020-12-22 07:52:38 -05:00
Wilson Snyder
b93e409f0e Optimize additional display statements (#2702). 2020-12-19 11:12:47 -05:00
Wilson Snyder
ca9bdc6e70 Tests: Ignore github action commits 2020-12-18 23:06:42 -05:00
Wilson Snyder
1e34ae31d2 Fix vpi_release_handle to be called implicitly per IEEE (#2706). 2020-12-18 21:16:57 -05:00
Wilson Snyder
d0c4aee7b5 Tests: clang-format 2020-12-17 22:44:50 -05:00
Todd Strader
a88965a124
Fix scope map for multiple construction (#2710) 2020-12-17 12:21:40 -05:00
James Hanlon
c18cbca813
Add support for package imports preceeding parameters in interfaces (#2714)
Co-authored-by: James Hanlon <mail@jameswhanlon.com>
2020-12-17 11:26:53 -05:00
Wilson Snyder
deb5531e54 Tests: Make explicit some IEEE-mandated freeing of VPI handles 2020-12-16 20:57:02 -05:00