Commit Graph

2319 Commits

Author SHA1 Message Date
Wilson Snyder
ca42be982c Copyright year update. 2022-01-01 08:26:40 -05:00
Wilson Snyder
8952aa59ff Tests: Add force/release tests. 2021-12-31 15:17:16 -05:00
Wilson Snyder
2966f03042 Tests: Enumerations supported 2021-12-31 15:10:29 -05:00
Yutetsu TAKATSUKASA
0658a7654f
Add tests of tracing SystemC model verilated with --hierarchical (#3252)
* Tests: Add t_hier_block_sc_trace(fst|vcd) that tests tracing hierarchical block on SystemC.

* Add a check that elaboration is done before a trace file is opened.

* Add a check that elaboration is done before trace() is called to verilated SystemC model.

* Tests: call sc_core::sc_start(sc_core::SC_ZERO_TIME) before opening a trace file

* Tests: Fix t_trace_two_sc to call sc_start before opening trace

* Use vl_fatal as suggested in PR review.
2021-12-23 08:41:11 +09:00
Wilson Snyder
7526151670 Fix bad ending address on $readmem (#3205). 2021-12-21 19:55:04 -05:00
Wilson Snyder
560b59f97f Use C++11 standard types for MacOS portability (#3254). 2021-12-21 13:18:05 -05:00
Geza Lore
1de2de4bde Fix splitting of large _eval and related functions
Fix bug that only used to measure size of first statement in functions
to determine if splitting was necessary. Measure whole function instead.
2021-12-20 11:24:11 +00:00
Geza Lore
ff425369ac
Reduce .rodata footprint of trace initialization (#3250)
Trace initialization (tracep->decl* functions) used to explicitly pass
the complete hierarchical names of signals as string constants. This
contains a lot of redundancy (path prefixes), does not scale well with
large designs and resulted in .rodata sections (the string constants) in
ELF executables being extremely large.

This patch changes the API of trace initialization that allows pushing
and popping name prefixes as we walk the hierarchy tree, which are
prepended to declared signal names at run-time during trace
initialization. This in turn allows us to emit repeat path/name
components only once, effectively removing all duplicate path prefixes.
On SweRV EH1 this reduces the .rodata section in a --trace build by 94%.

Additionally, trace declarations are now emitted in lexical order by
hierarchical signal names, and the top level trace initialization
function respects --output-split-ctrace.
2021-12-19 15:15:07 +00:00
Yutetsu TAKATSUKASA
30ccccdb67
Support FST tracing in hierarchical verilation (#3251)
* Rename t_hier_block_trace -> t_hier_block_trace_vcd

* Add t_hir_block_trace_fst test

* Support FST dump with hierarchical verilation
2021-12-18 16:57:28 +09:00
Wilson Snyder
f775feb7f0 Fix foreach on dotted reference. 2021-12-12 20:43:15 -05:00
Wilson Snyder
aa8423ba46 Tests: Add t_class_param_mod.pl 2021-12-12 19:49:06 -05:00
Wilson Snyder
d753f36ebc Internals: Add missing broken assertions & cloneTrees 2021-12-12 18:10:52 -05:00
Wilson Snyder
55976dbc25 Tests: Add t_class_param_nconst_bad test. 2021-12-12 15:26:29 -05:00
Wilson Snyder
6b0601fd54 Support lower dimension looping in foreach loops (#3172). 2021-12-11 20:39:58 -05:00
Wilson Snyder
740fee660e Fix associative array foreach loop (#3229). 2021-12-11 18:38:23 -05:00
Wilson Snyder
984ee624ed Fix break under foreach loop (#3230).
Internals: Move Foreach handling into V3Width.
2021-12-11 15:06:33 -05:00
Adrien Le Masle
00ef0519f5
Fix top level parameter overwrite when a package has same parameter (#3241) (#3247) 2021-12-11 14:55:59 -05:00
Wilson Snyder
59d170c6f8 Support up to 64 bit enums for .next/.prev/.name (#3244). 2021-12-11 11:29:01 -05:00
Wilson Snyder
9a722ccf62 Internals: Cleanup of InitArray stuff. No functional change intended. 2021-12-11 11:22:04 -05:00
Wilson Snyder
748fa4cb80 Fix coredump after huge enum warning. 2021-12-10 23:08:03 -05:00
Wilson Snyder
694cf371f9 Tests: Always failing tests 2021-12-10 21:22:23 -05:00
Wilson Snyder
8696e38e6f Primary inputs and outputs (VL_INW/VL_OUTW) now use VlWide type (#3236). 2021-12-09 19:41:33 -05:00
Adrien Le Masle
c3f17ce2c4
Fix VL_STREAML_FAST_QQI with 64 bit left-hand-side (#3232) (#3235) 2021-12-09 17:30:04 -05:00
Wilson Snyder
41f29d2ce3 Tests (#3230) 2021-12-06 21:27:32 -05:00
Yutetsu TAKATSUKASA
1160dddc6d
Fix bit op tree optimization (#3221)
* Add a test to reproduce #3197

* Fix #3197. Optimize correctly even if a variable is >32

* Quick exit instead of continue. No functional change is intended.

* Delete comment-out line.

* update per review comment
2021-11-30 23:20:00 +09:00
Wilson Snyder
ca09f73446 Tests: Fix open test on some automount cloud providers 2021-11-28 15:40:35 -05:00
Wilson Snyder
e814855357 Tests: Skip gdb tests if no gdb 2021-11-28 15:33:33 -05:00
Wilson Snyder
692306ef44 Optimize $random concatenates/selects (#3114). 2021-11-28 14:17:28 -05:00
Wilson Snyder
04e0c7e4f1 Support tracing through --hierarchical/--lib-create libraries (#3200). 2021-11-27 17:07:27 -05:00
Wilson Snyder
c6dae40cf6 Support task name in $display %m (#3211). 2021-11-26 20:38:48 -05:00
Michaël Lefebvre
9bda2cb4ad
Fix some SliceSels not being constants (#3186) (#3218). 2021-11-26 10:51:11 -05:00
Wilson Snyder
62387a0e32 Fix display of empty string constant (#3207) (#3215). 2021-11-25 08:03:27 -05:00
Wilson Snyder
31079ca8b5 Fix $size on dynamic strings (#3216). 2021-11-25 07:50:47 -05:00
Wilson Snyder
e7ebe0e280 Fix $fopen etc on integer arrays (#3214). 2021-11-23 18:22:16 -05:00
Wilson Snyder
c14bbb9421 Fix incorrect width after and-or optimization (#3208). 2021-11-23 18:15:21 -05:00
Wilson Snyder
b1b92b7dd4 Fix hang on recursive definition error (#3199). 2021-11-23 07:27:41 -05:00
Wilson Snyder
2ccf49031b Fix $display of signed/unsigned without format (#3207). 2021-11-17 18:50:52 -05:00
Wilson Snyder
0abc856be9 Fix %0 format on $value$plusargs. 2021-11-17 17:54:07 -05:00
Wilson Snyder
d2a8fa7440 Fix display of empty string constant (#3207). 2021-11-17 17:46:08 -05:00
Wilson Snyder
c0892dd11c When using --lib-create, disable tracing hash/internals. Partial (#3200). 2021-11-14 10:16:59 -05:00
Wilson Snyder
899de9a282 Add --lib-create, similar to --protect-lib but without protections (#3200). 2021-11-14 09:39:31 -05:00
Wilson Snyder
28b6e79cf7 Tests: Rename t_lib_prot tests in prep for new options. 2021-11-14 08:58:04 -05:00
Wilson Snyder
c496649c49 Internals: Remove unused DfaGraph code. 2021-11-13 14:48:21 -05:00
Wilson Snyder
3a5cbd5b67 Internals: Untabify some embedded tabs. 2021-11-13 10:46:25 -05:00
Geza Lore
185e5d8f42 Make 'bit', 'logic' and 'time' types unsigned by default
IEEE 1800-2017 6.11.3 says these types are unsigned. Until now these
types were treated as not having a signedness (NOSIGN), and nodes having
these types were later resolved by V3Width to be unsigned. This is a bit
problematic when creating nodes of these types after V3Width. Treating
these types as unsigned from the get go is fine, and actually improves
generated code slightly.
2021-11-09 21:54:21 +00:00
Yutetsu TAKATSUKASA
b08c694cd6
Fix wrong bit op tree optimization (#3185)
* Add a test to reproduce bug3182. Run the same HDL with -Oo to confirm the result is same.

* Hopefully fix #3182. The result can be 0 only when polarity is true (no AstNot is found during traversal).
2021-11-06 12:31:50 +09:00
Wilson Snyder
758264dc77 Fix nested generate if genblk naming (#3189). 2021-11-01 08:59:00 -04:00
Teng Huang
fdbf465eda
Fix array method names with parens (#3181) (#3183) 2021-10-26 12:20:45 -04:00
Yutetsu TAKATSUKASA
f3b10df454
Skip merging assign statements if a variable is marked split_var to fix #3177 (#3179)
* add tests to reproduce #3177.

Any random test circuits can be added to t_split_var_4.v later because it uses CRC to check the result while
t_split_var_0.v has just barrel shifters.

* Fix #3177. Don't merge assign statements if a variable is marked split_var.
2021-10-25 20:56:59 +09:00
Wilson Snyder
aa1a0b0f13 Tests: Fix numactl on WSL2 2021-10-19 21:24:22 -04:00
Wilson Snyder
371bf01957 Tests: Fix numactl on WSL2 2021-10-19 21:21:52 -04:00
Wilson Snyder
b8f6b262e4 Fix false EOFNEWLINE warning when DOS carriage returns present (#3171). 2021-10-13 21:21:51 -04:00
Wilson Snyder
b64e89f7ed Fix calling new with arguments in same class (#3166). 2021-10-12 21:22:59 -04:00
Iru Cai
9731ec76e3
Fix $urandom_range when the range is 0 ... UINT_MAX (#3161) 2021-10-11 06:45:19 -06:00
Matthew Ballance
a9646cf45c
Fix constructor-parameter argument comma-separation in C++ (#3162) 2021-10-09 17:19:31 -06:00
Wilson Snyder
5f597dd9fc Tests: Improve internal coverage holes 2021-10-05 22:02:37 -04:00
Wilson Snyder
4739956cfe Internals: Add missing const. No functional change. 2021-10-05 21:20:22 -04:00
Wilson Snyder
e202a6324a Tests: Improve internal coverage holes 2021-10-05 21:09:57 -04:00
Wilson Snyder
66d70c8b37 Internal coverage: Fix some test runs having conflicting sources. 2021-10-05 20:22:29 -04:00
Wilson Snyder
2560fc867f verilator_gantt: Fix reading broken /cpu/procinfo reports 2021-10-02 11:10:43 -04:00
Wilson Snyder
f5c9deecb8 Tests: Add verilator_gantt no-proc test. 2021-10-02 10:05:59 -04:00
Zhanglei Wang
1c1c805b07
Fix internal error on bad widths (#3140) (#3145) 2021-09-28 07:28:02 -04:00
Wilson Snyder
9029da5ab8 Add profile-guided optmization of mtasks (#3150). 2021-09-26 22:51:11 -04:00
Wilson Snyder
44809f1843 Remove unused CFG_CXXFLAGS_STD_OLDEST 2021-09-26 16:01:25 -04:00
Wilson Snyder
741bb5328e verilator_gantt: Fix argument report omitting last digits 2021-09-24 21:11:15 -04:00
Wilson Snyder
8ab51dbf22 Verilator_gantt: remove ASCII graphics 2021-09-24 08:48:20 -04:00
Wilson Snyder
fd4595d6b4 verilator_gantt: Add eval count to report 2021-09-24 08:48:20 -04:00
Wilson Snyder
c2819923c5 Verilator_gantt now shows the predicted mtask times, eval times, and additional statistics. 2021-09-23 22:59:36 -04:00
Keith Colbert
0defb61a18
Fix --waiver-output for multiline warnings (#2429) (#3141) 2021-09-22 07:42:59 -04:00
Wilson Snyder
a7374e84a2 Tests: Some coverage improvements 2021-09-20 18:20:48 -04:00
Wilson Snyder
2418df7bb2 Commentary 2021-09-17 20:03:45 -04:00
Wilson Snyder
08c8b0d7d6 Fix removing if statement with side effect in condition (#3131). 2021-09-13 15:52:53 -04:00
Wilson Snyder
d384a69877 Fix display has no time units on class function (#3116). 2021-09-08 19:31:46 -04:00
github action
a8b480559d Apply 'make format' 2021-09-08 22:46:27 +00:00
Wilson Snyder
f1b8b1d99b Format: perltidy spacing cleanup. No functional change. 2021-09-08 18:45:25 -04:00
Wilson Snyder
4b274a8d4d Convert verilator_gantt to python 2021-09-08 08:16:31 -04:00
Wilson Snyder
c678e7ec3e Format: perltidy spacing cleanup. No functional change. 2021-09-07 23:50:28 -04:00
Wilson Snyder
2a79e46c46 Tests: Fix t_dist_fixme to detect later files. 2021-09-07 19:27:46 -04:00
Wilson Snyder
d09b6a7d2c Include processor information in verilator_gantt data file. 2021-09-05 11:56:28 -04:00
Wilson Snyder
cac0b0f316 Tests: Fix t_gantt_io 2021-09-04 16:51:55 -04:00
Wilson Snyder
8519dc1383 Tests: Skip unstability 2021-09-04 13:48:16 -04:00
Wilson Snyder
72f198d79e Tests: Add t_gantt_io test 2021-09-04 12:44:13 -04:00
Wilson Snyder
1cb8091125 verilator_profcfunc: Also allow eval_step. 2021-09-04 12:28:26 -04:00
Wilson Snyder
496b9f9c63 Tests: Add difftree test. 2021-09-04 08:27:59 -04:00
Wilson Snyder
56dc66d842 Fix verilator_profcfunc profile accounting (#3115). 2021-09-03 19:59:10 -04:00
Iru Cai
4ed00c563c
Support displaying x and z in $display task (#3107) (#3109) 2021-09-02 08:10:52 -04:00
Krzysztof Bieganski
cd9e9da4b5
Support assignment patterns as children of pins (#3041)
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2021-08-30 10:44:03 -04:00
Wilson Snyder
43aa3229fb Support empty queue assignment to delete queue 2021-08-28 17:23:35 -04:00
Wilson Snyder
27d53691bd Add header guards on Dpi.h generated files (#2979). 2021-08-23 21:43:54 -04:00
Wilson Snyder
c3d64d9743 Fix internal error on wide -x-initial unique (#3106). 2021-08-23 20:13:09 -04:00
Wilson Snyder
f9806595f2 Add error when constant function under a generate (#3103). 2021-08-21 10:33:20 -04:00
Geza Lore
34a0bb448e Improve V3MergeCond
- Merge AstNodeIf nodes as well (not just assignment from AstCond)
- Merge merged results recursively (optimizes nested conditionals/ifs)
- Only checking mergeability once per node.
- Don't add redundant masking
- Duplicate cheap statements in both branches, if doing so yields a
  larger merge
- Include reduced nodes before the starting conditional in the merge
2021-08-19 18:55:39 +01:00
Geza Lore
8681861be9 Improve bitop tree optimization
- Remove redundant casting
- Cheaper final XOR parity flip (~/^1 instead of != 0)
- Support XOR reduction of ~XOR nodes
- Don't add redundant masking of terms
- Support unmasked terms
- Add cheaper implementation for single bit only terms
- Ensure result is clean under all circumstances (this fixes current bugs)
2021-08-18 22:00:13 +01:00
Geza Lore
c69ddc46f8
Fix bitop tree optimization dropping necessary cleaning AND (#3097)
Fixes #3096.
2021-08-14 21:09:01 +01:00
Yutetsu TAKATSUKASA
4ec8bc3589
Fix op count and wrong optimization in bitop tree (#3099)
- Fix op calculation.
- Fix wrong optimization revealed by changing the op calculation:
  Not(CCast(And(a, b))) must be frozen.
2021-08-14 12:28:47 +01:00
Geza Lore
536bdf506e
Fix re-evaluation of logic dependent on state set in DPI exports (#3091).
Verilator should now correctly re-evaluate any logic that depends on
state set in a DPI exported function, including if the DPI export is
called outside eval, or if the DPI export is called from a DPI import.

Whenever the design contains a DPI exported function that sets a
non-local variable, we create a global __Vdpi_export_trigger flag, that
is set in the body of the DPI export, and make all variables set in any
DPI exported functions dependent on this flag (this ensures correct
ordering and change detection on state set in DPI exports when needed).
The DPI export trigger flag is cleared at the end of eval, which ensured
calls to DPI exports outside of eval are detected. Additionally the
ordering is modifies to assume that any call to a 'context' DPI import
might call DPI exports by adding an edge to the ordering graph from the
logic vertex containing the call to the DPI import to the DPI export
trigger variable vertex (note the standard does not allow calls to DPI
exports from DPI imports that were not imported with 'context', so we
do not enforce ordering on those).
2021-08-12 21:43:32 +01:00
Pieter Kapsenberg
d1836b7b6f
Traces show array instances using brackets instead of parens (#3092) (#3095) 2021-08-12 20:40:44 +03:00
Geza Lore
00fe36f44c Name temporary variables based on hash of related node.
This improves output stability by removing sequence numbers and hence
can improve ccache hit rate. No functional change intended.
2021-08-11 17:29:22 +01:00
Geza Lore
5adc856950 Tests: ignore all hashes in files_identical
Also add 'h' prefix to all printed hashes, to reduce ambiguity. No
functional change.
2021-08-11 16:55:11 +01:00
Geza Lore
2c8456ea75 Internals: Cleanup V3SplitVar
- Use C++11 initialization syntax
- Use C++11 for loops
- Add const
- Factor out repeated _->fileline() sub-expressions
- Factor out issuing warning message

No functional change.
2021-08-02 15:48:26 +01:00