Commit Graph

4711 Commits

Author SHA1 Message Date
Wilson Snyder
3e03cd5a4d Commentary 2021-09-01 20:39:59 -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
f64d9d87f6 Clang compile fix 2021-08-28 17:44:19 -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
959793cde3 Internals: Cleanup VL_VALUE_STRING_MAX widths (#3050). 2021-08-23 21:13:33 -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
fffc63970d Use narrowest RedXor 2021-08-18 22:00:09 +01:00
Ivan Vnučec
8f527a0c6e
Commentary (#3102)
Actually you can see `https://github.com/verilator/verilator` URL in your browser.
2021-08-18 15:19:02 -04: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
bc3e24c8cd Use c++XX instead of gnu++XX language standards.
The GNU extensions to C/C++ are not required to build Verilator. Note
this change does not affect __attribute__, __builtin_* and intrinsics,
which are still available when using GCC or Clang with the standard
language options.
2021-08-04 11:48:32 +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
Geza Lore
519cc7d61c Internals: Remove code duplication from V3Order
No functional change
2021-08-02 14:06:50 +01:00
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
3ec3c2c268 Internals: Cleanup V3Expand
- Use C++ initialization syntax
- Add const
- Make members static where appropriate
- Factor out repeated _->fileline() sub-expressions

No functional change.
2021-07-27 13:18:57 +01:00
Wilson Snyder
b8e804f05b Internals: Some clang-tidy cleanups. No functional change intended. 2021-07-25 13:38:27 -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
deebfa3239 Tests: Remove Ubuntu 16.04 as github removes in a month. 2021-07-25 11:22:25 -04:00
Wilson Snyder
f937e3282f Tests: Ignore DepSet hash numbers. (#3083) 2021-07-25 11:20:19 -04:00
Geza Lore
b46664c70a Internals: Use C++11 constexpr for instruction count costs
No functional change.
2021-07-25 13:32:40 +01:00
github action
33af14eba8 Apply 'make format' 2021-07-25 01:07:07 +00: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
43ecaec9a0 Internal C++11 flex cleanups. No functional change intended. 2021-07-24 12:49:07 -04:00
Wilson Snyder
275885a797 Internals: Fix some long UNSUP lines. No functional change. 2021-07-24 12:21:04 -04:00
Wilson Snyder
68aa731ce9 Fix missing null on blackbox parse. 2021-07-24 12:13:19 -04:00
Wilson Snyder
b90fce55f4 Includes: Refactor verilated.h and deprecate verilated_heavy.h (#2701). 2021-07-24 10:00:33 -04:00
Wilson Snyder
44173b40a1 Internals: Remove dead code. No functional change. 2021-07-24 09:18:49 -04:00
Wilson Snyder
ab13a2ebdc Internals: Use C++11 const and initializers. No functional change intended. 2021-07-24 08:36:11 -04:00
Wilson Snyder
19875d2e85 Increase split count of ChangeDet (#3072). 2021-07-23 19:24:25 -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
Geza Lore
9907d211ff Make VlWide and VlUnpacked C++20 compatible aggregates.
C++20 requires that aggregate types do not have a user declared
constructor, not even an explicitly defaulted one. We need these types
to be aggregates for static initialization.

Fixes #3076.
2021-07-23 12:57:45 +01:00
Wilson Snyder
13933743ad Suppress creating change_request if not needed. 2021-07-22 20:50:03 -04:00
Wilson Snyder
fc25721e55 Increase instruction count of ChangeDet (#3072) 2021-07-22 20:13:45 -04:00
Wilson Snyder
fa64f8fb32 Internals: C++11 cleanup. No functional change intended. 2021-07-22 20:05:54 -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
8bb77f86ec Emit: Factor out parent module access via user4
No functional change.
2021-07-22 16:31:46 +01:00
Geza Lore
42d918c163 Internals: Omit selfPointer from ConstPool references
AstVarRefs to constant pool values are special and they have no use for
the selfPointer. Removing it simplifies future downstream code.
2021-07-22 13:35:22 +01:00
Geza Lore
e3dd70c373 Internals: Simplify V3CUse
No functional change intended.
2021-07-20 19:52:15 +01:00
Geza Lore
9273fafbbf Internals: Split parts of V3CUse into V3Common
Apart from adding required AstCUse, V3CUse also used to create some
standard methods for classes. This is now done in a separate pass
V3Common. Note that this is not a performance issue, as V3Common just
iterates through each module, which are stored in a simple linked list
under the netlist, and does not need to traverse the whole netlist.
2021-07-20 17:18:52 +01:00