Commit Graph

6536 Commits

Author SHA1 Message Date
Ícaro Lima
1da15181da Update CONTRIBUTORS (#4641) 2023-10-29 16:44:42 -04:00
Wilson Snyder
3c6b755352 Tests: Rename t_opt_dead 2023-10-29 09:42:52 -04:00
Geza Lore
3c144ada53
Delete AstNode user5 (#4638)
This saves about 5% memory. V3AstUserAllocator is appropriate for most use
cases, performance is marginally up as we are mostly D-cache bound on
large designs.
2023-10-29 01:12:27 +01:00
Wilson Snyder
7ba6647c4f Internals: Cleanup some V3Graph constructors/funcs and docs. No functional change. 2023-10-28 20:11:28 -04:00
Geza Lore
e708670f9a Minor memory optimizatoin of AstUser*Allocator 2023-10-28 20:31:57 +01:00
Geza Lore
de4c6065dc
make: add test-snap/test-diff targets (#4635) 2023-10-28 15:58:29 +01:00
Geza Lore
d60f180f43 Avoid double traversal of maps
The typical find/if-not-exists-insert pattern can be achieved with 1
lookup instead of 2 using emplace with a sentinel value. Also maps value
initialize their values when inserted with the [] operator, this is
defined and so there is no need to explicitly insert zeroes for integer
values.
2023-10-28 13:41:43 +01:00
Geza Lore
30318a6654 C++11 cleanup 2023-10-28 11:26:48 +01:00
Geza Lore
d8420413b7 test: fix FST trace file names 2023-10-28 10:40:07 +01:00
Geza Lore
a5951babfc test: make output deterministic 2023-10-28 10:36:30 +01:00
Geza Lore
2cba167634 Make eval loop construction more unified and the output more readable 2023-10-28 08:48:04 +01:00
Krzysztof Boroński
89743aae5d
Fix stable name generation in V3Fork (#4615) (#4624) 2023-10-27 15:08:02 -04:00
Ryszard Rozak
e6135981a5
Fix dynamic casts of null values (#4631) 2023-10-27 15:58:40 +02:00
Kamil Rakoczy
739521333c
Tests: Fix clang_check_attributes missing dataclass decorator (#4604) (#4611) 2023-10-27 08:24:27 -04:00
Ryszard Rozak
64af83161a
Fix rand fields of reference types (#4627) 2023-10-26 17:17:23 -04:00
Chih-Mao Chen
98252634fc
Include systemc instead of systemc.h in model header files (#4622) (#4623)
This may require that SystemC programs add:
using namespace sc_core;
using namespace sc_dt;
2023-10-26 14:36:18 -04:00
Krzysztof Boroński
a87fb57656
Allow assigning events (#4403)
Signed-off-by: Krzysztof Boronski <kboronski@antmicro.com>
2023-10-26 16:38:47 +02:00
Geza Lore
34708bbba1 Respect --dump-tree-addrids in tree dumps 2023-10-25 18:17:26 +01:00
Krzysztof Boroński
f91259f46d
Fix insertion at queue's end (#4619)
Signed-off-by: Krzysztof Boronski <kboronski@antmicro.com>
Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>
2023-10-25 17:41:28 +02:00
Marlon James
cf6e362972
Support VPI variables of real and string data types (#4594) 2023-10-24 20:46:20 -04:00
Geza Lore
95c4ade718
Unify code generation for trace declarations in both trace formats (#4612)
This patch adds some abstract enums to pass to the trace decl* APIs, so
the VCD/FST specific code can be kept in verilated_{vcd,fst}_*.cc, and
removed from V3Emit*. It also reworks the generation of the trace init
functions (those that call 'decl*' for the signals) such that the scope
hierarchy is traversed precisely once during initialization, which
simplifies the FST writer. This later change also has the side effect of
fixing tracing of nested interfaces when traced via an interface
reference - see the change in the expected t_interface_ref_trace - which
previously were missed.
2023-10-24 16:33:29 +01:00
Ryszard Rozak
84125d7c92
Fix virtual methods (#4616) 2023-10-24 15:51:46 +02:00
Geza Lore
17721aff55 Remove unused IMPLICITWIRE var type 2023-10-24 10:02:00 +01:00
Geza Lore
d1b6224c2b
Associate trace codes with function indices (#4610)
For each traced variable, also register the trace function index that
will write it.
2023-10-23 16:01:55 +01:00
github action
1bd31742b9 Apply 'make format' 2023-10-23 14:07:52 +01:00
Geza Lore
165a2ef1b8 Separate tracing of const values from non-const values
Some values emitted to the trace files are constant (e.g.: actual
parameter values), and never change. Previously we used to trace these
in the 'full' dumps, which also included all other truly variable
signals. This patch introduces a new generated trace function 'const',
to complement the 'full' and 'chg' flavour, and 'const' now only
contains the constant signals, while 'full' and 'chg' contain only the
truly variable signals. The generate 'full' and 'chg' trace functions
now have exactly the same shape. Note that 'const' signals are still
traced using the 'full*' dump methods of the trace buffers, so there is
no need for a third flavour of those.
2023-10-23 14:07:52 +01:00
Ryszard Rozak
774c10396c
Fix try_put method of unbounded mailbox (#4608) 2023-10-23 14:33:22 +02:00
Marlon James
33c5b5feb8
Add sv_vpi_user.h from IEEE 1800-2017 Annex M (#4606) 2023-10-22 20:41:40 -04:00
Wilson Snyder
b83b9974ee Fix gcc -O0 incompatible allocator warning 2023-10-22 09:51:02 -04:00
Wilson Snyder
bcbe5059a9 Internal: V3Graph style cleanup. No functional change 2023-10-22 09:50:38 -04:00
Wilson Snyder
5bda901146 Internals: Fix stats report to include main AstCFile made 2023-10-21 20:56:24 -04:00
Geza Lore
82565690c7 test driver.pl: don't redirect to STDOUT of interactive GDB 2023-10-22 00:56:10 +01:00
Geza Lore
978d900e36 Simplify and fix code stats
V3Stats for "fast" code have bit-rotted a little and is causing some
problems with tests that rely on stats outputs. The problem is that not
all code is necessarily reachable from eval() any more (due to the
complexity of some the features added over the past few years), so it
might miss some things, as for measuring the "fast" code, it is trying
to trace the execution paths via calls, starting from eval(). It also
appears the fast code can also contain calls to slow code in some
circumstances.

To avoid all that, removed trying to trace dynamic execution, and simply
report the static node counts, which is enough for testing.

Similarly, the variable counts are somewhat dubious, as they don't
include all data types, or all instances of a module in some stages.
Removing these as they are not widely used nor dependable. More specific
stats can be added if required and can be well defined.
2023-10-22 00:25:07 +01:00
Geza Lore
d330100542 Create implicit nets for inputs of gate primitives.
Prior to this we failed to create implicit nets for inputs of gate
primitives, which is required by the standard (IEEE 1800-2017 6.10).
Note: outputs were covered due to being modeled as the LHS of
assignments, which do create implicit nets.
2023-10-21 22:45:26 +01:00
Geza Lore
4c0edd2efb Improve --prof-exec infrastructure and report
Again --prof-exec have bit-rotted a little with all the recent changes
to the structure of the generated code. This patch contains a few
improvements:
- Repalce the eval/evl_loop begin/end events with generic
  section_push/section_pop events, that can be arbitrarily sprinkled
  into the generate code (so long as they are matched correctly) to
  measure various sections. The report then contains a nested profile
  of the sections, and the VCD trace shows the section names.
- Better handling of exec graphs
- Clearer overall statistics
2023-10-21 21:09:03 +01:00
Geza Lore
146cdc020d Remove V3AstConstOnly.h
This is now redundant with the introduction of VNVisitorConst
2023-10-21 20:41:46 +01:00
Geza Lore
52f2b9ef58 Remove pointless test
t_optm_if_cond was a test for a then non-existent optimization to merge
conditionals. V3MergeCond implements this and has its own tests.
2023-10-21 20:41:46 +01:00
Geza Lore
a09506a0ad Trivial simplification of V3EmitCModel
Still some remains of the --threads 0 mode. Remove unnecessary complexity
from V3EmitCModel. (Also don't pretend there is an MTask in single
threaded mode, when there really isn't.)
2023-10-21 20:41:46 +01:00
Geza Lore
10d33238b9 Do not merge entry/exit MTasks during coarsening 2023-10-21 19:31:52 +01:00
Geza Lore
b78ea06829 Make VL_LOCK_SPINS configurable
It's unlikely one value fits all use case, so making VL_LOCK_SPINS
configurable at model build time.

For testing, we reduce the value as we expect high contention.
2023-10-21 18:05:53 +01:00
Wilson Snyder
eae942b91c Internals: Fix some lint-py warnings 2023-10-21 12:48:36 -04:00
Geza Lore
1075b006b5 Consider children of AstConcat in V3InstrCount
Previously V3InstrCount used to completely ignore an AstConcat,
including its children (see the rational in the comment). The problem is
the operands can be huge and expensive compound expressions (especially
since DFG), and not just a simple variable reference. This fix gains
some MT speed improvement.
2023-10-21 17:15:40 +01:00
Wilson Snyder
afaa02709c CI: Increase CCACHE_MAXSIZE (#4595) 2023-10-21 10:38:46 -04:00
Wilson Snyder
332a687aef Commentary 2023-10-21 10:35:07 -04:00
Geza Lore
d1c7875406 Fix conditionals on obsolete --threads 0
Since we removed --threads 0 support, the 'threads()' option always
returns a value >= 1. Remove corresponding dead code.

Some of the coverage counters appear to use atomics even if the model is
single threaded. I'm under the impression this was a bug originally so
those ones I changed to use threads() > 1 instead.
2023-10-21 15:14:27 +01:00
Geza Lore
cbc2f9eb32 Do not overwrite LD_LIBRARY_PATH in t_flag_ldflags 2023-10-21 11:34:36 +01:00
Quentin Corradi
26e3785963
Fix PLI/DPI user defined system task/function grammar (#4587) (#4588)
According to 1800-2017 36.3, 1800-2017 A.9.3, 1364-2005 20.2 and 1364-2005 A.9.3, user defined system task and function identifiers can use the same character set for the second character as all the following characters.
2023-10-21 02:43:49 -04:00
Wilson Snyder
f8b7fb72b8 Fix fault on empty clocking block (#4593). 2023-10-21 02:40:08 -04:00
Krzysztof Bieganski
7b12f6a1dd
Support NBAs in non-inlined functions/tasks (#4496) (#4572) 2023-10-20 20:01:45 -04:00
Mariusz Glebocki
c7a0613c57
Support Clang 16 (#4592) 2023-10-20 15:47:09 -04:00