Compare commits

...
1024 Commits
Author SHA1 Message Date
Wilson Snyder 890cecc15b Version bump 2020-02-08 09:03:51 -05:00
Wilson Snyder f7bad37e88 Fix GCC 4.4.7 errors. 2020-02-08 07:09:41 -05:00
Wilson Snyder 134b5efd70 Tests: Ignore obj_iv. 2020-02-07 18:00:07 -05:00
Wilson Snyder 0d6ebf21b3 Suggest svSetScope, #2152. 2020-02-07 17:59:02 -05:00
Wilson Snyder 2d1b804e80 Fix OpenSolaris issues, #2154. 2020-02-07 17:35:04 -05:00
Todd Strader 77f1b3eef4 Support parameter access from arrays of interfaces, #2155. 2020-02-06 19:19:23 -05:00
Wilson Snyder 609a5dc26d Fix cppcheck warnings. No functional change intended. 2020-02-03 23:21:56 -05:00
Wilson Snyder 0aabe6ce00 Internals: Fix cppcheck warning including missing init. 2020-02-03 22:10:29 -05:00
Wilson Snyder 20cc4e57d5 tests: Driver style fix. 2020-02-03 18:43:56 -05:00
Wilson Snyder f3ebdc40c6 Fix some coverage lost when multithreaded, #2151. 2020-02-03 18:43:41 -05:00
Wilson Snyder 2ca9f73b31 Internals: Cleanup Emit towards constructor/destructor output. 2020-02-02 21:15:07 -05:00
Wilson Snyder 73f5e3f808 Internals: Add missing const. No functional change. 2020-02-02 10:34:29 -05:00
Wilson Snyder 8d3dad510f Fix unused variable. 2020-02-02 06:52:28 -05:00
Wilson Snyder 2576c136f6 Fix `pragma pedantic check to work with -E. 2020-02-01 22:03:18 -05:00
Wilson Snyder a8ad97eef2 Add VL_CACHE_LINE_BYTES and use 64 as defult. 2020-02-01 20:28:03 -05:00
Wilson Snyder ee7da1e690 Remove .h comments for empty sections. 2020-02-01 20:11:21 -05:00
Wilson Snyder 969a46faf6 Internals: V3Emit refactoring. No functional change intended. 2020-02-01 19:32:04 -05:00
Wilson Snyder 820df28ad9 Internals: V3CUse state refactoring. No functional change intended. 2020-02-01 19:11:19 -05:00
Yutetsu TAKATSUKASA 50fb7fc8b4 Tests: Resolve self assignment in t_unoptflat_simple_2, Closes #2149. 2020-02-01 19:07:02 -05:00
Wilson Snyder 119162912a Internals: Determine emit forward declaraions in new pass, towards classes. 2020-02-01 16:51:05 -05:00
Wilson Snyder 80d94891e1 Internals: Allow const & non-member CFuncs for class branch. No functional change. 2020-02-01 10:57:55 -05:00
Geza Lore f00ff61559 Link Verilator binary partially statically, Closes #2146.
The build is now by default configured to link performance critical
libraries (libgcc, libstdc++, libtcmalloc) statically. This improves
Verilation speed by between 4.5-7% based on my measurements as it
eliminates approx 20% of the mispredicted branches from the execution.
With partial static linking, the size of the .text section in
verilator_bin is increased by about 14%, and the binary is itself only
about 800KB bigger on disk, so hopefully this is not a big issue in
exchange for the faster compilation speed. A configure option
"--disable-partial-static" is provided to restore the old behaviour of
linking everything dynamically.

Note: This patch also changes to use libtcmalloc_minimal, which is all
we really need and itself has fewer dependencies.
2020-01-31 19:13:55 -05:00
Wilson Snyder 2d195ebae5 Cleanup IEEE references. 2020-01-30 20:23:57 -05:00
Wilson Snyder 9a6bc3ddcf Commentary 2020-01-30 19:52:58 -05:00
Wilson Snyder d218f1746c Add warning on genvar in normal for loop, #2143. 2020-01-29 21:16:44 -05:00
Yutetsu TAKATSUKASA 8d8eb1b9f3 Tests: Resolve racing among initial blocks in t_display_signed.v, #2144. 2020-01-29 17:07:45 -05:00
Wilson Snyder d4614c290e Fix WIDTH warning on </<= of narrower value, #2141. 2020-01-28 20:10:10 -05:00
Tobias Rosenkranz 027cce35c0 Support enum.next(k) with constant k > 1, #2125. 2020-01-27 17:25:25 -05:00
Wilson Snyder 9fd81b2c6b Support string character access via indexing. 2020-01-26 16:38:22 -05:00
Wilson Snyder 5430e4ac9b Cleanup more errors showing data types. 2020-01-26 15:54:57 -05:00
Wilson Snyder 619214b48f Support $sampled. 2020-01-26 13:38:15 -05:00
Wilson Snyder 68fa82fb14 Support $typename, and use to cleanup error messages. 2020-01-26 13:21:25 -05:00
Wilson Snyder cac50282eb Fix pattern replication without key. 2020-01-26 11:38:34 -05:00
Wilson Snyder b50ef9ff39 Tests: Disabled test for 5.9. 2020-01-26 11:23:52 -05:00
Wilson Snyder 8a8f1135b7 Support type(expression) operator, #1650. 2020-01-26 10:28:13 -05:00
Wilson Snyder f0b2336345 Internals: Fix cell recursion with future module-in-module. 2020-01-25 18:15:55 -05:00
Wilson Snyder 52907e7b02 astgen: Preserve #line, #2138. 2020-01-25 15:36:37 -05:00
Geza Lore ef5250f0ca Internals: Further performance improvement of AstNode type tests, #2138. No functional change intended.
Replace the virtual type() method on AstNode with a non-virtual, inlined
accessor to a const member variable m_type.  This means that in order to be
able to use this for type testing, it needs to be initialized based on the
final type of the node. This is achieved by passing the relevant AstType
value back through the constructor call chain. Most of the boilerplate
involved is auto generated by first feeding V3AstNodes.h through astgen to
get V3AstNodes__gen.h, which is then included in V3Ast.h. No client code
needs to be aware and there is no functional change intended.

Eliminating the virtual function call to fetch the node type identifier
results in measured compilation speed improvement of 5-10% as it
eliminates up to 20% of all mispredicted branches from the execution.
2020-01-25 15:29:44 -05:00
Wilson Snyder eafed88a6e Internals: Add assertions. No functional change intended. 2020-01-25 10:19:59 -05:00
Wilson Snyder d64e6b3f9c Internals: Refactoring towards classes. No functional change intended. 2020-01-25 09:33:43 -05:00
Wilson Snyder d68ffba8cd Internals: Rename to prefixNameProtect. No functional change intended. 2020-01-25 09:16:00 -05:00
Wilson Snyder f0f370490f Internals: Style cleanups. 2020-01-25 07:59:25 -05:00
Wilson Snyder 708fd36563 Tests: Show entering/exit so goto-error works on compile errors. 2020-01-24 22:40:19 -05:00
Wilson Snyder a4e8d39932 Spelling fixes 2020-01-24 20:10:44 -05:00
Wilson Snyder 8f0e8e0696 Fix FST tracing of enums inside structs. 2020-01-24 19:46:46 -05:00
Wilson Snyder 11380bc3b2 Merge from upstream gtkwave includes. 2020-01-23 17:48:27 -05:00
Geza Lore 7ab2bdb6bb Support libgoogle-perftools-dev's libtcmalloc if available. #2137.
As Verilator continuously allocates and releases small objects (e.g.:
AstNode, V3GraphVertex, V3GraphEdge), it spends a significant amount of
time in malloc/free and friends. This patch adds the --enable-tcmalloc
configure option to link Verilator against the high performance malloc
implementation library libtcmalloc. The default is to use libtcmalloc if
available on the system. Note that there are no source code change, we
are simply replacing the standard library memory allocation functions.

Measured major compilation speed improvement of 27% when running
Verilator with -O3 on a large design.
2020-01-23 17:32:19 -05:00
Pieter Kapsenberg 5d037c3c8c Docs: Add initial XML dovcument description. #2136. 2020-01-23 07:26:11 -05:00
Geza Lore c5d04631d1 Internals: More performance efficient AstNode casting. Closes #2133.
dynamic_cast can have large run-time cost, so here we implement type
tests for AstNode instances by checking the unique type() property, which
in turn is a constant generated by astgen. For leaf types in the AstNode
type hierarchy, this is a simple equality check. To handle intermediate
types, we generate the type ids of leaf types in a pre-order traversal of
the type hierarchy. This yields contiguous ranges of ids for sub-type
trees, which means we can check membership of a non-leaf type via 2
comparisons against a low and high id. This single patch makes Verilator
itself 6-13% faster (depending on which optimizations are enabled) on a
large design of over 250k lines of Verilog.
2020-01-22 19:07:48 -05:00
Pieter Kapsenberg 957c1d606b Add detailed XML location to cell elements, #2134, #2122.
This was accidentally omitted from the previous PR #2122.
2020-01-22 07:18:50 -05:00
Wilson Snyder 48dd358c03 Fix clang warnings from override. 2020-01-21 20:22:32 -05:00
Geza Lore 220daa5f33 Internals: Restore AstNode naming property. #2133.
The intention was that all subclasses of AstNode which are
intermediate must be abstract as well and called AstNode*. This was
violated recently by 28b9db1903. This
patch restores that property by:
- Renaming AstFile to AstNodeFile
- Introducing AstNodeSimpleText as the common base of AstText and
  AstTextBlock, rather than AstTextBlock deriving from AstText.
2020-01-21 19:54:14 -05:00
Wilson Snyder d76b5b7823 Fix C++11 intrusion. 2020-01-21 19:45:44 -05:00
Wilson Snyder 4266d31443 Internals: Add VL_OVERRIDE to includes. No functional change intended. 2020-01-21 18:02:23 -05:00
Yutetsu TAKATSUKASA fbdf5f2dad Internals: Mark all visit() with VL_OVERRIDE. Closes #2132.
* Add VL_OVERRIDE macro so that compiler can tell my typo when trying to override a function.

* Mark visit() with VL_OVERRIDE. No functional change intended.
2020-01-21 17:35:56 -05:00
Stefan Wallentowitz 8e26bdd098 Fix vpi scope naming (#2130)
Dedot and shorten the name so that public modules and interface cells
are accessible too via VPI.

Fixes #2109
2020-01-21 17:03:21 +01:00
Stefan Wallentowitz 22088c907f Set maximum number width (#2128)
Adjust the maximum number width to 64K. Add --max-num-width option to
adjust this setting.

Closes #2082
2020-01-21 12:17:31 +01:00
Matthew Ballance d87648c258 Correct FST-support issue with some GCC versions. Closes #2129. 2020-01-20 17:33:40 -05:00
Wilson Snyder abf3850d08 Internals: Misc cleanups for classes. 2020-01-20 16:53:27 -05:00
Pieter Kapsenberg 4a122fd0f2 Add detailed location to XML output (#2122)
* Add detailed location to XML output

* Fixing build failures

* less cryptic regulary expressions

* correcting typo in test

* Adding file letter to the location attribute, and cleaning up the regular expression in the tests.

* Add remaining test expected output files for XML changes

* spacing fix, adding documentation on changes
2020-01-20 14:08:13 -05:00
Wilson Snyder 0352ceea44 Internals: Refactor some emit code towards classes. No functional change intended. 2020-01-20 14:07:03 -05:00
Wilson Snyder e8ff191a17 Internals: Prepare for hierarchical NodeModule's. No functional change intended. 2020-01-20 13:27:27 -05:00
Wilson Snyder 5ae09daf5b Internals: Style cleanup. No functional change. 2020-01-20 11:56:08 -05:00
Wilson Snyder 1acff950d0 Commentary: Add deprecations section to docs. Closes #2081. 2020-01-20 10:06:45 -05:00
Stefan Wallentowitz f28d837930 Docker: Tag stable as latest (#2098) 2020-01-20 15:53:26 +01:00
Pieter Kapsenberg 1dd9a74b6c Internals: Move V3Global function definitions to their own files. No functional change intended. Closes #2120. 2020-01-19 07:23:26 -05:00
Pieter Kapsenberg 165833a97c Add compile_commands.json to .gitignore (#2119)
When running make with the "bear" command, the generated
compile_commands.json file shouldn't be considered new source. This file
allows clangd-based code completion tools (e.g. YouCompleteMe) to know
the flags that each file was compiled with.
2020-01-18 22:44:03 -05:00
Wilson Snyder 18e837336a Internals: Rename MethodCall. No functional change. 2020-01-18 14:11:05 -05:00
Wilson Snyder 835f668aaa Internals: Refactor statement tracking. No functional change intended. 2020-01-18 13:02:42 -05:00
Wilson Snyder 09199f79a6 Internals: Add VL_DO_CLEAR delete protections. No functional change intended. 2020-01-18 10:29:49 -05:00
Wilson Snyder 2f4954ca68 Commentary 2020-01-18 09:18:57 -05:00
Wilson Snyder 7024ea8cb6 Cleaner tristate error. #2117. 2020-01-18 07:56:50 -05:00
Wilson Snyder 623c4ec103 Internals: Create VL_DO_DANGLING. No functional change intended. 2020-01-16 20:17:11 -05:00
Wilson Snyder 023526ad4b Internals: Minor refactoring from class branch. 2020-01-15 20:18:12 -05:00
Wilson Snyder e2ba1c041f Commentary 2020-01-15 20:09:19 -05:00
Tobias Rosenkranz b41b9417b9 Fix sign compare warning. Closes #2112. 2020-01-15 07:40:22 -05:00
Pieter Kapsenberg 4443ab34fd Support left justified . Closes #2101. 2020-01-15 07:32:45 -05:00
Wilson Snyder e9a309ea8d Clang warning fix. 2020-01-15 07:27:04 -05:00
Wilson Snyder 81e8127168 Add parameter values in XML. #2110. 2020-01-14 18:51:20 -05:00
Wilson Snyder 47803c3591 Tests: Better message for contributors. 2020-01-14 17:49:04 -05:00
Wilson Snyder af38e8d387 Improve error on > 127 char modnames. #2106. 2020-01-14 07:33:12 -05:00
Wilson Snyder 67bb0c78c8 Codacity fix. 2020-01-14 07:13:35 -05:00
Wilson Snyder 918df2e618 Support / with assoc arrarys. Closes #2100. 2020-01-14 07:01:17 -05:00
Wilson Snyder 7bed17b14b Fix clang warning 2020-01-13 19:01:30 -05:00
Stefan Wallentowitz fad465abf1 Add lint_off -match waivers (#2102)
* Add more directives to configuration files

Allow to set the same directives in configuration files that can also
be set by comment attributes (such as /* verilator public */ etc).

* Add support for lint messsage waivers

Add configuration file switch '-match' for lint_off. It takes a string
with wildcards allowed and warnings will be matched against it (if
rule and file also match). If it matches, the warning is waived.

Fixes #1649 and #1514 
Closes #2072
2020-01-12 10:03:17 +01:00
Wilson Snyder 98fb7ec193 Commentary. 2020-01-11 21:08:20 -05:00
Wilson Snyder b71eb76252 For / allow 64-bit addressing. 2020-01-11 14:08:07 -05:00
Wilson Snyder 1d2a7b2f41 Style cleanups. No functional change. 2020-01-11 12:36:30 -05:00
Wilson Snyder cd38e88fb8 For travis, add VERILATOR_AUTHOR_SITE to get -Werror. Closes #2099. 2020-01-11 10:52:13 -05:00
Todd Strader a15aa0b82b Fix clang warning 2020-01-11 09:59:42 -05:00
Wilson Snyder fe94f9891b Add error on misused define. 2020-01-11 09:16:26 -05:00
Wilson Snyder fe9cf9bd42 devel release 2020-01-11 09:08:33 -05:00
Wilson Snyder 0c99bee4b1 Version bump 2020-01-11 06:54:36 -05:00
Wilson Snyder f66dacd185 Remove some make clean files. 2020-01-11 06:53:52 -05:00
Wilson Snyder 5f9ceb99a7 Cleanup spacing. 2020-01-10 21:37:53 -05:00
Wilson Snyder 2638f9db19 Error cleanups. 2020-01-10 19:18:27 -05:00
Wilson Snyder 8859cbf5bc Commentary 2020-01-10 19:12:45 -05:00
Wilson Snyder 16bb97687a Tests: Check for missing newlines at EOF. 2020-01-10 18:49:23 -05:00
Wilson Snyder 1234c83953 Fix some C++11 requirements. 2020-01-10 07:07:21 -05:00
Wilson Snyder 2982336ec2 Commentary 2020-01-09 20:29:36 -05:00
Wilson Snyder ca211c3b11 Commentary - Codacy badge fix. 2020-01-09 20:28:33 -05:00
Wilson Snyder 87d126de49 Commentary 2020-01-09 20:09:50 -05:00
Philipp Wagner 4a307742c4 Fix typo in help output (#2096)
The variable is named VM_PARALLEL_BUILDS, not VM_PARALLEL_BUILD.

Signed-off-by: Philipp Wagner <[email protected]>
2020-01-09 20:07:08 -05:00
Wilson Snyder a2911ed933 Fix shebang breaking some shells. Closes #2067. 2020-01-09 20:01:12 -05:00
Wilson Snyder 2a50fafef2 Fix %{number}s with strings. #2093. 2020-01-09 19:39:27 -05:00
Wilson Snyder 029ff69d30 Update .clang-format to allow 6.0.0 to work. 2020-01-09 19:39:14 -05:00
Wilson Snyder aac02c1ed1 Fix expand optimization slowing --lint-only. Closes #2091. 2020-01-09 18:04:49 -05:00
Stefan Wallentowitz 525c79bd0a Add Docker infrastructure (#2087)
This adds files to build and run two Docker images:

 - run: Build a Docker container that can be used as an executable
        drop-in for verilator. This can be useful to test behavior of
        older versions or a development version. The functionality is
        pretty simplistic at the moment for a start.

 - buildenv: Everything needed to build and test Verilator. Useful to
        run quick tests in the cloud or try other compilers. It can
        also serve as basis for further CI integration.
2020-01-09 23:22:15 +01:00
Yutetsu TAKATSUKASA b5c151863a Update .clang-format so that recent clang-format such as LLVM-8 works. (#2092)
Use C++03 because this project needs to compile with the standard.
2020-01-09 10:13:08 -05:00
Wilson Snyder 06247686c5 Codacy cleanups 2020-01-08 19:33:47 -05:00
Wilson Snyder 951a7d867a Commentary 2020-01-08 19:33:42 -05:00
Wilson Snyder 9978cbfa5c Fix tracing -1 index arrays. Closes #2090. 2020-01-08 07:32:31 -05:00
Wilson Snyder f23fe8fd84 Update copyright year. 2020-01-06 18:05:53 -05:00
Stefan Wallentowitz 37dc33a195 Deprecation (#2088)
* Add deprecation warning

* Deprecate -msg in configuration files

* Deprecate sc_clock
2020-01-03 17:27:51 +01:00
Stefan Wallentowitz 924fe235a9 No assign alias for unpacked public variables (#2089)
Public variables are all emitted in the C code and unpacked arrays
arrays are sliced up for this. After inlining public unpacked array
assignments should not be alias assignments but actual assignments, so
that they are sliced and hence emitted properly.

Fixes #2073
2020-01-03 13:44:45 +01:00
Todd Strader 1957b1ebbd Fix permissions on build_vcddiff.sh 2020-01-02 07:40:15 -05:00
Todd Strader b70d1c1349 Update gtkwave files 2020-01-02 07:39:24 -05:00
Stefan Wallentowitz b7665a88db Rename msg to rule in configuration files (#2080)
Rename the -msg switch to -rule in configuration files as it is more
clear.

resolves #2068
2019-12-30 19:15:43 +01:00
Kuba Ober 19c8d32263 Fix SystemC link in the documentation. (#2076) 2019-12-30 18:56:51 +03:00
Stefan Wallentowitz 7b384f7eb7 XML: Add variable attributes (#2079) 2019-12-30 12:55:36 +01:00
Kuba Ober 7bbce51f7b Add include guard to V3InstrCount.h. (#2075)
This is needed for cmake unity build to work.
2019-12-30 06:04:03 +03:00
Kuba Ober ac1cdf7cdf Implement APIs missing on Windows. (#12) 2019-12-28 19:44:24 +03:00
Wilson Snyder c753904a3f Internals: Copy into parser Verilog-Perl rules as comments. No functional change. 2019-12-24 16:15:48 -05:00
Wilson Snyder 8bd43d83b1 Internals: bisonpre should ignore commented BISONPRE lines. 2019-12-24 16:15:47 -05:00
Wilson Snyder ea5b01d9f3 Internals: Rename pexpr. No functional change intended. 2019-12-24 16:04:28 -05:00
Wilson Snyder f540dead79 Internals: new() support code, and misc stuff. 2019-12-24 12:47:27 -05:00
Wilson Snyder 40a847d613 Internals: Refactor some code. No functional change intended. 2019-12-24 10:23:43 -05:00
Wilson Snyder 37b9f254a2 Internals: Add origNameProtect. No functional change intended. 2019-12-24 08:47:30 -05:00
Wilson Snyder c8daab3b46 Internals: Refactor some member handling. No functional change intended. 2019-12-23 20:48:23 -05:00
Wilson Snyder a0d391d695 Tests: Less aggressive contributors check. 2019-12-23 19:01:29 -05:00
Wilson Snyder 5089f997cc Internals: Use standard function for include guards. No functional change intended. 2019-12-23 19:00:17 -05:00
Wilson Snyder 5c59fde92e Fix codacy warning 2019-12-23 18:56:08 -05:00
Wilson Snyder 81ee4930fc Github: Update issue templates 2019-12-23 17:40:50 -05:00
Wilson Snyder 350de3719e Github: Update issue templates 2019-12-23 17:39:38 -05:00
Wilson Snyder a37a127ef1 Github: Update issue templates 2019-12-23 17:37:48 -05:00
W Snyder dc8a0dfd5a Update issue templates 2019-12-23 17:36:26 -05:00
Wilson Snyder 0ca197ec1b Github: Add issue templates 2019-12-23 17:34:53 -05:00
Wilson Snyder f23a7bfdd7 Tests: Check for carriage returns 2019-12-23 17:34:43 -05:00
Peter Monsson 9b998cf6b3 Support implication operator "|->" in assertions, #2069.
Signed-off-by: Wilson Snyder <[email protected]>
2019-12-23 16:49:18 -05:00
Wilson Snyder 0f0c3d4684 Internals: Copy into parser Verilog-Perl rules as comments. No functional change. 2019-12-23 16:27:07 -05:00
Wilson Snyder bacbb4cafd Parse join_any/join_none still as unsupported. 2019-12-23 15:19:22 -05:00
Wilson Snyder 4afde8b478 Test class parsing (intended as part of last commit). 2019-12-23 15:18:55 -05:00
Wilson Snyder 2cbfe99ad5 Parse all class constructs, as still unsupported. 2019-12-23 15:03:04 -05:00
Julien Margetts c1fb938a61 Fix huge case statement performance. Closes #1644.
Signed-off-by: Wilson Snyder <[email protected]>
2019-12-23 07:47:57 -05:00
Wilson Snyder 49db4d2b66 Internals: Trivial spacing change to force CI rebuild. No functional change. 2019-12-22 20:02:37 -05:00
Wilson Snyder b087673254 Fix output endif spacing. No functional change. 2019-12-22 18:21:43 -05:00
Wilson Snyder 5c361efaea Internals: Minor format cleanups. No functional change. 2019-12-22 18:09:46 -05:00
Peter Monsson ea979c8f83 Fix disable iff in assertions. Closes #1404.
Signed-off-by: Wilson Snyder <[email protected]>
2019-12-22 15:49:10 -05:00
Wilson Snyder 3a70bbc70c Update Changes to reflect github issue numbers. 2019-12-22 15:33:45 -05:00
Kuba Ober 3f0e2f7d9d Fix argument in AstConst.m_num.width. (#9) 2019-12-21 10:25:05 -05:00
Kuba Ober c9ca390926 Fix missing <algorithm> header. Pull (#8) 2019-12-20 20:14:52 -05:00
Kuba Ober 4a31b69f84 Decrease the number of chained if-else blocks to fix MSVC build. Pull (#7)
MSVC has a limit of 128 blocks in a chain.
2019-12-20 20:07:50 -05:00
Kuba Ober ee184f3f39 Fix strcasecmp for windows, bug1651.
Signed-off-by: Wilson Snyder <[email protected]>
2019-12-20 06:58:05 -05:00
Wilson Snyder 9807025618 Fix infinite loop on some V3Ast internal errors. 2019-12-19 20:07:48 -05:00
Stefan Wallentowitz 9a54b2144b Fix queue issues, bug1643.
Signed-off-by: Wilson Snyder <[email protected]>
2019-12-18 18:17:18 -05:00
Wilson Snyder 0465b6a3b1 Fix example makefiles, 1648. 2019-12-18 17:58:24 -05:00
Julien Margetts cafb148a62 Commentary 2019-12-17 18:27:47 -05:00
Stefan Wallentowitz d738501c01 Fix queues as statements, bug1641. 2019-12-17 06:08:41 -05:00
Wilson Snyder 53c6b7df63 Internals: Rename NodeClassDType. No functional change. 2019-12-16 22:46:09 -05:00
Wilson Snyder f514049c04 Add cleaner error on version control conflicts in sources. 2019-12-16 21:54:20 -05:00
Wilson Snyder 83a1bd0675 Support immediate cover statements & refactor coverage internals. 2019-12-16 21:44:20 -05:00
Yutetsu TAKATSUKASA 8cdc0c4e00 Support string putc, getc, substr, bug1606.
Signed-off-by: Wilson Snyder <[email protected]>
2019-12-15 08:09:52 -05:00
Wilson Snyder 460e0541f3 Add error when `resetall inside module 2019-12-14 22:04:58 -05:00
Wilson Snyder 2408de16a0 Support bounded queues. 2019-12-14 21:39:47 -05:00
Wilson Snyder 2a1c57ada6 With -Wpedentic, warn about bad `pragma 2019-12-14 10:13:38 -05:00
Wilson Snyder 7387db506d GTKWave: Merge from upstream. 2019-12-14 09:25:36 -05:00
Stefan Wallentowitz 3ac6745658 Add vpiTimeUnit and allow to specify time as string, bug1636.
Signed-off-by: Wilson Snyder <[email protected]>
2019-12-13 19:11:37 -05:00
Wilson Snyder 39950d16d0 Ignore `uselib to end-of-line, bug1634. 2019-12-12 20:57:48 -05:00
Todd Strader c62c152048 Commentary 2019-12-12 07:53:08 -05:00
Wilson Snyder 6046b06b17 Tests: Fix no-email contributors. 2019-12-11 18:56:10 -05:00
Julien Margetts f7a06cb54a Fix little endian cell ranges, bug1631.
Signed-off-by: Wilson Snyder <[email protected]>
2019-12-11 17:15:45 -05:00
Wilson Snyder 521418d832 Update FST trace API for better performance. 2019-12-10 18:55:09 -05:00
Wilson Snyder 1c643916a3 Tests: Add copy_if_golden to harness. 2019-12-10 18:53:35 -05:00
Todd Strader 9cf5acc43e Install vcddiff for Travis, bug1600. 2019-12-10 05:27:34 -05:00
Yutetsu TAKATSUKASA c2037ddbc5 Support string compare, icompare, ato* methods, bug1606.
Signed-off-by: Wilson Snyder <[email protected]>
2019-12-09 19:17:52 -05:00
Wilson Snyder ca1b083d5c Fix clang warning. 2019-12-09 18:53:56 -05:00
Wilson Snyder c896a76fef Fix clang warning. 2019-12-09 18:25:59 -05:00
Wilson Snyder bd0eadb311 Fix handling user-botch of %d to print real. 2019-12-08 22:48:44 -05:00
Wilson Snyder 62b0d15d2e Add lint check for bad enum 4-state values. 2019-12-08 22:26:54 -05:00
Wilson Snyder 700f2072c0 Framework for WDatas being vectors of 64-bit EDatas, but not supporting this at this time. 2019-12-08 21:36:38 -05:00
Wilson Snyder cda5c53cf9 Add BOUNDED warning and promote bounded queues to unbounded. 2019-12-08 15:56:49 -05:00
Wilson Snyder 3be0eea995 devel release 2019-12-08 13:50:14 -05:00
Wilson Snyder 44ce83cd8e Version bump 2019-12-08 07:58:47 -05:00
Wilson Snyder c199930943 Commentary 2019-12-08 07:34:47 -05:00
Wilson Snyder 81fc1d48a6 Fix gate lvalue optimization error, bug831. 2019-12-07 16:49:11 -05:00
Wilson Snyder f330f16bf6 Internals: Additional debug dumps. 2019-12-07 16:41:34 -05:00
Wilson Snyder 10a6b566ef Fix error on unpacked concatenations, bug1627. 2019-12-07 15:53:34 -05:00
Driss Hafdi cff5485821 Tests: Unsupported test for bug1627.
Signed-off-by: Wilson Snyder <[email protected]>
2019-12-07 13:46:50 -05:00
Driss Hafdi dcbdac1b81 Tests: Unsupported test for bug1626.
Signed-off-by: Wilson Snyder <[email protected]>
2019-12-07 13:46:29 -05:00
Driss Hafdi a59777aa75 Tests: Unsupported test for bug1624.
Signed-off-by: Wilson Snyder <[email protected]>
2019-12-07 13:15:46 -05:00
Driss Hafdi d82b9128d0 Tests: Unsupported test for bug1623.
Signed-off-by: Wilson Snyder <[email protected]>
2019-12-07 12:59:00 -05:00
Driss Hafdi ab4f18c892 Tests: Unsupported test for bug1622.
Signed-off-by: Wilson Snyder <[email protected]>
2019-12-07 12:59:00 -05:00
Todd Strader 4480938b25 Fix interface reference tracing, bug1595. 2019-12-07 12:28:19 -05:00
Driss Hafdi 11a1b201a9 Tests: Unsupported on parameters in functions, bug1624. 2019-12-06 18:51:39 -05:00
Wilson Snyder 1a8b192e40 Unsupported on parameters in functions, bug1624. 2019-12-06 18:50:41 -05:00
Driss Hafdi aee3a32354 Added name to Contributors 2019-12-06 18:49:54 -05:00
Wilson Snyder 35e9489f33 Includes: Allow VCD trace of 64 bit array. 2019-12-05 22:25:30 -05:00
Wilson Snyder 5c6d74cd80 Fix assertion on dotted parameter arrayed function, bug1620. 2019-12-04 19:25:45 -05:00
Wilson Snyder 8611ff230d GTKWave: Merge from upstream. No functional change. 2019-12-04 05:31:38 -05:00
Wilson Snyder 8ef4097f00 Fix cppcheck warning. 2019-12-03 19:21:36 -05:00
Wilson Snyder fe684e8733 Allow redefining VL_PRINTF, bug1598. 2019-12-03 19:12:18 -05:00
Garrett Smith 96f8bbd023 Support float and shorts, bug1592, bug1619.
Signed-off-by: Wilson Snyder <[email protected]>
2019-12-03 18:26:22 -05:00
Wilson Snyder 95ffcad12e Fix t_queue crash on Trusty due to lifetime issue. 2019-12-03 07:18:59 -05:00
Wilson Snyder ebed1a9000 Fix 64-bit signed power with -1. 2019-12-03 06:58:38 -05:00
Wilson Snyder 2240f42bfa Fix 64-bit signed power with -1. 2019-12-03 06:26:17 -05:00
Wilson Snyder ac4f0da9ee Tests: Add output wire check. 2019-12-02 20:38:43 -05:00
Wilson Snyder 559852f60b Add error when number missing value. 2019-12-02 20:21:24 -05:00
Wilson Snyder b0669f3aca Fix false unused message on __Vemumtab, msg3180. 2019-12-02 19:03:33 -05:00
Todd Strader 00979ede14 Fix overly aggressive --protect-lib check 2019-12-02 08:33:44 -05:00
Todd Strader 13569ed98b Stop-gap CI email fix 2019-12-02 08:18:15 -05:00
Wilson Snyder 809a6de9cd Fix template brackets to avoid C++11, bug1617. 2019-12-02 06:19:33 -05:00
Wilson Snyder d65d8fda54 Optimize returns at end of functions. 2019-12-01 17:19:18 -05:00
Wilson Snyder 2076b0219d Fix labels on functions with returns, bug1614. 2019-12-01 17:19:03 -05:00
Wilson Snyder 32f93a8a1e Commentary, bug1615. 2019-12-01 12:43:41 -05:00
Wilson Snyder e28175108f Support queues (excluding {} notation and pattern assignments), bug545. 2019-12-01 12:35:49 -05:00
Wilson Snyder b81295230a Support associative arrays. 2019-12-01 11:52:48 -05:00
Wilson Snyder 6ae7f7b152 Last commit: Fix pattern mismatch crash. 2019-12-01 11:43:48 -05:00
Wilson Snyder 03026b63b9 Internals: Refactor huge pattern function. No functional change intended. 2019-12-01 11:03:53 -05:00
Wilson Snyder 38e586fabe Internals: Misc refectoring for assoc/queues. 2019-12-01 06:09:58 -05:00
Wilson Snyder 3d6e8e9eb0 Add -Wno-context.
Signed-off-by: Wilson Snyder <[email protected]>
2019-11-23 10:40:32 -05:00
Wilson Snyder df192f2b61 Support / with warning. 2019-11-23 09:16:06 -05:00
Wilson Snyder 17ad59394f Support shortreal as real, with a SHORTREAL warning. 2019-11-23 08:34:40 -05:00
Wilson Snyder 682c2a610f Fix $display("%p") to be closer to IEEE. 2019-11-21 19:29:46 -05:00
Wilson Snyder 59782266b9 Tests: Fix uninitalized data in t_vpi_time tests, bug1612. 2019-11-21 18:42:40 -05:00
Wilson Snyder 4885bcb93c Tests: Report core dumps on tests. 2019-11-21 18:42:40 -05:00
Todd Strader d47d3b5162 Fix CI typo 2019-11-21 08:31:18 -05:00
Wilson Snyder 99455a16bf Fix // in filenames, bug1610. 2019-11-20 21:23:03 -05:00
Wilson Snyder a86e1953eb Tests: Fix object order dependence, bug1611. 2019-11-20 06:57:39 -05:00
Matthew Ballance f63dfd7028 Fix VPI timed callbacks to be one-shot, pull5.
Signed-off-by: Matthew Ballance <[email protected]>
Signed-off-by: Wilson Snyder <[email protected]>
2019-11-19 22:44:33 -05:00
Matthew Ballance 7a413a121d Tests: Fix modelsim driver, pull 5.
Signed-off-by: Matthew Ballance <[email protected]>
Signed-off-by: Wilson Snyder <[email protected]>
2019-11-19 21:53:17 -05:00
Wilson Snyder 0f6b625db8 Fix hang on concat error, bug1608. 2019-11-19 19:23:40 -05:00
Wilson Snyder f134ac4f2f Black box some additional unsupported constructs. 2019-11-17 09:01:41 -05:00
Wilson Snyder 39eeda50c6 Internals: Rename MethodCall. No functional change. 2019-11-17 08:51:25 -05:00
Wilson Snyder 09ca4ce791 Internals: Assert proper AstArgs in place. 2019-11-17 08:43:04 -05:00
Wilson Snyder 2ff22d9050 Fix earlier +verilated+error+count to do all . 2019-11-17 08:12:39 -05:00
Wilson Snyder c726ad0142 Commentary 2019-11-17 07:53:30 -05:00
Wilson Snyder 0c0198cf55 Support string.toupper and string.tolower. 2019-11-17 05:05:09 -05:00
Wilson Snyder d480c2f033 Add +verilator+error+limit to see more assertion errors. 2019-11-16 18:25:47 -05:00
Wilson Snyder 8ebe86e54b Fix color assertion on empty if, bug1604. 2019-11-16 17:23:51 -05:00
Wilson Snyder 62af9dbed4 Fix member to method error messages. 2019-11-16 15:32:55 -05:00
Wilson Snyder 3eb0ff8aa0 Detect wrong number of args on method calls. 2019-11-16 15:18:57 -05:00
Wilson Snyder ce5a70fbca Internals: Split large method function. No functional change. 2019-11-16 14:40:45 -05:00
Wilson Snyder c36d9a68f5 Support $ungetc. 2019-11-16 12:55:10 -05:00
Wilson Snyder 8c5aa21a11 Support $rewind. 2019-11-16 12:21:35 -05:00
Wilson Snyder 47b5e36e60 Add -Wpedantic for compliance testing. 2019-11-16 11:59:21 -05:00
Wilson Snyder a481638edb Add error on redefining preprocessor directives. 2019-11-16 10:19:43 -05:00
Wilson Snyder de7caad710 Fix signed wildcard comparisons. 2019-11-16 09:58:01 -05:00
Wilson Snyder b1c14e485a Fix capital S signed numbers. 2019-11-16 09:39:41 -05:00
Wilson Snyder 66727670f9 Override gtkwave config in upstreamable way. No functional change. 2019-11-16 03:54:05 -05:00
Wilson Snyder b9322206d7 Update gtkwave files to latest 2019-11-16 03:44:51 -05:00
Wilson Snyder 617424e04a Internals: Fix cppcheck warning. No functional change. 2019-11-16 03:14:55 -05:00
Wilson Snyder e9c4ffa04e Fix for loop missing initializer, bug1605. 2019-11-15 18:24:55 -05:00
Todd Strader 30c2e53f9e Travis fixes 2019-11-14 17:54:57 -05:00
Sebastien Van Cauwenberghe a250decfaa Tests: Fix t_trace_cat when non-English sort. 2019-11-13 06:43:15 -05:00
Wilson Snyder 21a380def0 Rework variable emit to prep for other data types. 2019-11-12 21:52:25 -05:00
Wilson Snyder 77e30d4920 Internals: Remove dead code. No functional change. 2019-11-12 18:55:16 -05:00
Wilson Snyder 98dcbc6b3e Remove footprint comment when single threaded. 2019-11-11 22:21:37 -05:00
Wilson Snyder 6ce81698e7 devel release 2019-11-10 14:25:54 -05:00
Wilson Snyder 30be381aa8 Version bump 2019-11-10 14:13:46 -05:00
Wilson Snyder e04bc16ffa Codacity cleanup 2019-11-10 13:21:05 -05:00
Wilson Snyder 2b26ca2c07 Optimize mask/and above conditionals. 2019-11-10 13:17:29 -05:00
Wilson Snyder ce178ec987 Optimize modulus by power-of-two constants. 2019-11-10 12:12:57 -05:00
Wilson Snyder fcb733e8d0 Fix clang warning. 2019-11-09 21:47:27 -05:00
Wilson Snyder f87107e757 Tests etc: Cleanup some clang-format suggestions. No functional change. 2019-11-09 20:35:12 -05:00
Wilson Snyder cf9f466f0a Fix false uninit warning 2019-11-09 18:42:18 -05:00
Wilson Snyder 28cbf39995 Support some unpacked arrays in parameters, bug1315. 2019-11-09 18:31:24 -05:00
Wilson Snyder 4767083a72 Internals: Rework AstInitArray to have O(1) access. No functional change intended. 2019-11-09 17:12:26 -05:00
Wilson Snyder 704f40b1a2 Internals: Prep work for simulation of array parameters, bug1315. No functional change intended. 2019-11-09 15:27:10 -05:00
Wilson Snyder c5f859c9a3 Internals: Format cleanup. No functional change. 2019-11-09 15:27:10 -05:00
Todd Strader abe95f3ab3 Add interface port visibility in traces, bug1594. 2019-11-08 08:26:48 -05:00
Wilson Snyder 2eda38c4d1 Update URLs to https://verilator.org 2019-11-07 22:41:34 -05:00
Wilson Snyder 5811ec07e6 Update URLs to https://verilator.org 2019-11-07 22:33:59 -05:00
Wilson Snyder 8a5d13bce2 Commentary 2019-11-07 20:13:00 -05:00
Wilson Snyder 3232bdf016 Commentary 2019-11-07 19:55:11 -05:00
Wilson Snyder 7ef620dc64 Rewrite README and install.adoc 2019-11-07 19:52:56 -05:00
Wilson Snyder 8043a9c666 Tests: Test for bug1593. 2019-11-07 18:15:55 -05:00
Wilson Snyder f1b10e2b4c Improve error messages on DIDNOTSETTLE, bug1556. 2019-11-06 19:47:34 -05:00
Wilson Snyder c1a9ada279 Protect change request filenames. 2019-11-05 21:53:26 -05:00
Wilson Snyder 2aed499e00 Fix detecting missing reg types, bug1570. 2019-11-05 21:15:44 -05:00
Wilson Snyder b2c5f8e74e Commentary: No functional change. 2019-11-05 20:42:49 -05:00
Todd Strader 9ef200d5a3 Fix --protect-lib test concurrency issue, bug1580. 2019-11-05 08:49:43 -05:00
Wilson Snyder 8a3227697e Fix bad-syntax crashes, bug1579. 2019-11-04 22:00:20 -05:00
Wilson Snyder 530ab17c8b Fix bad-syntax crashes, bug1586, bug1587. 2019-11-04 21:51:20 -05:00
Wilson Snyder ca8da1f54f Fix bad-syntax crashes, bug1589. 2019-11-04 21:16:07 -05:00
Wilson Snyder cc4cb4e006 Avoid internal on unsupported; make tests more stable otherwise on internal. 2019-11-04 21:11:15 -05:00
Wilson Snyder e40ad4a095 Commentary; part of last commit. 2019-11-04 19:33:21 -05:00
Wilson Snyder 67a0ad02d2 Fix bad-syntax crasses, bug1591. 2019-11-04 19:27:31 -05:00
Wilson Snyder 055a978866 Fix bad-syntax crasses, bug1583, bug1585. 2019-11-04 19:06:55 -05:00
Wilson Snyder 67d52372e5 Fix bad-syntax crashes, bug1582. 2019-11-04 18:48:47 -05:00
Wilson Snyder a28896d967 Don't have examples require graphviz 2019-11-02 17:44:58 -04:00
Wilson Snyder 9ff5ef4ad5 Fix false CMPCONST/UNSIGNED warnings on inside, bug1581. 2019-11-02 16:56:37 -04:00
Wilson Snyder 25f08b29c6 Add XML examples. 2019-11-02 16:40:59 -04:00
Wilson Snyder 7febeab275 Tests: Use standard verilator.mk rules for tests. 2019-11-02 11:15:58 -04:00
Wilson Snyder c0c038c887 Remove false unoptimizable warning under debug 2019-11-02 11:15:08 -04:00
Wilson Snyder 8a5b8d5f38 Internals: Fix VFlagBitPacked giving 4-state types. 2019-11-01 20:10:45 -04:00
Wilson Snyder ff0dd26fe5 Fix --trace-coverage with randReset. 2019-11-01 20:09:57 -04:00
Wilson Snyder f781085755 Add --xml-output option. 2019-10-31 21:17:05 -04:00
Wilson Snyder 8f6efdaf5c Allow both -MMD and --no-MMD, and --no/--skip-identical to override default 2019-10-31 20:59:52 -04:00
Wilson Snyder 4b5f0fd173 Tests: Cleanup mis-die's 2019-10-31 20:45:17 -04:00
Wilson Snyder 1224c69126 Tests: Fix bad-syntax crashes, bug1577. 2019-10-31 19:34:13 -04:00
Wilson Snyder bcb766b4ce Fix bad-syntax crashes, bug1577. 2019-10-30 21:49:25 -04:00
Wilson Snyder 63373f6f4c Fix missing error when parameter assigned to type, bug1576. 2019-10-30 18:18:29 -04:00
Wilson Snyder 40bdd85a07 Fix minor output spacing issues. 2019-10-29 23:19:59 -04:00
Wilson Snyder 974bf1d643 Add .clang-format. Note this gets close, but isn't perfect, don't blindly use it. 2019-10-29 22:40:58 -04:00
Wilson Snyder 8ce60e955f Fix missing error when parameter assigned to type, bug1575. 2019-10-29 18:38:59 -04:00
Wilson Snyder 171960635e Add recursive define detection, bug1574. 2019-10-28 22:35:31 -04:00
Wilson Snyder 2ab819aef0 Fix bad-syntax crashes, bug1573 2019-10-28 18:46:13 -04:00
Wilson Snyder 647c321437 Suppress 'command failed' on normal errors. 2019-10-27 17:34:04 -04:00
Wilson Snyder 2bbb9dccb1 Less verbose ar messages 2019-10-27 11:30:25 -04:00
Wilson Snyder bac5d32582 Commentary; fix example here documents. 2019-10-27 11:30:12 -04:00
Wilson Snyder 3ebd6915f3 Commentary 2019-10-27 10:29:19 -04:00
Wilson Snyder f852ba8a33 Add --trace-coverage. 2019-10-27 09:27:18 -04:00
Wilson Snyder 8f6015aad5 Fix copy-and-paste error in undriven checks. 2019-10-24 22:50:50 -04:00
Wilson Snyder 352adbed74 Codacy/Cppcheck cleanups. 2019-10-24 22:40:15 -04:00
Wilson Snyder 0cbfd29ac5 Codacy/Cppcheck cleanups and badge. 2019-10-24 22:19:46 -04:00
Wilson Snyder 9f977ed419 Codacy/Cppcheck cleanups and badge. 2019-10-24 21:48:45 -04:00
Yves Mathieu baa6a2c31a Support quoted arguments in -f files, bug1535.
Signed-off-by: Wilson Snyder <[email protected]>
2019-10-24 07:33:19 -04:00
Todd Strader 3b33438e91 Benchmark --protect-lib runtime, bug1519. 2019-10-23 10:03:37 -04:00
Wilson Snyder 17ee8579a4 Internals: Make cleanOut/sizeMatters const. No functional change intended. 2019-10-20 11:58:41 -04:00
Wilson Snyder 94f7133c6f Internals: make dump const. No functional change intended. 2019-10-20 11:49:41 -04:00
Wilson Snyder 6d58d32a0f Commentary 2019-10-19 22:37:08 -04:00
Wilson Snyder c9d000467b Tests: Allow test-by-test verbose. 2019-10-19 07:14:13 -04:00
Wilson Snyder e15d3afb7b Commentary 2019-10-19 07:08:18 -04:00
Ahmed El-Mahmoudy 712bc43a06 Commentary, bug1568. 2019-10-19 06:47:46 -04:00
Wilson Snyder 71fa09a25b Fix bad-syntax crashes, bug1563. 2019-10-18 21:30:34 -04:00
Wilson Snyder 89c3c5f952 Internals: Style cleanup. No functional change. 2019-10-18 20:28:59 -04:00
Wilson Snyder 7311c84937 Slightly faster FST tracing. 2019-10-18 19:48:27 -04:00
Wilson Snyder 8078fc0965 Commentary 2019-10-18 19:40:48 -04:00
Wilson Snyder 31a6a968cc Speedup compiler flags for Ubuntu 19.10. 2019-10-17 20:43:45 -04:00
Patrick Stewart 1e4f471049 Add cmake support, bug1363.
Signed-off-by: Wilson Snyder <[email protected]>
2019-10-17 19:44:10 -04:00
Wilson Snyder 1232746395 Tests: Keep pass/unsup/skip count on retests. 2019-10-17 19:33:47 -04:00
Wilson Snyder 1852ae1cc8 Tests: Tweak driver to still print status every 15 seconds. 2019-10-16 23:17:31 -04:00
Eric Rippey 77f79f0114 Tests: Add fuzzing infrastructure.
Signed-off-by: Wilson Snyder <[email protected]>
2019-10-16 22:18:35 -04:00
Wilson Snyder 6081c262f2 Fix misc bad-syntax crashes, bug1557-1560. 2019-10-16 20:05:29 -04:00
Todd Strader 46ab907f6a Refactor Verilator building in Travis, bug1547. 2019-10-16 05:32:59 -04:00
Todd Strader 8700564197 Build examples using only their Makefiles. 2019-10-16 05:30:51 -04:00
Todd Strader af8cc9127f driver.pl: Report possibly stalled tests. 2019-10-16 05:28:27 -04:00
Wilson Snyder c73336f8f5 Fix misc bad-syntax crashes, bug1548, bug1550-1553. 2019-10-15 19:06:00 -04:00
Patrick Stewart 4361fb838f Tests: Minor testbench fixes to prepare for CMake.
Signed-off-by: Wilson Snyder <[email protected]>
2019-10-10 19:48:06 -04:00
Wilson Snyder 6b8afe8137 Commentary 2019-10-10 06:46:03 -04:00
Wilson Snyder a7c2037b7a Add --generate-key. 2019-10-09 18:53:30 -04:00
Todd Strader 9b09309f51 Commentary: Fix Changes 2019-10-09 08:28:53 -04:00
Todd Strader da0da9e258 Add --protect-lib to create protected libraries, bug1490. 2019-10-09 06:47:26 -04:00
Wilson Snyder 58a42834a6 Tests: Remove some old makefile rules. 2019-10-08 19:12:33 -04:00
Wilson Snyder 8c836e1222 Fix clang thread lint error. 2019-10-08 12:07:46 -04:00
Wilson Snyder ce179bd2e3 Fix clang mutex check. 2019-10-08 08:29:53 -04:00
Patrick Stewart 68e5c95b82 Tests: Rename harness flag. No functional change.
Signed-off-by: Wilson Snyder <[email protected]>
2019-10-07 22:15:43 -04:00
Patrick Stewart 07db53e54f Commentary 2019-10-07 22:11:50 -04:00
Patrick Stewart 0ed58a4217 Fix multithreaded yield behavior when no work.
Signed-off-by: Wilson Snyder <[email protected]>
2019-10-07 19:27:31 -04:00
Patrick Stewart 8e6d68147c Support multithreading on Windows.
Signed-off-by: Wilson Snyder <[email protected]>
2019-10-07 19:23:06 -04:00
Wilson Snyder e08b9b84b5 Commentary 2019-10-07 17:31:33 -04:00
Wilson Snyder 2f28c5f5b4 Increase case duplicate/incomplete to 16 bit tables, bug1545. 2019-10-07 07:38:40 -04:00
Wilson Snyder 91f1acd85f Add --protect-ids to obscure information in objects, bug1521. 2019-10-06 13:24:21 -04:00
Wilson Snyder ed1e5fb509 Tests: When doing extended tests, run most examples under harness for better parallelism. 2019-10-06 10:58:16 -04:00
Wilson Snyder 99b2ab7540 Rename examples in prep for CMake. 2019-10-06 10:32:49 -04:00
Wilson Snyder 763b9909f1 devel release 2019-10-06 10:04:45 -04:00
Wilson Snyder dfcd412e5f Version bump 2019-10-06 09:40:36 -04:00
Wilson Snyder 307549e8a6 Internals: Fix some cppcheck warnings. 2019-10-06 08:20:02 -04:00
Wilson Snyder 09b79a731a Fix more output spacing issues. 2019-10-05 21:52:33 -04:00
Wilson Snyder 4544a2fd99 Fix extra declaration of trace() in submodules. 2019-10-05 20:16:33 -04:00
Wilson Snyder e09c918198 Fix indentation broke in 977a767477. 2019-10-05 18:00:45 -04:00
Wilson Snyder 9bf6135f6d Remove some output tabs. 2019-10-05 17:35:08 -04:00
Wilson Snyder d472ef63e9 Internals: Cleanup some misnamed classes. No functional change. 2019-10-05 08:17:21 -04:00
Wilson Snyder f1c04b5d25 Fix extra space in mtask comment. No functional change. 2019-10-04 22:54:57 -04:00
Wilson Snyder 1cf29c4d20 Fix truncation of comments, broke in f133c4d0b3. 2019-10-04 22:54:17 -04:00
Maarten De Braekeleer 977a767477 Avoid tabs in C output.
Signed-off-by: Wilson Snyder <[email protected]>
2019-10-04 21:10:53 -04:00
Wilson Snyder 771a301f66 Commentary: Remove newlines, upsets some patches. No functional change. 2019-10-04 20:17:11 -04:00
Wilson Snyder a9954a71c3 Fix case statements with strings, bug1536. 2019-10-04 19:13:39 -04:00
Wilson Snyder 967dc24fda Commentary 2019-10-04 17:42:34 -04:00
Wilson Snyder e1e45cf13c Internals: Move option checks to notify(). 2019-10-03 22:18:29 -04:00
Wilson Snyder bd89c71694 Internals: Refactor to avoid V3Global requirements in V3String. No functional change intended. 2019-10-02 21:38:16 -04:00
Stefan Wallentowitz 633131b984 Return vpiModule when it is the scope.
Return the vpiModule when it is searched for by name and not the vpiScope,
now that we actually have it (one step further to supporting vpiModule in
complete).

Signed-off-by: Stefan Wallentowitz <[email protected]>
Signed-off-by: Wilson Snyder <[email protected]>
2019-10-02 18:47:12 -04:00
Wilson Snyder 99db18b6c3 Commentary 2019-10-02 18:47:06 -04:00
Todd Strader 961a8e190f Internals: Remove rogue character. 2019-10-02 08:52:26 -04:00
Stefan Wallentowitz 045ff25f80 Support vpiModule, bug1469.
Add very basic support for vpiModule. Basically it allows to traverse
the module tree to find a variable etc. It does not support more than
vpi_iterate and vpi_scan for vpiModule along basic operations like
vpi_get_str on vpiModule.

The support is added non-intrusively to non-VPI verilator runs. It
essentially:

 - Tracks the creation of cell instances and keeps them alive until
   the emit phase. They are there converted to scopes if modules.

 - Emits empty (don't add anything during construction)
   VerilatedScopes for all inlined modules, only for those inlined
   modules that are on the hierarchical path to public variables.

 - Adds VerilatedHierarchy as abstraction to structure of the
   scopes. It is only created for VPI designs. It allows to traverse
   the hierarchy from the top (NULL).

Signed-off-by: Stefan Wallentowitz <[email protected]>
Signed-off-by: Wilson Snyder <[email protected]>
2019-10-01 21:57:45 -04:00
Wilson Snyder 66209d1114 Tests: Less verbose status. 2019-10-01 21:32:38 -04:00
Todd Strader 3f1fe2d18a Internals: Travis CI environment. 2019-10-01 06:05:11 -04:00
Wilson Snyder 8b6fb26272 Return good exit status on --help. 2019-09-30 23:15:10 -04:00
Wilson Snyder 881362bb04 Fix clang compile warnings. 2019-09-30 21:55:31 -04:00
Wilson Snyder 239ef1ae6d Fix misc bad-syntax crashes, bug1533. 2019-09-30 20:00:30 -04:00
Wilson Snyder 9eaec3b5c1 Fix misc bad-syntax crashes, bug1530. 2019-09-30 19:48:01 -04:00
Wilson Snyder dd4aa948ae Tests: Have driver report ETA. 2019-09-30 19:22:36 -04:00
Wilson Snyder 12fa085b26 Fix misc bad-syntax crashes, bug1529. 2019-09-30 19:22:14 -04:00
Wilson Snyder 9d6b0d7dd6 Tests: Fix broken contributors check. 2019-09-30 18:56:04 -04:00
Wilson Snyder a1405dac8e Fix misc bad-syntax crashes, bug1532. 2019-09-30 18:50:27 -04:00
Todd Strader cb115e1a15 Commentary 2019-09-30 09:33:17 -04:00
Wilson Snyder 1c7eb89df5 Commentary: Update contributing indentation. 2019-09-29 17:11:13 -04:00
Wilson Snyder 6e91f82a7d Commentary: Fix logo rendering 2019-09-29 17:09:03 -04:00
Wilson Snyder 17123cd0e0 Add contributing document. Convert internals to asciidoc format. Part of last commit. 2019-09-29 17:05:13 -04:00
Wilson Snyder 3f0c5b7550 WIP 2019-09-29 17:03:07 -04:00
Wilson Snyder f6e0e9adec Internals: Use SHA256 instead of insecure SHA1. 2019-09-28 13:32:28 -04:00
Wilson Snyder dea1531f40 Commentary 2019-09-28 11:38:23 -04:00
Wilson Snyder edcfaa888d Commentary 2019-09-28 11:13:30 -04:00
Todd Strader 28b9db1903 Add AstVFile and AstTextBlock, towards bug1490. 2019-09-27 04:24:38 -04:00
Todd Strader 9e64be71a7 Add XSim user run flags 2019-09-27 01:12:53 -04:00
Stefan Wallentowitz 99a8845a96 Fix VerilatedVpioVar vpiMemory/vpiReg accessor, bug1528.
Signed-off-by: Wilson Snyder <[email protected]>
2019-09-27 00:01:09 -04:00
Wilson Snyder be4692772c Ignore MCD fopenw with --bbox-unsup. 2019-09-26 23:37:22 -04:00
Wilson Snyder 4f315d9078 Fix ugly error on interface misuse, bug1525. 2019-09-25 21:53:01 -04:00
Wilson Snyder f133c4d0b3 Fix mis-indenting AstComments with C++ symbols. 2019-09-24 19:07:22 -04:00
Wilson Snyder 8490046028 Internals: AstComment optional suppression of at. No functional change intended. 2019-09-23 18:44:45 -04:00
Lukasz Dalek d6ac351dcb Add --public-flat-rw switch, bug1511.
This switch exposes VARs, PORTs and WIREs to C++ code. It must be use
with care as it has a significant performance impact and may result in
mis-simulation of generated clocks. Anyhow, it is prefered over
--public and useful for VPI.

Signed-off-by: Lukasz Dalek <[email protected]>
Signed-off-by: Stefan Wallentowitz <[email protected]>
Signed-off-by: Wilson Snyder <[email protected]>
2019-09-23 07:56:07 -04:00
Stefan Wallentowitz 502bd6cbd6 Tests: Set VM_PREFIX from test script.
Signed-off-by: Wilson Snyder <[email protected]>
2019-09-21 08:26:34 -04:00
Philipp Wagner d7b6b53c4d Make callCbs() public.
VerilatedVpi::callCbs() can be used by the user to signal
simulation-related callbacks, e.g.
VerilatedVpi::callCbs(cbStartOfSimulation).

The information if any callbacks have been called may be important to
drive an evaluation until no further changes are observed.

Signed-off-by: Lukasz Dalek <[email protected]>
Signed-off-by: Philipp Wagner <[email protected]>
Signed-off-by: Stefan Wallentowitz <[email protected]>
Signed-off-by: Wilson Snyder <[email protected]>
2019-09-21 07:43:20 -04:00
Stefan Wallentowitz 96725b3431 Tests: To allow reuse of cpp files, allow to set the PLI filename.
Signed-off-by: Wilson Snyder <[email protected]>
2019-09-19 18:46:45 -04:00
Stefan Wallentowitz 8686ed9b00 Fix vpiType accessor, bug1510.
Signed-off-by: Wilson Snyder <[email protected]>
2019-09-18 12:24:19 -04:00
Stefan Wallentowitz 32e1207782 Fix vpiType accessor, bug1509.
Signed-off-by: Wilson Snyder <[email protected]>
2019-09-18 07:22:59 -04:00
Wilson Snyder 900115bb2d Fix false warning on backward indexing, bug1507. 2019-09-17 15:17:23 -04:00
Wilson Snyder 3469c78153 Fix bad module name. 2019-09-16 21:09:18 -04:00
Wilson Snyder baa634343b Fix config_rev revision detection on old versions. 2019-09-13 07:20:26 -04:00
Wilson Snyder 1471f5691a Fix error on multidimensional cells, bug1505. 2019-09-12 19:06:26 -04:00
Wilson Snyder e556269692 Commentary - Spelling fixes 2019-09-12 07:22:22 -04:00
Todd Strader d1af69f91d Produce man files with 'make all' 2019-09-11 10:01:18 -04:00
Wilson Snyder fa904f386c Commentary - Spelling fixes 2019-09-09 07:50:21 -04:00
Todd Strader a4daae66de -LDLIBS isn't an option 2019-09-06 13:04:47 -04:00
Todd Strader c813026566 Make Syms file honor --output-split-cfuncs, bug1499. 2019-09-04 06:15:41 -04:00
Wilson Snyder 314cd92129 Support $fseek, $ftell, $frewind, bug1496. 2019-09-03 21:28:15 -04:00
Wilson Snyder 3bc260c55d Fix make test with no VERILATOR_ROOT, bug1494. 2019-09-01 11:15:42 -04:00
Wilson Snyder 4c0f95af10 devel release 2019-08-29 19:12:47 -04:00
Wilson Snyder 35fe205fd6 Version bump 2019-08-29 18:58:38 -04:00
Todd Strader 70cf2582d6 Add XSim support to driver.pl, bug1493. 2019-08-29 17:00:49 -04:00
Todd Strader ec620387af Add --dpi-hdr-only, bug1491. 2019-08-27 21:36:59 -04:00
Wilson Snyder e1e4bde125 Remove old V3ClkGater code 2019-08-27 17:51:06 -04:00
Todd Strader b947391662 Retain widthSized when simulating 2019-08-12 15:38:58 -04:00
Wilson Snyder edc0f442e4 Tests: Add tests for bug1487. 2019-08-09 05:45:44 -04:00
Wilson Snyder 562b9551bf Internals: Remove some unused arguments. No functional change intended. 2019-08-09 04:12:49 -04:00
Wilson Snyder f74af949da Remove trailing spaces. 2019-08-08 17:53:49 -04:00
Wilson Snyder 81e806e895 Fix elaboration time errors, bug1429. 2019-08-04 22:34:54 -04:00
Wilson Snyder 7d4958264a Support arbitrary-argument $warning/$info etc 2019-08-04 21:50:08 -04:00
Wilson Snyder 88b87429dc Tests: Add elaboration info test. 2019-08-04 21:31:06 -04:00
Wilson Snyder 429f463032 Don't check SYSTEMC environment, for part of CMake support, bug1363. 2019-08-04 20:21:58 -04:00
Wilson Snyder af4a39603c Makefile: Run hello world before other examples. 2019-08-04 20:20:29 -04:00
Wilson Snyder a13d230d8c Tests: Less verbosity 2019-08-04 15:04:34 -04:00
Wilson Snyder b7bd5956ea Concats should be unsigned 2019-08-04 14:48:17 -04:00
Wilson Snyder 1a36e05cc6 Fix core dump on v3Number replace'ed assertions. 2019-08-04 14:14:28 -04:00
Wilson Snyder 71265a8ec9 Internals: Rename unsized functions. No functional change. 2019-08-04 12:39:35 -04:00
Wilson Snyder 3a720204c2 Internals: Remove m_logicMap as m_detailedMap covers it. No functional change intended. 2019-08-04 08:16:24 -04:00
Wilson Snyder a95f58749f Fix internal error on gate optimization of assign, bug1475. 2019-08-03 21:49:39 -04:00
Wilson Snyder 9e58ede480 Internals: Rename V3Hashed functions for future commit. No functional change. 2019-08-03 19:05:59 -04:00
Wilson Snyder cf2ac30f66 Fix date. 2019-08-02 21:39:32 -04:00
Wilson Snyder 68b22a4a3d Tests: Summarize any skips. 2019-07-30 22:20:37 -04:00
Wilson Snyder 875dc9a27e --debug doesn't take an arg 2019-07-30 18:40:38 -04:00
Maarten De Braekeleer 1332446f2a Spelling fixes.
Signed-off-by: Wilson Snyder <[email protected]>
2019-07-30 18:27:36 -04:00
Wilson Snyder 6b798830c9 Fix spacing 2019-07-29 21:07:37 -04:00
Wilson Snyder ffa23b59b8 Tests: Add iff test, bug1482. 2019-07-26 19:31:02 -04:00
Maarten De Braekeleer 7d27461054 Spelling fixes.
Signed-off-by: Wilson Snyder <[email protected]>
2019-07-26 12:58:13 -04:00
Maarten De Braekeleer b3f318d8ab Add contributor certification. 2019-07-26 12:57:42 -04:00
Todd Strader 4a14788c9b When showing an error, show the instance location 2019-07-26 12:52:38 -04:00
Wilson Snyder 5560da2934 Commentary 2019-07-26 06:24:26 -04:00
Todd Strader 43ce048f9e Add rr support 2019-07-25 21:34:09 -04:00
Todd Strader b045111a67 Refactor SimulateVisitor to use AstConst 2019-07-23 13:58:17 -04:00
Todd Strader 654571bd1c V3Number cleanup 2019-07-22 15:07:08 -04:00
Todd Strader a3fd105acb Add more Travis coverage 2019-07-18 05:31:02 -04:00
Wilson Snyder 97561bf064 When showing an error, show source code. 2019-07-14 21:42:03 -04:00
Wilson Snyder a4820fc700 Misc minor error cleanups from show-source branch. 2019-07-14 20:59:56 -04:00
Wilson Snyder ee469eedaf Fix some errors reporting wrong objects. 2019-07-14 15:06:49 -04:00
Wilson Snyder a49d819437 Tests: Default test_regress to quiet 2019-07-14 15:04:19 -04:00
Wilson Snyder cbb9288cb1 Fix some errors reporting wrong objects. 2019-07-14 12:21:39 -04:00
Wilson Snyder 173efbc829 Offer suggestions on bad identifier errors. 2019-07-14 10:08:53 -04:00
Wilson Snyder 0fef3b02ec Fix some parse tokens having wrong fileline. 2019-07-13 12:01:26 -04:00
Wilson Snyder d1ee6689c4 Internals: Make V3LanguageWords a singleton. 2019-07-13 08:57:42 -04:00
Wilson Snyder b3eab9d78a Tests: Move t_math_synmul to extended tests. 2019-07-12 19:35:28 -04:00
Wilson Snyder defd05bdd7 Tests: Fix driver checking threads/gcc for extended tests. 2019-07-12 19:35:10 -04:00
Wilson Snyder a7e5cccf33 In errors, single quote signals and other from-user data. 2019-07-11 22:36:32 -04:00
Wilson Snyder 0f857ce423 In errors, single quote signals and other from-user data. 2019-07-11 22:09:30 -04:00
Wilson Snyder 83cf1882de Quote reserved word messages, and related internal cleanups. 2019-07-11 20:49:35 -04:00
Wilson Snyder e17543d6d8 Tests: Fill in some missing error coverage holes. 2019-07-11 20:18:36 -04:00
Wilson Snyder dacf45fea9 Fix error message continuations to avoid linenumber repetition 2019-07-11 19:15:40 -04:00
Wilson Snyder 13a20c5ee9 Internals: Fix inserted tabs. 2019-07-11 07:05:33 -04:00
Wilson Snyder 58dfe9d071 Internals: Detab and fix spacing style issues. No functional change.
When diff, recommend using "git diff --ignore-all-space"
When merging, recommend using "git merge -Xignore-all-space"
2019-07-11 06:57:49 -04:00
Wilson Snyder 6c5cc885a6 Internals: Cleanup FileLine constructors. No functional change intended. 2019-07-10 22:04:58 -04:00
Sebastien Van Cauwenberghe 2c44ab61ac Fix GDB returning wrong error code on Fedora 30
Signed-off-by: Wilson Snyder <[email protected]>
2019-07-10 06:47:20 -04:00
Sebastien Van Cauwenberghe 0847ea57ae Docs: Add name to contributors
Signed-off-by: Wilson Snyder <[email protected]>
2019-07-10 06:46:28 -04:00
Wilson Snyder 9af84c71f5 Internals: More UASSERT_OBJ conversions. No functional change intended. 2019-07-07 09:01:36 -04:00
Wilson Snyder 4ce77d3e68 Header mentions public use. 2019-07-07 09:00:57 -04:00
Philipp Wagner 3c67791624 docs: Document parse-order-dependency for config files, bug1474
Signed-off-by: Wilson Snyder <[email protected]>
2019-07-06 18:09:23 -04:00
Philipp Wagner a281c00752 docs: Contributor signoff
Signed-off-by: Wilson Snyder <[email protected]>
2019-07-06 18:08:22 -04:00
Wilson Snyder 2ca418288d Fix enum values not being sized based on parent, bug1442. 2019-07-06 16:26:44 -04:00
Wilson Snyder bea34d0ced Internals: Misc enum cleanups. No functional change. 2019-07-06 15:50:25 -04:00
Wilson Snyder a5f2ce0dad Tests: Disable t_leak on Travis-CI. 2019-07-06 13:47:17 -04:00
Gianfranco Costamagna 07ae7146e3 Honour system flags, this makes debug flags being injected correctly.
Signed-off-by: Wilson Snyder <[email protected]>
2019-07-06 13:02:36 -04:00
Wilson Snyder 8548ecfdac Internals: Add UASSERT_OBJ macro to replace hand-done ifs. No functional change intended.
This makes it easier to filter out correctly zero code-coverage lines.
2019-07-06 12:57:50 -04:00
Wilson Snyder 7e54ff1b37 Additional lcov code coverage. 2019-07-05 22:30:19 -04:00
Wilson Snyder a4b9745e6e Fix lifetime opt dropping 2019-07-05 22:30:19 -04:00
Wilson Snyder 8612ba2b8d Internals: Commentary and fix gate debug glibc warning 2019-07-05 22:30:19 -04:00
Todd Strader fea6e047e2 Add Travis badge 2019-07-05 05:26:08 -04:00
Wilson Snyder 01ef7122e9 Internals: Add lcov code coverage markers. 2019-06-30 22:37:03 -04:00
Wilson Snyder ac43e7322b Internals: Remove dead code. 2019-06-30 22:11:56 -04:00
Wilson Snyder 02a3f2089f Include filenames in savable error. 2019-06-30 22:01:53 -04:00
Wilson Snyder 33ad834106 Tests: Close some test coverage holes. 2019-06-30 22:00:18 -04:00
Wilson Snyder efe739c52f Tests: Cover --error-limit and update docs (found via coverage). 2019-06-30 21:36:57 -04:00
Wilson Snyder 5cd531a5e0 Tests: Fix glib warning 2019-06-30 21:35:55 -04:00
Wilson Snyder 0e8dfdbb71 Tests: Less verbosity. 2019-06-30 17:45:42 -04:00
Wilson Snyder ec32a9b976 Tests: Close some test coverage holes. 2019-06-30 17:38:41 -04:00
Wilson Snyder 1aae6df669 Internals: Run graph self tests on --debug-self-test 2019-06-30 17:36:58 -04:00
Wilson Snyder f7641d2ecc Change MULTITOP to warning to help linting, see manual. 2019-06-30 16:46:48 -04:00
Wilson Snyder 5f27c41ee3 Test driver: Cleanup rerun flags & status. 2019-06-29 21:36:33 -04:00
Wilson Snyder 51df77099a Test driver: With --quiet print summary every 15sec or Travis barfs. 2019-06-29 15:58:00 -04:00
Wilson Snyder b8b7e5c978 Test driver: Add --rerun and --quiet options 2019-06-29 15:24:56 -04:00
Wilson Snyder dddcfeb482 Test driver: Move one_test, no functional change. 2019-06-29 13:37:01 -04:00
Wilson Snyder 8d63f83177 Tests: Reduce verbosity unless use --verbose 2019-06-29 13:11:30 -04:00
Wilson Snyder d43e9aa2c5 Fix not in array context on non-power-of-two slices, msg2946. 2019-06-29 11:30:38 -04:00
Wilson Snyder a2c1b7f827 Tests: Fix t_flag_csplit skip on old make. 2019-06-29 08:25:50 -04:00
Wilson Snyder 2fff92fe78 Tests: Add array MDA test. 2019-06-29 08:12:00 -04:00
Wilson Snyder ba9af4aabf For internal messages, use <command-line> and <built-in> to match GCC. 2019-06-29 07:39:34 -04:00
Wilson Snyder ef02678305 tests: Fix default make test, broke earlier commit. 2019-06-29 07:22:19 -04:00
Wilson Snyder 6990db70fa Avoid unique internal fileline in selftest. 2019-06-28 22:34:01 -04:00
Wilson Snyder af5616c077 Fix line number in dup vars. 2019-06-28 22:34:01 -04:00
Todd Strader 009f053d6e Add initial Travis CI config 2019-06-27 11:26:25 -04:00
Wilson Snyder 6903c52ef7 Tests: Add coverage of missing include error. 2019-06-26 19:12:57 -04:00
Wilson Snyder aa65dfb1bc Tests: Use only 2 threads for t_gantt. 2019-06-26 19:06:52 -04:00
Wilson Snyder 84a2cd0ec7 Remove some old DIRPROJECT dead code. 2019-06-26 18:50:38 -04:00
Wilson Snyder 8e7559c6c9 Show included-from filenames in warnings, bug1439. 2019-06-22 17:01:39 -04:00
Wilson Snyder 951521320a Warnings: Suppress dup lines, and use lowercase note: to match gcc 2019-06-22 16:12:17 -04:00
Wilson Snyder abc0eb92a0 Debug: Show only first line of suppressed warnings 2019-06-22 14:25:31 -04:00
Wilson Snyder c514bb26e8 Always internal module wrapper TOP. 2019-06-22 13:43:49 -04:00
Wilson Snyder 5cb6474cc6 Fix not reporting some duplicate signals/ports, bug1462. 2019-06-22 12:43:48 -04:00
Wilson Snyder b8eb6368e9 Tests: Fix up duplicate var declarations. 2019-06-22 12:32:13 -04:00
Wilson Snyder 6239deb1df Tests: Disable t_flag_csplit with old make. 2019-06-19 08:44:40 -04:00
Wilson Snyder 89c2a6070a devel release 2019-06-16 10:01:09 -04:00
Wilson Snyder c53ea10c75 Version bump 2019-06-16 09:30:56 -04:00
Wilson Snyder 8fa54b1c4d Add .gitattributes 2019-06-15 21:49:49 -04:00
Wilson Snyder e5fae03364 docs: Move license files back to top out of docs to appease github. 2019-06-15 21:41:38 -04:00
Wilson Snyder 081fd3b789 Rename to LICENSE to appease github 2019-06-15 17:57:40 -04:00
Wilson Snyder 0edd3c9e95 Tests: Support remote test obj_ 2019-06-15 16:37:58 -04:00
Wilson Snyder 659c7b78d5 Warn only once if too few CPUs. 2019-06-15 09:17:51 -04:00
Wilson Snyder 34ef3c9c38 Internals: Assert V3Number ops have different pointers. 2019-06-15 08:10:17 -04:00
Wilson Snyder 90af180ec1 Fix constant function return of function var, bug1467. 2019-06-15 08:03:39 -04:00
Wilson Snyder 0d71c1154d Fix overshift error to have user's source line. 2019-06-15 07:44:03 -04:00
Alex Chadwick 5da5e32e86 Fix --savable invalid C++ on packed arrays, bug1465.
Signed-off-by: Wilson Snyder <[email protected]>
2019-06-14 18:42:27 -04:00
Wilson Snyder ea59a39661 Commentary 2019-06-13 20:53:39 -04:00
Wilson Snyder f5ca1a04cc Docs: Rewrite README 2019-06-13 20:51:06 -04:00
Wilson Snyder b6c905dffc Move files into docs directory. 2019-06-13 07:19:44 -04:00
Wilson Snyder e4a3f9b38c Tests: Remove tabs from golden-output tests. No functional change. 2019-06-12 22:41:51 -04:00
Wilson Snyder b3e2d26e35 Tests: Remove tabs from golden-output tests. No functional change. 2019-06-12 22:22:36 -04:00
Wilson Snyder 79e9fbaeb7 Tests: Add additional .out files instead of expects. 2019-06-12 21:49:40 -04:00
Wilson Snyder f5f5cd522b Tests: Make standard lint() to replace inconsistent compile() 2019-06-12 21:05:02 -04:00
Wilson Snyder e713c8ce57 Fix not reporting some duplicate signals, bug1462. 2019-06-12 19:17:10 -04:00
Wilson Snyder 94ed817897 Fix debug over-verbosity. 2019-06-12 19:11:26 -04:00
Wilson Snyder ff360738b5 XML: Remove extranious space on dtypes. 2019-06-12 07:19:14 -04:00
Wilson Snyder f7f73a0825 Internals: Standardize internal FileLine filenames. 2019-06-12 07:00:56 -04:00
Wilson Snyder 2cedd14d43 Fix build error on MinGW, bug1460. 2019-06-11 21:38:17 -04:00
Wilson Snyder 77c2d49d1a Internals: Move code out of verilog.y. No functional change. 2019-06-11 21:19:44 -04:00
Wilson Snyder dd8d5ef687 Internals: Move code out of verilog.l. No functional change. 2019-06-11 21:03:03 -04:00
Wilson Snyder cfb05cd70a Whitespace cleanup. No functional change. 2019-06-11 20:20:04 -04:00
Todd Strader 6f2f668449 Fix dotted references to type parameter sizes, bug1458.
Signed-off-by: Wilson Snyder <[email protected]>
2019-06-11 19:00:24 -04:00
Wilson Snyder 6ffbb7cabf Internals: Remove extra semicolons. No functional change. 2019-06-11 18:31:06 -04:00
Wilson Snyder 6c1782e4de Add contributors and test. 2019-06-10 20:29:58 -04:00
Todd Strader 10e3cc6e3b Tests: Better checking for type param hash fix.
Signed-off-by: Wilson Snyder <[email protected]>
2019-06-06 19:57:31 -04:00
Todd Strader 34424e70d8 Fix sameHash error on type parameters, bug1456.
Signed-off-by: Wilson Snyder <[email protected]>
2019-06-05 20:39:42 -04:00
Wilson Snyder 38ad8727af Tests: Remove CRs. 2019-06-04 20:37:16 -04:00
Wilson Snyder 4e115d4b69 Fix performance when mulithreaded on 1 CPU, bug1455. 2019-06-03 19:13:03 -04:00
Wilson Snyder f6f8073058 Support logical equivalence operator <->. 2019-06-01 19:40:06 -04:00
Wilson Snyder 902ba752a3 Move many unsupported errors from lex to parser so can --bbox-unsup ignore them. 2019-05-31 21:05:50 -04:00
Wilson Snyder 97d9de3dad Support deferred assertions, bug1449. 2019-05-31 07:33:57 -04:00
Todd Strader 97fef7c60b Tests: Fix t_dist_whitespace.pl --golden, bug1451
Signed-off-by: Wilson Snyder <[email protected]>
2019-05-30 20:36:13 -04:00
Wilson Snyder a58e7d94ec Error continuation lines no longer have %Error prefix. 2019-05-30 20:30:59 -04:00
Wilson Snyder c0be8bcefb Internals: Remove some pointless V3Number temporaries. No functional change intended. 2019-05-29 23:18:47 -04:00
Wilson Snyder 8846b365f4 Fix some memory leaks in V3Const/V3Unroll. 2019-05-29 22:43:26 -04:00
Kanad Kanhere 72eb361131 Fix invalid XML output due to special chars, bug1444.
Signed-off-by: Wilson Snyder <[email protected]>
2019-05-29 18:41:03 -04:00
Wilson Snyder b83b606267 Internals: Detab and fix spacing style issues. No functional change.
When diff, recommend using "git diff --ignore-all-space"
When merging, recommend using "git merge -Xignore-all-space"
2019-05-19 16:13:13 -04:00
Wilson Snyder 59d7d9e8c3 Fix real parameter assignment, bug1427. 2019-05-17 20:50:57 -04:00
Kanad Kanhere 3411279294 Internals: Relocate quoteNameControls, part of bug1444.
Signed-off-by: Wilson Snyder <[email protected]>
2019-05-16 21:44:01 -04:00
Wilson Snyder 8d6bea8975 nodist: Fix git_untabify --narrow. 2019-05-16 21:32:50 -04:00
Wilson Snyder 01725f662f Fix $display with string without %s, bug1441. 2019-05-16 21:21:38 -04:00
Wilson Snyder d841e68f4f Fix parameter function string returns, bug1441. 2019-05-16 21:16:20 -04:00
Wilson Snyder 13ecb8e177 Fix fault on with %t, bug1443. 2019-05-16 19:35:10 -04:00
Todd Strader 26436cf4dd Tests: Fix files ignored by t_dist_manifest, bug1438.
Signed-off-by: Wilson Snyder <[email protected]>
2019-05-15 19:02:17 -04:00
Wilson Snyder 96c70ea2df Internals: Fix some long lines in include files. No functional change.
When merging, recommend using "git merge -Xignore-all-space"
2019-05-14 22:49:32 -04:00
Wilson Snyder c8849094fc Fix spacing of last commit. 2019-05-14 22:05:37 -04:00
Wilson Snyder afea6d84e3 Mark infrequently called functions with GCC cold attribute. 2019-05-14 22:03:50 -04:00
Wilson Snyder 1fb0af7fba Internals: Fix some -Wsuggest-attribute=const suggestions. 2019-05-14 21:46:19 -04:00
Wilson Snyder 8ad1a68420 Fix OSX compile issue with -Winvalid-noreturn, bug1440. 2019-05-14 20:51:28 -04:00
Wilson Snyder 6ef7d5f0fd Internals: Fix spacing of last commit 2019-05-14 06:56:20 -04:00
Todd Strader d0fbdfac07 Add --quiet-exit, bug1436.
Signed-off-by: Wilson Snyder <[email protected]>
2019-05-14 06:47:51 -04:00
Sergey Kvachonok 16997d153f Fix sign-compare warning in verilated.cpp, bug1437.
Signed-off-by: Wilson Snyder <[email protected]>
2019-05-14 06:07:16 -04:00
Wilson Snyder 7777d10e9b Tests: Check for and remove trailing newlines 2019-05-13 19:47:52 -04:00
Wilson Snyder 00214f738f Tests: New scope-relevant tests, towards bug1305. 2019-05-13 19:31:24 -04:00
Wilson Snyder 07e6bc17db Fix error message showing pointer 2019-05-13 19:31:00 -04:00
Wilson Snyder afdfa4df87 Support VerilatedFstC set_time_unit, bug1433. 2019-05-12 08:19:49 -04:00
Wilson Snyder 1f714c6813 Commentary: Spelling fixes. 2019-05-11 18:42:27 -04:00
Wilson Snyder 5df3032b11 gtkwave: Merge from upstream. 2019-05-09 20:38:48 -04:00
Todd Strader eac3458647 Internals: V3Number tracks node information, part of bug1305.
Signed-off-by: Wilson Snyder <[email protected]>
2019-05-09 20:03:19 -04:00
Wilson Snyder 00efa05b50 devel release 2019-05-08 21:39:23 -04:00
Wilson Snyder cc1d380864 Version bump 2019-05-08 21:15:56 -04:00
Wilson Snyder f96942a526 Internals: Detab and fix spacing style issues in include files. No functional change.
When merging, recommend using "git merge -Xignore-all-space"
2019-05-08 21:13:38 -04:00
Wilson Snyder b23fc06388 Internals: Detab and fix spacing style issues in some include files. No functional change. 2019-05-07 23:30:24 -04:00
Wilson Snyder f818ddc71c Internals: Detab and fix spacing style issues in tests and scripts. No functional change. 2019-05-07 22:34:09 -04:00
Wilson Snyder 37c8cc82b2 Auto-extend and WIDTH warn on unsized X/Zs, bug1423. 2019-05-07 21:57:38 -04:00
Wilson Snyder 03ebd5554f Fix table compile error with multiinterfaces, bug1431. 2019-05-06 19:33:54 -04:00
Wilson Snyder a2a7021914 Reorder VCD codes for better viewer packing. 2019-05-06 18:55:38 -04:00
Wilson Snyder c6650f88e1 Internals: Remove some uses of AstConst taking V3Number. No functional change intended. 2019-05-03 21:21:18 -04:00
Wilson Snyder 55a25674a2 Add --trace-fst-thread. 2019-05-02 20:33:05 -04:00
Wilson Snyder 05c3d520a6 Test: Ignore tabs on new .out 2019-05-02 20:32:50 -04:00
Wilson Snyder 6b3304320b For FST tracing use LZ4 compression. 2019-05-02 19:55:16 -04:00
Wilson Snyder 8d15276625 Tests: Use golden_filename consistently. 2019-05-02 19:02:40 -04:00
Todd Strader 354f107fed Tests: Converting tests to golden files for bug1305.
Signed-off-by: Wilson Snyder <[email protected]>
2019-05-02 18:45:32 -04:00
Wilson Snyder 1ff55c20e0 Support "'dx" constants, bug1423. 2019-05-01 20:02:28 -04:00
Todd Strader 9583f0d3cc Add .git file (not directory) to MANIFEST.SKIP for git worktrees
Signed-off-by: Wilson Snyder <[email protected]>
2019-05-01 19:48:27 -04:00
Wilson Snyder 3acb85a005 Fix FST enums not displaying, bug1426. 2019-05-01 19:18:45 -04:00
Wilson Snyder 08d041cb93 Add error when use parameters without value, bug1424. 2019-04-30 19:16:41 -04:00
Wilson Snyder 274b2002c2 Fix GTKWave register warning, bug1421. 2019-04-29 05:28:30 -04:00
Todd Strader 681e91f9d8 Fix FST documentation, bug1419.
Signed-off-by: Wilson Snyder <[email protected]>
2019-04-28 17:53:58 -04:00
Wilson Snyder 6e333bd9ab Fix test problems when missing fst2vcd, bug1417. 2019-04-10 20:51:38 -04:00
Larry Lee 6a331e37fc Fix missing VL_SHIFTL_ errors, bug1412, bug1415.
Signed-off-by: Wilson Snyder <[email protected]>
2019-04-05 19:32:25 -04:00
Sergey Kvachonok d8a020905a Fix MinGW GCC 6 printf formats, bug1413.
Signed-off-by: Wilson Snyder <[email protected]>
2019-04-02 18:24:36 -04:00
Wilson Snyder efa6f4cd95 Fix extraction, part of fix missing VL_SHIFTL_QQW error, bug1412. 2019-03-28 19:46:39 -04:00
Larry Lee ca537dc3ed Fix missing VL_SHIFTL_QQW error, bug1412.
Signed-off-by: Wilson Snyder <[email protected]>
2019-03-28 19:11:46 -04:00
Wilson Snyder 3b64f54cea Support '#' comments in , bug1411. 2019-03-27 07:40:14 -04:00
Wilson Snyder 32c1e38b84 devel release 2019-03-23 21:14:30 -04:00
Wilson Snyder a7aa8820e1 Version bump 2019-03-23 21:00:07 -04:00
Wilson Snyder 2582a83376 Unsupported error on select of concatenation 2019-03-13 19:52:23 -04:00
Wilson Snyder 0094cd7a81 Internals: Spacing fixes. No functional change. 2019-03-13 19:47:47 -04:00
Wilson Snyder d9b33d74a4 Support void' cast on functions called as tasks, bug1383. 2019-03-10 15:12:20 -04:00
Wilson Snyder 539a773ea7 Add IGNOREDRETURN warning. 2019-03-10 14:57:01 -04:00
Wilson Snyder b1831d7e33 Fix +1364-1995ext flags applying too late, bug1384. 2019-03-10 14:09:22 -04:00
Wilson Snyder b8ccb7a4c1 Fix maintainer test when no Parallel::Forker, msg2630. 2019-03-10 12:14:58 -04:00
Wilson Snyder 0eb75a41bb Fix perl 5.38 warning. 2019-03-10 12:14:02 -04:00
Wilson Snyder 4cc47e3297 Tests: Cleanup spacing/style. No functional change. 2019-03-10 09:25:23 -04:00
Wilson Snyder 7bf3366041 Support . 2019-03-07 20:56:53 -05:00
Wilson Snyder c4b9f4bccf Tests: Remove old verilator_file_descriptor 2019-03-07 18:29:44 -05:00
Wilson Snyder 455c552132 Fix MSVC compile error, bug1406. 2019-03-04 20:29:01 -05:00
Wilson Snyder f26fb51509 Commentary, bug1339. 2019-03-01 20:14:48 -05:00
Wilson Snyder ab3c6576ed Report PORTSHORT errors on concat constants, bug 1400. 2019-02-27 21:06:07 -05:00
Wilson Snyder d1bd994113 Commentary, bug1399. 2019-02-26 18:56:13 -05:00
Wilson Snyder d1548b1161 Commentary 2019-02-26 18:24:46 -05:00
Wilson Snyder 8a43f41ed6 Fix $value$plus$args missing verilated_heavy.h. 2019-02-15 18:33:52 -05:00
Wilson Snyder 42759e4011 Fix VERILATOR_GDB being ignored, msg2860. 2019-02-12 18:20:40 -05:00
Wilson Snyder 27fa19eb94 Add +verilator+seed, bug1396. 2019-02-04 20:28:17 -05:00
Wilson Snyder 426ed8589b devel release 2019-01-28 07:30:42 -05:00
Wilson Snyder 44e53129a0 Version bump 2019-01-27 21:31:05 -05:00
Wilson Snyder cf2e8f7a9c Add sizeof checks on types. 2019-01-25 18:26:14 -05:00
Wilson Snyder 46be6d32c9 Add unsupported for loops error, msg2692. 2019-01-22 19:25:00 -05:00
Wilson Snyder 93d1fd6bb5 Commentary, msg2820 2019-01-22 18:46:47 -05:00
Wilson Snyder f700a73b3e Fix cygwin warning on fstapi, msg2770. 2019-01-20 14:16:09 -05:00
Wilson Snyder abd69167ef Commentary 2019-01-18 18:15:07 -05:00
Wilson Snyder 60f2f176a2 Fix DPI export void compiler error, bug1391. 2019-01-16 00:38:42 -05:00
Wilson Snyder 3a51e84ebc For XML, fix extends, bug1372. 2019-01-13 20:59:15 -05:00
Wilson Snyder a2a09253a2 Internals: Show static funcs. 2019-01-12 09:43:24 -05:00
Wilson Snyder ef884143d1 Add circular typedef error, bug1388. 2019-01-12 09:33:57 -05:00
Wilson Snyder 62a7d713a7 Fix internal error on xrefs into unrolled functions, bug1387. 2019-01-06 17:38:27 -05:00
Wilson Snyder aaf5b7c2c0 Fix uninitialized data in unroller, bug1386. [Al Grant] 2019-01-06 16:56:56 -05:00
Wilson Snyder 30aa180211 Internals: Use pushDelete for empty unrolls. Theoretical problem only. 2019-01-05 06:53:26 -05:00
Wilson Snyder 0d4270c979 Turn off temporary debug message. 2019-01-05 06:01:22 -05:00
Wilson Snyder 3505486ec8 Internals: Spacing; fix assertion 2019-01-05 05:46:37 -05:00
Wilson Snyder 9b0f2cce86 Copyright year update 2019-01-05 05:46:23 -05:00
Wilson Snyder 0e1f8db0d1 Fix uninitialized data in verFiles.dat, bug1385. 2019-01-05 04:58:14 -05:00
Wilson Snyder 8a4aeddbb0 Copyright year update. 2019-01-03 19:17:22 -05:00
Wilson Snyder e8636f987f Fix missing too many digits warning, bug1380. 2019-01-03 19:03:27 -05:00
Wilson Snyder 0198a2e9f3 Fix error when no modules in , bug1381. 2019-01-02 18:38:49 -05:00
Wilson Snyder db92ab47ba For --xml, add additional information, bug1372. 2019-01-02 07:16:37 -05:00
Wilson Snyder 47107a5a36 Fix FST tracing of wide arrays, bug1376. 2018-12-18 20:49:44 -05:00
Wilson Snyder e01c9df35e Fix error when pattern assignment has too few elements, bug1378. 2018-12-18 20:41:14 -05:00
Wilson Snyder 8f16557499 Tests: Less verbose 2018-12-12 22:19:33 -05:00
Wilson Snyder 89fb57e54f For --xml, add additional information, bug1372. 2018-12-12 22:12:31 -05:00
Wilson Snyder 8a3e9748b3 For --xml, add additional information, bug1372. 2018-12-10 19:11:35 -05:00
Wilson Snyder 66b23be746 For --xml, add additional modport information, bug1372. 2018-12-10 07:25:44 -05:00
Wilson Snyder f0cdae129e Removed --trace-lxt2, use --trace-fst instead. 2018-12-06 19:06:20 -05:00
Wilson Snyder ede7236945 For --xml, add additional var information, bug1372. 2018-12-06 07:12:39 -05:00
Wilson Snyder a226111829 Fix fst_config compile error on MINGW, msg2670. 2018-12-06 07:12:21 -05:00
Wilson Snyder 49edcbc2ac Internals: Misc cleanup. No functional change. 2018-12-06 06:56:39 -05:00
Wilson Snyder 6050ab311e Commentary 2018-12-05 20:14:22 -05:00
Wilson Snyder 83b5c981d0 devel release 2018-12-01 15:07:31 -05:00
Wilson Snyder 2685037ca2 Version bump 2018-12-01 14:52:21 -05:00
Wilson Snyder 940dc98c66 Add CONTASSREG error on continuous assignments to regs, bug1369. 2018-12-01 10:12:10 -05:00
Wilson Snyder 49353784fd Fix __Slow files getting compiled with OPT_FAST, bug1370. 2018-11-29 20:35:21 -05:00
Wilson Snyder 2e5919549c Tests: Separate make_main flag from verilator_make_gcc flag. 2018-11-29 19:50:09 -05:00
Wilson Snyder 8170391573 Internals: Fix spacing of comments. No functional change. 2018-11-28 19:59:10 -05:00
Wilson Snyder 61e4b0a472 Add IMPORTSTAR warning on import::* inside scope. 2018-11-28 18:25:34 -05:00
Wilson Snyder 15af706286 Fix crash due to cygwin bug in getline, bug1349. 2018-11-26 19:09:08 -05:00
Wilson Snyder 2a43410fa6 Tests: Fix buggy size test. 2018-11-26 18:22:20 -05:00
Wilson Snyder 5cc11839b5 Add PROCASSWIRE error on behavioral assignments to wires, msg2737. 2018-11-26 17:58:18 -05:00
Wilson Snyder d1bfeae026 Tests: Ignore obj_vcs 2018-11-25 21:08:16 -05:00
Wilson Snyder e0b2c46664 Internals: Function return values act as vars, not wires. 2018-11-25 19:50:53 -05:00
Wilson Snyder ea61559ab5 Internals: Cleaner name for var. No functional change. 2018-11-25 19:10:18 -05:00
Wilson Snyder 6a5a2a56d7 Internals: Favor AstNetlist for global thread errors, and allow 0 line number error suppression. 2018-11-16 20:49:17 -05:00
Wilson Snyder 5cbf80918f Tests: Favor golden files over long regexps. No functional change. 2018-11-03 14:59:04 -04:00
Wilson Snyder 196e3a9712 Tests: Reduce timeout when single-threaded testing. 2018-11-03 09:07:28 -04:00
Wilson Snyder 3798b80091 Tests: Fix test instability. 2018-11-03 09:07:11 -04:00
Wilson Snyder 689e4cf1d3 Tests: Have files_identical fail on error 2018-11-01 21:58:39 -04:00
Wilson Snyder 64f11251b6 Fix verilator_coverage not sorting output 2018-11-01 21:39:37 -04:00
Wilson Snyder 6cd2bd2972 Tests: Add golden_filename. 2018-11-01 21:04:19 -04:00
Wilson Snyder d396c55e34 In --xml-only show module_files and cells ala Verilog-Perl vhier, msg2716. 2018-11-01 19:53:26 -04:00
Wilson Snyder 45c9939a5e Fix hang on bad pattern keys, bug1364. 2018-11-01 19:03:52 -04:00
Wilson Snyder ad2929dff0 Support "ref" and "const ref" pins and functions, bug1360. 2018-10-30 20:50:09 -04:00
Wilson Snyder d3e1dfd3f5 Tests: Add VERILATOR_MAKE override variable. 2018-10-30 20:28:39 -04:00
Wilson Snyder 14b48140bd In --xml-only show the original unmodified names, msg2716. 2018-10-30 18:17:37 -04:00
Wilson Snyder 7be1678fb0 Fix --trace-lxt2 compile error on MinGW, msg2711. 2018-10-30 07:35:30 -04:00
Wilson Snyder d464ce1477 Fix unneeded emit comment. No functional change. 2018-10-29 20:48:50 -04:00
Wilson Snyder 0a04f79576 Commentary 2018-10-28 08:16:19 -04:00
Wilson Snyder b8098098d8 Internals: Refactor input/output to new class in prep for ref support. 2018-10-27 17:29:00 -04:00
Wilson Snyder dc26815b1c Tests: Report wide line numbers. 2018-10-27 17:21:07 -04:00
Wilson Snyder f2028b60af Internals: Expand git_untabify lines touched. 2018-10-27 16:48:42 -04:00
Wilson Snyder 06c7d8ce3b Internals: Fix whitespace issues. No functional change, use -b to diff 2018-10-27 10:03:28 -04:00
Wilson Snyder 160505c5a4 devel release 2018-10-27 08:48:12 -04:00
Wilson Snyder 3df9b4230b Version bump 2018-10-27 08:27:10 -04:00
Wilson Snyder 13163aef24 make distclean should remove .1 files as not in distribution 2018-10-27 08:26:25 -04:00
Wilson Snyder 5c2b5bd782 Internals: Expand git_untabify lines touched 2018-10-26 19:49:36 -04:00
Wilson Snyder da1ebcb4e4 Add --pp-comments, msg2700. 2018-10-25 21:17:25 -04:00
Wilson Snyder 8dbfc940ba Internals: Refactor comment parsing. No functional change intended. 2018-10-25 20:46:23 -04:00
Wilson Snyder e0654dc218 Add --dump-defines. 2018-10-25 19:47:07 -04:00
Patrick Stewart 74a92e739f Internals: Fix missing static. No functional change.
Signed-off-by: Wilson Snyder <[email protected]>
2018-10-24 19:40:07 -04:00
Wilson Snyder 304a24d03a Internals: Fix many clang-tidy issues. No functional change intended. 2018-10-14 18:39:33 -04:00
Wilson Snyder 5ae1ce90ad Internals: Refactor into cvtToHex function. No functional change. 2018-10-14 16:25:36 -04:00
Wilson Snyder d87b9d25ca Internals: Cleanup and standardize include order. No functional change intended. 2018-10-14 13:59:40 -04:00
Wilson Snyder 9bc8d77f39 Includes: Move version to implementation only. 2018-10-14 11:21:09 -04:00
Wilson Snyder b7e4083e70 Internals: Cleanup temp string inserts for clang-tidy. No functional change. 2018-10-14 11:10:11 -04:00
Wilson Snyder 595419b370 Internals: Sort includes for clang-tidy. No functional change intended. 2018-10-14 07:04:18 -04:00
Wilson Snyder 442e4f35f0 Internals: Cleanup empty string constructors for clang-tidy. No functional change. 2018-10-13 23:06:36 -04:00
Wilson Snyder e8b8b33ff6 Internals: Cleanup find with chars for clang-tidy. No functional change. 2018-10-13 22:28:59 -04:00
Wilson Snyder e4d638c73d Internals: Cleanup string casts. No functional change. 2018-10-13 22:02:39 -04:00
Wilson Snyder bccb9f794c Fix Windows .exe not found, bug1361. 2018-10-12 19:13:50 -04:00
Wilson Snyder fe0dae74c1 include: Upstream update for GTKWave 2018-10-12 06:55:12 -04:00
Wilson Snyder b59c23d346 Move some unsupported syntax to parser for cleaner errors. 2018-10-11 21:57:07 -04:00
Wilson Snyder 6047049fc7 Fix --trace-lxt2 compile error on MinGW, msg2684. 2018-10-11 21:03:49 -04:00
Wilson Snyder 08e650a2b4 Commentary 2018-10-11 21:00:29 -04:00
Wilson Snyder 11d4d6562f Commentary 2018-10-10 17:10:59 -04:00
Wilson Snyder 5c9da65606 Fix --trace-lxt2 compile error on MinGW, msg2667. 2018-10-10 06:54:51 -04:00
Wilson Snyder 97d89cce35 Move some unsupported syntax to parser for cleaner errors. 2018-10-08 22:18:09 -04:00
Wilson Snyder cc45a3dd72 For --trace-fst, save enum decoding information, bug1358. 2018-10-08 07:21:22 -04:00
Wilson Snyder 870918a788 Tests: Dump and test FST trace attributes. 2018-10-07 22:04:49 -04:00
Wilson Snyder 41be66af95 Indent output C code '= {' blocks. 2018-10-07 21:23:45 -04:00
Wilson Snyder 9ad252be34 For --trace-fst, instead of *.fst.hier, put data into *.fst. 2018-10-07 20:47:26 -04:00
Wilson Snyder 1f344ac99e Fix whitespace on trace function calls. Output changed, but no functional change. 2018-10-07 18:17:45 -04:00
Wilson Snyder 8b738c0022 Compute struct/union/enum names from surrounding typedefs. 2018-10-07 18:07:42 -04:00
Wilson Snyder 57fbf38fb2 Internals: Don't detabify gtkwave files. 2018-10-07 18:00:04 -04:00
Wilson Snyder 4cd01bc99a Deprecate --trace-lxt2. 2018-10-06 14:13:38 -04:00
Wilson Snyder fc0cf00b1d devel release 2018-10-06 10:12:31 -04:00
Wilson Snyder 4333c201f1 Version bump 2018-10-06 09:51:57 -04:00
Wilson Snyder 1f5913a83c Internals: V3Simulate refactoring prep for future work. No functional change. 2018-10-05 20:26:54 -04:00
Wilson Snyder 159c653b4b Internals: V3Simulate refactoring prep for future work. No functional change. 2018-10-05 20:06:08 -04:00
Wilson Snyder 47a2e2aeb9 Commentary 2018-10-05 18:47:46 -04:00
Wilson Snyder 98b0d19363 Tests: Add enum to trace test. 2018-10-05 18:38:52 -04:00
Wilson Snyder 24a0873f6d Commentary 2018-10-05 06:47:18 -04:00
Wilson Snyder c5fee7c456 Fix flex warning 2018-10-04 20:51:20 -04:00
Wilson Snyder d11592cadd Support signal types in FST dumps, bug1358. 2018-10-04 20:24:41 -04:00
Wilson Snyder 8ef9ac7dba Support in/out directions in FST dumps, bug1358. 2018-10-03 19:51:05 -04:00
Sergi Granell a5aa0e2b0a Add GTKWave FST native tracing, bug1356.
Signed-off-by: Wilson Snyder <[email protected]>
2018-10-02 18:42:53 -04:00
Wilson Snyder f8ae08c0c2 Internals: Fix whitespace. 2018-10-02 06:31:11 -04:00
Wilson Snyder 72f5d39ace Rename include/lxt2 to include/gtkwave. 2018-10-01 18:29:04 -04:00
Sergi Granell 5c9801d42c Commentary
Signed-off-by: Wilson Snyder <[email protected]>
2018-09-30 17:34:47 -04:00
Wilson Snyder c9ee425ed5 Fix replication of 64-bit signal change detects. 2018-09-28 08:36:37 -04:00
Wilson Snyder 1871e2b541 Commentary 2018-09-27 19:58:17 -04:00
Wilson Snyder 3e39c55a97 Tests: Check mod-prefix subnames. 2018-09-27 19:58:13 -04:00
Wilson Snyder e4d6fa0e3b include: Update license from GTKWave upstream. 2018-09-27 19:55:00 -04:00
Wilson Snyder 9f8dbc91f2 Support restrict, bug1350. 2018-09-23 15:20:12 -04:00
Wilson Snyder 0e37747d2c Support $past. 2018-09-23 15:20:01 -04:00
Wilson Snyder a8519a7a53 Fix MinGW compile issues, msg2636. 2018-09-20 18:09:19 -04:00
Kevin Kiningham d4159811d2 configure: Fix test for c++03 etc. 2018-09-17 21:47:35 -04:00
Kevin Kiningham b2ca4995ab Fix Mac OSX 10.13.6 / LLVM 9.1 compile issues, bug1348. 2018-09-17 18:35:23 -04:00
Wilson Snyder 7876fe94ad Fix Mac OSX 10.13.6 / LLVM 9.1 compile issues, bug1348. 2018-09-17 06:39:43 -04:00
Wilson Snyder cc9f7d1ac3 devel release 2018-09-17 06:24:18 -04:00
Wilson Snyder 94c295f26a Version bump 2018-09-16 17:02:50 -04:00
Wilson Snyder 8c51b5a980 Docs: Add logo to PDF 2018-09-16 17:01:45 -04:00
Wilson Snyder 4f98f84da9 Fix duplicate symbol error on generate tri, bug1347. 2018-09-14 06:56:59 -04:00
Wilson Snyder 63a429dd64 pod2latex: Cleanup latex build in prep for logo 2018-09-13 20:06:10 -04:00
Wilson Snyder 9c3331927b Fix man files misinstalling; cleanup mkinstalldirs 2018-09-13 19:09:35 -04:00
Wilson Snyder 3a6edae59d Fix string ?: conditional type resolution, bug1345. 2018-09-12 19:20:15 -04:00
Wilson Snyder 75794e2eaa Fix number parsing with newline after radix, bug1340. 2018-09-12 19:19:48 -04:00
Wilson Snyder 24efa6c19a Fix compile error on tracing of string arrays, bug1338. 2018-09-08 01:16:07 -04:00
Wilson Snyder 7a8c5ecfe1 Disable GCC2017, bug1339. 2018-09-03 08:19:43 -04:00
Wilson Snyder 4684f1d4cc Include sys/types to make sure __WORDSIZE is set, bug1333. 2018-08-31 06:52:12 -04:00
Wilson Snyder ef5c31b4c9 Fix first clock edge and --x-initial-edge, bug1327. 2018-08-30 20:05:13 -04:00
Wilson Snyder 9d21c5441b tests: Fix strange verilated-debug flag 2018-08-30 20:04:55 -04:00
Wilson Snyder 24fe724e0b Commentary 2018-08-30 18:51:02 -04:00
johnjohnlin acf4a3fa99 Add GTKWave LXT2 native tracing, bug1333.
Signed-off-by: Wilson Snyder <[email protected]>
2018-08-28 06:41:17 -04:00
Wilson Snyder 3ed8d968ff Commentary and spacing. No functional change. 2018-08-28 06:30:30 -04:00
Wilson Snyder 45c09f3fae Fix LLVM thread_safety function 2018-08-27 18:25:58 -04:00
Wilson Snyder c93d28050e Fix mkdir on MSYS2, msg2614. 2018-08-27 18:07:52 -04:00
Wilson Snyder 15abb4d590 Fix OS X compile issues, bug1332. 2018-08-27 06:15:12 -04:00
Wilson Snyder ae98e87222 Fix OS X compile issues, bug1332. 2018-08-26 19:55:02 -04:00
Wilson Snyder 77f6b8cf5f Use local algorithm for random, bug1332. 2018-08-26 07:07:01 -04:00
Wilson Snyder 573e79a329 Fix OS X compile issues, bug1332. 2018-08-25 17:54:27 -04:00
Wilson Snyder aaac5d4685 Support string.atoi and similar methods, bug1289. 2018-08-25 13:49:37 -04:00
Wilson Snyder b02e353ad1 Internals: Fix VERILATOR_NO_OPT_BUILD, broken in recent commit. 2018-08-25 13:11:28 -04:00
Wilson Snyder 80a269f49a Tests: Add t_param_array3 test, bug1315 2018-08-25 10:36:31 -04:00
Wilson Snyder 75f28fd446 Internals: Fix spacing of function calls. No functional change. 2018-08-25 09:52:45 -04:00
Wilson Snyder ec538c02d8 MAJOR: Merge develop-v4 into master 2018-08-25 08:01:15 -04:00
Wilson Snyder f7b93c8718 Fix install test. 2018-08-25 07:55:48 -04:00
Wilson Snyder 18ae08e14a Commentary 2018-08-25 07:54:06 -04:00
Wilson Snyder bffe658026 Commentary 2018-08-25 07:53:17 -04:00
Wilson Snyder 789917cd06 Fix Ubuntu 18 warnings. 2018-08-24 18:47:38 -04:00
Wilson Snyder 8f838433df Internals: Fix spacing and style of v4 changes. No functional change. 2018-08-23 05:22:34 -04:00
Wilson Snyder 0b84222500 Includes: Fix spacing and style in prep for new LXT2. No functional change. 2018-08-22 19:14:06 -04:00
Wilson Snyder aad5c3ae75 Merge from master 2018-08-22 18:50:19 -04:00
Wilson Snyder b586e071fb devel release 2018-08-22 18:49:30 -04:00
Wilson Snyder c8e437c45c Version bump 2018-08-22 18:09:06 -04:00
Wilson Snyder 4d034d774d Merge from master 2018-08-22 17:58:02 -04:00
Wilson Snyder 4627716aa4 Remove extra space in generated func call. 2018-08-21 18:14:32 -04:00
Wilson Snyder 847dbbbaf0 Fix function inlining inside certain while loops, bug1330. 2018-08-21 18:09:40 -04:00
Wilson Snyder c011842edf Commentary: Rewrite TODO 2018-07-24 07:37:39 -04:00
Wilson Snyder aabb7394c3 Merge from master 2018-07-23 19:05:17 -04:00
Wilson Snyder d90064eaee Change MODDUP errors to warnings, msg2588. 2018-07-23 18:57:34 -04:00
Wilson Snyder ec8dbbffed MAJOR: Add multithreaded model generation. 2018-07-22 20:54:28 -04:00
Wilson Snyder 0070520edb Fix cppcheck warnings. 2018-07-22 20:41:46 -04:00
Wilson Snyder 8e646bc55f configure: Add URL 2018-07-22 19:44:03 -04:00
Wilson Snyder e97dbf9537 Add UNOPTTHREADS, for threads branch. 2018-07-22 12:09:27 -04:00
Wilson Snyder 0ef3baa87d Merge from master 2018-07-22 11:53:58 -04:00
Wilson Snyder 3a777c2a37 Verilated: Always define VL_RDTSC, though unused; useful for benchmarking. 2018-07-22 11:53:35 -04:00
Wilson Snyder 237f4806bf Fix doxygen old dir refs. 2018-07-20 19:45:58 -04:00
Wilson Snyder 8ec8c0ea76 Merge from master 2018-07-18 22:43:22 -04:00
Wilson Snyder dfe66a2b77 Fix whitespace after functions in generated files. 2018-07-18 22:42:05 -04:00
Wilson Snyder a18d6c8159 Merge from master 2018-07-18 21:34:38 -04:00
Wilson Snyder a0b09b6450 Remove tabs inside generated files/quotes. 2018-07-18 21:25:21 -04:00
Wilson Snyder ca24357611 Fix gcc 4.4.7 compile errors 2018-07-16 20:38:31 -04:00
Wilson Snyder 78c16081a4 Assume most branches in bounds, and use branchpred for instruction estimation. 2018-07-15 22:35:44 -04:00
Wilson Snyder e37dce9d85 Internals: Add new graph algs for future partitioning. 2018-07-15 22:09:27 -04:00
Wilson Snyder 43694ec87c Continued... Show file and line info when possible on internal graph errors. 2018-07-14 20:44:43 -04:00
Wilson Snyder 22939d7473 Merge from master 2018-07-14 19:27:51 -04:00
Wilson Snyder 9e3a88c41d Inability to write a file is typically user, not internal error. 2018-07-14 19:22:50 -04:00
Wilson Snyder cf4bf9b7a5 Show file and line info when possible on internal graph errors. 2018-07-14 18:45:06 -04:00
Wilson Snyder d065662afc Internals: Add new UASSERT. Currently unused. No functional change. 2018-07-14 17:44:55 -04:00
Wilson Snyder 70e2538436 Internals: V3InstrCount now shows critical path only for branch. Still not used in develop-v4. 2018-07-14 17:31:36 -04:00
Wilson Snyder 338ebcd6f0 Internal: Minor style cleanups for next merge. No functional change. 2018-07-14 17:27:05 -04:00
Wilson Snyder ea8b416e91 Internals: Rename recent template. No functional change. 2018-07-09 21:32:10 -04:00
Wilson Snyder de81593e98 Internals: Template GraphAlg to allow const. No functional change. 2018-07-09 19:15:46 -04:00
Wilson Snyder 84562f98de Internals: Add GraphWay methods for future graph algs. No functional change. 2018-07-08 22:01:16 -04:00
Wilson Snyder 5520759d9e Internals: Track dpi import wrapper creation. No functional change. 2018-07-07 08:02:29 -04:00
Wilson Snyder 9156a0e400 Internals: Allow override of initial value for vl_unordered_set() 2018-07-05 20:39:03 -04:00
John Coiner 736bf75a50 tests: Allow cmdline args to override test args. 2018-07-05 18:52:25 -04:00
Wilson Snyder 81ef9b5dd2 Internals: Add V3InstrCount, for threads branch. 2018-07-04 21:52:15 -04:00
Wilson Snyder 2f18a52118 Ignore automake flags passed by Ubuntu builds 2018-07-04 17:09:59 -04:00
Wilson Snyder f3ed36840e Update error, bug1322. 2018-07-04 17:09:59 -04:00
Wilson Snyder 129610821f Ignore automake flags passed by Ubuntu builds 2018-07-03 21:34:50 -04:00
Wilson Snyder 4cd0310516 Update error, bug1322. 2018-07-02 09:11:20 -04:00
Wilson Snyder 8b245138ee Merge from master 2018-07-01 21:48:18 -04:00
Wilson Snyder 4f962bddd8 Fix std:: build error, bug1322. 2018-06-28 18:55:36 -04:00
Wilson Snyder 02738ec4ea Warn if using pre-C++11 so find out who needs it. 2018-06-26 17:57:57 -04:00
Wilson Snyder e8a23cf8bc Fix to ignore Unicode UTF-8 BOM sequences, msg2576. 2018-06-26 17:57:57 -04:00
Wilson Snyder 39ecfd9900 Internals: rank() public for future optimizers. 2018-06-26 17:57:57 -04:00
Wilson Snyder d6a7073a2b Commentary 2018-06-26 17:57:57 -04:00
Wilson Snyder 45eddfb335 Warn if using pre-C++11 so find out who needs it. 2018-06-26 07:33:55 -04:00
Wilson Snyder d4b9b5aba6 Fix to ignore Unicode UTF-8 BOM sequences, msg2576. 2018-06-26 07:11:56 -04:00
Wilson Snyder b1bf742544 Internals: rank() public for future optimizers. 2018-06-24 18:47:08 -04:00
Wilson Snyder ebab30d864 Fix new reloop misinserting Vars 2018-06-24 11:22:56 -04:00
Wilson Snyder cdd70ff8fc Commentary 2018-06-24 08:08:34 -04:00
Wilson Snyder ad4c8ee955 Add new reloop optimization for repetitive assignment compression. 2018-06-23 17:07:22 -04:00
Wilson Snyder 2edfe7b8a8 Internals: Ordering internals realigned with thread branch. 2018-06-22 23:01:50 -04:00
Wilson Snyder 3444dad9ce Internals: Refactoring in prep for next commit. No functional change. 2018-06-22 22:56:58 -04:00
Wilson Snyder b8842f7e55 Fix clocker attributes to not propagate on concats. 2018-06-22 19:46:27 -04:00
Wilson Snyder 86d85412e1 Merge from master 2018-06-22 18:51:02 -04:00
Wilson Snyder 2b56acb39a Add git_untabify utility 2018-06-22 07:09:21 -04:00
Wilson Snyder 35a40b4930 Commentary 2018-06-22 06:35:27 -04:00
Wilson Snyder c1f2b2cf93 *Ordering Change*: Separate initial and settle when ordering. From threads branch. 2018-06-21 23:12:11 -04:00
Wilson Snyder 011e9f3b0a Internals: Reorder some functions in prep for threads. No functional change. 2018-06-21 23:08:56 -04:00
Wilson Snyder dddc51b75c Internals: Rename templated types to be T_*. Use Euler hashing. 2018-06-21 21:14:38 -04:00
Wilson Snyder 5187096bf9 Merge from master 2018-06-21 20:29:24 -04:00
Wilson Snyder ae33a1ceb1 Tests: Add t_gate_tree test 2018-06-21 20:27:33 -04:00
Wilson Snyder d225e46e4a Fix define argument stringification, broke since 3.914. 2018-06-21 08:19:59 -04:00
Wilson Snyder dcf946b437 Rework V3LifePost to be similar to threading algorithm's. 2018-06-20 23:44:58 -04:00
Wilson Snyder 2a5123f318 Internals: Spacing change in prep for LifePost rewrite from branch. No functional change. 2018-06-20 20:24:11 -04:00
John Coiner 43d07235c9 Tests: Fix sc_main compilation errors.
Signed-off-by: Wilson Snyder <[email protected]>
2018-06-20 19:01:19 -04:00
Wilson Snyder 1fad055286 Internals: Add TSP solver, for future threads branch. 2018-06-17 21:06:41 -04:00
Wilson Snyder e89cb1b9f7 Internals: For unordered set, add constant accessor. No functional change. 2018-06-17 10:31:27 -04:00
Wilson Snyder 4c7a397dc4 Merge from master 2018-06-16 18:05:26 -04:00
Wilson Snyder 047a08c999 Internals: Clean some UASSERTs. No functional change. 2018-06-16 18:00:21 -04:00
Wilson Snyder 1d74657bbb Internals: Remove dead code 2018-06-16 17:59:57 -04:00
Wilson Snyder 7085fdbc27 Internals: Refactor var sorting, merge from threads branch. 2018-06-16 07:45:30 -04:00
Wilson Snyder 4c9c39bd08 Merge from master 2018-06-16 07:32:32 -04:00
Wilson Snyder ec82243ee6 Fix shrinking new unordered_set_map to save memory. No end-result change intended. 2018-06-15 20:57:07 -04:00
Wilson Snyder 65bb93a6c5 Add OBJCACHE envvar support to examples and generated Makefiles. 2018-06-15 07:13:18 -04:00
Wilson Snyder 6e7f28785e Internals: Cleanup graph includes. No functional change. 2018-06-15 06:54:03 -04:00
Wilson Snyder 35654b5355 Tests: Backward port from threads branch. 2018-06-15 06:28:33 -04:00
Wilson Snyder efb2801eeb Internals: Add orderPreRanked. No functional change. 2018-06-14 20:29:54 -04:00
Wilson Snyder 9f5a4c9b22 Fix cppcheck warnings. No functional change intended. 2018-06-14 19:04:52 -04:00
Wilson Snyder 7fc565a1bd Merge from master 2018-06-14 19:04:36 -04:00
Wilson Snyder 0eb1d0a84e Fix cppcheck warnings. No functional change intended. 2018-06-14 18:59:24 -04:00
Wilson Snyder 5d26bca55c Internals: Remove unneeded returns on asserts. 2018-06-13 18:05:00 -04:00
John Coiner ba69297c33 Merge branch 'develop-v4' of ssh://git-verilator-jcoiner/git/verilator into develop-v4 2018-06-13 08:23:40 -04:00
John Coiner 8b5dc0b678 Fix nasty performance bug in rehash() that could lead to rehashing everything into one giant bucket, but only for tables with >256K elements, so we never saw it in regression. 2018-06-13 08:20:19 -04:00
Wilson Snyder 5988bba9fb Merge from master 2018-06-12 21:25:26 -04:00
Wilson Snyder a15e6f68dd devel release 2018-06-12 21:22:01 -04:00
Wilson Snyder 77e7e2bf1c Version bump 2018-06-12 21:20:12 -04:00
Wilson Snyder 1c5c9e2435 cppcheck fixes 2018-06-12 21:14:20 -04:00
Wilson Snyder adfb903469 Merge from master 2018-06-12 05:23:13 -04:00
John Coiner 3e739db7fa Fix linear searches. bug1316. 2018-06-11 22:05:45 -04:00
John Coiner c124fe6d0c Add clones of std::unordered_map and std::unordered_set for pre-C++11 compilers. 2018-06-11 22:05:15 -04:00
James Hutchinson f0ed4346b2 Fix to be in verilog 2005, bug1319.
Signed-off-by: Wilson Snyder <[email protected]>
2018-06-08 08:01:22 -04:00
John Coiner 94c8064798 Fix linear search; this is part of the fix for issue 1316. 2018-06-07 12:43:19 -04:00
Wilson Snyder 95da5f90c7 Tests: Fix runflag test stability. 2018-05-29 20:33:04 -04:00
Wilson Snyder e4a79d643d Fix error without nodep. 2018-05-29 20:03:58 -04:00
Wilson Snyder 27c7d0c95b Merge from master 2018-05-29 20:02:07 -04:00
Wilson Snyder cf0464c263 Internals: Cleanup V3EmitC common code. No functional change. From threads branch. 2018-05-29 19:55:42 -04:00
Wilson Snyder 05a8a9ee28 Remove NULL checks of this, as upsets some compilers. 2018-05-26 08:28:19 -04:00
Wilson Snyder 6268db643c Commentary 2018-05-25 07:17:38 -04:00
Wilson Snyder fd98d231e4 Tests: Fix determinism of randomization. 2018-05-25 07:15:29 -04:00
Wilson Snyder b1ab48b9fc Include: Fix command line parser hang when threaded. 2018-05-25 07:02:15 -04:00
Wilson Snyder e4e3294363 Merge from master 2018-05-24 22:18:09 -04:00
Wilson Snyder 92649ba494 includes: Fix VL_RDTSC & misc stuff. 2018-05-24 22:17:44 -04:00
Wilson Snyder 9afa1f7fb9 Commentary 2018-05-20 09:16:37 -04:00
Wilson Snyder c253b7769e Merge from master 2018-05-20 09:14:30 -04:00
Wilson Snyder 0efe343494 Renamed --profile-cfuncs to --prof-cfuncs. 2018-05-20 09:12:29 -04:00
Wilson Snyder f3c9b4fb03 Add runtime arguments. 2018-05-20 08:40:35 -04:00
Wilson Snyder 26c31db75e Merge from master 2018-05-20 08:37:03 -04:00
Wilson Snyder 84335b9580 Verilated: Cleanup command line parsing. Backport from pending v4 change. 2018-05-20 08:36:39 -04:00
Wilson Snyder e8b2c57610 Commentary 2018-05-19 14:50:28 -04:00
Wilson Snyder 3d49136e27 Merge from master 2018-05-19 09:32:15 -04:00
Wilson Snyder 5e22ca77ec Tests: Fix misc multithreaded issues, merge from threads branch. 2018-05-19 09:30:54 -04:00
Wilson Snyder b6e8133a4d When tracing, use scalars on single bit arrays to appease vcddiff. 2018-05-19 07:52:07 -04:00
Wilson Snyder 02a22c12ea Internals: Add missing [] to delete call in verilated_vcd_c.cpp, bug1309 2018-05-17 07:08:11 -04:00
Wilson Snyder cd4e6b35b3 Internals: Standardize debug() function generation. No functional change intended. 2018-05-14 06:50:47 -04:00
Wilson Snyder 4abf5be9ce Detect linker requirements for multithreaded runtime. 2018-05-13 19:47:35 -04:00
Wilson Snyder 9ba6fc9279 Merge from master 2018-05-13 19:39:30 -04:00
Wilson Snyder fe917ba7f4 include: Merge misc thread runtime support. 2018-05-13 19:30:51 -04:00
Wilson Snyder 2c568603f6 Fix latex warning & misc Commentary 2018-05-13 19:21:08 -04:00
Wilson Snyder 05db8ce6c8 Internals: Move iterators to AstNVisitor to avoid null this. 2018-05-10 20:55:37 -04:00
Wilson Snyder 51422e3ee8 Fix parsing error on bad missing #, bug1308. 2018-05-09 18:32:12 -04:00
Wilson Snyder 489f58011b Merge from master 2018-05-08 21:43:55 -04:00
Wilson Snyder 0ef3c10931 Pull some thread include changes from thread branch. 2018-05-08 21:43:32 -04:00
Wilson Snyder 1759b0826e Merge from master 2018-05-08 19:43:26 -04:00
Wilson Snyder 35be80f789 Tests: Use vlt_all for any Verilator test. 2018-05-08 19:39:32 -04:00
Wilson Snyder 5f3c9cca11 Merge from master 2018-05-07 20:58:30 -04:00
Wilson Snyder c29e7619eb Tests: Support multiple scenario testing. 2018-05-07 20:42:28 -04:00
Wilson Snyder a265417727 Tests: Cleanup Perl indentations. No functional change. 2018-05-06 22:39:18 -04:00
Wilson Snyder b69af164f7 Commentary 2018-05-06 20:40:23 -04:00
Wilson Snyder ff61bb509c Tests: Fix race and dead code. 2018-05-05 07:44:52 -04:00
Wilson Snyder f02b99c709 Merge from master 2018-04-30 20:36:26 -04:00
Wilson Snyder c8ba51581f Commentary 2018-04-30 20:34:52 -04:00
Wilson Snyder 29f1a9208e Commentary 2018-04-30 20:00:38 -04:00
John Coiner 542cf9b6e1 Remove errant assert from V3Split 2018-04-13 06:54:53 -04:00
Wilson Snyder 8b954dc381 Additional debug prints 2018-04-12 22:00:34 -04:00
Wilson Snyder 2f7002c5ec Merge from master 2018-04-10 22:11:49 -04:00
John Coiner 767ac2547d Misc clang warning fixes.
Signed-off-by: Wilson Snyder <[email protected]>
2018-04-10 22:05:55 -04:00
Wilson Snyder a46aa2d62b Fix verilator_profcfunc on old gprofs. 2018-04-10 22:05:17 -04:00
Todd Strader 9219ddaece Report interface ports connected to wrong interface, bug1294. 2018-04-04 21:03:43 -04:00
Wilson Snyder c7c99d8553 Fix parsing "output signed" in V2K port list, msg2540. 2018-03-29 20:10:27 -04:00
John Coiner 422c915c1d Fix a nondeterminism issue in the new V3Split 2018-03-29 14:03:18 -04:00
Wilson Snyder 1f04d17e77 Merge from master 2018-03-17 12:03:08 -04:00
Wilson Snyder e3354a0191 devel release 2018-03-17 12:01:59 -04:00
Wilson Snyder df3d1a4da9 Version bump 2018-03-17 11:56:37 -04:00
Wilson Snyder 3963fe4384 Fix GCC-8 compile error. 2018-03-17 11:33:47 -04:00
Wilson Snyder 38261ac649 Tests: Ignore history file. 2018-03-17 09:25:38 -04:00
Wilson Snyder e49539fb4c Internals: Put cell assigns near cell. No functional change intended except statement order. 2018-03-17 08:43:19 -04:00
Wilson Snyder 3cd96cf558 Tests: Print error line in summary file. 2018-03-16 19:54:25 -04:00
Wilson Snyder 02f18fc21b Merge from master 2018-03-15 23:31:59 -04:00
Wilson Snyder 1bcaaa0f0d Internals: Cleanup V3Inst unused argument. No functional change intended. 2018-03-15 23:19:43 -04:00
Wilson Snyder 7922a1de28 Internals: Misc cleanups related to V3LinkDot. No functional change intended. 2018-03-15 19:46:05 -04:00
John Coiner e897c862f2 Tests: t_foreach now checks that all foreach loops get unrolled and evaluated statically. 2018-03-15 19:06:32 -04:00
John Coiner f55040a38b Fix severe runtime performance bug in certain foreach loops. 2018-03-15 08:59:52 -04:00
Wilson Snyder 2d580e6939 Support IEEE 1800-2017 as default language. 2018-03-12 22:26:34 -04:00
John Coiner fc48008c1c Support 2018-03-12 16:44:01 -04:00
Wilson Snyder 4cf2e4024f verilator_difftree: Better error. 2018-03-11 16:49:40 -04:00
Wilson Snyder 57c7d77af3 Tests: Future reduction or test. 2018-03-11 16:33:38 -04:00
Wilson Snyder 5652867316 Merge from master 2018-03-11 10:42:44 -04:00
Wilson Snyder c8cf2afb15 Support assert properties, bug785, bug1290. 2018-03-11 10:37:20 -04:00
Wilson Snyder d08a91b71e Fix GCC lint complaint of calling NULL->cloneTree. No functional change intended. 2018-03-10 17:44:17 -05:00
Wilson Snyder 2c30aecc5b Merge from master 2018-03-10 16:51:34 -05:00
Wilson Snyder 770045676f Internals: Split some extremely long lines. No functional change. 2018-03-10 16:32:04 -05:00
Wilson Snyder 68cca0e114 Commentary, bug1288 2018-03-10 14:16:37 -05:00
Wilson Snyder 0a1b775ed6 Fix various small node leaks. 2018-03-10 14:10:41 -05:00
Wilson Snyder 54a101acbe Internals: Fix -DLEAK_CHECKS failing due to visitor destructor being too late. 2018-03-10 12:57:50 -05:00
John Coiner db1af07d72 On convergence errors, show activity. 2018-03-10 12:52:11 -05:00
John Coiner ff82f75023 Add --no-debug-leak to reduce memory use under debug. 2018-03-10 12:18:19 -05:00
Wilson Snyder 9ae54786e4 Commentary, bug1288. 2018-03-09 00:04:00 -05:00
Wilson Snyder 22ff760f0b Support calling system functions as tasks, bug1285. 2018-03-08 23:40:19 -05:00
John Coiner 86fe6ac3a8 Fix quoting of quoted arguments.
Signed-off-by: Wilson Snyder <[email protected]>
2018-03-08 22:43:29 -05:00
Wilson Snyder 3dccd89c18 Fix missing include for gcc6.4 2018-03-08 21:46:20 -05:00
Tymoteusz Blazejczyk 9f52e23158 Fix verilator_coverage --annotate-min, bug1284. 2018-03-07 19:52:29 -05:00
Wilson Snyder aed3307214 Enable GCC debug when in debug build 2018-03-03 20:43:14 -05:00
John Coiner ef3c7bb6a2 Better optimize large always block splitting, bug1244.
Signed-off-by: Wilson Snyder <[email protected]>
2018-02-28 06:58:41 -05:00
John Coiner 0a887c29f1 Internals: Fix V3LifePost recording assignPre variables.
Signed-off-by: Wilson Snyder <[email protected]>
2018-02-28 06:57:08 -05:00
Wilson Snyder e1410775fb Fix CC warning with flex 2.5.35. 2018-02-28 06:34:03 -05:00
Wilson Snyder f0ba17a19b Merge from master. 2018-02-27 07:24:31 -05:00
John Coiner a7a790416e Internals: Fix passing bool as int. No functional change.
Signed-off-by: Wilson Snyder <[email protected]>
2018-02-27 07:16:16 -05:00
Patrick Stewart fe5c4df079 Support trig functions (() etc), bug1281.
Signed-off-by: Wilson Snyder <[email protected]>
2018-02-26 04:25:07 -05:00
Wilson Snyder 1376e5de92 Fix pullup/pulldowns on bit selects, bug1274. 2018-02-10 19:08:07 -05:00
Wilson Snyder 7f5b1a402c Internals: Part of last change, spacing. 2018-02-07 20:29:58 -05:00
Wilson Snyder 22573d238b Internals: Fix GCC8 cppcheck warnings. No functional change. 2018-02-07 20:16:53 -05:00
Wilson Snyder 32859d9fc2 Fix GCC 8.0 issues 2018-02-07 18:58:21 -05:00
Wilson Snyder 597d28b505 Fix internals to make null-pointer-check clean. Also add more const's. No functional change intended, but likely something will break. 2018-02-01 21:32:58 -05:00
Wilson Snyder 94e8cf1de9 Internals: Use explicit std:: instead of using namespace std. No functional change intended. 2018-02-01 21:24:41 -05:00
Wilson Snyder 33d6205e20 Prepare for version 4 branch 2018-02-01 21:21:21 -05:00
Wilson Snyder 1b12800b8f devel release 2018-02-01 20:14:40 -05:00
Wilson Snyder 13d11b037a Version bump 2018-02-01 20:09:58 -05:00
Wilson Snyder 0ca0854cac Fix compile error with --public and interface bind, bug1264. 2018-02-01 20:07:46 -05:00
Wilson Snyder 1726c71649 Commentary 2018-02-01 19:20:08 -05:00
Wilson Snyder fd8c29f981 Commentary 2018-02-01 19:18:00 -05:00
Wilson Snyder e07ee559a0 Tests: Fix gcc7.2 warnings. 2018-01-31 19:27:42 -05:00
Wilson Snyder 097107bd0b Support 'assume' similar to 'assert', bug1269. 2018-01-31 07:33:10 -05:00
Wilson Snyder b40b152b87 Fix missing edge type in xml output, msg2480. 2018-01-31 07:29:14 -05:00
Wilson Snyder 3c7fef68c0 Internals: Sort EmitXml visitors. No functional change. 2018-01-31 07:25:10 -05:00
Wilson Snyder b2322ae873 Fix tracing example file output, bug1268. 2018-01-29 19:07:49 -05:00
Wilson Snyder e3f137875b Fix spacing of trace func decls. No functional change. 2018-01-29 19:04:37 -05:00
Wilson Snyder 71fcf45d73 Fix gate optimization out of memory, add --gate-stmts, bug1260. 2018-01-27 15:06:51 -05:00
Wilson Snyder 652b68a5a0 Fix compile error on public real parameters by suppressing, bug1261. 2018-01-24 22:30:30 -05:00
John Coiner 3e0401de1c Misc harmless cleanups from thread branch.
Signed-off-by: Wilson Snyder <[email protected]>
2018-01-24 20:20:26 -05:00
Stefan Wallentowitz c164024f38 Remove c++filt and fix status code of Makefile, bug1265
In the generated Makefile the linker output is piped through c++filt
which was very useful for older linkers. But unfortunately the status
code is lost during the piping. So when the make process is embedded
in a larger setup a failure will not manifest to the outside flow.

As modern linkers do the job of c++filt, this removes it from the
generated Makefile. It will also produce a proper status code then.

Signed-off-by: Wilson Snyder <[email protected]>
2018-01-18 21:25:43 -05:00
Wilson Snyder bd1f1e8699 Fix compile error on public real parameters by suppressing, bug1261. 2018-01-16 19:53:50 -05:00
Wilson Snyder 7ee6efab74 devel release 2018-01-02 18:13:45 -05:00
Wilson Snyder 3788e90644 Version bump 2018-01-02 18:06:05 -05:00
Wilson Snyder 8e65d93d6d Copyright year update. No functional change. 2018-01-02 18:05:06 -05:00
Wilson Snyder 4901668f13 Add INFINITELOOP warning, bug1254. 2017-12-26 21:35:08 -05:00
Wilson Snyder f98940e40a Fix cppcheck warnings. No functional change. 2017-12-17 18:44:35 -05:00
Wilson Snyder 49fe4d081c Support DPI open arrays, bug909, bug1245. 2017-12-17 16:28:58 -05:00
Wilson Snyder 3054b36a8d Internals: Avoid cleaning arrays in prep for openarrays. 2017-12-17 12:53:22 -05:00
Wilson Snyder b888158907 Fix DPI svGetBitselLogic and svPutPartselLogic. 2017-12-17 12:19:40 -05:00
Tymoteusz Blazejczyk 173f71dca6 Fix SystemC 2.3.2 compile error, bug1251.
Signed-off-by: Wilson Snyder <[email protected]>
2017-12-17 08:23:22 -05:00
Wilson Snyder 37a931feb4 Internals: Refactor some V3Task code in prep for openarrays. No functional change intended. 2017-12-16 15:46:21 -05:00
Wilson Snyder 79f5c7fbda Internals: Split verilated_syms.h and rename some methods. No functional change intended. 2017-12-16 10:52:43 -05:00
Wilson Snyder bf3f111ca4 Internals: Move VLVF flags to common function. No functional change. 2017-12-16 10:07:15 -05:00
Wilson Snyder 9a2a5d3155 Internals: Unroll V3Width task processing, in prep for openarrays. No functional change intended. 2017-12-16 09:36:07 -05:00
Wilson Snyder 2a7c61cd6d Commentary 2017-12-16 09:35:28 -05:00
Wilson Snyder 51787d68b9 Add error if always_comb has sensitivity list. 2017-12-13 19:49:37 -05:00
Wilson Snyder 33eb0db6f8 Fix resolving inline nested interface names, bug1250. 2017-12-13 19:42:49 -05:00
Wilson Snyder a0b2727c59 Use power-of-two number of members to align structs 2017-12-11 19:16:49 -05:00
Wilson Snyder d1b8f53711 Support DPI time and svLogicVal.
Note older version incorrectly assumed svBitVal even for logicals.
2017-12-09 20:17:37 -05:00
Wilson Snyder 27b5bfe9b1 DPI: Implement IEEE DPI copy routines. 2017-12-09 17:05:32 -05:00
Wilson Snyder ea91b10086 Internals: Add charIQWN. Proper capitalization. 2017-12-09 14:44:55 -05:00
Wilson Snyder 08da777b33 Tests: Fix illegal dpi return types, and other cleanups 2017-12-09 14:44:25 -05:00
Wilson Snyder 345657ab32 Workaround GCC/clang bug with huge compile times, bug1248. 2017-12-09 11:52:35 -05:00
Wilson Snyder 1b605ade94 Tests: Fix internal run scripts 2017-12-08 19:40:16 -05:00
Wilson Snyder b11fa372b1 Fix constant propagation across DPI imports of inout strings. 2017-12-07 20:10:27 -05:00
Wilson Snyder 662ebece71 Support string len() method. 2017-12-07 19:57:11 -05:00
Wilson Snyder 6b6e8dc83e Use VL_UNCOPYABLE in emitted code. No functional change intended. 2017-12-06 23:26:27 -05:00
Wilson Snyder d215149c7c Fix false ALWCOMBORDER on interface references, bug1247. 2017-12-06 21:29:10 -05:00
Wilson Snyder 895fc0911a Support > 64 bit decimal $display. 2017-12-02 22:10:58 -05:00
Wilson Snyder 754527edfd verilated internals: Add VL_BITRSHIFT_W. No functional change. 2017-12-02 08:17:20 -05:00
John Coiner f0217edef1 Internals: Keep a ptr to _eval in AstNetlist, make it easier to find.
Signed-off-by: Wilson Snyder <[email protected]>
2017-11-30 18:53:57 -05:00
Wilson Snyder 8f1798cc6f Fix modport outputs being treated as inputs, bug1246. 2017-11-28 19:11:41 -05:00
John Coiner 631bda395d Avoid duplicated scans of CFuncs.
Trace into non-entry-point functions (most of them) at their call
sites. We'll trace into entry-point functions (like eval) from their parent
scope. We must trace eval_ to reach the tree of calls beneath it.

Signed-off-by: Wilson Snyder <[email protected]>
2017-11-28 18:38:19 -05:00
John Coiner 791d02a753 Internals: Remove dead code. No functional change.
Signed-off-by: Wilson Snyder <[email protected]>
2017-11-28 18:29:14 -05:00
Wilson Snyder 54b3f92951 Commentary 2017-11-28 18:21:43 -05:00
Wilson Snyder 45de0599d7 Commentary 2017-11-27 20:11:34 -05:00
John Coiner 331ecdc2e7 Commentary
Signed-off-by: Wilson Snyder <[email protected]>
2017-11-27 19:23:55 -05:00
Wilson Snyder 339a7640a8 devel release 2017-11-27 18:50:14 -05:00
2304 changed files with 136138 additions and 67642 deletions
+111
View File
@@ -0,0 +1,111 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: DontAlign
AlignOperands: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 99
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp03
TabWidth: 8
UseTab: Never
...
+9
View File
@@ -0,0 +1,9 @@
Checks: 'clang-diagnostic-*,clang-analyzer-*,*,-modernize*,-hicpp*,-android-cloexec-fopen,-cert-dcl50-cpp,-cert-env33-c,-cert-err34-c,-cert-err58-cpp,-clang-analyzer-core.UndefinedBinaryOperatorResult,-clang-analyzer-security*,-cppcoreguidelines-no-malloc,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-union-access,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-special-member-functions,-fuchsia-default-arguments,-fuchsia-overloaded-operator,-google-default-arguments,-google-readability-todo,-google-runtime-references,-llvm-header-guard,-llvm-include-order,-misc-string-integer-assignment,-misc-string-literal-with-embedded-nul,-readability-braces-around-statements,-readability-container-size-empty,-readability-delete-null-pointer,-readability-else-after-return,-readability-implicit-bool-conversion,-readability-named-parameter,-readability-static-accessed-through-instance'
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: none
CheckOptions:
- key: google-readability-braces-around-statements.ShortStatementLines
value: '2'
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '2'
+5
View File
@@ -0,0 +1,5 @@
---
exclude_paths:
- '.github/**'
- 'ci/build_verilator.sh'
- 'include/vltstd/**'
+4
View File
@@ -0,0 +1,4 @@
*.v linguist-language=SystemVerilog
*.vh linguist-language=SystemVerilog
*.sv linguist-language=SystemVerilog
nodist linguist-detectable=false
+14
View File
@@ -0,0 +1,14 @@
---
name: Bug report
about: Something isn't working as expected, and it isn't "Unsupported." (Note our contributor agreement at https://github.com/verilator/verilator/.github/blob/master/CONTRIBUTING.adoc)
title: ''
labels: new
assignees: ''
---
Thanks for taking the time to report this.
Can you attach an example that shows the issue? (Must be openly licensed, ideally in test_regress format.)
May we assist you in trying to fix this yourself?
+16
View File
@@ -0,0 +1,16 @@
---
name: Feature Request
about: Request something should be supported, or a new feature added. (Note our contributor agreement at https://github.com/verilator/verilator/.github/blob/master/CONTRIBUTING.adoc)
title: ''
labels: new
assignees: ''
---
Thanks for taking the time to report this.
What would you like added/supported?
Can you attach an example that runs on other simulators? (Must be openly licensed, ideally in test_regress format.)
May we assist you in trying to fix this yourself?
+10
View File
@@ -0,0 +1,10 @@
---
name: Q and A, or Other
about: Ask a question, not related to a specific bug or feature request. (Note our contributor agreement at https://github.com/verilator/verilator/.github/blob/master/CONTRIBUTING.adoc)
title: ''
labels: new
assignees: ''
---
How may we help - what is your question?
+1
View File
@@ -0,0 +1 @@
We appreciate your contributing to Verilator. If this is your first commit, please add your name to docs/CONTRIBUTORS, and read our contributing guidelines in docs/CONTRIBUTING.adoc.
+199
View File
@@ -0,0 +1,199 @@
["area: assertions"]
color = "ffffe8"
name = "area: assertions"
description = "Issue involves assertions"
["area: configure/compiling"]
color = "ffffe8"
name = "area: configure/compiling"
description = "Issue involves configuring or compilating Verilator itself"
["area: coverage"]
color = "ffffe8"
name = "area: coverage"
description = "Issue involves coverage generation"
["area: data-types"]
color = "ffffe8"
name = "area: data-types"
description = "Issue involves data-types"
["area: documentation"]
color = "ffffe8"
name = "area: documentation"
description = "Issue involves documentation"
["area: elaboration"]
color = "ffffe8"
name = "area: elaboration"
description = "Issue involves elaboration phase"
["area: invoking/options"]
color = "ffffe8"
name = "area: invoking/options"
description = "Issue involves options passed to Verilator"
["area: lint"]
color = "ffffe8"
name = "area: lint"
description = "Issue involves SystemVerilog lint checking"
["area: parser"]
color = "ffffe8"
name = "area: parser"
description = "Issue involves SystemVerilog parsing"
["area: performance"]
color = "ffffe8"
name = "area: performance"
description = "Issue involves performance issues"
["area: portability"]
color = "ffffe8"
name = "area: portability"
description = "Issue involves operating system/compiler portability"
["area: runtime result"]
color = "ffffe8"
name = "area: runtime result"
description = "Issue involves an incorrect runtine result from Verilated model"
["area: scheduling"]
color = "ffffe8"
name = "area: scheduling"
description = "Issue involves scheduling/ordering of events"
["area: tests"]
color = "ffffe8"
name = "area: tests"
description = "Issue involves the testing system"
["area: usability"]
color = "ffffe8"
name = "area: usability"
description = "Issue involves general usability"
["effort: days"]
color = "d0c0b0"
name = "effort: days"
description = "Expect this issue to require roughly days of invested effort to resolve"
["effort: hours"]
color = "f5e6d6"
name = "effort: hours"
description = "Expect this issue to require roughly hours of invested effort to resolve"
["effort: minutes"]
color = "f5e6d6"
name = "effort: minutes"
description = "Expect this issue to require less than an hour of invested effort to resolve"
["effort: weeks"]
color = "d0c0b0"
name = "effort: weeks"
description = "Expect this issue to require weeks or more of invested effort to resolve"
["good first issue"]
color = "7057ff"
name = "good first issue"
description = "Good for newcomers"
["help wanted"]
color = "008672"
name = "help wanted"
description = "Extra attention is needed"
["new"]
color = "ff4400"
name = "new"
description = "New issue, not yet seen by maintainers"
["resolution: abandoned"]
color = "cfd3d7"
name = "resolution: abandoned"
description = "Closed; not enough information or otherwise never finished"
["resolution: answered"]
color = "cfd3d7"
name = "resolution: answered"
description = "Closed; only applies to questions which were answered"
["resolution: duplicate"]
color = "cfd3d7"
name = "resolution: duplicate"
description = "Closed; issue or pull request already exists"
["resolution: external"]
color = "cfd3d7"
name = "resolution: external"
description = "Closed; passed to another tool's bug tracker"
["resolution: fixed"]
color = "cfd3d7"
name = "resolution: fixed"
description = "Closed; fixed"
["resolution: invalid"]
color = "cfd3d7"
name = "resolution: invalid"
description = "Closed; issue or pull request is no longer relevant"
["resolution: no fix needed"]
color = "cfd3d7"
name = "resolution: no fix needed"
description = "Closed; no fix required (not a bug)"
["resolution: wontfix"]
color = "cfd3d7"
name = "resolution: wontfix"
description = "Closed; work won't continue on an issue or pull request"
["status: asked reporter"]
color = "ffffff"
name = "status: asked reporter"
description = "Bug is waiting for reporter to answer a question"
["status: assigned"]
color = "a0f0ff"
name = "status: assigned"
description = "Issue is assigned to someone to work on"
["status: blocked"]
color = "00007f"
name = "status: blocked"
description = "Issue is waiting for another bug, when other bug is fixed, then goes to 'status: assigned'"
["status: discussion"]
color = "d876e3"
name = "status: discussion"
description = "Issue is waiting for discussions to resolve"
["status: ready"]
color = "b6c92a"
name = "status: ready"
description = "Issue is ready for someone to fix; then goes to 'status: assigned'"
["type: bug"]
color = "d73a4a"
name = "type: bug"
description = "Defect"
["type: feature-IEEE"]
color = "cfccff"
name = "type: feature-IEEE"
description = "Request to add new feature, described in IEEE 1800"
["type: feature-non-IEEE"]
color = "cfccff"
name = "type: feature-non-IEEE"
description = "Request to add new feature, outside IEEE 1800"
["type: maintenance"]
color = "cfccff"
name = "type: maintenance"
description = "Internal maintenance task"
["type: q and a"]
color = "84ba34"
name = "type: q and a"
description = "Question and answer about some feature or user question"
+5
View File
@@ -1,6 +1,7 @@
\#*
.#*
*~
*.tidy
*.old
*.gz
*.gz.uu
@@ -16,6 +17,7 @@
README
TAGS
autom4te.cache
compile_commands.json
config.cache
config.status
configure
@@ -23,9 +25,12 @@ dddrun*
doxygen-doc
gdbrun*
gmon.out
ncverilog.history
internals.txt
verilator.txt
verilator_bin*
verilator_coverage_bin*
verilator.pc
verilator-config.cmake
verilator-config-version.cmake
**/obj_dir/*
+179
View File
@@ -0,0 +1,179 @@
# DESCRIPTION: Travis-CI config
#
# Copyright 2003-2019 by Todd Strader. Verilator is free software; you can
# redistribute it and/or modify it under the terms of either the GNU Lesser
# General Public License Version 3 or the Perl Artistic License Version 2.0.
version: ~> 1.0
os: linux
language: cpp
cache: ccache
env:
global:
- VERILATOR_CACHE=$HOME/verilator_cache
- VERILATOR_ROOT=$PWD
- VERILATOR_NUM_JOBS=$(echo `nproc` + 1 | bc)
- VERILATOR_CONFIG_FLAGS="--enable-maintainer-mode --enable-longtests"
- VERILATOR_AUTHOR_SITE=1
- OBJCACHE=ccache
cache:
directories:
- $VERILATOR_CACHE
before_install:
# Perl modules needed for testing
- yes yes | sudo cpan -fi Unix::Processors Parallel::Forker Bit::Vector
- sudo apt-get install gdb gtkwave
- sudo apt-get install libgoogle-perftools-dev
before_script:
- bash -x ci/build_vcddiff.sh
- bash -x ci/build_verilator.sh
after_script:
- ccache -s
stages:
- "Build Verilator"
- test
jobs:
include:
- if: type != cron
stage: "Build Verilator"
name: Build Verilator
compiler: gcc
script: echo "Done building Verilator"
# Non-cron build will just run on whatever linux flavor we get
- if: type != cron
stage: test
name: Dist test
compiler: gcc
script: ci/test.sh dist
- if: type != cron
stage: test
name: Vlt test
compiler: gcc
script: ci/test.sh vlt
- if: type != cron
stage: test
name: Vltmt test
compiler: gcc
script: ci/test.sh vltmt
# Cron builds try different OS/compiler combinations
- if: type = cron
stage: "Build Verilator"
name: Build xenial gcc Verilator
os: linux
dist: xenial
compiler: gcc
script: echo "Done building Verilator"
- if: type = cron
stage: test
name: Xenial gcc dist test
os: linux
dist: xenial
compiler: gcc
script: ci/test.sh dist
- if: type = cron
stage: test
name: Xenial gcc vlt test
os: linux
dist: xenial
compiler: gcc
script: ci/test.sh vlt
- if: type = cron
stage: test
name: Xenial gcc vltmt test
os: linux
dist: xenial
compiler: gcc
script: ci/test.sh vltmt
- if: type = cron
stage: "Build Verilator"
name: Build xenial clang Verilator
os: linux
dist: xenial
compiler: clang
script: echo "Done building Verilator"
- if: type = cron
stage: test
name: Xenial clang dist test
os: linux
dist: xenial
compiler: clang
script: ci/test.sh dist
- if: type = cron
stage: test
name: Xenial clang vlt test
os: linux
dist: xenial
compiler: clang
script: ci/test.sh vlt
- if: type = cron
stage: test
name: Xenial clang vltmt test
os: linux
dist: xenial
compiler: clang
script: ci/test.sh vltmt
# - if: type = cron
# stage: "Build Verilator"
# name: Build OSX gcc Verilator
# os: osx
# compiler: gcc
# script: echo "Done building Verilator"
# - if: type = cron
# stage: test
# name: OSX gcc dist test
# os: osx
# compiler: gcc
# script: ci/test.sh dist
# - if: type = cron
# stage: test
# name: OSX gcc vlt test
# os: osx
# compiler: gcc
# script: ci/test.sh vlt
# - if: type = cron
# stage: test
# name: OSX gcc vltmt test
# os: osx
# compiler: gcc
# script: ci/test.sh vltmt
- if: type = cron
stage: "Build Verilator"
name: Build trusty gcc Verilator
os: linux
dist: trusty
compiler: gcc
script: echo "Done building Verilator"
- if: type = cron
stage: test
name: Trusty gcc dist test
os: linux
dist: trusty
compiler: gcc
script: ci/test.sh dist
- if: type = cron
stage: test
name: Trusty gcc vlt test
os: linux
dist: trusty
compiler: gcc
script: ci/test.sh vlt
- if: type = cron
stage: test
os: linux
dist: trusty
name: Trusty gcc vltmt test
compiler: gcc
script: ci/test.sh vltmt
notifications:
email:
if: repo = verilator/verilator
recipients:
- [email protected]
- [email protected]
-674
View File
@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+1087 -548
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1,7 +1,7 @@
GNU LESSER GENERAL PUBLIC LICENSE
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
+28 -7
View File
@@ -1,6 +1,8 @@
^CVS/
/CVS/
\.clang-format
\.clang-tidy
\.git/
\.git$
\.github/
\.svn/
\.(bak|old)/
\.(bak|old)$
@@ -9,38 +11,57 @@
.*\.log
\..*\.swp
.*\.tmp
.*\.tidy
.*\.tex
.*\.key
.*\.vcd
.*\.1
/obj_dir/
\.codacy\.yml
\.travis\.yml
/build/
/obj_dbg/
/obj_dir/
/obj_dist/
/obj_iv/
/obj_nc/
/obj_opt/
/obj_vcs/
/obj_vlt/
/obj_vltmt/
/INCA_libs/
/cov_work/
/logs/
^Makefile$
README.html
bin/verilator_bin.*
bin/verilator_coverage_bin.*
docs/.*\.html$
docs/Makefile$
docs/doxygen-doc/.*
examples/xml_py/copied/
examples/xml_py/graph.*
src/Makefile$
src/Makefile_obj$
include/verilated.mk$
test_regress/.gdbinit$
config.cache$
config.status$
verilator.log
verilator.tex
verilator\.log
verilator\.tex
verilator-config.cmake$
verilator-config-version.cmake$
verilator.pc$
verilator_bin.*
verilator_coverage_bin.*
.vcsmx_rebuild$
ncverilog.history
autom4te\.cache/
nodist/
ci/
/simv$
/simv.daidir/
/vc_hdrs.h$
/csrc/
doxygen-doc/.*
obj_dir/.*
obj_dir.*
TAGS
.*~
+146 -116
View File
@@ -3,11 +3,11 @@
#
# This file is part of Verilator.
#
# Code available from: http://www.veripool.org/verilator
# Code available from: https://verilator.org
#
#*****************************************************************************
#
# Copyright 2003-2017 by Wilson Snyder. This program is free software; you can
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
@@ -56,6 +56,7 @@ INSTALL_DATA = @INSTALL_DATA@
MAKEINFO = makeinfo
POD2TEXT = pod2text
POD2LATEXFIX = $(srcdir)/src/pod2latexfix
MKINSTALLDIRS = $(SHELL) $(srcdir)/src/mkinstalldirs
PERL = @PERL@
# Destination prefix for RPMs
@@ -82,7 +83,7 @@ infodir = @infodir@
pkgdatadir = @pkgdatadir@
# Directory in which to install pkgconfig file
# Generall ${prefix}/share/pkgconfig
# Generally ${prefix}/share/pkgconfig
pkgconfigdir = @pkgconfigdir@
# Directory in which to install data across multiple architectures
@@ -102,42 +103,74 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
SHELL = /bin/sh
SUBDIRS = src test_regress \
examples/hello_world_c examples/hello_world_sc \
examples/tracing_c examples/tracing_sc \
SUBDIRS = docs src test_regress \
examples/cmake_hello_c \
examples/cmake_hello_sc \
examples/cmake_tracing_c \
examples/cmake_tracing_sc \
examples/cmake_protect_lib \
examples/make_hello_c \
examples/make_hello_sc \
examples/make_tracing_c \
examples/make_tracing_sc \
examples/make_protect_lib \
examples/xml_py \
INFOS = README README.html README.pdf internals.txt internals.html \
internals.pdf verilator.txt verilator.html verilator.pdf \
$(VL_INST_MAN_FILES)
INFOS = verilator.txt verilator.html verilator.pdf
INFOS_OLD = README README.html README.pdf
# Files that can be generated, but should be up to date for a distribution.
DISTDEP = info Makefile
DISTFILES_INC = $(INFOS) .gitignore Artistic COPYING COPYING.LESSER \
DISTFILES_INC = $(INFOS) .gitignore \
*.in *.ac \
Changes TODO \
Artistic \
Changes \
LICENSE \
MANIFEST.SKIP \
README.adoc \
verilator-config.cmake.in \
verilator-config-version.cmake.in \
bin/verilator \
bin/verilator_coverage \
bin/verilator_difftree \
bin/verilator_gantt \
bin/verilator_includer \
bin/verilator_profcfunc \
doxygen-mainpage doxygen.config veripool-logo.png \
install-sh configure mkinstalldirs *.pod \
docs/.gitignore \
docs/CONTRIBUTING.adoc \
docs/CONTRIBUTORS \
docs/Makefile.in \
docs/TODO \
docs/doxygen-mainpage \
docs/doxygen.config \
docs/install.adoc \
docs/internals.adoc \
docs/verilator_logo.png \
docs/xml.adoc \
install-sh configure *.pod \
include/*.[chv]* \
include/*.in \
include/.*ignore \
include/gtkwave/*.[chv]* \
include/vltstd/*.[chv]* \
.*attributes */.*attributes */*/.*attributes \
src/.*ignore src/*.in src/*.cpp src/*.[chly] \
src/astgen src/bisonpre src/*fix src/cppcheck_filtered \
src/vlcovgen \
src/vlcovgen src/mkinstalldirs \
src/.gdbinit \
src/*.pl src/*.pod \
examples/*/.*ignore examples/*/Makefile* \
examples/*/*.[chv]* examples/*/*.pl \
examples/*/*.[chv]* examples/*/vl_* \
examples/*/CMakeLists.txt \
test_*/.*ignore test_*/Makefile* test_*/*.cpp \
test_*/*.pl test_*/*.v test_*/*.vc test_*/*.vh \
test_regress/*.pl \
test_regress/Makefile \
test_regress/Makefile_obj \
test_regress/input.vc \
test_regress/CMakeLists.txt \
test_regress/t/t*/*.sv* \
test_regress/t/t*/*.v* \
test_regress/t/t*/*/*.sv* \
@@ -154,10 +187,12 @@ DISTFILES_INC = $(INFOS) .gitignore Artistic COPYING COPYING.LESSER \
INST_PROJ_FILES = \
bin/verilator \
bin/verilator_coverage \
bin/verilator_gantt \
bin/verilator_includer \
bin/verilator_profcfunc \
include/verilated.mk \
include/*.[chv]* \
include/gtkwave/*.[chv]* \
include/vltstd/*.[chv]* \
INST_PROJ_BIN_FILES = \
@@ -167,12 +202,21 @@ INST_PROJ_BIN_FILES = \
DISTFILES := $(DISTFILES_INC)
EXAMPLES_FIRST = \
examples/make_hello_c \
examples/make_hello_sc \
EXAMPLES = $(EXAMPLES_FIRST) $(filter-out $(EXAMPLES_FIRST), $(sort $(wildcard examples/*)))
ifeq ($(OBJCACHE_JOBS),)
ifneq ($(OBJCACHE_HOSTS),)
export OBJCACHE_JOBS := -j $(shell objcache --jobs "$(OBJCACHE_HOSTS)")
endif
endif
# See uninstall also - don't put wildcards in this variable, it might uninstall other stuff
VL_INST_MAN_FILES = verilator.1 verilator_coverage.1 verilator_gantt.1 verilator_profcfunc.1
default: all
all: all_nomsg msg_test
all_nomsg: verilator_exe $(VL_INST_MAN_FILES)
@@ -183,8 +227,8 @@ all_nomsg: verilator_exe $(VL_INST_MAN_FILES)
.PHONY:verilator_coverage_bin_dbg
verilator_exe verilator_bin verilator_bin_dbg verilator_coverage_bin_dbg:
@echo ------------------------------------------------------------
@echo "making verilator in src" ; \
(cd src && $(MAKE) $(OBJCACHE_JOBS) )
@echo "making verilator in src"
$(MAKE) -C src $(OBJCACHE_JOBS)
.PHONY:msg_test
msg_test: all_nomsg
@@ -195,7 +239,9 @@ msg_test: all_nomsg
.PHONY: test
ifeq ($(CFG_WITH_LONGTESTS),yes) # Local... Else don't burden users
test: smoke-test examples test_regress
test: smoke-test test_regress
# examples is part of test_regress's test_regress/t/t_a2_examples.pl
# (because that allows it to run in parallel with other test_regress's)
else
test: smoke-test examples
endif
@@ -206,20 +252,22 @@ endif
@echo
smoke-test: all_nomsg
test_regress/t/t_a_first_cc.pl
test_regress/t/t_a_first_sc.pl
test_regress/t/t_a1_first_cc.pl
test_regress/t/t_a2_first_sc.pl
test_regress: all_nomsg
@(cd test_regress && $(MAKE))
$(MAKE) -C test_regress
examples: all_nomsg
for p in examples/* ; do \
for p in $(EXAMPLES) ; do \
$(MAKE) -C $$p VERILATOR_ROOT=`pwd` || exit 10; \
done
.PHONY: docs
docs: info
info: $(INFOS)
# Use --no-split to avoid creating filenames > 14 chars.
%.1: ${srcdir}/bin/%
pod2man $< $@
@@ -230,55 +278,20 @@ verilator.html: ${srcdir}/bin/verilator
pod2html $< >$@
# PDF needs DIST variables; but having configure.ac as dependency isn't detected
verilator.pdf: ${srcdir}/bin/verilator Makefile
pod2latex --full --out verilator.tex ${srcdir}/bin/verilator
verilator.pdf: ${srcdir}/bin/verilator Makefile $(POD2LATEXFIX)
pod2latex --full --out verilator.tex $<
$(PERL) $(POD2LATEXFIX) "$(DISTTITLE)" "${DISTDATE}" < verilator.tex > verilator2.tex
mv verilator2.tex verilator.tex
pdflatex verilator.tex
pdflatex verilator.tex
-rm -f verilator.toc verilator.aux verilator.idx verilator.out
README: README.pod
-rm -f $@
$(POD2TEXT) --loose $< > $@
README.html: README.pod
pod2html $< >$@
# PDF needs DIST variables; but having configure.ac as dependency isn't detected
README.pdf: README.pod Makefile
pod2latex --full --out README.tex README.pod
$(PERL) $(POD2LATEXFIX) "$(DISTTITLE) README File" "${DISTDATE}" < README.tex > README2.tex
mv README2.tex README.tex
pdflatex README.tex
pdflatex README.tex
-rm -f README.toc README.aux README.idx README.out
internals.txt: internals.pod
-rm -f $@
$(POD2TEXT) --loose $< > $@
internals.html: internals.pod
pod2html $< >$@
# PDF needs DIST variables; but having configure.ac as dependency isn't detected
internals.pdf: internals.pod Makefile
pod2latex --full --out internals.tex internals.pod
$(PERL) $(POD2LATEXFIX) "$(DISTTITLE) Internals Manual" "${DISTDATE}" < internals.tex > internals2.tex
mv internals2.tex internals.tex
pdflatex internals.tex
pdflatex internals.tex
-rm -f internals.toc internals.aux internals.idx internals.out
# See uninstall also - don't put wildcards in this variable, it might uninstall other stuff
VL_INST_BIN_FILES = verilator verilator_bin verilator_bin_dbg verilator_coverage_bin_dbg \
verilator_coverage verilator_includer verilator_profcfunc
verilator_coverage verilator_gantt verilator_includer verilator_profcfunc
# Some scripts go into both the search path and pkgdatadir,
# so they can be found by the user, and under $VERILATOR_ROOT.
# See uninstall also - don't put wildcards in this variable, it might uninstall other stuff
VL_INST_MAN_FILES = verilator.1 verilator_coverage.1 verilator_profcfunc.1
VL_INST_INC_BLDDIR_FILES = \
include/verilated_config.h \
include/verilated.mk \
@@ -286,33 +299,36 @@ VL_INST_INC_BLDDIR_FILES = \
# Files under srcdir, instead of build time
VL_INST_INC_SRCDIR_FILES = \
include/*.[chv]* \
include/gtkwave/*.[chv]* \
include/vltstd/*.[chv]* \
VL_INST_DATA_SRCDIR_FILES = \
examples/*/*.[chv]* examples/*/Makefile* \
examples/*/CMakeLists.txt
installbin:
$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(bindir)
$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator $(DESTDIR)$(bindir)/verilator )
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_coverage $(DESTDIR)$(bindir)/verilator_coverage )
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_gantt $(DESTDIR)$(bindir)/verilator_gantt )
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_profcfunc $(DESTDIR)$(bindir)/verilator_profcfunc )
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_bin $(DESTDIR)$(bindir)/verilator_bin )
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_bin_dbg $(DESTDIR)$(bindir)/verilator_bin_dbg )
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_coverage_bin_dbg $(DESTDIR)$(bindir)/verilator_coverage_bin_dbg )
$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(pkgdatadir)/bin
( cd bin ; $(INSTALL_PROGRAM) verilator_bin $(DESTDIR)$(bindir)/verilator_bin )
( cd bin ; $(INSTALL_PROGRAM) verilator_bin_dbg $(DESTDIR)$(bindir)/verilator_bin_dbg )
( cd bin ; $(INSTALL_PROGRAM) verilator_coverage_bin_dbg $(DESTDIR)$(bindir)/verilator_coverage_bin_dbg )
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/bin
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_includer $(DESTDIR)$(pkgdatadir)/bin/verilator_includer )
# Man files can either be part of the original kit, or built in current directory
# So important we use $< so VPATH is searched
# So important we use $^ so VPATH is searched
installman: $(VL_INST_MAN_FILES)
$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(mandir)/man1
cd $(srcdir) \
; for p in $(VL_INST_MAN_FILES) ; do \
$(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man1
for p in $^ ; do \
$(INSTALL_DATA) $$p $(DESTDIR)$(mandir)/man1/$$p; \
done
installdata:
$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(pkgdatadir)/include/vltstd
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/include/gtkwave
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/include/vltstd
for p in $(VL_INST_INC_BLDDIR_FILES) ; do \
$(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \
done
@@ -320,16 +336,24 @@ installdata:
; for p in $(VL_INST_INC_SRCDIR_FILES) ; do \
$(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \
done
$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(pkgdatadir)/examples/hello_world_c
$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(pkgdatadir)/examples/hello_world_sc
$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(pkgdatadir)/examples/tracing_c
$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(pkgdatadir)/examples/tracing_sc
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/make_hello_c
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/make_hello_sc
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/make_tracing_c
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/make_tracing_sc
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/make_protect_lib
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_hello_c
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_hello_sc
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_c
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_sc
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_protect_lib
cd $(srcdir) \
; for p in $(VL_INST_DATA_SRCDIR_FILES) ; do \
$(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \
done
$(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(pkgconfigdir)
$(MKINSTALLDIRS) $(DESTDIR)$(pkgconfigdir)
$(INSTALL_DATA) verilator.pc $(DESTDIR)$(pkgconfigdir)
$(INSTALL_DATA) verilator-config.cmake $(DESTDIR)$(pkgdatadir)
$(INSTALL_DATA) verilator-config-version.cmake $(DESTDIR)$(pkgdatadir)
# We don't trust rm -rf, so rmdir instead as it will fail if user put in other files
uninstall:
@@ -340,14 +364,24 @@ uninstall:
-cd $(DESTDIR)$(pkgdatadir) && rm -f $(VL_INST_INC_SRCDIR_FILES)
-cd $(DESTDIR)$(pkgdatadir) && rm -f $(VL_INST_DATA_SRCDIR_FILES)
-rm $(DESTDIR)$(pkgconfigdir)/verilator.pc
-rm $(DESTDIR)$(pkgdatadir)/verilator-config.cmake
-rm $(DESTDIR)$(pkgdatadir)/verilator-config-version.cmake
-rmdir $(DESTDIR)$(pkgdatadir)/bin
-rmdir $(DESTDIR)$(pkgdatadir)/include/gtkwave
-rmdir $(DESTDIR)$(pkgdatadir)/include/vltstd
-rmdir $(DESTDIR)$(pkgdatadir)/include
-rmdir $(DESTDIR)$(pkgdatadir)/examples/hello_world_c
-rmdir $(DESTDIR)$(pkgdatadir)/examples/hello_world_sc
-rmdir $(DESTDIR)$(pkgdatadir)/examples/tracing_c
-rmdir $(DESTDIR)$(pkgdatadir)/examples/tracing_sc
-rmdir $(DESTDIR)$(pkgdatadir)/examples/make_hello_c
-rmdir $(DESTDIR)$(pkgdatadir)/examples/make_hello_sc
-rmdir $(DESTDIR)$(pkgdatadir)/examples/make_tracing_c
-rmdir $(DESTDIR)$(pkgdatadir)/examples/make_tracing_sc
-rmdir $(DESTDIR)$(pkgdatadir)/examples/make_protect_lib
-rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_hello_c
-rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_hello_sc
-rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_c
-rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_sc
-rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_protect_lib
-rmdir $(DESTDIR)$(pkgdatadir)/examples
-rmdir $(DESTDIR)$(pkgdatadir)/cmake
-rmdir $(DESTDIR)$(pkgdatadir)
-rmdir $(DESTDIR)$(pkgconfigdir)
@@ -359,40 +393,15 @@ install-here: installman ftp
ifeq ($(VERILATOR_AUTHOR_SITE),1) # Local... Else don't burden users
DISTNAMEREV = $(shell sed -e '/DTVERSION/!d' -e 's/.*verilator_\([^"]*\).*/\1/' -e q ${srcdir}/src/config_rev.h)
DIRPROJECT := $(shell project_dir --project)
VERILATOR_CAD_DIR = $(CAD_DIR)/verilator/$(DISTNAMEREV)/$(DIRPROJECT_ARCH)
INST_PROJ_CVS = cp_if_cvs_diff
install-project: dist
@echo "Install-project to $(DIRPROJECT)"
strip bin/verilator_bin*
strip bin/verilator_coverage_bin*
$(MAKE) install-project-quick
for p in $(VL_INST_MAN_FILES) ; do \
$(INSTALL_DATA) $$p $(DIRPROJECT_PREFIX)/man/man1/$$p; \
done
$(INST_PROJ_CVS) $(DISTNAME).tgz $(DIRPROJECT)/hw/utils/verilator/verilator.tgz
rm $(DISTNAME).tgz
install-project-quick:
ifeq ($(CFG_WITH_DEFENV),yes)
@echo "%Error: Reconfigure with './configure --disable-defenv' to avoid hardcoded paths."
false
endif
@echo "Install-project-quick (no strip) to $(DIRPROJECT)"
for p in $(INST_PROJ_FILES) ; do \
$(INST_PROJ_CVS) $$p $(DIRPROJECT)/hw/utils/verilator/$$p; \
done
for p in $(INST_PROJ_BIN_FILES) ; do \
$(INST_PROJ_CVS) $$p $(DIRPROJECT)/hw/utils/verilator/$$p-$(DIRPROJECT_ARCH); \
done
install-cadtools: dist
@echo "Install-project to $(CAD_DIR)"
strip bin/verilator_bin*
strip bin/verilator_coverage_bin*
$(MAKE) install-cadtools-quick
$(SHELL) ${srcdir}/mkinstalldirs $(VERILATOR_CAD_DIR)/man/man1
$(MKINSTALLDIRS) $(VERILATOR_CAD_DIR)/man/man1
for p in $(VL_INST_MAN_FILES) ; do \
$(INSTALL_DATA) $$p $(VERILATOR_CAD_DIR)/man/man1/$$p; \
done
@@ -405,8 +414,9 @@ ifeq ($(CFG_WITH_DEFENV),yes)
false
endif
@echo "Install-cadtools-quick (no strip) to $(VERILATOR_CAD_DIR)"
$(SHELL) ${srcdir}/mkinstalldirs $(VERILATOR_CAD_DIR)/include/vltstd
$(SHELL) ${srcdir}/mkinstalldirs $(VERILATOR_CAD_DIR)/bin
$(MKINSTALLDIRS) $(VERILATOR_CAD_DIR)/include/gtkwave
$(MKINSTALLDIRS) $(VERILATOR_CAD_DIR)/include/vltstd
$(MKINSTALLDIRS) $(VERILATOR_CAD_DIR)/bin
for p in $(INST_PROJ_FILES) ; do \
$(INST_PROJ_CVS) $$p $(VERILATOR_CAD_DIR)/$$p; \
done
@@ -418,11 +428,17 @@ endif
endif
# Use --xml flag to see the cppcheck code to use for suppression
CPPCHECK_CPP = $(wildcard \
$(srcdir)/include/*.cpp \
$(srcdir)/src/*.cpp )
CPPCHECK_H = $(wildcard \
$(srcdir)/include/*.h \
$(srcdir)/src/*.h )
CPPCHECK = src/cppcheck_filtered
CPPCHECK_FLAGS = --enable=all --inline-suppr \
--suppress=unusedScopedObject --suppress=cstyleCast --suppress=useInitializationList
--suppress=unusedScopedObject --suppress=cstyleCast --suppress=useInitializationList \
--suppress=nullPointerRedundantCheck
CPPCHECK_FLAGS += --xml
CPPCHECK_CPP = $(wildcard $(srcdir)/include/*.cpp $(srcdir)/src/*.cpp)
CPPCHECK_DEP = $(subst .cpp,.cppcheck,$(CPPCHECK_CPP))
CPPCHECK_INC = -I$(srcdir)/include -I$(srcdir)/src/obj_dbg -I$(srcdir)/src
@@ -430,6 +446,17 @@ cppcheck: $(CPPCHECK_DEP)
%.cppcheck: %.cpp
$(CPPCHECK) $(CPPCHECK_FLAGS) -DVL_DEBUG=1 -DVL_CPPCHECK=1 $(CPPCHECK_INC) $<
CLANGTIDY = clang-tidy
CLANGTIDY_FLAGS = -config=''
CLANGTIDY_DEP = $(subst .h,.h.tidy,$(CPPCHECK_H)) \
$(subst .cpp,.cpp.tidy,$(CPPCHECK_CPP))
clangtidy: $(CLANGTIDY_DEP)
%.cpp.tidy: %.cpp
$(CLANGTIDY) $(CLANGTIDY_FLAGS) $< -- -DVL_DEBUG=1 -DVL_CPPCHECK=1 $(CPPCHECK_INC) | 2>&1 tee $@
%.h.tidy: %.h
$(CLANGTIDY) $(CLANGTIDY_FLAGS) $< -- -DVL_DEBUG=1 -DVL_CPPCHECK=1 $(CPPCHECK_INC) | 2>&1 tee $@
analyzer-src:
-rm -rf src/obj_dbg
scan-build $(MAKE) -k verilator_coverage_bin_dbg verilator_bin_dbg
@@ -447,7 +474,7 @@ install-msg:
@echo "Installed examples to $(DESTDIR)$(pkgdatadir)/examples"
@echo
@echo "For documentation see 'man verilator' or 'verilator --help'"
@echo "For forums and to report bugs see http://www.veripool.org/verilator"
@echo "For forums and to report bugs see https://verilator.org"
@echo
IN_WILD := ${srcdir}/*.in ${srcdir}/*/*.in
@@ -471,13 +498,13 @@ endif
maintainer-clean::
@echo "This command is intended for maintainers to use;"
@echo "rebuilding the deleted files requires makeinfo."
rm -f *.info* *.1 $(INFOS) configure
@echo "rebuilding the deleted files requires autoconf."
rm -f configure
clean mostlyclean distclean maintainer-clean maintainer-copy::
for dir in $(SUBDIRS); do \
echo making $@ in $$dir ; \
(cd $$dir && $(MAKE) $@) ; \
$(MAKE) -C $$dir $@ ; \
done
clean mostlyclean distclean maintainer-clean::
@@ -486,10 +513,13 @@ clean mostlyclean distclean maintainer-clean::
rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs *.idx
rm -f *.ev *.evs *.ov *.ovs *.cv *.cvs *.ma *.mas
rm -f *.tex
rm -rf examples/*/obj_dir* examples/*/logs
rm -rf test_*/obj_dir
rm -rf examples/*/obj_dir examples/*/logs
rm -rf nodist/fuzzer/dictionary
rm -rf nodist/obj_dir
distclean maintainer-clean::
rm -f *.info* *.1 $(INFOS) $(INFOS_OLD) $(VL_INST_MAN_FILES)
rm -f Makefile config.status config.cache config.log TAGS
rm -f verilator_bin* verilator_coverage_bin*
rm -f bin/verilator_bin* bin/verilator_coverage_bin*
@@ -504,7 +534,7 @@ TAGS: $(TAGFILES)
.PHONY: doxygen
doxygen:
$(DOXYGEN) doxygen.config
$(MAKE) -C docs doxygen
######################################################################
# Test targets
+151
View File
@@ -0,0 +1,151 @@
// Github doesn't render images unless absolute URL
:!toc:
ifdef::env-github[]
image:https://img.shields.io/badge/License-LGPL%20v3-blue.svg[license LGPLv3,link=https://www.gnu.org/licenses/lgpl-3.0]
image:https://img.shields.io/badge/License-Artistic%202.0-0298c3.svg[license Artistic-2.0,link=https://opensource.org/licenses/Artistic-2.0]
image:https://api.codacy.com/project/badge/Grade/48478c986f13400682ffe4a5e0939b3a[Code Quality,link=https://www.codacy.com/gh/verilator/verilator]
image:https://travis-ci.com/verilator/verilator.svg?branch=master[Build Status (Travis CI),link=https://travis-ci.com/verilator/verilator]
endif::[]
ifdef::env-github[]
:link_verilator_contributing: link:docs/CONTRIBUTING.adoc
:link_verilator_install: link:docs/install.adoc
endif::[]
ifndef::env-github[]
:link_verilator_contributing: https://github.com/verilator/verilator/blob/master/docs/CONTRIBUTING.adoc
:link_verilator_install: https://verilator.org/install
endif::[]
:link_verilator_commercial_support: https://verilator.org/verilator_commercial_support
== Welcome to Verilator
[cols="a,a",indent=0,frame="none"]
|===
^.^| *Welcome to Verilator, the fastest free Verilog HDL simulator.*
+++ <br/> +++ &bullet; Accepts synthesizable Verilog or SystemVerilog
+++ <br/> +++ &bullet; Performs lint code-quality checks
+++ <br/> +++ &bullet; Compiles into multithreaded {cpp}, SystemC, or (soon) {cpp}-under-Python
+++ <br/> +++ &bullet; Creates XML to front-end your own tools
<.^|image:https://www.veripool.org/img/verilator_256_200_min.png[Logo,256,200]
>.^|image:https://www.veripool.org/img/verilator_multithreaded_performance_bg-min.png[,388,178]
^.^| *Fast*
+++ <br/> +++ &bullet; Outperforms many commercial simulators
+++ <br/> +++ &bullet; Single- and multi-threaded output models
^.^| *Widely Used*
+++ <br/> +++ &bullet; Wide industry and academic deployment
+++ <br/> +++ &bullet; Out-of-the-box support from Arm, and RISC-V vendor IP
<.^|image:https://www.veripool.org/img/verilator_usage_400x200-min.png[,400,200]
>.^|image:https://www.veripool.org/img/verilator_community_400x125-min.png[,400,125]
^.^| *Community Driven & Openly Licensed*
+++ <br/> +++ &bullet; Guided by the https://chipsalliance.org/[CHIPS Alliance] and https://www.linuxfoundation.org/[Linux Foundation]
+++ <br/> +++ &bullet; Open, and free as in both speech and beer
+++ <br/> +++ &bullet; More simulation for your verification budget
^.^| *Commercial Support Available*
+++ <br/> +++ &bullet; Commercial support contracts
+++ <br/> +++ &bullet; Design support contracts
+++ <br/> +++ &bullet; Enhancement contracts
<.^|image:https://www.veripool.org/img/verilator_support_400x125-min.png[,400,125]
|===
== What Verilator Does
Verilator is invoked with parameters similar to GCC or Synopsys's VCS. It
"Verilates" the specified synthesizable Verilog or SystemVerilog code by
reading it, performing lint checks, and optionally inserting assertion
checks and coverage-analysis points. It outputs single- or multi-threaded
.cpp and .h files, the "Verilated" code.
The user writes a little {cpp}/SystemC wrapper file, which instantiates the
"Verilated" model of the user's top level module. These {cpp}/SystemC
files are then compiled by a {cpp} compiler (gcc/clang/MSVC++). The
resulting executable performs the design simulation. Verilator also
supports linking its generated libraries, optionally encrypted, into other
simulators.
Verilator may not be the best choice if you are expecting a full featured
replacement for NC-Verilog, VCS or another commercial Verilog simulator, or
if you are looking for a behavioral Verilog simulator e.g. for a quick
class project (we recommend http://iverilog.icarus.com[Icarus Verilog] for
this.) However, if you are looking for a path to migrate synthesizable
Verilog to {cpp} or SystemC, and your team is comfortable writing just a
touch of {cpp} code, Verilator is the tool for you.
== Performance
Verilator does not simply convert Verilog HDL to {cpp} or SystemC. Rather
than only translate, Verilator compiles your code into a much faster
optimized and optionally thread-partitioned model, which is in turn wrapped
inside a {cpp}/SystemC/Python module. The results are a compiled Verilog
model that executes even on a single-thread over 10x faster than standalone
SystemC, and on a single thread is about 100 times faster than interpreted
Verilog simulators such as http://iverilog.icarus.com[Icarus
Verilog]. Another 2-10x speedup might be gained from multithreading
(yielding 200-1000x total over interpreted simulators).
Verilator has typically similar or better performance versus the commercial
Verilog simulators (Carbon Design Systems Carbonator, Modelsim, Cadence
Incisive/NC-Verilog, Synopsys VCS, VTOC, and Pragmatic CVer/CVC). But,
Verilator is free, so you can spend on computes rather than licenses. Thus
Verilator gives you more cycles/dollar than anything else available.
For more information on how Verilator stacks up to some of the other
commercial and free Verilog simulators, see the
https://www.veripool.org/verilog_sim_benchmarks.html[Verilog Simulator
Benchmarks]. (If you benchmark Verilator, please see the notes in the
https://verilator.org/verilator_doc.pdf[Verilator manual (PDF)], and also
if possible post on the forums the results; there may be additional tweaks
possible.)
== Installation & Documentation
For more information:
* {link_verilator_install}[Verilator installation and package directory
structure]
* https://verilator.org/verilator_doc.html[Verilator manual (HTML)],
or https://verilator.org/verilator_doc.pdf[Verilator manual (PDF)]
* https://verilator.org/forum[Verilator forum]
* https://verilator.org/issues[Verilator Issues]
== Support
Verilator is a community project, guided by the
https://chipsalliance.org/[CHIPS Alliance] under the
https://www.linuxfoundation.org/[Linux Foundation].
We appreciate and welcome your contributions in whatever form; please see
{link_verilator_contributing}[Contributing to Verilator]. Thanks to our
https://verilator.org/verilator_doc.html#CONTRIBUTORS[Contributors and
Sponsors].
Verilator also supports and encourages commercial support models and
organizations; please see {link_verilator_commercial_support}[Verilator
Commercial Support].
== Related Projects
* http://gtkwave.sourceforge.net/[GTKwave] - Waveform viewer for Verilator
traces.
* http://iverilog.icarus.com[Icarus Verilog] - Icarus is a full featured
interpreted Verilog simulator. If Verilator does not support your needs,
perhaps Icarus may.
== Open License
Verilator is Copyright 2003-2020 by Wilson Snyder. (Report bugs to
https://verilator.org/issues[Verilator Issues].)
Verilator is free software; you can redistribute it and/or modify it under
the terms of either the GNU Lesser General Public License Version 3 or the
Perl Artistic License Version 2.0. See the documentation for more
details.
-204
View File
@@ -1,204 +0,0 @@
# DESCRIPTION: DOCUMENT source run through perl to produce README file
# Use 'make README' to produce the output file
=pod
=head1 NAME
This is the Verilator package README file.
=head1 DISTRIBUTION
http://www.veripool.org/verilator
This package is Copyright 2003-2017 by Wilson Snyder. (Report bugs to
L<http://www.veripool.org/>.)
Verilator is free software; you can redistribute it and/or modify it under
the terms of either the GNU Lesser General Public License Version 3 or the
Perl Artistic License Version 2.0. (See the documentation for more
details.)
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
=head1 DESCRIPTION
Verilator converts synthesizable (generally not behavioral) Verilog code
into C++ or SystemC code. It is not a complete simulator, just a
translator.
Verilator is invoked with parameters similar to GCC or Synopsys's VCS. It
reads the specified Verilog code, lints it, and optionally adds coverage
code. For C++ format, it outputs .cpp and .h files. For SystemC format,
it outputs .cpp and .h files using the standard SystemC headers.
The resulting files are then compiled with C++. The user writes a little
C++ wrapper file, which instantiates the top level module. This is
compiled in C++, and linked with the Verilated files.
The resulting executable will perform the actual simulation.
=head1 SUPPORTED SYSTEMS
Verilator is developed and has primary testing on Ubuntu. Versions have
also built on Redhat Linux, Macs OS-X, HPUX and Solaris. It should run
with minor porting on any Linix-ish platform. Verilator also works on
Windows under Cygwin, and Windows under MinGW (gcc -mno-cygwin). Verilated
output (not Verilator itself) compiles under MSVC++ 2008 and newer.
=head1 INSTALLATION
For more details see
L<http://www.veripool.org/projects/verilator/wiki/Installing>.
If you will be modifying Verilator, you should use the "git" method as it
will let you track changes.
=over 4
=item
The latest version is available at L<http://www.veripool.org/verilator>.
Download the latest package from that site, and decompress.
tar xvzf verilator_version.tgz
=item
If you will be using SystemC (vs straight C++ output), download SystemC
from L<http://www.systemc.org>. Follow their installation instructions.
You will need to set SYSTEMC_INCLUDE to point to the include directory with
systemc.h in it, and SYSTEMC_LIBDIR to points to the directory with
libsystemc.a in it. (Older installations may set SYSTEMC and SYSTEMC_ARCH
instead.)
=item
You will need the C<flex> and C<bison> packages installed.
=item
C<cd> to the Verilator directory containing this README.
=item
You now have to decide how you're going to eventually install the kit.
Note Verilator builds the current value of VERILATOR_ROOT, SYSTEMC_INCLUDE,
and SYSTEMC_LIBDIR as defaults into the executable, so try to have them
correct before configuring.
=over 4
=item 1.
Our personal favorite is to always run Verilator from the kit directory.
This allows the easiest experimentation and upgrading. It's also how most
EDA tools operate; to run you point to the tarball, no install is needed.
export VERILATOR_ROOT=`pwd` # if your shell is bash
setenv VERILATOR_ROOT `pwd` # if your shell is csh
./configure
=item 2.
To install globally onto a "cad" disk with multiple versions of every tool,
and add it to path using Modules/modulecmd:
unset VERILATOR_ROOT # if your shell is bash
unsetenv VERILATOR_ROOT # if your shell is csh
# For the tarball, use the version number instead of git describe
./configure --prefix /CAD_DISK/verilator/`git describe | sed "s/verilator_//"`
After installing you'll want a module file like the following:
set install_root /CAD_DISK/verilator/{version-number-used-above}
unsetenv VERILATOR_ROOT
prepend-path PATH $install_root/bin
prepend-path MANPATH $install_root/man
prepend-path PKG_CONFIG_PATH $install_root/share/pkgconfig
=item 3.
The next option is to install it globally, using the normal system paths:
unset VERILATOR_ROOT # if your shell is bash
unsetenv VERILATOR_ROOT # if your shell is csh
./configure
=item 4.
Alternatively you can configure a prefix that install will populate, as
most GNU tools support:
unset VERILATOR_ROOT # if your shell is bash
unsetenv VERILATOR_ROOT # if your shell is csh
./configure --prefix /opt/verilator-VERSION
Then after installing you will need to add /opt/verilator-VERSION/bin to
PATH.
=back
=item
Type C<make> to compile Verilator.
Type C<make test> to check the compilation.
Configure with C<--enable-longtests> for more complete developer tests.
Additional packages may be required for these tests.
You may get a error about a typedef conflict for uint32_t. Edit
verilated.h to change the typedef to work, probably to @samp{typedef
unsigned long uint32_t;}.
=item
If you used the VERILATOR_ROOT scheme you're done. Programs should set the
environment variable VERILATOR_ROOT to point to this distribution, then
execute $VERILATOR_ROOT/bin/verilator, which will find the path to all
needed files.
If you used the prefix scheme, now do a C<make install>. To run verilator,
have the verilator binary directory in your PATH (this should already be
true if using the default configure), and make sure VERILATOR_ROOT is not
set.
You may now wish to consult the examples directory. Type C<make> inside any
example directory to run the example.
=back
=head1 USAGE DOCUMENTATION
Detailed documentation and the man page can be seen by running:
bin/verilator --help
or reading verilator.txt in the same directory as this README.
=head1 DIRECTORY STRUCTURE
The directories in the kit after de-taring are as follows:
bin/verilator => Compiler Wrapper invoked to Verilate code
include/ => Files that should be in your -I compiler path
include/verilated*.cpp => Global routines to link into your simulator
include/verilated*.h => Global headers
include/verilated.v => Stub defines for linting
include/verilated.mk => Common makefile
src/ => Translator source code
examples/hello_world_c => Example simple Verilog->C++ conversion
examples/hello_world_sc => Example simple Verilog->SystemC conversion
examples/tracing_c => Example Verilog->C++ with tracing
examples/tracing_sc => Example Verilog->SystemC with tracing
test_regress => Internal tests
=head1 LIMITATIONS
See verilator.txt (or execute C<bin/verilator --help>) for limitations.
-129
View File
@@ -1,129 +0,0 @@
// DESCRIPTION: Verilator: List of To Do issues.
//
// Copyright 2004-2017 by Wilson Snyder. This program is free software; you can
// redistribute it and/or modify it under the terms of either the GNU
// Lesser General Public License Version 3 or the Perl Artistic License
// Version 2.0.
Language support:
* Fix ordering of each bit separately in a signal (mips)
assign b[3:0] = b[7:4]; assign b[7:4] = in;
* Support UDP gate primitives/ cell libraries
(have code for combos - problem is sequential udps)
* Function to eval combo logic after /*verilator public*/ functions [gwaters]
* Support generated clocks (correctness)
* Real numbers
* Recursive functions
* Verilog configuration files
* Structs/unions (have starting point)
* DPI to define C/C++ calls from Verilog
* Expression coverage (see notes)
* Better tristate support
Long-term Features
* Assertions
* Tristate support
* Multithreaded execution
Configure/Make/Install
* Full MSVC++ compilation (does scons support this?) (4.000?)
* Distribute with flex/bison already expanded?
Flex library not needed. Probably too difficult to be worth it.
Testing:
* Move test_c/sp/v/verilated into test_regress format (4.000?)
* Capture all inputs into global "rerun it" file
* Code to make wrapper that sets signals, so can do comparison checks
* New random program generator
* Better graph viewer with search and zoom
* Port and test against opencores.org code
* // verilator debug in code so can see only tree affecting those nodes
Usability:
* Detect and pre-remove most UNOPTFLATs (4.000)
* Better reporting of unopt problems, including what lines of code
* Report more errors (all of them?) before exiting [Eugene Weber]
* Auto-create scons config files
* Print version/etc message at runtime. (4.000?)
Include number of lines of code, percent comments, code complexity measurement
<-80chars------------------------------------------------------------------->
Verilator 3.600 - fast, free, open-sourced. Copyright 2001-2013.
Verilated #### modules, #### instances, ##### sigs,
#### non-comment lines, ##### ops, ### KB model size
* Default the --l2name to remove extra "v" level of hierarchy (flag to make "top")
Lint:
* CDCRSTLOGIC should allow filtering with paths
"waive CDCRSTLOGIC --from a.b.sig --to a.c.sig --via OR"
Internal Code:
* Eliminate the AstNUser* passed to all visitors; its only needed in V3Width,
and removing it will speed up and simplify all the other code.
* V3Graph should be templated container type, taking in Vertex + Edge types
* Rename V3PreLex etc to match VerilogPerl filenames
* Instead of string, have an VEncodedString/VIdString which contains __DOT__ish
things, to reduce bugs. Also add _20 trailing space to \ encoded names. (4.000)
Runtime:
* New evalulation loop ~/src/verilator/notes/event_loop.txt (4.000?)
* Remove all private internal functions from top level wrapper header, move
to new level (4.000?)
* Completely standalone simulation (4.000)
main() records arguments for $test$plusvars
instantiates top,
does tracing (support $dump?)
calls top->simulateForever()
exits
Performance:
* Latch optimizations
* Constant propagation
Extra cleaning AND: 1 & ((VARREF >> 1) | ((&VARREF >> 1) & VARREF))
Extra shift (perhaps due to clean): if (1 & CAST (VARREF >> #))
* Gated clock and latch conversion to flops. [JeanPaul Vanitegem]
Could propagate the AND into pos/negedges and let domaining optimize.
* Negedge reset
Switch to remove negedges that don't matter
Can't remove async resets from control flops (like in syncronizers)
* If all references to array have a constant index, blow up into separate signals-per-index
* Bit-multiply for faster bit swapping and a=b[1,3,2] random bit reorderings.
* Move _last sets and all other combo logic inside master
if() that triggers on all possible sense items
* Rewrite and combine V3Life, V3Subst
If block temp only ever set in one place to constant, propagate it
Used in t_mem for array delayed assignments
Replace variables if set later in same cfunc branch
See for example duplicate sets of _narrow in cycle 90/91 of t_select_plusloop
* Same assignment on both if branches
"if (a) { ... b=2; } else { ... b=2;}" -> "b=2; if ..."
Careful though, as b could appear in the statement or multiple times in statement
(Could just require exatly two 'b's in statement)
* Simplify XOR/XNOR/AND/OR bit selection trees
Foo = A[1] ^ A[2] ^ A[3] etc are better as ^ ( A & 32'b...1110 )
* Combine variables into wider elements
Parallel statements on different bits should become single signal
Variables that are always consumed in "parallel" can be joined
* Duplicate assignments in gate optimization
Common to have many separate posedge blocks, each with identical
reset_r <= rst_in
* If signal is used only once (not counting trace), always gate substitute
Don't merge if any combining would form circ logic (out goes back to in)
* Multiple assignments each bit can become single assign with concat
Make sure a SEL of a CONCAT can get the single bit back.
* Usually blocks/values
Enable only after certain time, so VL_TIME_I(32) > 0x1e gets eliminated out
* Better ordering of a<=b, b<=c, put all refs to 'b' next to each other to optimize caching
* Allow Split of case statements without a $display/$stop
* I-cache packing improvements (what/how?)
* Data cache organization (order of vars in class)
First have clocks,
then bools instead of uint32_t's
then based on what sense list they come from, all outputs, then all inputs
finally have any signals part of a "usually" block, or constant.
* Rather then tracking widths, have a MSB...LSB of this expression
(or better, a bitmask of bits relevant in this expression)
* Track recirculation and convert into clock-enables
* Clock enables should become new clocking domains for speed
* If floped(a) & flopped(b) and no other a&b, then instead flop(a&b).
* Sort by output bitselects so can combine more assignments (see DDP example dx_dm signal)
+1422 -349
View File
File diff suppressed because it is too large Load Diff
+54 -56
View File
@@ -1,9 +1,7 @@
: # -*-Mode: perl;-*- use perl, wherever it is
eval 'exec perl -wS $0 ${1+"$@"}'
if 0;
#!/usr/bin/env perl
######################################################################
#
# Copyright 2003-2017 by Wilson Snyder. This program is free software; you
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
@@ -17,13 +15,6 @@ eval 'exec perl -wS $0 ${1+"$@"}'
require 5.006_001;
use warnings;
BEGIN {
if ($ENV{DIRPROJECT} && $ENV{DIRPROJECT_PERL_BOOT}) {
# Magic to allow author testing of perl packages in local directory
require $ENV{DIRPROJECT}."/".$ENV{DIRPROJECT_PERL_BOOT};
}
}
use Getopt::Long;
use FindBin qw($RealBin $RealScript);
use IO::File;
@@ -31,7 +22,7 @@ use Pod::Usage;
use Cwd qw(abs_path getcwd);
use strict;
use vars qw ($Debug @Opt_Verilator_Sw);
use vars qw($Debug @Opt_Verilator_Sw);
#######################################################################
#######################################################################
@@ -54,26 +45,26 @@ foreach my $sw (@ARGV) {
push @Opt_Verilator_Sw, $sw;
}
Getopt::Long::config ("no_auto_abbrev","pass_through");
Getopt::Long::config("no_auto_abbrev","pass_through");
if (! GetOptions (
# Major operating modes
"help" => \&usage,
"debug:s" => \&debug,
# "version!" => \&version, # Also passthru'ed
# Additional parameters
"<>" => sub {}, # Ignored
# Major operating modes
"help" => \&usage,
"debug:s" => \&debug,
# "version!" => \&version, # Also passthru'ed
# Additional parameters
"<>" => sub {}, # Ignored
)) {
pod2usage(-exitstatus=>2, -verbose=>0);
}
# Normal, non gdb
run (verilator_coverage_bin()
." ".join(' ',@Opt_Verilator_Sw));
run(verilator_coverage_bin()
." ".join(' ',@Opt_Verilator_Sw));
#----------------------------------------------------------------------
sub usage {
pod2usage(-verbose=>2, -exitval=>2, -output=>\*STDOUT);
pod2usage(-verbose=>2, -exitval=>0, -output=>\*STDOUT);
}
sub debug {
@@ -90,23 +81,25 @@ sub verilator_coverage_bin {
my $bin = "";
# Use VERILATOR_ROOT if defined, else assume verilator_bin is in the search path
my $basename = ($ENV{VERILATOR_COVERAGE_BIN}
|| "verilator_coverage_bin_dbg");
|| "verilator_coverage_bin_dbg");
if (defined($ENV{VERILATOR_ROOT})) {
my $dir = $ENV{VERILATOR_ROOT};
if (-x "$dir/bin/$basename") { # From a "make install" into VERILATOR_ROOT
$bin = "$dir/bin/$basename";
} else {
$bin = "$dir/$basename"; # From pointing to kit directory
}
my $dir = $ENV{VERILATOR_ROOT};
if (-x "$dir/bin/$basename"
|| -x "$dir/bin/$basename.exe") { # From a "make install" into VERILATOR_ROOT
$bin = "$dir/bin/$basename";
} else {
$bin = "$dir/$basename"; # From pointing to kit directory
}
} else {
if (-x "$RealBin/$basename") {
$bin = "$RealBin/$basename"; # From path/to/verilator with verilator_bin installed
} else {
$bin = $basename; # Find in PATH
}
# Note we don't look under bin/$basename which would be right if running
# in the kit dir. Running that would likely break, since
# VERILATOR_ROOT wouldn't be set and Verilator won't find internal files.
if (-x "$RealBin/$basename"
|| -x "$RealBin/$basename.exe") {
$bin = "$RealBin/$basename"; # From path/to/verilator with verilator_bin installed
} else {
$bin = $basename; # Find in PATH
}
# Note we don't look under bin/$basename which would be right if running
# in the kit dir. Running that would likely break, since
# VERILATOR_ROOT wouldn't be set and Verilator won't find internal files.
}
return $bin;
}
@@ -123,23 +116,28 @@ sub run {
system($command);
my $status = $?;
if ($status) {
if ($! =~ /no such file or directory/i) {
warn "%Error: verilator_coverage: Misinstalled, or VERILATOR_ROOT might need to be in environment\n";
}
if ($Debug) { # For easy rerunning
warn "%Error: export VERILATOR_ROOT=".($ENV{VERILATOR_ROOT}||"")."\n";
warn "%Error: $command\n";
}
if ($status & 127) {
if (($status & 127) == 8 || ($status & 127) == 11) { # SIGFPA or SIGSEGV
warn "%Error: Verilator_coverage internal fault, sorry.\n" if !$Debug;
} elsif (($status & 127) == 6) { # SIGABRT
warn "%Error: Verilator_coverage aborted.\n" if !$Debug;
} else {
warn "%Error: Verilator_coverage threw signal $status.\n" if !$Debug;
}
}
die "%Error: Command Failed $command\n";
if ($! =~ /no such file or directory/i) {
warn "%Error: verilator_coverage: Misinstalled, or VERILATOR_ROOT might need to be in environment\n";
}
if ($Debug) { # For easy rerunning
warn "%Error: export VERILATOR_ROOT=".($ENV{VERILATOR_ROOT}||"")."\n";
warn "%Error: $command\n";
}
if ($status & 127) {
if (($status & 127) == 8 || ($status & 127) == 11) { # SIGFPA or SIGSEGV
warn "%Error: Verilator_coverage internal fault, sorry.\n" if !$Debug;
} elsif (($status & 127) == 6) { # SIGABRT
warn "%Error: Verilator_coverage aborted.\n" if !$Debug;
} else {
warn "%Error: Verilator_coverage threw signal $status.\n" if !$Debug;
}
}
if ($status != 256 || $Debug) { # i.e. not normal exit(1)
warn "%Error: Command Failed $command\n";
}
exit $! if $!; # errno
exit $? >> 8 if $? >> 8; # child exit status
exit 255; # last resort
}
}
@@ -269,9 +267,9 @@ Specifies a module search directory.
=head1 DISTRIBUTION
The latest version is available from L<http://www.veripool.org/>.
The latest version is available from L<https://verilator.org>.
Copyright 2003-2017 by Wilson Snyder. Verilator is free software; you can
Copyright 2003-2020 by Wilson Snyder. Verilator is free software; you can
redistribute it and/or modify the Verilator internals under the terms of
either the GNU Lesser General Public License Version 3 or the Perl Artistic
License Version 2.0.
+65 -67
View File
@@ -1,16 +1,13 @@
: # -*-Mode: perl;-*- use perl, wherever it is
eval 'exec perl -wS $0 ${1+"$@"}'
if 0;
#!/usr/bin/env perl
# See copyright, etc in below POD section.
######################################################################
require 5.006_001;
use warnings;
use Getopt::Long;
use IO::File;
use Pod::Usage;
use strict;
use vars qw ($Debug);
use vars qw($Debug);
#======================================================================
@@ -37,12 +34,12 @@ my $Opt_B;
my $Opt_Lineno = 1;
autoflush STDOUT 1;
autoflush STDERR 1;
Getopt::Long::config ("no_auto_abbrev");
if (! GetOptions (
"help" => \&usage,
"debug" => \&debug,
"<>" => \&parameter,
"lineno!" => \$Opt_Lineno,
Getopt::Long::config("no_auto_abbrev");
if (! GetOptions(
"help" => \&usage,
"debug" => \&debug,
"<>" => \&parameter,
"lineno!" => \$Opt_Lineno,
)) {
die "%Error: Bad usage, try 'verilator_difftree --help'\n";
}
@@ -54,9 +51,9 @@ defined $Opt_B or die "%Error: No new diff filename\n";
-e $Opt_B or die "%Error: No new diff filename found: $Opt_B\n";
if (-d $Opt_A && -d $Opt_B) {
diff_dir ($Opt_A, $Opt_B);
diff_dir($Opt_A, $Opt_B);
} elsif (-f $Opt_A && -f $Opt_B) {
diff_file ($Opt_A, $Opt_B);
diff_file($Opt_A, $Opt_B);
} else {
die "%Error: Mix of files and dirs\n";
}
@@ -68,24 +65,25 @@ sub diff_dir {
my %files;
foreach my $fn (glob("$a/*.tree")) {
(my $base = $fn) =~ s!.*/!!;
$files{$base}{a} = $fn;
(my $base = $fn) =~ s!.*/!!;
$files{$base}{a} = $fn;
}
foreach my $fn (glob("$b/*.tree")) {
(my $base = $fn) =~ s!.*/!!;
$files{$base}{b} = $fn;
(my $base = $fn) =~ s!.*/!!;
$files{$base}{b} = $fn;
}
my $any;
foreach my $base (sort (keys %files)) {
my $a = $files{$base}{a};
my $b = $files{$base}{b};
next if !$a || !$b;
print "="x70,"\n";
print "= $a <-> $b\n";
diff_file($a,$b);
$any = 1;
my $a = $files{$base}{a};
my $b = $files{$base}{b};
next if !$a || !$b;
print "="x70,"\n";
print "= $a <-> $b\n";
diff_file($a,$b);
$any = 1;
}
$any or warn "%Warning: No .tree files found\n";
$any or warn("%Warning: No .tree files found that have similar base names:\n "
.join("\n ", sort keys %files),"\n");
}
sub diff_file {
@@ -100,10 +98,10 @@ sub diff_file {
my $vera = version_from($a);
my $verb = version_from($b);
my $verCvt = (($vera < 0x3900 && $verb >= 0x3900)
|| ($vera >= 0x3900 && $verb < 0x3900));
|| ($vera >= 0x3900 && $verb < 0x3900));
filter ($a, $tmp_a, $verCvt);
filter ($b, $tmp_b, $verCvt);
filter($a, $tmp_a, $verCvt);
filter($b, $tmp_b, $verCvt);
system("diff -u $tmp_a $tmp_b");
unlink $tmp_a;
unlink $tmp_b;
@@ -114,8 +112,8 @@ sub version_from {
# Return dump format
my $f1 = IO::File->new ($fn) or die "%Error: $! $fn,";
while (defined (my $line=$f1->getline())) {
last if $. > 10;
return hex $1 if $line =~ /\(format (0x[0-9.]+)\)/;
last if $. > 10;
return hex $1 if $line =~ /\(format (0x[0-9.]+)\)/;
}
return 1.0;
}
@@ -129,36 +127,36 @@ sub filter {
my $f2 = IO::File->new ($fn2,"w") or die "%Error: $! $fn2,";
while (defined (my $line=$f1->getline())) {
same_line:
next if $line =~ / This=/;
$line =~ s/0x[a-f0-9]+/0x/g;
$line =~ s/<e[0-9]+\#?>/<e>/g;
$line =~ s/{[a-z]*\d+}/{}/g if !$Opt_Lineno;
if ($verCvt) {
next if $line =~ /^ NETLIST/;
$line =~ s!\@dt=0x\(G?/?([^)]+)\)!$1!g; # NEW: @dt -> OLD: non @dt format
# # Below Ver1_Non_Dtyped may replace above further
if ($line =~ /: ([A-Z]+) /) {
my $type = $1;
next if $type =~ 'DTYPE';
if ($type eq 'TYPETABLE' || $type eq 'RANGE') {
$line =~ /^(\s+\S+:) /; my $prefix = $1;
while (defined ($line=$f1->getline())) {
next if $line =~ /^\s+[a-z]/; # Table body
next if $line =~ /^${prefix}[0-9]:/;
goto same_line;
}
next;
}
if ($Ver1_Non_Dtyped{$type}) {
$line =~ s! w[0-9]+!!g;
}
}
$line =~ s!\@dt=0$!NoW!g; # NEW: dt=null -> common format
$line =~ s!\@dt=0 !NoW !g; # NEW: dt=null -> common format
$line =~ s! s?w0$! NoW!g; # OLD: no width -> common format
$line =~ s! s?w0 ! NoW !g; # OLD: no width -> common format
}
print $f2 $line;
next if $line =~ / This=/;
$line =~ s/0x[a-f0-9]+/0x/g;
$line =~ s/<e[0-9]+\#?>/<e>/g;
$line =~ s/{[a-z]*\d+}/{}/g if !$Opt_Lineno;
if ($verCvt) {
next if $line =~ /^ NETLIST/;
$line =~ s!\@dt=0x\(G?/?([^)]+)\)!$1!g; # NEW: @dt -> OLD: non @dt format
# # Below Ver1_Non_Dtyped may replace above further
if ($line =~ /: ([A-Z]+) /) {
my $type = $1;
next if $type =~ 'DTYPE';
if ($type eq 'TYPETABLE' || $type eq 'RANGE') {
$line =~ /^(\s+\S+:) /; my $prefix = $1;
while (defined ($line=$f1->getline())) {
next if $line =~ /^\s+[a-z]/; # Table body
next if $line =~ /^${prefix}[0-9]:/;
goto same_line;
}
next;
}
if ($Ver1_Non_Dtyped{$type}) {
$line =~ s! w[0-9]+!!g;
}
}
$line =~ s!\@dt=0$!NoW!g; # NEW: dt=null -> common format
$line =~ s!\@dt=0 !NoW !g; # NEW: dt=null -> common format
$line =~ s! s?w0$! NoW!g; # OLD: no width -> common format
$line =~ s! s?w0 ! NoW !g; # OLD: no width -> common format
}
print $f2 $line;
}
$f1->close;
$f2->close;
@@ -167,8 +165,8 @@ sub filter {
#----------------------------------------------------------------------
sub usage {
pod2usage(-verbose=>2, -exitval=>2, -output=>\*STDOUT);
exit (1);
pod2usage(-verbose=>2, -exitval=>0, -output=>\*STDOUT);
exit(1); # Unreachable
}
sub debug {
@@ -178,11 +176,11 @@ sub debug {
sub parameter {
my $param = shift;
if (!defined $Opt_A) {
$Opt_A = $param;
$Opt_A = $param;
} elsif (!defined $Opt_B) {
$Opt_B = $param;
$Opt_B = $param;
} else {
die "%Error: Unknown parameter: $param\n";
die "%Error: Unknown parameter: $param\n";
}
}
@@ -233,9 +231,9 @@ Do not show differences in line numbering.
=head1 DISTRIBUTION
The latest version is available from L<http://www.veripool.org/verilator>.
The latest version is available from L<https://verilator.org>.
Copyright 2005-2017 by Wilson Snyder. This package is free software; you can
Copyright 2005-2020 by Wilson Snyder. This package is free software; you can
redistribute it and/or modify it under the terms of either the GNU Lesser
General Public License Version 3 or the Perl Artistic License Version 2.0.
+558
View File
@@ -0,0 +1,558 @@
#!/usr/bin/env perl
# See copyright, etc in below POD section.
######################################################################
use warnings;
use strict;
use Getopt::Long;
use IO::File;
use Pod::Usage;
use vars qw($Debug);
$Debug = 0;
my $Opt_File;
my $Opt_Time_Per_Char = 0; # rdtsc ticks per char in gantt chart, 0=auto
my $opt_vcd = "profile_threads.vcd";
our %Threads;
our %Mtasks;
our %Global;
autoflush STDOUT 1;
autoflush STDERR 1;
Getopt::Long::config("no_auto_abbrev");
if (! GetOptions(
"help" => \&usage,
"scale=i" => \$Opt_Time_Per_Char,
"debug" => sub { $Debug = 1; },
"vcd=s" => \$opt_vcd,
"no-vcd!" => sub { $opt_vcd = undef; },
"<>" => \&parameter,
)) {
die "%Error: Bad usage, try 'verilator_gantt --help'\n";
}
$Opt_File = "profile_threads.dat" if !defined $Opt_File;
process($Opt_File);
write_vcd($opt_vcd) if defined $opt_vcd;
exit(0);
#######################################################################
sub usage {
pod2usage(-verbose=>2, -exitval=>0, -output=>\*STDOUT);
exit(1); # Unreachable
}
sub parameter {
my $param = shift;
if (!defined $Opt_File) {
$Opt_File = $param;
} else {
die "%Error: Unknown parameter: $param\n";
}
}
#######################################################################
sub process {
my $filename = shift;
read_data($filename);
report();
}
#######################################################################
sub read_data {
my $filename = shift;
%Global = (rdtsc_cycle_time => 0);
my $fh = IO::File->new ($filename) or die "%Error: $! $filename,";
while (my $line = $fh->getline) {
if ($line =~ m/VLPROF mtask\s(\d+)\sstart\s(\d+)\send\s(\d+)\selapsed\s(\d+)\spredict_time\s(\d+)\scpu\s(\d+)\son thread (\d+)/) {
my $mtask = $1;
my $start = $2;
my $end = $3;
my $elapsed_time = $4;
my $predict_time = $5;
my $cpu = $6;
my $thread = $7;
$Threads{$thread}{$start}{mtask} = $mtask;
$Threads{$thread}{$start}{end} = $end;
$Threads{$thread}{$start}{cpu} = $cpu;
if (!exists $Mtasks{$mtask}{elapsed}) {
$Mtasks{$mtask}{elapsed} = 0;
}
$Mtasks{$mtask}{elapsed} += $elapsed_time;
$Mtasks{$mtask}{predict} = $predict_time;
$Mtasks{$mtask}{end} = max($Mtasks{$mtask}{end}, $end);
}
elsif ($line =~ /^VLPROFTHREAD/) {}
elsif ($line =~ m/VLPROF arg\s+(\S+)\+([0-9.])\s*$/
|| $line =~ m/VLPROF arg\s+(\S+)\s+([0-9.])\s*$/) {
$Global{args}{$1} = $2;
}
elsif ($line =~ m/VLPROF stat\s+(\S+)\s+([0-9.]+)/) {
$Global{stats}{$1} = $2;
}
elsif ($line =~ /^#/) {}
elsif ($Debug) {
chomp $line;
print "Unk: $line\n";
}
# TODO -- this is parsing text printed by a client.
# Really, verilator proper should generate this
# if it's useful...
if ($line =~ m/rdtsc time = (\d+) ticks/) {
$Global{rdtsc_cycle_time} = $1;
}
}
}
sub report {
print "Verilator Gantt report\n";
print "\nArgument settings:\n";
foreach my $arg (sort keys %{$Global{args}}) {
my $plus = ($arg =~ /^\+/) ? "+" : " ";
printf " %s%s%d\n", $arg, $plus, $Global{args}{$arg};
}
my $nthreads = scalar keys %Threads;
$Global{cpus}{cpu_time} = {};
foreach my $thread (keys %Threads) {
# Make potentially multiple characters per column
foreach my $start (keys %{$Threads{$thread}}) {
my $cpu = $Threads{$thread}{$start}{cpu};
my $elapsed = $Threads{$thread}{$start}{end} - $start;
$Global{cpus}{cpu_time}{$cpu} += $elapsed;
}
}
my $mt_mtask_time = 0;
my $long_mtask_time = 0;
my $last_end = 0;
foreach my $mtask (keys %Mtasks) {
$mt_mtask_time += $Mtasks{$mtask}{elapsed};
$last_end = max($last_end, $Mtasks{$mtask}{end});
$long_mtask_time = max($long_mtask_time, $Mtasks{$mtask}{elapsed});
}
$Global{last_end} = $last_end;
report_graph();
# If we know cycle time in the same (rdtsc) units,
# this will give us an actual utilization number,
# (how effectively we keep the cores busy.)
#
# It also gives us a number we can compare against
# serial mode, to estimate the overhead of data sharing,
# which will show up in the total elapsed time. (Overhead
# of synchronization and scheduling should not.)
print "\nAnalysis:\n";
printf " Total threads = %d\n", $nthreads;
printf " Total mtasks = %d\n", scalar(keys %Mtasks);
printf " Total cpus used = %d\n", scalar(keys %{$Global{cpus}});
printf " Total yields = %d\n", $Global{stats}{yields};
printf " Total eval time = %d rdtsc ticks\n", $Global{last_end};
printf " Longest mtask time = %d rdtsc ticks\n", $long_mtask_time;
printf " All-thread mtask time = %d rdtsc ticks\n", $mt_mtask_time;
my $long_efficiency = $long_mtask_time/($Global{last_end});
printf " Longest-thread efficiency = %0.1f%%\n", $long_efficiency*100;
my $mt_efficiency = $mt_mtask_time/($Global{last_end}*$nthreads);
printf " All-thread efficiency = %0.1f%%\n", $mt_efficiency*100;
printf " All-thread speedup = %0.1f\n", $mt_efficiency*$nthreads;
if ($Global{rdtsc_cycle_time} > 0) {
my $ut = $mt_mtask_time / $Global{rdtsc_cycle_time};
print "tot_mtask_cpu=$mt_mtask_time cyc=$Global{rdtsc_cycle_time} ut=$ut\n";
}
my @p2e_ratios;
my $min_p2e = 1000000;
my $min_mtask;
my $max_p2e = -1000000;
my $max_mtask;
foreach my $mtask (sort keys %Mtasks) {
if ($Mtasks{$mtask}{elapsed} > 0) {
if ($Mtasks{$mtask}{predict} == 0) {
$Mtasks{$mtask}{predict} = 1; # don't log(0) below
}
my $p2e_ratio = log( $Mtasks{$mtask}{predict} / $Mtasks{$mtask}{elapsed} );
#print "log(p2e $mtask) = $p2e_ratio (predict $Mtasks{$mtask}{predict}, elapsed $Mtasks{$mtask}{elapsed})\n";
push @p2e_ratios, $p2e_ratio;
if ($p2e_ratio > $max_p2e) {
$max_p2e = $p2e_ratio;
$max_mtask = $mtask;
}
if ($p2e_ratio < $min_p2e) {
$min_p2e = $p2e_ratio;
$min_mtask = $mtask;
}
}
}
print "\nStatistics:\n";
print " min log(p2e) = $min_p2e from mtask $min_mtask (predict $Mtasks{$min_mtask}{predict}, elapsed $Mtasks{$min_mtask}{elapsed})\n";
print " max log(p2e) = $max_p2e from mtask $max_mtask (predict $Mtasks{$max_mtask}{predict}, elapsed $Mtasks{$max_mtask}{elapsed})\n";
my $stddev = stddev(\@p2e_ratios);
my $mean = mean(\@p2e_ratios);
print " mean = " . ($mean) . "\n";
print " stddev = " . ($stddev) . "\n";
print " e ^ stddev = " . exp($stddev). "\n";
print "\n";
}
sub report_graph {
my $time_per = $Opt_Time_Per_Char;
if ($time_per == 0) {
$time_per = ($Global{last_end} / 40); # Start with 40 columns
while ($time_per > 10) {
my ($graph, $conflicts) = _make_graph($time_per);
last if !$conflicts;
$time_per = int($time_per/2);
}
# One more step so we can fit more labels
$time_per = int($time_per/2);
}
my ($graph, $conflicts) = _make_graph($time_per);
print "\nThread gantt graph:\n";
print " Legend: One character width = $time_per rdtsc ticks\n";
print " Legend: '&' = multiple mtasks in this period (character width)\n";
my $scale = " <-".$Global{last_end}." rdtsc total";
for (my $col = length($scale); # -2 for '->' below
$col < ($Global{last_end}/$time_per); ++$col) {
$scale .= "-";
}
print " $scale->\n";
foreach my $thread (sort keys %{$graph}) {
print " t: ";
_print_graph_line($graph->{$thread}, '');
}
}
sub _make_graph {
my $time_per = shift;
my $graph = {}; # {thread}{column}{char=>'x' or chars=>#}
my $conflicts = 0;
foreach my $thread (keys %Threads) {
# Make potentially multiple characters per column
foreach my $start (sort {$a <=> $b} keys %{$Threads{$thread}}) {
my $end = $Threads{$thread}{$start}{end};
my $mtask = $Threads{$thread}{$start}{mtask};
my $cpu = $Threads{$thread}{$start}{cpu};
my $startcol = _time_col($time_per, $start);
my $endcol = _time_col($time_per, $end);
my $label = "[";
$label .= "$cpu"; # Maybe make optional in future
my $width = $endcol - $startcol + 1;
while (length($label) < ($width-1)) { # -1 for ']'
$label .= "-";
}
$label .= "]";
$graph->{$thread}[$startcol]{char} .= $label;
}
if ($Debug) {
print "# Multicol: "; _print_graph_line($graph->{$thread}, '|');
}
# Expand line to one char per column
for (my $col = 0; $col <= $#{$graph->{$thread}}; ++$col) {
if (my $chars = $graph->{$thread}[$col]{char}) {
my $ok = 1;
for (my $coladd = 1; $coladd<length($chars); ++$coladd) {
if ($graph->{$thread}[$col + $coladd]{char}) {
$ok = 0; last;
}
}
if (!$ok) {
if ($chars =~ /\[.*\[/) { # Two begins or more
$conflicts++;
$graph->{$thread}[$col]{char} = "&";
} else {
$graph->{$thread}[$col]{char} = "[";
}
for (my $coladd = 1; $coladd<length($chars); ++$coladd) {
if ($graph->{$thread}[$col + $coladd]{char}) {
last;
} else {
$graph->{$thread}[$col + $coladd]{char} = 'x';
}
}
} else {
my $coladd = 0;
foreach my $char (split //, $chars) {
$graph->{$thread}[$col+$coladd]{char} = $char;
++$coladd;
}
}
}
}
if ($Debug) {
print "# Singlcol: "; _print_graph_line($graph->{$thread}, '|');
}
}
print "# Conflicts $conflicts\n" if $Debug;
return ($graph, $conflicts);
}
sub _print_graph_line {
my $graph_thread = shift;
my $sep = shift;
for (my $col = 0; $col <= $#{$graph_thread}; ++$col) {
my $c = $graph_thread->[$col]{char}; $c=' ' if !defined $c;
print $c, $sep;
}
print "\n";
}
sub _time_col {
my $time_per = shift;
my $time = shift;
return int($time/$time_per);
}
#######################################################################
sub write_vcd {
my $filename = shift;
print "Writing $filename\n";
my $fh = IO::File->new(">$filename") or die "%Error: $! $filename,";
my $vcd = {values => {}, # {<time>}{<code>} = value
sigs => {}, # {<module>}{<sig}} = code
code => 0,
};
my %parallelism;
foreach my $thread (keys %Threads) {
my $mcode = ($vcd->{sigs}{threads}{"thread${thread}_mtask"} ||= $vcd->{code}++);
foreach my $start (sort {$a <=> $b} keys %{$Threads{$thread}}) {
my $end = $Threads{$thread}{$start}{end};
my $mtask = $Threads{$thread}{$start}{mtask};
my $cpu = $Threads{$thread}{$start}{cpu};
$vcd->{values}{$start}{$mcode} = $mtask;
$vcd->{values}{$end}{$mcode} = undef;
$parallelism{$start}++;
$parallelism{$end}--;
my $ccode = $vcd->{sigs}{cpus}{"cpu${cpu}_thread"} ||= $vcd->{code}++;
$vcd->{values}{$start}{$ccode} = $thread;
$vcd->{values}{$end}{$ccode} = undef;
my $mcode = $vcd->{sigs}{mtasks}{"mtask${mtask}_cpu"} ||= $vcd->{code}++;
$vcd->{values}{$start}{$mcode} = $cpu;
$vcd->{values}{$end}{$mcode} = undef;
}
}
{
my $pcode = ($vcd->{sigs}{Stats}{"parallelism"} ||= $vcd->{code}++);
my $value = 0;
foreach my $time (sort {$a<=>$b} keys %parallelism) {
$value += $parallelism{$time};
$vcd->{values}{$time}{$pcode} = $value;
}
}
$fh->print('$version Generated by verilator_gantt $end'."\n");
$fh->print('$timescale 1ns $end'."\n");
$fh->print("\n");
my %all_codes;
$fh->print(' $scope module gantt $end'."\n");
foreach my $module (sort keys %{$vcd->{sigs}}) {
$fh->printf(' $scope module %s $end'."\n", $module);
foreach my $sig (sort keys %{$vcd->{sigs}{$module}}) {
my $code = $vcd->{sigs}{$module}{$sig};
$fh->printf(' $var wire 32 v%x %s [31:0] $end'."\n",
$code, $sig);
$all_codes{$code} = 1;
}
$fh->print(' $upscope $end'."\n");
}
$fh->print(' $upscope $end'."\n");
$fh->print('$enddefinitions $end'."\n");
$fh->print("\n");
my $first = 1;
foreach my $time (sort {$a <=> $b} keys %{$vcd->{values}}) {
if ($first) {
$first = 0;
# Start with Z for any signals without time zero data
foreach my $code (keys %all_codes) {
if (!defined $vcd->{values}{$time}{$code}) {
$vcd->{values}{$time}{$code} = undef;
}
}
}
$fh->printf("#%d\n", $time);
foreach my $code (sort keys %{$vcd->{values}{$time}}) {
my $value = $vcd->{values}{$time}{$code};
if (defined $value) {
$fh->printf("b%b v%x\n", $value, $code);
} else {
$fh->printf("bz v%x\n", $code);
}
}
}
}
#######################################################################
# Similar to Statistics::Basic functions, but avoid a package dependency
sub max {
my $n = $_[0]; shift;
while (defined $_[0]) {
$n = $_[0] if !defined $n || $_[0] > $n;
shift;
}
return $n;
}
sub mean {
my $arrayref = shift;
my $n = 0;
my $sum = 0;
foreach my $v (@$arrayref) {
$sum += $v;
$n++;
}
return undef if !$n;
return $sum/$n;
}
sub stddev {
my $arrayref = shift;
my $n = 0;
my $sum = 0;
my $sumsq = 0;
foreach my $v (@$arrayref) {
$sum += $v;
$sumsq += $v**2;
$n++;
}
return undef if !$n;
return sqrt(($sumsq/$n) - ($sum/$n)**2);
}
#######################################################################
__END__
=pod
=head1 NAME
verilator_gantt - Create Gantt chart of multi-threaded execution
=head1 SYNOPSIS
Creates a visual representation to help analyze Verilator multithreaded
simulation performance, by showing when each macro-task starts and ends,
and showing when each thread is busy or idle.
The generated Gantt chart has time on the X-axis. Times shown are to the
scale printed, i.e. a certain about of time for each character width. The
Y-axis shows threads, each thread's execution is shown on one line. That
line shows "[" at the position in time when it executes.
Following the "[" is the cpu number the task executed on, followed by zero
or more "-" to make the width of the characters match the scaled execution
time, followed by a "]". If the scale is too small, the cpu number and
mtask number will not be printed. If the scale is very small, a "&"
indicates multiple mtasks started at that time position.
Also creates a value change dump (VCD) format dump file which may be viewed
in a waveform viewer (e.g. C<GTKWave>). See below.
=head1 USAGE
Build with --prof-threads.
Run a sim with +verilator+prof+threads+window 2.
This will create profile_threads.dat.
Then run:
verilator_gantt profile_threads.dat
The report will be printed on standard output, this also generates
profile_threads.vcd
View profile_threads.vcd in a waveform viewer.
=head1 VCD SIGNALS
In waveforms there are the following signals. Most signals the "decimal"
format will remove the leading zeros and make the traces easier to read.
parallelism: The number of mtasks active at this time, for best performance
this will match the thread count. You may want to use an "analog step"
format to view this signal.
cpu#_thread: For the given CPU number, the thread number executing.
mtask#_cpu; For the given mtask id, the CPU it is executing on.
thread#_mtask: For the given thread number, the mtask id executing.
=head1 ARGUMENTS
=over 4
=item I<filename>
The filename to read data from, defaults to "profile_threads.dat".
=item --help
Displays this message and program version and exits.
=item --scale I<n>
On the X-axis of the generated Gantt chart, each character represents this
many time units. (On x86, time units are rdtsc ticks.) Defaults to 0,
which will automatically compute a reasonable scale where no two mtasks
need to fit into same character width's worth of scaled time.
=item --no-vcd
=item --vcd I<filename>
Set output filename for vcd dump, or disable. Default is
verilator_gantt.vcd.
=back
=head1 DISTRIBUTION
The latest version is available from L<https://verilator.org>.
Copyright 2018-2020 by Wilson Snyder. Verilator is free software; you can
redistribute it and/or modify it under the terms of either the GNU Lesser
General Public License Version 3 or the Perl Artistic License Version 2.0.
=head1 AUTHORS
Wilson Snyder <[email protected]>
=head1 SEE ALSO
C<verilator>
=cut
######################################################################
### Local Variables:
### compile-command: "$V4/bin/verilator_gantt $V4/test_regress/obj_vltmt/t_gantt/vlt_sim.log"
### End:
+2 -4
View File
@@ -1,9 +1,7 @@
: # -*-Mode: perl;-*- use perl, wherever it is
eval 'exec perl -wS $0 ${1+"$@"}'
if 0;
#!/usr/bin/env perl
# DESCRIPTION: Print include statements for each ARGV
#
# Copyright 2003-2017 by Wilson Snyder. This package is free software; you can
# Copyright 2003-2020 by Wilson Snyder. This package is free software; you can
# redistribute it and/or modify it under the terms of either the GNU Lesser
# General Public License Version 3 or the Perl Artistic License Version 2.0.
######################################################################
+103 -97
View File
@@ -1,6 +1,4 @@
: # -*-Mode: perl;-*- use perl, wherever it is
eval 'exec perl -wS $0 ${1+"$@"}'
if 0;
#!/usr/bin/env perl
# See copyright, etc in below POD section.
######################################################################
@@ -11,7 +9,7 @@ use IO::File;
use Pod::Usage;
eval { use Data::Dumper; $Data::Dumper::Indent = 1; }; # Debug, ok if missing
use strict;
use vars qw ($Debug);
use vars qw($Debug);
#======================================================================
@@ -23,12 +21,12 @@ $Debug = 0;
my $Opt_File;
autoflush STDOUT 1;
autoflush STDERR 1;
Getopt::Long::config ("no_auto_abbrev");
if (! GetOptions (
"help" => \&usage,
"debug" => \&debug,
"<>" => \&parameter,
)) {
Getopt::Long::config("no_auto_abbrev");
if (! GetOptions(
"help" => \&usage,
"debug" => \&debug,
"<>" => \&parameter,
)) {
die "%Error: Bad usage, try 'verilator_profcfunc --help'\n";
}
@@ -39,8 +37,8 @@ profcfunc($Opt_File);
#----------------------------------------------------------------------
sub usage {
pod2usage(-verbose=>2, -exitval=>2, -output=>\*STDOUT);
exit (1);
pod2usage(-verbose=>2, -exitval=>0, -output=>\*STDOUT);
exit(1); # Unreachable
}
sub debug {
@@ -50,9 +48,9 @@ sub debug {
sub parameter {
my $param = shift;
if (!defined $Opt_File) {
$Opt_File = $param;
$Opt_File = $param;
} else {
die "%Error: Unknown parameter: $param\n";
die "%Error: Unknown parameter: $param\n";
}
}
@@ -66,13 +64,21 @@ sub profcfunc {
my %funcs;
while (defined (my $line=$fh->getline())) {
# %time cumesec selfsec calls {stuff} name
if ($line =~ /^\s*([0-9.]+)\s+[0-9.]+\s+([0-9.]+)\s+([0-9.]+)\s+[^a-zA-Z_]*([a-zA-Z_].*)$/) {
my $pct=$1; my $sec=$2; my $calls=$3; my $func=$4;
$funcs{$func}{pct} += $pct;
$funcs{$func}{sec} += $sec;
$funcs{$func}{calls} += $calls;
}
# %time cumesec selfsec calls {stuff} name
if ($line =~ /^\s*([0-9.]+)\s+[0-9.]+\s+([0-9.]+)\s+([0-9.]+)\s+[^a-zA-Z_]*([a-zA-Z_].*)$/) {
my $pct=$1; my $sec=$2; my $calls=$3; my $func=$4;
$funcs{$func}{pct} += $pct;
$funcs{$func}{sec} += $sec;
$funcs{$func}{calls} += $calls;
}
# Older gprofs have no call column for single-call functions
# %time cumesec selfsec {stuff} name
elsif ($line =~ /^\s*([0-9.]+)\s+[0-9.]+\s+([0-9.]+)\s+[^a-zA-Z_]*([a-zA-Z_].*)$/) {
my $pct=$1; my $sec=$2; my $calls=1; my $func=$3;
$funcs{$func}{pct} += $pct;
$funcs{$func}{sec} += $sec;
$funcs{$func}{calls} += $calls;
}
}
$fh->close;
@@ -80,10 +86,10 @@ sub profcfunc {
my %pointer_mods;
my %verilated_mods;
foreach my $func (keys %funcs) {
if ($func =~ /(.*)::_eval\(([a-zA-Z_0-9]+__Syms).*\)$/) {
$verilated_mods{$1} = qr/^$1/;
$pointer_mods{$2} = $1;
}
if ($func =~ /(.*)::_eval\(([a-zA-Z_0-9]+__Syms).*\)$/) {
$verilated_mods{$1} = qr/^$1/;
$pointer_mods{$2} = $1;
}
}
#print Dumper(\%pointer_mods, \%verilated_mods);
@@ -91,72 +97,72 @@ sub profcfunc {
my %vfuncs;
my %groups;
foreach my $func (keys %funcs) {
my $pct = $funcs{$func}{pct};
my $vfunc = $func;
my $design;
my $pct = $funcs{$func}{pct};
my $vfunc = $func;
my $design;
if ($func =~ /\(([a-zA-Z_0-9]+__Syms)/) {
$design = $pointer_mods{$1};
}
if ($func =~ /\(([a-zA-Z_0-9]+__Syms)/) {
$design = $pointer_mods{$1};
}
foreach my $vde (keys %verilated_mods) {
last if $design;
if ($func =~ /$verilated_mods{$vde}/) {
$design=$vde;
last;
}
}
foreach my $vde (keys %verilated_mods) {
last if $design;
if ($func =~ /$verilated_mods{$vde}/) {
$design=$vde;
last;
}
}
if ($vfunc =~ /__PROF__([a-zA-Z_0-9]+)__l?([0-9]+)\(/) {
$vfunc = sprintf("VBlock %s:%d", $1, $2);
$groups{type}{"Verilog Blocks under $design"} += $pct;
$groups{design}{$design} += $pct;
$groups{module}{$1} += $pct;
} else {
if ($design) {
$vfunc = sprintf("VCommon %s", $func);
$groups{type}{"Common code under $design"} += $pct;
$groups{design}{$design} += $pct;
$groups{module}{$design." common code"} += $pct;
} elsif ($func =~ /^VL_[A-Z0-9_]+/
|| $func =~ /^_?vl_[a-zA-Z0-9_]+/
|| $func =~ /^verilated/i) {
$vfunc = sprintf("VLib %s", $func);
$groups{type}{'VLib'} += $pct;
$groups{design}{'VLib'} += $pct;
$groups{module}{'VLib'} += $pct;
} elsif ($func =~ /^_mcount_private/) {
$vfunc = sprintf("Prof %s", $func);
$groups{type}{'Prof'} += $pct;
$groups{design}{'Prof'} += $pct;
$groups{module}{'Prof'} += $pct;
} else {
$vfunc = sprintf("C++ %s", $func);
$groups{type}{'C++'} += $pct;
$groups{design}{'C++'} += $pct;
$groups{module}{'C++'} += $pct;
}
}
$vfuncs{$vfunc} = $funcs{$func};
if ($vfunc =~ /__PROF__([a-zA-Z_0-9]+)__l?([0-9]+)\(/) {
$vfunc = sprintf("VBlock %s:%d", $1, $2);
$groups{type}{"Verilog Blocks under $design"} += $pct;
$groups{design}{$design} += $pct;
$groups{module}{$1} += $pct;
} else {
if ($design) {
$vfunc = sprintf("VCommon %s", $func);
$groups{type}{"Common code under $design"} += $pct;
$groups{design}{$design} += $pct;
$groups{module}{$design." common code"} += $pct;
} elsif ($func =~ /^VL_[A-Z0-9_]+/
|| $func =~ /^_?vl_[a-zA-Z0-9_]+/
|| $func =~ /^verilated/i) {
$vfunc = sprintf("VLib %s", $func);
$groups{type}{'VLib'} += $pct;
$groups{design}{'VLib'} += $pct;
$groups{module}{'VLib'} += $pct;
} elsif ($func =~ /^_mcount_private/) {
$vfunc = sprintf("Prof %s", $func);
$groups{type}{'Prof'} += $pct;
$groups{design}{'Prof'} += $pct;
$groups{module}{'Prof'} += $pct;
} else {
$vfunc = sprintf("C++ %s", $func);
$groups{type}{'C++'} += $pct;
$groups{design}{'C++'} += $pct;
$groups{module}{'C++'} += $pct;
}
}
$vfuncs{$vfunc} = $funcs{$func};
}
foreach my $type (qw(type design module)) {
my $missing = 100;
foreach (sort (keys %{$groups{$type}})) {
$missing -= $groups{$type}{$_};
}
if ($missing) {
$groups{$type}{"\377Unaccounted for/rounding error"} = $missing;
}
my $missing = 100;
foreach (sort (keys %{$groups{$type}})) {
$missing -= $groups{$type}{$_};
}
if ($missing) {
$groups{$type}{"\377Unaccounted for/rounding error"} = $missing;
}
print("Overall summary by $type:\n");
printf(" %-6s %s\n","% time",$type);
foreach my $what (sort (keys %{$groups{$type}})) {
(my $pwhat = $what) =~ s/^\377//; # Just used to establish sort order
printf(" %6.2f %s\n", $groups{$type}{$what}, $pwhat);
}
print("\n");
print("Overall summary by $type:\n");
printf(" %-6s %s\n","% time",$type);
foreach my $what (sort (keys %{$groups{$type}})) {
(my $pwhat = $what) =~ s/^\377//; # Just used to establish sort order
printf(" %6.2f %s\n", $groups{$type}{$what}, $pwhat);
}
print("\n");
}
print("Verilog code profile:\n");
@@ -173,14 +179,14 @@ sub profcfunc {
my $cume = 0;
foreach my $func (sort {$vfuncs{$b}{sec} <=> $vfuncs{$a}{sec}
|| $a cmp $b}
(keys %vfuncs)) {
$cume += $vfuncs{$func}{sec};
printf +("%6.2f %9.2f %8.2f %8d %s\n",
$vfuncs{$func}{pct},
$cume, $vfuncs{$func}{sec},
$vfuncs{$func}{calls},
$func);
|| $a cmp $b}
(keys %vfuncs)) {
$cume += $vfuncs{$func}{sec};
printf +("%6.2f %9.2f %8.2f %8d %s\n",
$vfuncs{$func}{pct},
$cume, $vfuncs{$func}{sec},
$vfuncs{$func}{calls},
$func);
}
}
@@ -191,11 +197,11 @@ __END__
=head1 NAME
verilator_profcfunc - Read gprof report created with --profile-cfuncs
verilator_profcfunc - Read gprof report created with --prof-cfuncs
=head1 SYNOPSIS
verilator --profile-cfuncs ....
verilator --prof-cfuncs ....
gcc --ggdb -pg ....
{run executable}
gprof
@@ -204,8 +210,8 @@ verilator_profcfunc - Read gprof report created with --profile-cfuncs
=head1 DESCRIPTION
Verilator_profcfunc reads a profile report created by gprof. The names of
the functions are then transformed, assuming the user used verilator's
--profile-cfuncs, and a report printed showing the percentage of time, etc,
the functions are then transformed, assuming the user used Verilator's
--prof-cfuncs, and a report printed showing the percentage of time, etc,
in each Verilog block.
=head1 ARGUMENTS
@@ -220,9 +226,9 @@ Displays this message and program version and exits.
=head1 DISTRIBUTION
The latest version is available from L<http://www.veripool.org/>.
The latest version is available from L<https://verilator.org>.
Copyright 2007-2017 by Wilson Snyder. Verilator is free software; you can
Copyright 2007-2020 by Wilson Snyder. Verilator is free software; you can
redistribute it and/or modify it under the terms of either the GNU Lesser
General Public License Version 3 or the Perl Artistic License Version 2.0.
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash
# DESCRIPTION: Verilator: Build script for vcddiff
#
# Copyright 2019 by Todd Strader. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
set -e
# NB: it would be better to add this via a PPA
TMP_DIR=$(mktemp -d)
git -C "${TMP_DIR}" clone https://github.com/veripool/vcddiff
VCDDIFF_DIR=${TMP_DIR}/vcddiff
git -C "${VCDDIFF_DIR}" checkout 5112f88b7ba8818dce9dfb72619e64a1fc19542c
make -C "${VCDDIFF_DIR}"
sudo cp "${VCDDIFF_DIR}/vcddiff" /usr/local/bin
+64
View File
@@ -0,0 +1,64 @@
#!/bin/bash
# DESCRIPTION: Verilator: Travis CI build script
#
# Copyright 2019 by Todd Strader. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
#
# This script builds and caches the Verilator binaries for Travis CI
# (and possibly other CI platforms). The Verilator CI system uses this
# script, but other CI systems that depend on Verilator may also use
# the script.
# see: https://github.com/verilator/verilator_ext_tests/blob/master/.travis.yml
# To use this script, either checkout Verilator as part of the CI build
# process or add Verilator as a Git submodule. Verilator tarballs can
# not be used as the script relies on Git revisions for caching.
set -e
if [ -z "${VERILATOR_NUM_JOBS}" ]; then
VERILATOR_NUM_JOBS=$(nproc)
fi
# Caching would be simpler if we installed without VERILATOR_ROOT, but
# it's needed for driver.pl outside of the repo
if [ -z "${VERILATOR_ROOT}" ]; then
echo "VERILATOR_ROOT not set"
exit -1
fi
if [ -z "${VERILATOR_CACHE}" ]; then
echo "VERILATOR_CACHE not set"
exit -1
fi
VERILATOR_REV=$(cd "${VERILATOR_ROOT}" && git rev-parse HEAD)
echo "Found Verilator rev ${VERILATOR_REV}"
CACHED_REV_FILE=${VERILATOR_CACHE}/.rev.txt
if [[ ! -f "${CACHED_REV_FILE}" || \
$(< "${CACHED_REV_FILE}") != "${VERILATOR_REV}" ]]; then
echo "Building Verilator"
# Unsure why Travis monkies with the capitalization of the stage name, but it does
if [[ -n ${TRAVIS_BUILD_STAGE_NAME} && \
${TRAVIS_BUILD_STAGE_NAME} != "Build verilator" ]]; then
echo "WARNING: Building Verilator in Travis build stage other than \"Build verilator\": ${TRAVIS_BUILD_STAGE_NAME}"
fi
cd "${VERILATOR_ROOT}"
autoconf && ./configure ${VERILATOR_CONFIG_FLAGS} && make -j ${VERILATOR_NUM_JOBS}
# Copy the Verilator build artifacts
mkdir -p "${VERILATOR_CACHE}"
rm -rf ${VERILATOR_CACHE}/*
cp bin/*bin* "${VERILATOR_CACHE}"
# Remember the Git revision
echo "${VERILATOR_REV}" > "${CACHED_REV_FILE}"
else
echo "Using cached Verilator"
cd "${VERILATOR_ROOT}"
# Create include/verilated_config.h and maybe other things
autoconf && ./configure ${VERILATOR_CONFIG_FLAGS}
cp ${VERILATOR_CACHE}/* bin
fi
+57
View File
@@ -0,0 +1,57 @@
# DESCRIPTION: Dockerfile for env to build and fully test Verilator
#
# Copyright 2020 by Stefan Wallentowitz. This program is free
# software; you can redistribute it and/or modify it under the terms
# of either the GNU Lesser General Public License Version 3 or the
# Perl Artistic License Version 2.0.
FROM ubuntu:18.04
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends -y \
autoconf=2.69-11 \
bc=1.07.1-2 \
bison=2:3.0.4.dfsg-1build1 \
build-essential=12.4ubuntu1 \
ca-certificates=20180409 \
cmake=3.10.2-1ubuntu2.18.04.1 \
flex=2.6.4-6 \
gdb=8.1-0ubuntu3.2 \
gcc-6=6.5.0-2ubuntu1~18.04 \
gcc-5=5.5.0-12ubuntu1 \
gcc-4.8=4.8.5-4ubuntu8 \
git=1:2.17.1-1ubuntu0.5 \
gtkwave=3.3.86-1 \
g++-6=6.5.0-2ubuntu1~18.04 \
g++-5=5.5.0-12ubuntu1 \
g++-4.8=4.8.5-4ubuntu8 \
libfl2=2.6.4-6 \
libfl-dev=2.6.4-6 \
numactl=2.0.11-2.1ubuntu0.1 \
perl=5.26.1-6ubuntu0.3 \
python3=3.6.7-1~18.04 \
wget=1.19.4-1ubuntu2.2 \
zlibc=0.9k-4.3 \
zlib1g=1:1.2.11.dfsg-0ubuntu2 \
zlib1g-dev=1:1.2.11.dfsg-0ubuntu2 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
COPY build-systemc.sh /tmp/
RUN ./build-systemc.sh
RUN cpan install -fi Unix::Processors Parallel::Forker Bit::Vector
RUN git clone https://github.com/veripool/vcddiff.git && \
make -C vcddiff && \
cp -p vcddiff/vcddiff /usr/local/bin/vcddiff && \
rm -rf vcddiff
COPY build.sh /tmp/build.sh
ENV VERILATOR_AUTHOR_SITE=1
ENTRYPOINT [ "/tmp/build.sh" ]
+50
View File
@@ -0,0 +1,50 @@
= Verilator Build Environment
This container is set up to compile and test a Verilator build based
on the following parameters:
* Source repository (default: https://github.com/verilator/verilator)
* Source revision (default: master)
* GCC version (4.8.5, 5.5.0, 6.5.0, 7.4.0, default: 7.4.0)
The container is published as `verilator/verilator-buildenv` on
https://hub.docker.com/repository/docker/verilator/verilator-buildenv[docker hub].
To run the basic build of current master:
docker run -ti verilator/verilator-buildenv
To also run tests:
docker run -ti verilator/verilator-buildenv test
Change the compiler:
docker run -ti -e CC=gcc-4.8 -e CXX=g++-4.8 verilator/verilator-buildenv test
The tests that involve gdb are not working due to security restrictions.
To run those too:
....
docker run -ti -v ${PWD}:/tmp/repo -e REPO=/tmp/repo -e REV=`git rev-parse --short HEAD` -e CC=gcc-4.8 -e CXX=g++-4.8 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined verilator/verilator-buildenv test
....
You may want to avoid pushing your changes to a remote repository and
instead use a local working copy. You can mount the local working copy
path as a volume and use this as repo. Be careful, that it can only
use committed changes, so you may want to use a work-in-progress
commit or so. To build the current HEAD from top of a repository:
....
docker run -ti -v ${PWD}:/tmp/repo -e REPO=/tmp/repo -e REV=`git rev-parse --short HEAD` --cap-add=SYS_PTRACE --security-opt seccomp=unconfined verilator/verilator-buildenv test
....
== Under the Hood
To rebuild the image, simply run:
docker build .
It will build SystemC in all supported compiler variants to reduce the
impact on testing cycles. A build script will be the entrypoint to the
container that will perform a standard build and test procedure.
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash -e
# DESCRIPTION: Build SystemC in Ubuntu 18.04 with different g++/gcc
#
# Copyright 2020 by Stefan Wallentowitz. This program is free
# software; you can redistribute it and/or modify it under the terms
# of either the GNU Lesser General Public License Version 3 or the
# Perl Artistic License Version 2.0.
build_variant () {
version=$($1 --version | grep gcc | awk '{print $4}')
mkdir "/usr/local/systemc-2.3.3-gcc$version"
mkdir build
cd build
../configure --prefix="/usr/local/systemc-2.3.3-gcc$version" CC="$1" CXX="$2" LD="$2"
make -j
make install
cd ..
rm -r build
}
wget https://www.accellera.org/images/downloads/standards/systemc/systemc-2.3.3.tar.gz
tar -xzf systemc-2.3.3.tar.gz
cd systemc-2.3.3
build_variant gcc g++
build_variant gcc-6 g++-6
build_variant gcc-5 g++-5
build_variant gcc-4.8 g++-4.8
cd ..
rm -r systemc-2.3.3*
+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash -e
# DESCRIPTION: Build Verilator (inside container)
#
# Copyright 2020 by Stefan Wallentowitz. This program is free
# software; you can redistribute it and/or modify it under the terms
# of either the GNU Lesser General Public License Version 3 or the
# Perl Artistic License Version 2.0.
: "${REPO:=https://github.com/verilator/verilator}"
: "${REV:=master}"
: "${CC:=gcc}"
: "${CXX:=g++}"
GCCVERSION=$(${CC} --version | grep gcc | awk '{print $4}')
export SYSTEMC_INCLUDE="/usr/local/systemc-2.3.3-gcc${GCCVERSION}/include"
export SYSTEMC_LIBDIR="/usr/local/systemc-2.3.3-gcc${GCCVERSION}/lib-linux64"
export LD_LIBRARY_PATH=${SYSTEMC_LIBDIR}
SRCS=$PWD/verilator
git clone "$REPO" "$SRCS"
cd "$SRCS"
git checkout "$REV"
autoconf
./configure --enable-longtests
make -j $(nproc)
if [ "${1:-''}" == "test" ]; then
make test
fi
+47
View File
@@ -0,0 +1,47 @@
# DESCRIPTION: Dockerfile for image to run Verilator inside
#
# Copyright 2020 by Stefan Wallentowitz. This program is free
# software; you can redistribute it and/or modify it under the terms
# of either the GNU Lesser General Public License Version 3 or the
# Perl Artistic License Version 2.0.
FROM ubuntu:18.04
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
autoconf=2.69-11 \
bc=1.07.1-2 \
bison=2:3.0.4.dfsg-1build1 \
build-essential=12.4ubuntu1 \
ca-certificates=20180409 \
flex=2.6.4-6 \
git=1:2.17.1-1ubuntu0.5 \
libfl-dev=2.6.4-6 \
perl=5.26.1-6ubuntu0.3 \
python3=3.6.7-1~18.04 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ARG REPO=https://github.com/verilator/verilator
ARG SOURCE_COMMIT=master
WORKDIR /tmp
# Add an exception for the linter, we want to cd here in one layer
# to reduce the number of layers (and thereby size).
# hadolint ignore=DL3003
RUN git clone "${REPO}" verilator && \
cd verilator && \
git checkout "${SOURCE_COMMIT}" && \
autoconf && \
./configure && \
make -j "$(nproc)" && \
make install && \
cd .. && \
rm -r verilator
COPY verilator-wrap.sh /usr/local/bin/verilator-wrap.sh
WORKDIR /work
ENTRYPOINT [ "/usr/local/bin/verilator-wrap.sh" ]
+49
View File
@@ -0,0 +1,49 @@
= Docker Container as Verilator executable
This allows you to run Verilator easily as a docker image, e.g.:
docker run -ti verilator/verilator:latest --version
This is in particular useful to compare against older version or to
check when an issue was introduced.
You will need to give it access to your files as a volume and fix the
user rights:
....
docker run -ti -v ${PWD}:/work --user $(id -u):$(id -g) verilator/verilator:latest --cc test.v
....
The caveat is that it can only access files below the current
directory then, a workaround is to adopt the volume and set
`-workdir`.
There is a convenience script in this folder that wraps around the
docker calls:
$ verilator-docker 3.922 --version
Verilator 3.922 2018-03-17 rev UNKNOWN_REV
Finally, you can also work in the container by setting the entrypoint
(don't forget to mount a volume if you want your work persistent):
docker run -ti --entrypoint /bin/bash verilator/verilator:latest
The other files in this folder all for building the containers and to
store in them. You could use it to build Verilator at a specific
commit:
docker build --build-arg SOURCE_COMMIT=<commit> .
== Internals
The Dockerfile is pretty straight-forward, it builds Verilator and
removes the tree after that to reduce the image size. It sets a
wrapper script (`verilator-wrap.sh`) as entrypoint. This script calls
Verilator but also copies the verilated runtime files to the `obj_dir`
or the `-Mdir` respectively. This allows the user to build the C++
output with the matching runtime files. The wrapper patches the
generated Makefile accordingly.
There is also a hook defined that is run by docker hub via automated
builds.
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
# DESCRIPTION: Docker hub hook to pass SOURCE_COMMIT
#
# Copyright 2020 by Stefan Wallentowitz. This program is free
# software; you can redistribute it and/or modify it under the terms
# of either the GNU Lesser General Public License Version 3 or the
# Perl Artistic License Version 2.0.FROM ubuntu:18.04
docker build --build-arg SOURCE_COMMIT=${SOURCE_COMMIT} -f $DOCKERFILE_PATH -t $IMAGE_NAME .
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
# DESCRIPTION: Docker hub hook to tag the latest release (stable)
#
# Copyright 2020 by Stefan Wallentowitz. This program is free
# software; you can redistribute it and/or modify it under the terms
# of either the GNU Lesser General Public License Version 3 or the
# Perl Artistic License Version 2.0.FROM ubuntu:18.04
if [ "$SOURCE_BRANCH"="stable" ]; then
docker tag $IMAGE_NAME $DOCKER_REPO:latest
docker push $DOCKER_REPO:latest
fi
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
# DESCRIPTION: Wrap a verilator call to run a docker container
#
# Copyright 2020 by Stefan Wallentowitz. This program is free
# software; you can redistribute it and/or modify it under the terms
# of either the GNU Lesser General Public License Version 3 or the
# Perl Artistic License Version 2.0.
docker pull verilator/verilator:$1 >/dev/null
docker run -ti -v ${PWD}:/work --user $(id -u):$(id -g) verilator/verilator:$1 "${@:2}"
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash -e
# DESCRIPTION: Wrap a Verilator call and copy vlt includes
# (inside docker container)
#
# Copyright 2020 by Stefan Wallentowitz. This program is free
# software; you can redistribute it and/or modify it under the terms
# of either the GNU Lesser General Public License Version 3 or the
# Perl Artistic License Version 2.0.
perl /usr/local/bin/verilator "$@"
# Check if user set an obj_dir
obj_dir=$(echo " $@" | grep -oP '\s--Mdir\s*\K\S+')
if [ "$obj_dir" == "" ]; then
obj_dir="obj_dir"
fi
# If the run was successful: Copy required files to allow build without this container
if [ -e ${obj_dir} ]; then
# Copy files required for the build
mkdir -p ${obj_dir}/vlt
cp -r /usr/local/share/verilator/bin ${obj_dir}/vlt
cp -r /usr/local/share/verilator/include ${obj_dir}/vlt
# Point Makefile to that folder
perl -i -pe 's/VERILATOR_ROOT = \/usr\/local\/share\/verilator/VERILATOR_ROOT = vlt/g' ${obj_dir}/*.mk
fi
Executable
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
# DESCRIPTION: Verilator: Travis CI test script
#
# Copyright 2019 by Todd Strader. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
set -e
export DRIVER_FLAGS='-j 0 --quiet --rerun'
case $1 in
dist)
make -C test_regress SCENARIOS=--dist
;;
vlt)
make -C test_regress SCENARIOS=--vlt
;;
vltmt)
make -C test_regress SCENARIOS=--vltmt
;;
*)
echo "Usage: test.sh (dist|vlt|vltmt)"
exit -1
;;
esac
+201 -24
View File
@@ -1,25 +1,67 @@
# DESCRIPTION: Process this file with autoconf to produce a configure script.
#
# Copyright 2003-2017 by Wilson Snyder. Verilator is free software; you can
# Copyright 2003-2020 by Wilson Snyder. Verilator is free software; you can
# redistribute it and/or modify it under the terms of either the GNU Lesser
# General Public License Version 3 or the Perl Artistic License Version 2.0.
#AC_INIT([Verilator],[#.### YYYY-MM-DD])
#AC_INIT([Verilator],[#.### devel])
AC_INIT([Verilator],[3.916 2017-11-25])
AC_INIT([Verilator],[4.028 2020-02-06],
[https://verilator.org],
[verilator],[https://verilator.org])
# When releasing, also update header of Changes file
# and commit using "devel release" or "Version bump" message
AC_CONFIG_HEADER(src/config_build.h)
AC_CONFIG_FILES(Makefile src/Makefile src/Makefile_obj include/verilated.mk include/verilated_config.h verilator.pc)
AC_CONFIG_FILES(Makefile docs/Makefile src/Makefile src/Makefile_obj include/verilated.mk include/verilated_config.h verilator.pc verilator-config.cmake verilator-config-version.cmake)
AC_MSG_RESULT([configuring for $PACKAGE_STRING])
# Ignore automake flags passed by Ubuntu builds
AC_ARG_ENABLE([dependency-tracking],
[AS_HELP_STRING([--disable-dependency-tracking], [ignored])])
AC_ARG_ENABLE([maintainer-mode],
[AS_HELP_STRING([--enable-maintainer-mode], [ignored])])
AC_ARG_ENABLE([silent-rules],
[AS_HELP_STRING([--disable-silent-rules], [ignored])])
# Flag to enable linking specific libraries statically
AC_MSG_CHECKING(whether to perform partial static linking of Verilator binary)
AC_ARG_ENABLE([partial-static],
[AS_HELP_STRING([--disable-partial-static],
[By default, for Verilation peformance, Verilator
is linked against some of its dependencies
statically. Use this to link the Verilator binary
fully dynamically.])],
[case "${enableval}" in
yes) CFG_ENABLE_PARTIAL_STATIC=yes ;;
no) CFG_ENABLE_PARTIAL_STATIC=no ;;
*) AC_MSG_ERROR([bad value '${enableval}' for --disable-partial-static]) ;;
esac],
CFG_ENABLE_PARTIAL_STATIC=yes)
AC_MSG_RESULT($CFG_ENABLE_PARTIAL_STATIC)
# Flag to enable linking Verilator with tcmalloc if available
AC_MSG_CHECKING(whether to use tcmalloc)
AC_ARG_ENABLE([tcmalloc],
[AS_HELP_STRING([--enable-tcmalloc],
[Use libtcmalloc_minimal for faster dynamic memory
management in Verilator binary@<:@default=check@:>@])],
[case "${enableval}" in
yes) CFG_WITH_TCMALLOC=yes ;;
no) CFG_WITH_TCMALLOC=no ;;
*) AC_MSG_ERROR([bad value '${enableval}' for --enable-tcmalloc]) ;;
esac],
[CFG_WITH_TCMALLOC=check;])
AC_MSG_RESULT($CFG_WITH_TCMALLOC)
# Special Substitutions - CFG_WITH_DEFENV
AC_MSG_CHECKING(whether to use hardcoded paths)
AC_ARG_ENABLE([defenv],
[AS_HELP_STRING([--disable-defenv],
[disable using some hardcoded data paths extracted from some default environment variables (the default is to use hardcoded paths)])],
[disable using some hardcoded data paths extracted
from some default environment variables (the default
is to use hardcoded paths) in Verilator binary])],
[case "${enableval}" in
yes) CFG_WITH_DEFENV=yes ;;
no) CFG_WITH_DEFENV=no ;;
@@ -33,7 +75,8 @@ AC_MSG_RESULT($CFG_WITH_DEFENV)
AC_MSG_CHECKING(whether to show and stop on compilation warnings)
AC_ARG_ENABLE([ccwarn],
[AS_HELP_STRING([--enable-ccwarn],
[enable showing and stopping on compilation warnings])],
[enable showing and stopping on compilation warnings
in Verilator binrary and Verilated makefiles])],
[case "${enableval}" in
yes) CFG_WITH_CCWARN=yes ;;
no) CFG_WITH_CCWARN=no ;;
@@ -65,11 +108,27 @@ AC_ARG_ENABLE([longtests],
AC_SUBST(CFG_WITH_LONGTESTS)
AC_MSG_RESULT($CFG_WITH_LONGTESTS)
# CFG_WITH_PREC11
AC_MSG_CHECKING(whether allow pre-C++11)
AC_ARG_ENABLE([prec11],
[AS_HELP_STRING([--enable-prec11],
[enable pre-C++11 compilers for Verilator binary
and Verilated makefiles])],
[case "${enableval}" in
yes) CFG_WITH_PREC11=yes ;;
no) CFG_WITH_PREC11=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-prec11]) ;;
esac],
[CFG_WITH_PREC11=no;]
)
AC_SUBST(CFG_WITH_PREC11)
AC_MSG_RESULT($CFG_WITH_PREC11)
# Compiler flags
CFLAGS=-I${includedir}
CPPFLAGS=-I${includedir}
CXXFLAGS=-I${includedir}
LDFLAGS=-L${libdir}
CFLAGS+=" -I${includedir}"
CPPFLAGS+=" -I${includedir}"
CXXFLAGS+=" -I${includedir}"
LDFLAGS+=" -L${libdir}"
# Checks for programs.
AC_PROG_CC
@@ -77,6 +136,8 @@ AC_PROG_CXX
AC_PROG_INSTALL
AC_LANG_PUSH(C++)
cxx_version=$($CXX --version | head -1)
AC_MSG_RESULT([compiler is $CXX --version = $cxx_version])
AC_MSG_CHECKING([that C++ compiler can compile simple program])
AC_RUN_IFELSE(
[AC_LANG_SOURCE([int main() { return 0; }])],
@@ -163,26 +224,69 @@ AC_DEFUN([_MY_CXX_CHECK_OPT],
fi
])
AC_DEFUN([_MY_LDLIBS_CHECK_FLAG],
[# _MY_LDLIBS_CHECK_FLAG(flag) -- Check if linker supports specific options
# Set $_my_result appropriately
ACO_SAVE_LIBS="$LIBS"
LIBS="$LIBS $1"
AC_MSG_CHECKING([whether $CXX linker accepts $1])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[]])],
[_my_result=yes
if test -s conftest.err; then
if grep -e "$1" conftest.err >/dev/null; then
_my_result=no
fi
fi],
[_my_result=no])
AC_MSG_RESULT($_my_result)
LIBS="$ACO_SAVE_LIBS"
])
AC_DEFUN([_MY_LDLIBS_CHECK_IFELSE],
[# _MY_LDLIBS_CHECK_IFELSE(flag,action-if-supported,action-if-not-supported)
# Check if linker supports specific flag, if it does do action-if-supported
# otherwise do action-if-not-supported
_MY_LDLIBS_CHECK_FLAG($1)
if test "$_my_result" = "yes" ; then
true
$2
else
true
$3
fi
])
AC_DEFUN([_MY_LDLIBS_CHECK_OPT],
[# _MY_LDLIBS_CHECK_OPT(variable, flag) -- Check if linker supports specific
# options. If it does, append flag to variable.
_MY_LDLIBS_CHECK_IFELSE($2, $1="$$1 $2")
])
# Flag to select newest language standard supported
# Macros work such that first option that passes is the one we take
# gnu++17 code is clean, but SystemC in 2018 doesn't link with it (bug1339)
# gnu++14 is the newest that Verilator supports
# std++03 is the oldest that Verilator supports
#_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++17)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++14)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++11)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++03)
#_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++17)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++14)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++11)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++03)
AC_SUBST(CFG_CXXFLAGS_STD_NEWEST)
# And likewise oldest standard (same list above, backwards)
# This is used for internal testing
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=std++03)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=std++11)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=std++14)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=c++03)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=c++11)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=c++14)
#_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=std++17)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=gnu++03)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=gnu++11)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=gnu++14)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=gnu++17)
#_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=gnu++17)
AC_SUBST(CFG_CXXFLAGS_STD_OLDEST)
# Flags for compiling Verilator internals including parser, and Verilated files
@@ -196,7 +300,6 @@ AC_SUBST(CFG_CXXFLAGS_WEXTRA)
# Flags for compiling Verilator internals including parser always
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-Qunused-arguments)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-faligned-new)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-delete-null-pointer-checks)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-Wno-unused-parameter)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-Wno-undefined-bool-conversion)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-Wno-shadow)
@@ -215,17 +318,75 @@ AC_SUBST(CFG_CXXFLAGS_PARSER)
# without this flag, even though there's a conditional to prevent the divide.
# We still don't add no-div-by-zero as it throws message to stdout, though doesn't die.
#_MY_CXX_CHECK_OPT(-Wno-div-by-zero)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-faligned-new)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-fbracket-depth=4096)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Qunused-arguments)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-parentheses-equality)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-sign-compare)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-uninitialized)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-unused-but-set-variable)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-unused-parameter)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-unused-variable)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-shadow)
# For some reason -faligned-new does not work under Travis w/ clang but the
# configure test doesn't catch this either
AS_IF([test "x$TRAVIS_COMPILER" != xclang], [_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-faligned-new)])
CFG_CXX_FLAGS_CMAKE="-faligned-new"
m4_foreach([cflag],[
[-fbracket-depth=4096],
[-fcf-protection=none],
[-mno-cet],
[-Qunused-arguments],
[-Wno-bool-operation],
[-Wno-parentheses-equality],
[-Wno-sign-compare],
[-Wno-uninitialized],
[-Wno-unused-but-set-variable],
[-Wno-unused-parameter],
[-Wno-unused-variable],
[-Wno-shadow]],[
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,cflag)
# CMake will test what flags work itself, so pass all flags through to it
CFG_CXX_FLAGS_CMAKE="$CFG_CXX_FLAGS_CMAKE cflag"
])
AC_SUBST(CFG_CXXFLAGS_NO_UNUSED)
AC_SUBST(CFG_CXX_FLAGS_CMAKE)
# Find multithread linker flags
m4_foreach([ldflag], [
[-mt],
[-pthread],
[-lpthread],
[-latomic]],[
_MY_LDLIBS_CHECK_OPT(CFG_LDLIBS_THREADS,ldflag)
# CMake will test what flags work itself, so pass all flags through to it
CFG_LDFLAGS_THREADS_CMAKE="$CFG_LDFLAGS_THREADS_CMAKE ldflag"
])
AC_SUBST(CFG_LDLIBS_THREADS)
AC_SUBST(CFG_LDFLAGS_THREADS_CMAKE)
# When linking partially statically
if test "$CFG_ENABLE_PARTIAL_STATIC" = "yes"; then
_MY_LDLIBS_CHECK_OPT(CFG_LDFLAGS_SRC, -static-libgcc)
_MY_LDLIBS_CHECK_OPT(CFG_LDFLAGS_SRC, -static-libstdc++)
_MY_LDLIBS_CHECK_OPT(CFG_LDFLAGS_SRC, -Xlinker -gc-sections)
LTCMALLOC=-l:libtcmalloc_minimal.a
else
LTCMALLOC=-ltcmalloc_minimal
fi
AC_SUBST(CFG_LDFLAGS_SRC)
# The pthread library is required by tcmalloc, so add it if it exists. If it
# does not, the tcmalloc check below will fail anyway, and linking against
# pthreads is harmless otherwise.
_MY_LDLIBS_CHECK_OPT(CFG_LIBS, -lpthread)
# Check if tcmalloc is available based on --enable-tcmalloc
_MY_LDLIBS_CHECK_IFELSE(
$LTCMALLOC,
[if test "$CFG_WITH_TCMALLOC" != "no"; then
CFG_LIBS="$LTCMALLOC $CFG_LIBS";
# If using tcmalloc, add some extra options to make the compiler not assume
# it is using it's own versions of the standard library functions
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-malloc)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-calloc)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-realloc)
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-builtin-free)
fi],
[if test "$CFG_WITH_TCMALLOC" = "yes"; then
AC_MSG_ERROR([--enable-tcmalloc was given but test for ${LTCMALLOC} failed])
fi])
AC_SUBST(CFG_LIBS)
# Set CFG_WITH_THREADED if can support threading
AC_MSG_CHECKING(whether $CXX supports Verilated threads)
@@ -244,6 +405,22 @@ CFG_WITH_THREADED=$_my_result
AC_SUBST(CFG_WITH_THREADED)
AC_MSG_RESULT($CFG_WITH_THREADED)
# Check compiler flag
if test "$CFG_WITH_THREADED" = "no" ; then
if test "$CFG_WITH_PREC11" = "no" ; then
AC_MSG_NOTICE([[]])
AC_MSG_ERROR([[the $CXX compiler appears to not support C++11.
Verilator plans to require a C++11 or newer compiler in a future release,
unless sufficient people report problems. Therefore, if you do not have a
C++11 compiler, please post a message to
https://www.veripool.org/boards/3/topics/2580-Verilator-Requiring-C-11-compiler
indicating your OS and when you think C++11 might be ok, and then rerun
configure with the --enable-prec11 argument. Thanks.]])
fi
fi
# Checks for library functions.
AC_CHECK_MEMBER([struct stat.st_mtim.tv_nsec],
[AC_DEFINE([HAVE_STAT_NSEC],[1],[Defined if struct stat has st_mtim.tv_nsec])],
+4
View File
@@ -0,0 +1,4 @@
*.1
*.html
*.pdf
Makefile
+82
View File
@@ -0,0 +1,82 @@
= How to contribute to Verilator
Thanks for using Verilator! We welcome your contributions in whatever form.
This contributing document contains some suggestions that may make
contributions flow more efficiently.
==== Did you find a bug?
* Please **Ensure the bug was not already reported** by searching
https://verilator.org/issues[Verilator Issues].
* If you're unable to find an open issue addressing the problem,
https://verilator.org/issues/new[open a new Verilator issue].
** Be sure to include a **code sample** or an **executable test case**
demonstrating the bug and expected behavior that is not occurring.
** The ideal example works against other simulators, and is in the
test_regress/t test format, as described in
link:internals.adoc[docs/internals].
==== Did you write a patch that fixes a bug?
* Please https://verilator.org/issues/new[Open a new issue].
* You may attach a patch to the issue, or (preferred) may request a GitHub
pull request.
** Verilator uses Travis CI to provide continuous integration. You may
want to setup Travis CI on your GitHub branch to ensure your changes
keep the tests passing. See link:internals.adoc[docs/internals].
* Your source-code contributions must be certified as open source, under
the https://developercertificate.org/[Developer Certificate of
Origin]. On your first contribution, you must either:
** Have your patch include the addition of your name to
link:CONTRIBUTORS[docs/CONTRIBUTORS] (preferred).
** Use "git -s" as part of your commit. This adds a "signed-of-by"
attribute which will certify your contribution as described in the
https://github.com/wking/signed-off-by/blob/master/Documentation/SubmittingPatches[Signed-of-By
convention].
** Email, or post in an issue a statement that you certify your
contributions.
** In any of these cases your name will be added to
link:CONTRIBUTORS[docs/CONTRIBUTORS] and you are agreeing all future
contributions are also certified.
** We occasionally accept contributions where people do not want their
name published. Please email us; you must still certify your
contribution using email.
* Your test contributions are generally considered released into the public
domain, unless you request otherwise or put a GNU/Artistic license on
your test file.
* Most important is we get your patch. If you'd like to clean up
indentation and related issues ahead of our feedback, that is
appreciated; please see the coding conventions in
link:internals.adoc[docs/internals].
==== Do you have questions?
* Please see FAQ section and rest of the
https://verilator.org/verilator_doc.html[Verilator manual],
or https://verilator.org/verilator_doc.pdf[Verilator manual (PDF)].
* Ask any question in the
https://verilator.org/forum[Verilator forum].
==== Code of Conduct
* Our contributors and participants pledge to make participation in our
project and our community a positive experience for everyone. We follow
the https://www.contributor-covenant.org/version/1/4/code-of-conduct.html[Contributor
Covenant version 1.4].
Thanks!
+39
View File
@@ -0,0 +1,39 @@
The contributors listed below have certified their Verilator contributions
under the Developer Certificate of Origin
(https://developercertificate.org/).
Please see the Verilator manual for 200+ additional contributors. Thanks to
all.
Ahmed El-Mahmoudy
Alex Chadwick
Chris Randall
Driss Hafdi
Eric Rippey
Garrett Smith
Geza Lore
Gianfranco Costamagna
Howard Su
Iztok Jeras
Jeremy Bennett
John Coiner
Julien Margetts
Kanad Kanhere
Kevin Kiningham
Kuba Ober
Lukasz Dalek
Maarten De Braekeleer
Matthew Ballance
Mike Popoloski
Patrick Stewart
Peter Monsson
Philipp Wagner
Pieter Kapsenberg
Richard Myers
Sebastien Van Cauwenberghe
Stefan Wallentowitz
Tobias Rosenkranz
Todd Strader
Wilson Snyder
Yutetsu TAKATSUKASA
Yves Mathieu
+54
View File
@@ -0,0 +1,54 @@
#*****************************************************************************
# DESCRIPTION: Verilator documentation: Makefile pre-configure version
#
# This file is part of Verilator.
#
# Code available from: https://verilator.org
#
#*****************************************************************************
#
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
#
# Verilator is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#****************************************************************************/
#
# This file is intended only to be called from the top-level Verilator Makefile.
#### Start of system configuration section. ####
ASCIIDOCTOR = asciidoctor
DOXYGEN = doxygen
#### End of system configuration section. ####
######################################################################
.SUFFIXES:
default:
@echo "error: make not supported here, run 'make docs' from Verilator top-level"
%.html: %.adoc
$(ASCIIDOCTOR) $< -n -o $@
clean mostlyclean distclean maintainer-clean::
rm -f $(SCRIPTS) *.tmp
rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log
rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs *.idx
rm -f *.ev *.evs *.ov *.ovs *.cv *.cvs *.ma *.mas
rm -f *.tex
distclean maintainer-clean::
rm -f *.info* *.1 *.html *.pdf $(INFOS)
rm -f Makefile
.PHONY: doxygen
doxygen:
$(DOXYGEN) doxygen.config
+119
View File
@@ -0,0 +1,119 @@
// DESCRIPTION: Verilator: List of To Do issues.
//
// Copyright 2004-2020 by Wilson Snyder. This program is free software; you can
// redistribute it and/or modify it under the terms of either the GNU
// Lesser General Public License Version 3 or the Perl Artistic License
// Version 2.0.
* Language support:
** Fix ordering of each bit separately in a signal (mips)
assign b[3:0] = b[7:4]; assign b[7:4] = in;
** Support UDP gate primitives/ cell libraries
(have code for combos - problem is sequential udps)
** Function to eval combo logic after /*verilator public*/ functions [gwaters]
** Support generated clocks (correctness)
** Recursive functions
** Verilog configuration files
** Expression coverage (see notes)
** Better tristate support
** UVM
* Long-term Features
** Assertions
** Tristate support
* Configure/Make/Install
** Distribute with flex/bison already expanded?
Flex library not needed. Probably too difficult to be worth it.
* Testing:
** Capture all inputs into global "rerun it" file
** Code to make wrapper that sets signals, so can do comparison checks
** New random program generator
** Better graph viewer with search and zoom
** Port and test against opencores.org code
** // verilator debug in code so can see only tree affecting those nodes
* Usability:
** Detect and pre-remove most UNOPTFLATs
** Better reporting of unopt problems, including what lines of code
** Report more errors (all of them?) before exiting [Eugene Weber]
** Auto-create scons config files
** Print version/etc message at runtime. (4.000?)
Include number of lines of code, percent comments, code complexity measurement
<-80chars------------------------------------------------------------------->
Verilator 3.600 - The fast free open-sourced simulator. Copyright 2001-2013.
Verilated #### modules, #### instances, ##### sigs,
#### non-comment lines, ##### ops, ### KB model size
* Lint:
** CDCRSTLOGIC should allow filtering with paths
"waive CDCRSTLOGIC --from a.b.sig --to a.c.sig --via OR"
* Internal Code:
** A Visitor class that understands how to traverse data types
** V3Graph should be templated container type, taking in Vertex + Edge types
** Instead of string, have an VEncodedString/VIdString which contains __DOT__ish
things, to reduce bugs. Also add _20 trailing space to \ encoded names.
* Runtime:
** New evalulation loop ~/src/verilator/notes/event_loop.txt (4.000?)
** Remove all private internal functions from top level wrapper header, move
to new level
** Completely standalone simulation
main() records arguments for $test$plusvars
instantiates top,
does tracing (support $dump?)
calls top->simulateForever()
exits
* Performance:
** Latch optimizations
** Constant propagation
Extra cleaning AND: 1 & ((VARREF >> 1) | ((&VARREF >> 1) & VARREF))
Extra shift (perhaps due to clean): if (1 & CAST (VARREF >> #))
** Gated clock and latch conversion to flops. [JeanPaul Vanitegem]
Could propagate the AND into pos/negedges and let domaining optimize.
** Negedge reset
Switch to remove negedges that don't matter
Can't remove async resets from control flops (like in syncronizers)
** If all references to array have a constant index, blow up into separate signals-per-index
** Bit-multiply for faster bit swapping and a=b[1,3,2] random bit reorderings.
** Move _last sets and all other combo logic inside master
if() that triggers on all possible sense items
** Rewrite and combine V3Life, V3Subst
If block temp only ever set in one place to constant, propagate it
Used in t_mem for array delayed assignments
Replace variables if set later in same cfunc branch
See for example duplicate sets of _narrow in cycle 90/91 of t_select_plusloop
** Same assignment on both if branches
"if (a) { ... b=2; } else { ... b=2;}" -> "b=2; if ..."
Careful though, as b could appear in the statement or multiple times in statement
(Could just require exatly two 'b's in statement)
** Simplify XOR/XNOR/AND/OR bit selection trees
Foo = A[1] ^ A[2] ^ A[3] etc are better as ^ ( A & 32'b...1110 )
** Combine variables into wider elements
Parallel statements on different bits should become single signal
Variables that are always consumed in "parallel" can be joined
** Duplicate assignments in gate optimization
Common to have many separate posedge blocks, each with identical
reset_r <= rst_in
** If signal is used only once (not counting trace), always gate substitute
Don't merge if any combining would form circ logic (out goes back to in)
** Multiple assignments each bit can become single assign with concat
Make sure a SEL of a CONCAT can get the single bit back.
** Usually blocks/values
Enable only after certain time, so VL_TIME_I(32) > 0x1e gets eliminated out
** Better ordering of a<=b, b<=c, put all refs to 'b' next to each other to optimize caching
** I-cache packing improvements (what/how?)
** Data cache organization (order of vars in class)
First have clocks,
then bools instead of uint32_t's
then based on what sense list they come from, all outputs, then all inputs
finally have any signals part of a "usually" block, or constant.
** Rather then tracking widths, have a MSB...LSB of this expression
(or better, a bitmask of bits relevant in this expression)
** Track recirculation and convert into clock-enables
** Clock enables should become new clocking domains for speed
** If floped(a) & flopped(b) and no other a&b, then instead flop(a&b).
** Sort by output bitselects so can combine more assignments (see DDP example dx_dm signal)
+1 -1
View File
@@ -3,4 +3,4 @@
* \section intro_sec Introduction
*
* This is a full doxygen analysis of the Verilator source tree.
*/
*/
+2 -6
View File
@@ -45,7 +45,7 @@ PROJECT_BRIEF = "Verilog to C translator"
# exceed 55 pixels and the maximum width should not exceed 200 pixels.
# Doxygen will copy the logo to the output directory.
PROJECT_LOGO = veripool-logo.png
PROJECT_LOGO = verilator_logo.png
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
@@ -630,12 +630,8 @@ WARN_LOGFILE =
# with spaces.
INPUT = doxygen-mainpage \
include \
include \
src \
test_c \
test_regress \
test_sc \
test_v
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+303
View File
@@ -0,0 +1,303 @@
= Verilator Installation
:toc: right
// Github doesn't render unless absolute URL
image::https://www.veripool.org/img/verilator_256_200_min.png[Logo,256,200,role="right"]
== Introduction
This discusses how to install Verilator. For more general information
please see https://verilator.org[verilator.org].
== Quick-start
=== Install From a Package Manager
Using a distribution's package manager is the easiest way to get
started. (Note packages are unlikely to have the most recent version, so
Git, below, maybe a better alternative.) To install as a package:
apt-get install verilator
If this works, skip down to <<Running Verilator>>.
=== Docker
Verilator is available in pre-built Docker containers. See
https://github.com/verilator/verilator/blob/master/ci/docker/run/README.adoc
=== Git
Installing Verilator with Git provides the most flexibility.
For additional options and details see the additional sections below. In
brief:
// Also update README
....
# Prerequisites:
#sudo apt-get install git make autoconf g++ flex bison
#sudo apt-get install libfl2 # Ubuntu only (ignore if gives error)
#sudo apt-get install libfl-dev # Ubuntu only (ignore if gives error)
git clone https://git.veripool.org/git/verilator # Only first time
## Note the URL above is not a page you can see with a browser, it's for git only
# Every time you need to build:
unsetenv VERILATOR_ROOT # For csh; ignore error if on bash
unset VERILATOR_ROOT # For bash
cd verilator
git pull # Make sure git repository is up-to-date
git tag # See what versions exist
#git checkout master # Use development branch (e.g. recent bug fixes)
#git checkout stable # Use most recent stable release
#git checkout v{version} # Switch to specified release version
autoconf # Create ./configure script
./configure
make
sudo make install
# Now see "man verilator" or online verilator.pdf's for the example tutorials
....
If this works, skip down to <<Running Verilator>>.
== Detailed Build Instructions
This section describes details of the build process, and assumes you are
building from Git or a tarball. For using a pre-built binary for your
Linux distribution, see instead <<Install From a Package Manager>>.
=== OS Requirements
Verilator is developed and has primary testing on Ubuntu. Versions have
also built on Redhat Linux, Apple OS-X, HPUX and Solaris. It should run
with minor porting on any GNU/Linux-ish platform. Verilator also works on
Windows under Cygwin, and Windows under MinGW (gcc -mno-cygwin). Verilated
output (not Verilator itself) compiles under all the options above, plus
MSVC++.
=== Install Prerequisites
To build Verilator you will need to install some standard packages:
sudo apt-get install git
sudo apt-get install autoconf
sudo apt-get install flex bison
The following are optional, but improve compilation speed:
sudo apt-get install libgoogle-perftools-dev
Additionally, to build or run Verilator you need these standard packages:
sudo apt-get install perl python3
sudo apt-get install make
sudo apt-get install g++ # Alternatively, clang
sudo apt-get install libgz # Non-Ubuntu (ignore if gives error)
sudo apt-get install libfl2 libfl-dev zlibc zlib1g zlib1g-dev # Ubuntu only (ignore if gives error)
Those developing Verilator may also want these (see internals.adoc):
sudo apt-get install gdb asciidoctor graphviz
cpan install Pod::Perldoc
cpan install Unix::Processors
==== Install SystemC
If you will be using SystemC (vs straight C++ output), download
https://www.accellera.org/downloads/standards/systemc[SystemC].
Follow their installation instructions. You will need to set `SYSTEMC_INCLUDE`
to point to the include directory with `systemc.h` in it, and `SYSTEMC_LIBDIR`
to points to the directory with `libsystemc.a` in it. (Older installations
may set `SYSTEMC` and `SYSTEMC_ARCH` instead.)
==== Install GTKWave
To make use of Verilator FST tracing you will want
http://gtkwave.sourceforge.net/[GTKwave] installed, however this is not
required at Verilator build time.
=== Obtain Sources
You may use Git or a tarball for the sources. Git is the supported option.
(If using a historical build that uses a tarball, tarballs are obtained
from https://www.veripool.org/projects/verilator/wiki/Download[Verilator
Downloads]; we presume you know how to use it, and is not described here.)
Get the sources from the repository: (You need do this only once, ever.)
git clone https://git.veripool.org/git/verilator # Only first time
## Note the URL above is not a page you can see with a browser, it's for git only
Enter the checkout and determine what version/branch to use:
cd verilator
git pull # Make sure we're up-to-date
git tag # See what versions exist
#git checkout master # Use development branch (e.g. recent bug fix)
#git checkout stable # Use most recent release
#git checkout v{version} # Switch to specified release version
=== Auto Configure
Create the configuration script:
autoconf # Create ./configure script
=== Eventual Installation Options
Before configuring the build, you have to decide how you're going to
eventually install the kit. Verilator will be compiling the current value
of `VERILATOR_ROOT`, `SYSTEMC_INCLUDE`, and `SYSTEMC_LIBDIR` as defaults
into the executable, so they must be correct before configuring.
These are the options:
==== 1. Run-in-Place from VERILATOR_ROOT
Our personal favorite is to always run Verilator in-place from its Git
directory. This allows the easiest experimentation and upgrading, and
allows many versions of Verilator to co-exist on a system.
export VERILATOR_ROOT=`pwd` # if your shell is bash
setenv VERILATOR_ROOT `pwd` # if your shell is csh
./configure
# Running will use files from $VERILATOR_ROOT, so no install needed
Note after installing (below steps), a calling program or shell must set
the environment variable `VERILATOR_ROOT` to point to this Git directory,
then execute `$VERILATOR_ROOT/bin/verilator`, which will find the path to
all needed files.
==== 2. Install into a CAD Disk
You may eventually be installing onto a project/company-wide "CAD" tools
disk that may support multiple versions of every tool. Target the build to
a destination directory name that includes the Verilator version name:
unset VERILATOR_ROOT # if your shell is bash
unsetenv VERILATOR_ROOT # if your shell is csh
# For the tarball, use the version number instead of git describe
./configure --prefix /CAD_DISK/verilator/`git describe | sed "s/verilator_//"`
Note after installing (below steps), if you use
http://modules.sourceforge.net/[modulecmd], you'll want a module file like
the following:
.modulecmd's verilator/version file
----
set install_root /CAD_DISK/verilator/{version-number-used-above}
unsetenv VERILATOR_ROOT
prepend-path PATH $install_root/bin
prepend-path MANPATH $install_root/man
prepend-path PKG_CONFIG_PATH $install_root/share/pkgconfig
----
==== 3. Install into a Specific Path
You may eventually install Verilator into a specific installation prefix,
as most GNU tools support:
unset VERILATOR_ROOT # if your shell is bash
unsetenv VERILATOR_ROOT # if your shell is csh
./configure --prefix /opt/verilator-VERSION
Then after installing (below steps) you will need to add
`/opt/verilator-VERSION/bin` to `$PATH`.
==== 4. Install System Globally
The final option is to eventually install Verilator globally, using the
normal system paths:
unset VERILATOR_ROOT # if your shell is bash
unsetenv VERILATOR_ROOT # if your shell is csh
./configure
Then after installing (below) the binary directories should already be in
your `$PATH`.
=== Configure
The command to configure the package was described in the previous step.
Developers should configure to have more complete developer tests.
Additional packages may be required for these tests.
export VERILATOR_AUTHOR_SITE=1 # Put in your .bashrc
./configure --enable-longtests ...above options...
=== Compile
Compile Verilator:
make -j
=== Test
Check the compilation by running self-tests:
make test
=== Install
If you used any but the <<1. Run-in-Place from VERILATOR_ROOT>> scheme,
install to the OS-standard place:
make install
== Running Verilator
To run Verilator, see the example sections in the
https://verilator.org/verilator_doc.html[Verilator manual (HTML)],
or https://verilator.org/verilator_doc.pdf[Verilator manual (PDF)].
Also see the `examples/` directory that is part of the kit, and is installed
(in a OS-specific place, often in e.g. `/usr/local/share/verilator/examples`).
cd examples/make_hello_c
make
Note if you did a `make install` above you should not have `VERILATOR_ROOT`
set in your environment; it is built into the executable.
== Announcements
To get notified of new releases, login to
https://www.veripool.org[Veripool], and click the "watch" button near the
top right under https://www.veripool.org/projects/verilator/news[Verilator
News].
== Directory Structure
Some relevant files and directories in this package are as follows:
Changes => Version history
README.adoc => This document
bin/verilator => Compiler wrapper invoked to Verilate code
docs/ => Additional documentation
examples/make_hello_c => Example GNU-make simple Verilog->C++ conversion
examples/make_hello_sc => Example GNU-make simple Verilog->SystemC conversion
examples/make_tracing_c => Example GNU-make Verilog->C++ with tracing
examples/make_tracing_sc => Example GNU-make Verilog->SystemC with tracing
examples/make_protect_lib => Example using --protect-lib
examples/cmake_hello_c => Example building make_hello_c with CMake
examples/cmake_hello_sc => Example building make_hello_sc with CMake
examples/cmake_tracing_c => Example building make_tracing_c with CMake
examples/cmake_tracing_sc => Example building make_tracing_sc with CMake
examples/cmake_protect_lib => Example building make_protect_lib with CMake
include/ => Files that should be in your -I compiler path
include/verilated*.cpp => Global routines to link into your simulator
include/verilated*.h => Global headers
include/verilated.mk => Common Makefile
src/ => Translator source code
test_regress => Internal tests
For files created after a design is Verilated, see the
https://verilator.org/verilator_doc.html[Verilator manual (HTML)],
or https://verilator.org/verilator_doc.pdf[Verilator manual (PDF)].
== License
Copyright 2008-2020 by Wilson Snyder. Verilator is free software; you can
redistribute it and/or modify it under the terms of either the GNU Lesser
General Public License Version 3 or the Perl Artistic License Version 2.0.
+989
View File
@@ -0,0 +1,989 @@
= Verilator Internals Documentation
:toc: right
// Github doesn't render unless absolute URL
image::https://www.veripool.org/img/verilator_256_200_min.png[Logo,256,200,role="right"]
== Introduction
This file discusses internal and programming details for Verilator. It's a
reference for developers and debugging problems.
See also the Verilator internals presentation at https://www.veripool.org.
== Code Flows
=== Verilator Flow
The main flow of Verilator can be followed by reading the Verilator.cpp
`process()` function:
. First, the files specified on the command line are read. Reading
involves preprocessing, then lexical analysis with Flex and parsing with
Bison. This produces an abstract syntax tree (AST) representation of the
design, which is what is visible in the .tree files described below.
. Verilator then makes a series of passes over the AST, progressively
refining and optimizing it.
. Cells in the AST first linked, which will read and parse additional files
as above.
. Functions, variable and other references are linked to their definitions.
. Parameters are resolved and the design is elaborated.
. Verilator then performs many additional edits and optimizations on the
hierarchical design. This includes coverage, assertions, X elimination,
inlining, constant propagation, and dead code elimination.
. References in the design are then pseudo-flattened. Each module's
variables and functions get "Scope" references. A scope reference is an
occurrence of that un-flattened variable in the flattened hierarchy. A
module that occurs only once in the hierarchy will have a single scope and
single VarScope for each variable. A module that occurs twice will have a
scope for each occurrence, and two VarScopes for each variable. This
allows optimizations to proceed across the flattened design, while still
preserving the hierarchy.
. Additional edits and optimizations proceed on the pseudo-flat design.
These include module references, function inlining, loop unrolling,
variable lifetime analysis, lookup table creation, always splitting, and
logic gate simplifications (pushing inverters, etc).
. Verilator orders the code. Best case, this results in a single "eval"
function which has all always statements flowing from top to bottom with no
loops.
. Verilator mostly removes the flattening, so that code may be shared
between multiple invocations of the same module. It localizes variables,
combines identical functions, expands macros to C primitives, adds branch
prediction hints, and performs additional constant propagation.
. Verilator finally writes the C++ modules.
=== Key Classes Used in the Verilator Flow
==== `AstNode`
The AST is represented at the top level by the class `AstNode`. This
abstract class has derived classes for the individual components
(e.g. `AstGenerate` for a generate block) or groups of components
(e.g. `AstNodeFTask` for functions and tasks, which in turn has `AstFunc`
and `AstTask` as derived classes). An important property of the `AstNode`
type hierarchy is that all non-final subclasses of `AstNode` (i.e.: those
which themselves have subclasses) must be abstract as well, and be named
with the prefix `AstNode*`. The `astgen` (see below) script relies on this.
Each `AstNode` has pointers to up to four children, accessed by the `op1p`
through `op4p` methods. These methods are then abstracted in a specific
Ast* node class to a more specific name. For example with the `AstIf` node
(for `if` statements), `ifsp` calls `op2p` to give the pointer to the AST
for the "then" block, while `elsesp` calls `op3p` to give the pointer to
the AST for the "else" block, or NULL if there is not one.
`AstNode` has the concept of a next and previous AST - for example the next
and previous statements in a block. Pointers to the AST for these
statements (if they exist) can be obtained using the `back` and `next`
methods.
It is useful to remember that the derived class `AstNetlist` is at the top
of the tree, so checking for this class is the standard way to see if you
are at the top of the tree.
By convention, each function/method uses the variable `nodep` as a pointer
to the `AstNode` currently being processed.
==== `AstNVisitor`
The passes are implemented by AST visitor classes. These are implemented
by subclasses of the abstract class, `AstNVisitor`. Each pass creates an
instance of the visitor class, which in turn implements a method to perform
the pass.
==== `V3Graph`
A number of passes use graph algorithms, and the class `V3Graph` is
provided to represent those graphs. Graphs are directed, and algorithms are
provided to manipulate the graphs and to output them in
https://www.graphviz.org[GraphViz] dot format. `V3Graph.h` provides
documentation of this class.
==== `V3GraphVertex`
`V3GraphVertex` is the base class for vertices in a graph. Vertices have
an associated `fanout`, `color` and `rank`, which may be used in algorithms
for ordering the graph. A generic `user`/`userp` member variable is also
provided.
Virtual methods are provided to specify the name, color, shape and style to
be used in dot output. Typically users provide derived classes from
`V3GraphVertex` which will reimplement these methods.
Iterators are provided to access in and out edges. Typically these are used
in the form:
for (V3GraphEdge *edgep = vertexp->inBeginp();
edgep;
edgep = edgep->inNextp()) {
==== `V3GraphEdge`
`V3GraphEdge` is the base class for directed edges between pairs of
vertices. Edges have an associated `weight` and may also be made
`cutable`. A generic `user`/`userp` member variable is also provided.
Accessors, `fromp` and `top` return the "from" and "to" vertices
respectively.
Virtual methods are provided to specify the label, color and style to be
used in dot output. Typically users provided derived classes from
`V3GraphEdge` which will reimplement these methods.
==== `V3GraphAlg`
This is the base class for graph algorithms. It implements a `bool` method,
`followEdge` which algorithms can use to decide whether an edge is
followed. This method returns true if the graph edge has weight greater
than one and a user function, `edgeFuncp` (supplied in the constructor)
returns `true`.
A number of predefined derived algorithm classes and access methods are
provided and documented in `V3GraphAlg.cpp`.
=== Multithreaded Mode
In `--threads` mode, the frontend of the Verilator pipeline is the same as
serial mode, up until V3Order.
`V3Order` builds a fine-grained, statement-level dependency graph that
governs the ordering of code within a single `eval()` call. In serial mode,
that dependency graph is used to order all statements into a total serial
order. In parallel mode, the same dependency graph is the starting point
for a partitioner (`V3Partition`).
The partitioner's goal is to coarsen the fine-grained graph into a coarser
graph, while maintaining as much available parallelism as possible. Often
the partitioner can transform an input graph with millions of nodes into a
coarsened execution graph with a few dozen nodes, while maintaining enough
parallelism to take advantage of a modern multicore CPU. Runtime
synchronization cost is not prohibitive with so few nodes.
==== Partitioning
Our partitioner is similar to the one Vivek Sarkar described in his 1989
paper _Partitioning and Scheduling Parallel Programs for Multiprocessors_.
Let's define some terms:
==== Par Factor
The available parallelism or "par-factor" of a DAG is the total cost to
execute all nodes, divided by the cost to execute the longest critical path
through the graph. This is the speedup you would get from running the graph
in parallel, if given infinite CPU cores available and communication and
synchronization are zero.
==== Macro Task
When the partitioner coarsens the graph, it combines nodes together. Each
fine-grained node represents an atomic "task"; combined nodes in the
coarsened graph are "macro-tasks". This term comes from Sarkar. Each
macro-task executes from start to end on one processor, without any
synchronization to any other macro-task during its
execution. (Synchronization only happens before the macro-task begins or
after it ends.)
==== Edge Contraction
Verilator's partitioner, like Sarkar's, primarily relies on "edge
contraction" to coarsen the graph. It starts with one macro-task per atomic
task and iteratively combines pairs of edge-connected macro-tasks.
==== Local Critical Path
Each node in the graph has a "local" critical path. That's the critical
path from the start of the graph to the start of the node, plus the node's
cost, plus the critical path from the end of the node to the end of the
graph.
Sarkar calls out an important trade-off: coarsening the graph reduces
runtime synchronization overhead among the macro-tasks, but it tends to
increase the critical path through the graph and thus reduces par-factor.
Sarkar's partitioner, and ours, chooses pairs of macro-tasks to merge such
that the growth in critical path is minimized. Each candidate merge would
result in a new node, which would have some local critical path. We choose
the candidate that would produce the shortest local critical path. Repeat
until par-factor falls to a target threshold. It's a greedy algorithm, and
it's not guaranteed to produce the best partition (which Sarkar proves is
NP-hard).
==== Estimating Logic Costs
To compute the cost of any given path through the graph, Verilator
estimates an execution cost for each task. Each macro-task has an execution
cost which is simply the sum of its tasks' costs. We assume that
communication overhead and synchronization overhead are zero, so the cost
of any given path through the graph is simply the sum of macro-task
execution costs. Sarkar does almost the same thing, except that he has
nonzero estimates for synchronization costs.
Verilator's cost estimates are assigned by `InstrCountCostVisitor`. This
class is perhaps the most fragile piece of the multithread implementation.
It's easy to have a bug where you count something cheap (eg. accessing one
element of a huge array) as if it were expensive (eg. by counting it as if
it were an access to the entire array.) Even without such gross bugs, the
estimates this produce are only loosely predictive of actual runtime cost.
Multithread performance would be better with better runtime costs
estimates. This is an area to improve.
==== Scheduling Macro-Tasks at Runtime
After coarsening the graph, we must schedule the macro-tasks for runtime.
Sarkar describes two options: you can dynamically schedule tasks at
runtime, with a runtime graph follower. Sarkar calls this the
"macro-dataflow model." Verilator does not support this; early experiments
with this approach had poor performance.
The other option is to statically assign macro-tasks to threads, with each
thread running its macro-tasks in a static order. Sarkar describes this in
Chapter 5. Verilator takes this static approach. The only dynamic aspect is
that each macro task may block before starting, to wait until its
prerequisites on other threads have finished.
The synchronization cost is cheap if the prereqs are done. If they're not,
fragmentation (idle CPU cores waiting) is possible. This is the major
source of overhead in this approach. The `--prof-threads` switch and the
`verilator_gantt` script can visualize the time lost to such fragmentation.
==== Locating Variables for Best Spatial Locality
After scheduling all code, we attempt to locate variables in memory such
that variables accessed by a single macro-task are close together in
memory. This provides "spatial locality" -- when we pull in a 64-byte
cache line to access a 2-byte variable, we want the other 62 bytes to be
ones we'll also likely access soon, for best cache performance.
This turns out to be critical for performance. It should allow Verilator to
scale to very large models. We don't rely on our working set fitting in any
CPU cache; instead we essentially "stream" data into caches from
memory. It's not literally streaming, where the address increases
monotonically, but it should have similar performance characteristics, so
long as each macro-task's dataset fits in one core's local caches.
To achieve spatial locality, we tag each variable with the set of
macro-tasks that access it. Let's call this set the "footprint" of that
variable. The variables in a given module have a set of footprints. We can
order those footprints to minimize the distance between them (distance is
the number of macro-tasks that are different across any two footprints) and
then emit all variables into the struct in ordered-footprint order.
The footprint ordering is literally the traveling salesman problem, and we
use a TSP-approximation algorithm to get close to an optimal sort.
This is an old idea. Simulators designed at DEC in the early 1990s used
similar techniques to optimize both single-thread and multi-thread modes.
(Verilator does not optimize variable placement for spatial locality in
serial mode; that is a possible area for improvement.)
==== Improving Multithreaded Performance Further (a TODO list)
===== Wave Scheduling
To allow the Verilated model to run in parallel with the testbench, it
might be nice to support "wave" scheduling, in which work on a cycle begins
before `eval()` is called or continues after `eval()` returns. For now all
work on a cycle happens during the `eval()` call, leaving Verilator's
threads idle while the testbench (everything outside `eval()`) is
working. This would involve fundamental changes within the partitioner,
however, it's probably the best bet for hiding testbench latency.
===== Efficient Dynamic Scheduling
To scale to more than a few threads, we may revisit a fully dynamic
scheduler. For large (>16 core) systems it might make sense to dedicate an
entire core to scheduling, so that scheduler data structures would fit in
its L1 cache and thus the cost of traversing priority-ordered ready lists
would not be prohibitive.
===== Static Scheduling with Runtime Repack
We could modify the static scheduling approach by gathering actual
macro-task execution times at run time, and dynamically re-packing the
macro-tasks into the threads also at run time. Say, re-pack once every
10,000 cycles or something. This has the potential to do better than our
static estimates about macro-task run times. It could potentially react to
CPU cores that aren't performing equally, due to NUMA or thermal throttling
or nonuniform competing memory traffic or whatever.
===== Clock Domain Balancing
Right now Verilator makes no attempt to balance clock domains across
macro-tasks. For a multi-domain model, that could lead to bad gantt chart
fragmentation. This could be improved if it's a real problem in practice.
===== Other Forms of MTask Balancing
The largest source of runtime overhead is idle CPUs, which happens due to
variance between our predicted runtime for each MTask and its actual
runtime. That variance is magnified if MTasks are homogeneous, containing
similar repeating logic which was generally close together in source code
and which is still packed together even after going through Verilator's
digestive tract.
If Verilator could avoid doing that, and instead would take source logic
that was close together and distribute it across MTasks, that would
increase the diversity of any given MTask, and this should reduce variance
in the cost estimates.
One way to do that might be to make various "tie breaker" comparison
routines in the sources to rely more heavily on randomness, and generally
try harder not to keep input nodes together when we have the option to
scramble things.
===== Performance Regression
It would be nice if we had a regression of large designs, with some
diversity of design styles, to test on both single- and multi-threaded
modes. This would help to avoid performance regressions, and also to
evaluate the optimizations while minimizing the impact of parasitic noise.
===== Per-Instance Classes
If we have multiple instances of the same module, and they partition
differently (likely; we make no attempt to partition them the same) then
the variable sort will be suboptimal for either instance. A possible
improvement would be to emit a unique class for each instance of a module,
and sort its variables optimally for that instance's code stream.
=== Verilated Flow
The evaluation loop outputted by Verilator is designed to allow a single
function to perform evaluation under most situations.
On the first evaluation, the Verilated code calls initial blocks, and then
"settles" the modules, by evaluating functions (from always statements)
until all signals are stable.
On other evaluations, the Verilated code detects what input signals have
changes. If any are clocks, it calls the appropriate sequential functions
(from `always @ posedge` statements). Interspersed with sequential functions
it calls combo functions (from `always @*`). After this is complete, it
detects any changes due to combo loops or internally generated clocks, and
if one is found must reevaluate the model again.
For SystemC code, the `eval()` function is wrapped in a SystemC
`SC_METHOD`, sensitive to all inputs. (Ideally it would only be sensitive
to clocks and combo inputs, but tracing requires all signals to cause
evaluation, and the performance difference is small.)
If tracing is enabled, a callback examines all variables in the design for
changes, and writes the trace for each change. To accelerate this process
the evaluation process records a bitmask of variables that might have
changed; if clear, checking those signals for changes may be skipped.
== Coding Conventions
=== Compiler Version and C++11
Verilator supports GCC 4.4.7 and newer. GCC 4.4.7 does not support C++11,
therefore C++11 is generally not required. Exceptions may be made to
require C++11 for features that are only practical with C++11,
e.g. threads.
=== Indentation and Naming Style
We will work with contributors to fix up indentation style issues, but it
is appreciated if you could match our style:
* All files should contain the magic header to ensure standard indentation:
+
// -*- mode: C++; c-file-style: "cc-mode" -*-
+
This sets indentation to the `cc-mode` defaults. (Verilator predates a
CC-mode change of several years ago which overrides the defaults with GNU
style indentation; the `c-set-style` undoes that.)
* Use 4 spaces per level, and no tabs.
* Use 2 spaces between the end of source and the beginning of a comment.
* Use 1 space after if/for/switch/while and similar keywords.
* No spaces before semicolons, nor between a function's name and open
parenthesis (only applies to functions; if/else has a following space).
* Use "mixedCapsSymbols" instead of "underlined_symbols".
* Uas a "p" suffix on variables that are pointers, e.g. "nodep".
* Comment every member variable.
=== The `astgen` Script
Some of the code implementing passes is extremely repetitive, and must be
implemented for each sub-class of `AstNode`. However, while repetitive,
there is more variability than can be handled in C++ macros.
In Verilator this is implemented by using a Perl script, `astgen` to
pre-process the C++ code. For example in `V3Const.cpp` this is used to
implement the `visit()` functions for each binary operation using the
`TREEOP` macro.
The original C++ source code is transformed into C++ code in the `obj_opt`
and `obj_dbg` sub-directories (the former for the optimized version of
Verilator, the latter for the debug version). So for example `V3Const.cpp`
into `V3Const__gen.cpp`.
=== Visitor Functions
Verilator uses the "Visitor" design pattern to implement its refinement and
optimization passes. This allows separation of the pass algorithm from the
AST on which it operates. Wikipedia provides an introduction to the concept
at https://en.wikipedia.org/wiki/Visitor_pattern.
As noted above, all visitors are derived classes of `AstNVisitor`. All
derived classes of `AstNode` implement the `accept` method, which takes as
argument a reference to an instance or a `AstNVisitor` derived class and
applies the visit method of the `AstNVisitor` to the invoking AstNode
instance (i.e. `this`).
One possible difficulty is that a call to `accept` may perform an edit
which destroys the node it receives as argument. The
`acceptSubtreeReturnEdits` method of `AstNode` is provided to apply
`accept` and return the resulting node, even if the original node is
destroyed (if it is not destroyed it will just return the original node).
The behavior of the visitor classes is achieved by overloading the `visit`
function for the different `AstNode` derived classes. If a specific
implementation is not found, the system will look in turn for overloaded
implementations up the inheritance hierarchy. For example calling `accept`
on `AstIf` will look in turn for:
void visit(AstIf* nodep)
void visit(AstNodeIf* nodep)
void visit(AstNodeStmt* nodep)
void visit(AstNode* nodep)
There are three ways data is passed between visitor functions.
1. A visitor-class member variable. This is generally for passing "parent"
information down to children. `m_modp` is a common example. It's set to
NULL in the constructor, where that node (`AstModule` visitor) sets it,
then the children are iterated, then it's cleared. Children under an
`AstModule` will see it set, while nodes elsewhere will see it clear. If
there can be nested items (for example an `AstFor` under an `AstFor`) the
variable needs to be save-set-restored in the `AstFor` visitor, otherwise
exiting the lower for will lose the upper for's setting.
2. User attributes. Each `AstNode` (*Note.* The AST node, not the visitor)
has five user attributes, which may be accessed as an integer using the
`user1()` through `user5()` methods, or as a pointer (of type `AstNUser`)
using the `user1p()` through `user5p()` methods (a common technique lifted
from graph traversal packages).
+
A visitor first clears the one it wants to use by calling
`AstNode::user#ClearTree()`, then it can mark any node's `user#()` with whatever
data it wants. Readers just call `nodep->user()`, but may need to cast
appropriately, so you'll often see `VN_CAST(nodep->userp(), SOMETYPE)`.
At the top of each visitor are comments describing how the `user()` stuff
applies to that visitor class. For example:
+
// NODE STATE
// Cleared entire netlist
// AstModule::user1p() // bool. True to inline this module
+
This says that at the `AstNetlist` `user1ClearTree()` is called. Each
`AstModule`'s `user1()` is used to indicate if we're going to inline it.
+
These comments are important to make sure a `user#()` on a given `AstNode`
type is never being used for two different purposes.
+
Note that calling `user#ClearTree` is fast, it doesn't walk the tree, so
it's ok to call fairly often. For example, it's commonly called on every
module.
3. Parameters can be passed between the visitors in close to the "normal"
function caller to callee way. This is the second `vup` parameter of type
`AstNUser` that is ignored on most of the visitor functions. V3Width does
this, but it proved more messy than the above and is deprecated. (V3Width
was nearly the first module written. Someday this scheme may be removed,
as it slows the program down to have to pass vup everywhere.)
=== Iterators
`AstNVisitor` provides a set of iterators to facilitate walking over the
tree. Each operates on the current `AstNVisitor` class (as this) and takes
an argument type `AstNode*`.
`iterate`::
Applies the `accept` method of the `AstNode` to the visitor function.
`iterateAndNextIgnoreEdit`::
Applies the `accept` method of each `AstNode` in a list (i.e. connected by
`nextp` and `backp` pointers).
`iterateAndNextNull`::
Applies the `accept` method of each `AstNode` in a list, only if the
provided node is non-NULL. If a node is edited by the call to `accept`,
apply `accept` again, until the node does not change.
`iterateListBackwards`::
Applies the `accept` method of each `AstNode` in a list, starting with the
last one.
`iterateChildren`::
Applies the `iterateAndNextNull` method on each child `op1p` through `op4p`
in turn.
`iterateChildrenBackwards`::
Applies the `iterateListBackwards` method on each child `op1p` through
`op4p` in turn.
==== Caution on Using Iterators When Child Changes
Visitors often replace one node with another node; V3Width and V3Const are
major examples. A visitor which is the parent of such a replacement needs
to be aware that calling iteration may cause the children to change. For
example:
// nodep->lhsp() is 0x1234000
iterateAndNextNull(nodep->lhsp()); // and under covers nodep->lhsp() changes
// nodep->lhsp() is 0x5678400
iterateAndNextNull(nodep->lhsp());
Will work fine, as even if the first iterate causes a new node to take the
place of the `lhsp()`, that edit will update `nodep->lhsp()` and the second
call will correctly see the change. Alternatively:
lp = nodep->lhsp();
// nodep->lhsp() is 0x1234000, lp is 0x1234000
iterateAndNextNull(lp); **lhsp=NULL;** // and under covers nodep->lhsp() changes
// nodep->lhsp() is 0x5678400, lp is 0x1234000
iterateAndNextNull(lp);
This will cause bugs or a core dump, as lp is a dangling pointer. Thus it
is advisable to set lhsp=NULL shown in the *'s above to make sure these
dangles are avoided. Another alternative used in special cases mostly in
V3Width is to use acceptSubtreeReturnEdits, which operates on a single node
and returns the new pointer if any. Note acceptSubtreeReturnEdits does not
follow `nextp()` links.
lp = acceptSubtreeReturnEdits(lp)
=== Identifying Derived Classes
A common requirement is to identify the specific `AstNode` class we are
dealing with. For example a visitor might not implement separate `visit`
methods for `AstIf` and `AstGenIf`, but just a single method for the base
class:
void visit (AstNodeIf* nodep)
However that method might want to specify additional code if it is called
for `AstGenIf`. Verilator does this by providing a `VN_IS` method for each
possible node type, which returns true if the node is of that type (or
derived from that type). So our `visit` method could use:
if (VN_IS(nodep, AstGenIf) {
<code specific to AstGenIf>
}
Additionally the `VN_CAST` method converts pointers similar to C++
`dynamic_cast`. This either returns a pointer to the object cast to that
type (if it is of class `SOMETYPE`, or a derived class of `SOMETYPE`) or
else NULL. (However, for true/false tests use `VN_IS` as that is faster.)
== Testing
For an overview of how to write a test see the BUGS section of the
Verilator primary manual.
It is important to add tests for failures as well as success (for example
to check that an error message is correctly triggered).
Tests that fail should by convention have the suffix `_bad` in their name,
and include `fails = 1` in either their `compile` or `execute` step as
appropriate.
=== Preparing to Run Tests
For all tests to pass you must install the following packages:
* SystemC to compile the SystemC outputs, see http://systemc.org
* Parallel::Forker from CPAN to run tests in parallel, you can install this
with e.g. "sudo cpan install Parallel::Forker".
* vcddiff to find differences in VCD outputs. See the readme at
https://github.com/veripool/vcddiff
=== Controlling the Test Driver
Test drivers are written in PERL. All invoke the main test driver script,
which can provide detailed help on all the features available when writing
a test driver.
test_regress/t/driver.pl --help
For convenience, a summary of the most commonly used features is provided
here. All drivers require a call to `compile` subroutine to compile the
test. For run-time tests, this is followed by a call to the `execute`
subroutine. Both of these functions can optionally be provided with a hash
table as argument specifying additional options.
The test driver assumes by default that the source Verilog file name
matches the PERL driver name. So a test whose driver is `t/t_mytest.pl`
will expect a Verilog source file `t/t_mytest.v`. This can be changed
using the `top_filename` subroutine, for example
top_filename("t/t_myothertest.v");
By default all tests will run with major simulators (Icarus Verilog, NC,
VCS, ModelSim, etc) as well as Verilator, to allow results to be
compared. However if you wish a test only to be used with Verilator, you
can use the following:
scenarios(vlt => 1);
Of the many options that can be set through arguments to `compiler` and
`execute`, the following are particularly useful:
`verilator_flags2`::
A list of flags to be passed to verilator when compiling.
`fails`::
Set to 1 to indicate that the compilation or execution is intended to fail.
For example the following would specify that compilation requires two
defines and is expected to fail.
compile (
verilator_flags2 => ["-DSMALL_CLOCK -DGATED_COMMENT"],
fails => 1,
);
=== Regression Testing for Developers
Developers will also want to call ./configure with two extra flags:
`--enable-ccwarn`::
Causes the build to stop on warnings as well as errors. A good way to
ensure no sloppy code gets added, however it can be painful when it comes
to testing, since third party code used in the tests (e.g. SystemC) may not
be warning free.
`--enable-longtests`::
In addition to the standard C, SystemC examples, also run the tests in the
`test_regress` directory when using _make test_'. This is disabled by
default as SystemC installation problems would otherwise falsely indicate a
Verilator problem.
When enabling the long tests, some additional PERL modules are needed,
which you can install using cpan.
cpan install Unix::Processors
There are some traps to avoid when running regression tests
* When checking the MANIFEST, the test will barf on unexpected code in the
Verilator tree. So make sure to keep any such code outside the tree.
* Not all Linux systems install Perldoc by default. This is needed for the
`--help_' option to Verilator, and also for regression testing. This can be
installed using cpan:
+
cpan install Pod::Perldoc
+
Many Linux systems also offer a standard package for this. Red
Hat/Fedora/Centos offer _perl-Pod-Perldoc_', while Debian/Ubuntu/Linux Mint
offer `perl-doc'.
* Running regression may exhaust resources on some Linux systems,
particularly file handles and user processes. Increase these to
respectively 16,384 and 4,096. The method of doing this is system
dependent, but on Fedora Linux it would require editing the
`/etc/security/limits.conf` file as root.
=== Continuous Integration
Verilator has a https://travis-ci.com/verilator/verilator[Travis CI environment]
which automatically tests the master branch for test failures on new commits. It
also runs a daily cron job to validate all of the tests against different OS and
compiler versions.
Developers can connect Travis CI to their GitHub account so that the CI
environment can check their branches too by doing the following:
* Go to https://github.com/marketplace/travis-ci and follow the prompts
* Only the Open Source (FREE) version of Travis CI is required
* Under a Travis CI project click More options > Settings in order to set up a
cron job on a particular branch
=== Fuzzing
There are scripts included to facilitate fuzzing of Verilator. These have
been successfully used to find a number of bugs in the frontend.
The scripts are based on using http://lcamtuf.coredump.cx/afl/[American fuzzy lop]
on a Debian-like system.
To get started, cd to "nodist/fuzzer/" and run "./all". A sudo password
may be required to setup the system for fuzzing.
== Debugging
=== --debug
When you run with `--debug` there are two primary output file types placed
into the obj_dir, .tree and .dot files.
=== .dot Output
Dot files are dumps of internal graphs in
https://www.graphviz.org[Graphviz] dot format. When a dot file is dumped,
Verilator will also print a line on stdout that can be used to format the
output, for example:
dot -Tps -o ~/a.ps obj_dir/Vtop_foo.dot
You can then print a.ps. You may prefer gif format, which doesn't get
scaled so can be more useful with large graphs.
For dynamic graph viewing consider
http://zvtm.sourceforge.net/zgrviewer.html[ZGRViewer]. If you know of
better viewers let us know; ZGRViewer isn't great for large graphs.
=== .tree Output
Tree files are dumps of the AST Tree and are produced between every major
algorithmic stage. An example:
NETLIST 0x90fb00 <e1> {a0}
1: MODULE 0x912b20 <e8822> {a8} top L2 [P]
*1:2: VAR 0x91a780 <e74#> {a22} @dt=0xa2e640(w32) out_wide [O] WIRE
1:2:1: BASICDTYPE 0xa2e640 <e2149> {e24} @dt=this(sw32) integer kwd=integer range=[31:0]
The following summarizes the above example dump, with more detail on each
field in the section below.
[cols="20%,80%"]
|===
|`1:2:` | indicates the hierarchy of the `VAR` is the `op2p` pointer under
the `MODULE`, which in turn is the `op1p` pointer under the `NETLIST`
|`VAR` | is the AstNodeType.
| `0x91a780` | is the address of this node.
| `<e74>` | means the 74th edit to the netlist was the last modification to
this node.
| `{a22}` | indicates this node is related to line 22 in the source filename
"a", where "a" is the first file read, "z" the 26th, and "aa" the 27th.
| `@dt=0x...` | indicates the address of the data type this node contains.
| `w32` | indicates the width is 32 bits.
| `out_wide` | is the name of the node, in this case the name of the variable.
| `[O]` | are flags which vary with the type of node, in this case it means the
variable is an output.
|===
In more detail the following fields are dumped common to all nodes. They
are produced by the `AstNode::dump()` method:
Tree Hierarchy::
The dump lines begin with numbers and colons to indicate the child node
hierarchy. As noted above, `AstNode` has lists of items at the same level
in the AST, connected by the `nextp()` and `prevp()` pointers. These appear
as nodes at the same level. For example after inlining:
NETLIST 0x929c1c8 <e1> {a0} w0
1: MODULE 0x92bac80 <e3144> {e14} w0 TOP_t L1 [P]
1:1: CELLINLINE 0x92bab18 <e3686#> {e14} w0 v -> t
1:1: CELLINLINE 0x92bc1d8 <e3688#> {e24} w0 v__DOT__i_test_gen -> test_gen
...
1: MODULE 0x92b9bb0 <e503> {e47} w0 test_gen L3
...
AstNode type::
The textual name of this node AST type (always in capitals). Many of these
correspond directly to Verilog entities (for example `MODULE` and
`TASK`), but others are internal to Verilator (for example `NETLIST` and
`BASICDTYPE`).
Address of the node::
A hexadecimal address of the node in memory. Useful for examining with the
debugger.
Last edit number::
Of the form `<ennnn>` or `<ennnn#>` , where `nnnn` is the number
of the last edit to modify this node. The trailing `#` indicates the node
has been edited since the last tree dump (which typically means in the last
refinement or optimization pass). GDB can watch for this, see << /Debugging >>.
Source file and line::
Of the form `{xxnnnn}`, where C{xx} is the filename letter (or
letters) and `nnnn` is the line number within that file. The first file is
`a`, the 26th is `z`, the 27th is `aa` and so on.
User pointers::
Shows the value of the node's user1p...user5p, if non-NULL.
Data type::
Many nodes have an explicit data type. "@dt=0x..." indicates the address
of the data type (AstNodeDType) this node uses.
+
If a data type is present and is numeric, it then prints the width of the
item. This field is a sequence of flag characters and width data as follows:
+
* `s` if the node is signed.
* `d` if the node is a double (i.e a floating point entity).
* `w` always present, indicating this is the width field.
* `u` if the node is unsized.
* `/nnnn` if the node is unsized, where `nnnn` is the minimum width.
Name of the entity represented by the node if it exists::
For example for a `VAR` it is the name of the variable.
Many nodes follow these fields with additional node specific
information. Thus the `VARREF` node will print either `[LV]` or `[RV]`
to indicate a left value or right value, followed by the node of the
variable being referred to. For example:
1:2:1:1: VARREF 0x92c2598 <e509> {e24} w0 clk [RV] <- VAR 0x92a2e90 <e79> {e18} w0 clk [I] INPUT
In general, examine the `dump()` method in `V3AstNodes.cpp` of the node
type in question to determine additional fields that may be printed.
The `MODULE` has a list of `CELLINLINE` nodes referred to by its
`op1p()` pointer, connected by `nextp()` and `prevp()` pointers.
Similarly the `NETLIST` has a list of modules referred to by its `op1p()`
pointer.
=== Debugging with GDB
The test_regress/driver.pl script accepts `--debug --gdb` to start
Verilator under gdb and break when an error is hit or the program is about
to exit. You can also use `--debug --gdbbt` to just backtrace and then
exit gdb. To debug the Verilated executable, use `--gdbsim`.
If you wish to start Verilator under GDB (or another debugger), then you
can use `--debug` and look at the underlying invocation of
`verilator_dbg`. For example
t/t_alw_dly.pl --debug
shows it invokes the command:
../verilator_bin_dbg --prefix Vt_alw_dly --x-assign unique --debug
-cc -Mdir obj_dir/t_alw_dly --debug-check -f input.vc t/t_alw_dly.v
Start GDB, then `start` with the remaining arguments.
gdb ../verilator_bin_dbg
...
(gdb) start --prefix Vt_alw_dly --x-assign unique --debug -cc -Mdir
obj_dir/t_alw_dly --debug-check -f input.vc t/t_alw_dly.v
> obj_dir/t_alw_dly/vlt_compile.log
...
Temporary breakpoint 1, main (argc=13, argv=0xbfffefa4, env=0xbfffefdc)
at ../Verilator.cpp:615
615 ios::sync_with_stdio();
(gdb)
You can then continue execution with breakpoints as required.
To break at a specific edit number which changed a node (presumably to find
what made a <e####> line in the tree dumps):
watch AstNode::s_editCntGbl==####
Then, when the watch fires, to break at every following change to that node:
watch m_editCount
To print a node:
pn nodep
# or: call nodep->dumpGdb() # aliased to "pn" in src/.gdbinit
pnt nodep
# or: call nodep->dumpTreeGdb() # aliased to "pnt" in src/.gdbinit
When GDB halts, it is useful to understand that the backtrace will commonly
show the iterator functions between each invocation of `visit` in the
backtrace. You will typically see a frame sequence something like
...
visit()
iterateChildren()
iterateAndNext()
accept()
visit()
...
== Adding a New Feature
Generally what would you do to add a new feature?
. File an issue (if there isn't already) so others know what you're working on.
. Make a testcase in the test_regress/t/t_EXAMPLE format, see << /TESTING >>.
. If grammar changes are needed, look at the git version of VerilogPerl's
src/VParseGrammar.y, as this grammar supports the full SystemVerilog
language and has a lot of back-and-forth with Verilator's grammar. Copy
the appropriate rules to src/verilog.y and modify the productions.
. If a new Ast type is needed, add it to V3AstNodes.h. Follow the convention
described above about the AstNode type hierarchy.
. Now you can run "test_regress/t/t_{new testcase}.pl --debug" and it'll
probably fail but you'll see a test_regress/obj_dir/t_{newtestcase}/*.tree
file which you can examine to see if the parsing worked. See also the
sections above on debugging.
. Modify the later visitor functions to process the new feature as needed.
=== Adding a New Pass
For more substantial changes you may need to add a new pass. The simplest
way to do this is to copy the `.cpp` and `.h` files from an existing
pass. You'll need to add a call into your pass from the `process()`
function in `src/verilator.cpp`.
To get your pass to build you'll need to add its binary filename to the
list in `src/Makefile_obj.in` and reconfigure.
== Distribution
Copyright 2008-2020 by Wilson Snyder. Verilator is free software; you can
redistribute it and/or modify it under the terms of either the GNU Lesser
General Public License Version 3 or the Perl Artistic License Version 2.0.
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

+65
View File
@@ -0,0 +1,65 @@
= Verilator XML Output
:toc: right
// Github doesn't render unless absolute URL
image::https://www.veripool.org/img/verilator_256_200_min.png[Logo,256,200,role="right"]
== Introduction
This document describes Verilator's XML output. For more general information
please see https://verilator.org[verilator.org].
== General
Verilator's XML output is enabled with the `--xml-only` flag. It contains
limited information about the elaborated design including files, modules,
instance hierarchy, logic and data types. There is no formal schema since part
of the structure of the XML document matches the compiled code which would
require the schema to describe legal SystemVerilog structure. The intended
usage is to enable other downstream tools to take advantage of Verilator's
parser.
== Structure
The XML document is consists of 4 sections within the top level `verilator_xml`
element:
`<files>`...`</files>`::
This section contains a list of all design files read, including the
built-in constructs and the command line as their own entries. Each
`<file>` has an attribute `id` which is a short ASCII string unique to that
file. Other elements' `loc` attributes use this id to refer to a particular
file.
`<module_files>`...`</module_files>`::
All files containing Verilog module definitions are listed in this section.
This element's contents is a subset of the `<files>` element's contents.
`<cells>`...`</cells>`::
The cells section of the XML document contains the design instance
hierarchy. Each instance is represented with the `<cell>` element with the
following attributes:
* `fl` (deprecated): The file id and line number where the module was
instanced. Use `loc` instead.
* `loc`: The file id, first line number, last line number, first column
number and last column number of the identifier where the module was
instanced, separated by commas.
* `name`: The instance name.
* `submodname`: The module name uniquified with particular parameter values (if any).
* `hier`: The full hierarchy path.
`<netlist>`...`</netlist>`::
The netlist section contains a number of `<module>`...`</module>` elements,
each describing the contents of that module, and a single `<typetable>`...
`</typetable>` element which lists all used types used within the
modules. Each type has a numeric `id` attribute that is referred to by
elements in the `<module>` elements using the `dtype_id` attribute.
+1
View File
@@ -0,0 +1 @@
build*
+37
View File
@@ -0,0 +1,37 @@
######################################################################
#
# DESCRIPTION: Verilator CMake Example: Small CMakeLists.txt
#
# This is an example cmake script to build a verilog to systemc project
# using cmake and verilator.
#
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
#
######################################################################
# This example builds the tracing_c example using CMake
# To use it, run the following:
# cd /path/to/verilator/examples/cmake_c
# rm -rf build && mkdir build && cd build
# cmake ..
# cmake --build .
cmake_minimum_required(VERSION 3.8)
project(cmake_hello_c)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
if (NOT verilator_FOUND)
message(FATAL_ERROR "Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable")
endif()
# Create a new executable target that will contain all your sources
add_executable(example ../make_hello_c/sim_main.cpp)
# Add the Verilated circuit to the target
verilate(example
INCLUDE_DIRS "../make_hello_c"
SOURCES ../make_hello_c/top.v)
+79
View File
@@ -0,0 +1,79 @@
######################################################################
#
# DESCRIPTION: Verilator CMake example usage
#
# This file shows usage of the CMake script.
# This makefile is here for testing the examples and should
# generally not be added to a CMake project.
#
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
#
######################################################################
######################################################################
# Set up variables
# If $VERILATOR_ROOT isn't in the environment, we assume it is part of a
# package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),)
VERILATOR_COVERAGE = verilator_coverage
else
export VERILATOR_ROOT
VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage
endif
######################################################################
# Check if CMake is installed and of correct version
ifeq ($(shell which cmake),)
TARGET := nocmake
else
CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
ifeq ($(CMAKE_GT_3_8),true)
TARGET := run
else
TARGET := oldcmake
endif
endif
default: $(TARGET)
run:
@echo
@echo "-- Verilator CMake hello world example"
@echo
@echo "-- CMake ----------------"
mkdir -p build && cd build && cmake ..
@echo
@echo "-- COMPILE -----------------"
cmake --build build
@echo
@echo "-- RUN ---------------------"
build/example
@echo
@echo "-- DONE --------------------"
@echo
clean mostlyclean distclean maintainer-clean:
@rm -rf build logs
nocmake:
@echo
@echo "%Skip: CMake has not been found"
@echo
oldcmake:
@echo
@echo "%Skip: CMake version is too old (need at least 3.8)"
@echo
+1
View File
@@ -0,0 +1 @@
build*
+46
View File
@@ -0,0 +1,46 @@
######################################################################
#
# DESCRIPTION: Verilator CMake Example: Small CMakeLists.txt with SystemC
#
# This is an example cmake script to build a verilog to SystemC project
# using CMake and Verilator.
#
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
#
######################################################################
# This example builds the tracing_sc example using CMake
# To use it, run the following:
# cd /path/to/verilator/examples/cmake_sc
# rm -rf build && mkdir build && cd build
# cmake ..
# cmake --build .
cmake_minimum_required(VERSION 3.8)
project(cmake_hello_sc)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
if (NOT verilator_FOUND)
message(FATAL_ERROR "Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable")
endif()
# SystemC dependencies
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
# Find SystemC using SystemC's CMake integration
find_package(SystemCLanguage QUIET)
# Create a new executable target that will contain all your sources
add_executable(example ../make_hello_sc/sc_main.cpp)
# Add the Verilated circuit to the target
verilate(example SYSTEMC
INCLUDE_DIRS "../make_hello_sc"
SOURCES ../make_hello_sc/top.v)
verilator_link_systemc(example)
+129
View File
@@ -0,0 +1,129 @@
######################################################################
#
# DESCRIPTION: Verilator CMake example usage
#
# This file shows usage of the CMake script.
# This makefile is here for testing the examples and should
# generally not be added to a CMake project.
#
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
#
######################################################################
######################################################################
# Set up variables
# If $VERILATOR_ROOT isn't in the environment, we assume it is part of a
# package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),)
VERILATOR_COVERAGE = verilator_coverage
else
export VERILATOR_ROOT
VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage
endif
######################################################################
# Check if CMake is installed and of correct version
ifeq ($(shell which cmake),)
TARGET := nocmake
else
CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
ifneq ($(CMAKE_GT_3_8),true)
TARGET := oldcmake
else
# Test existence of SYSTEMC_INCLUDE and SYSTEMC_LIBDIR environment variabless
ifneq (,$(SYSTEMC_INCLUDE))
ifneq (,${SYSTEMC_LIBDIR})
SYSTEMC_SET := true
endif
endif
# Test existence of SYSTEMC_ROOT environment variable
ifneq (SYSTEMC_SET, true)
ifneq (,${SYSTEMC_ROOT})
SYSTEMC_SET := true
endif
endif
# Test existence of SYSTEMC environment variable
ifneq (SYSTEMC_SET, true)
ifneq (,${SYSTEMC})
SYSTEMC_SET := true
endif
endif
# Test whether SystemC is installed with CMake support
# This will print a CMake error about processing arguments that can (currently) be ignored.
ifneq (SYSTEMC_SET, true)
FINDSC := $(shell mkdir -p build && cd build && cmake --find-package -DNAME=SystemCLanguage -DCMAKE_USE_PTHREADS_INIT=ON -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST -DThreads_FOUND=ON)
ifneq (,$(findstring SystemCLanguage found,$(FINDSC)))
SYSTEMC_SET := true
endif
endif
ifeq ($(SYSTEMC_SET), true)
TARGET := run
else
TARGET := nosc
endif
endif
endif
default: $(TARGET)
run:
@echo
@echo "-- Verilator CMake SystemC hello-world simple example"
@echo
@echo "-- CMake ----------------"
mkdir -p build && cd build && cmake ..
@echo
@echo "-- COMPILE -----------------"
cmake --build build
@echo
@echo "-- RUN ---------------------"
@mkdir -p logs
build/example
@echo "-- DONE --------------------"
@echo "Note: Once this example is understood, see examples/cmake_tracing_sc."
@echo "Note: Also see the EXAMPLE section in the verilator manpage/document."
clean mostlyclean distclean maintainer-clean:
@rm -rf build logs
nocmake:
@echo
@echo "%Skip: CMake has not been found"
@echo
oldcmake:
@echo
@echo "%Skip: CMake version is too old (need at least 3.8)"
@echo
nosc:
@echo
@echo "%Skip: CMake could not find SystemC."
@echo "% Make sure that either:"
@echo "% - The environment variables SYSTEMC_INCLUDE and SYSTEMC_LIBDIR are exported."
@echo "% - Or, the environment variable SYSTEMC_ROOT is exported."
@echo "% - Or, The environment variable SYSTEMC is exported."
@echo "% - Or, if the SystemC installation provides CMake support,"
@echo "% that its installation prefix is in CMAKE_PREFIX_PATH."
@echo "% Also that the C++ standard of the SystemC library is the same as this example."
@echo "% Please see the Verilator documentation's CMake section for more information."
@echo
+1
View File
@@ -0,0 +1 @@
build*
+60
View File
@@ -0,0 +1,60 @@
######################################################################
#
# DESCRIPTION: Verilator CMake Example: Small CMakeLists.txt
#
# This is an example cmake script to build a verilog to systemc project
# using cmake and verilator.
#
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
#
######################################################################
# This example builds the tracing_c example using CMake
# To use it, run the following:
# cd /path/to/verilator/examples/cmake_c
# rm -rf build && mkdir build && cd build
# cmake ..
# cmake --build .
cmake_minimum_required(VERSION 3.8)
project(cmake_protect_lib)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
if (NOT verilator_FOUND)
message(FATAL_ERROR "Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable")
endif()
# Create the main executable target
add_executable(example ../make_protect_lib/sim_main.cpp)
# Create a secret library
add_library(verilated_secret STATIC) # or SHARED for a shared library
target_link_libraries(example PRIVATE verilated_secret)
# To create both libraries on CMake >= 3.12 replace the above 2 lines with the following:
# add_library(verilated_secret OBJECT)
# set_property(TARGET verilated_secret PROPERTY POSITION_INDEPENDENT_CODE 1)
# add_library(verilated_secret_static STATIC $<TARGET_OBJECTS:verilated_secret>)
# set_target_properties(verilated_secret_static PROPERTIES OUTPUT_NAME verilated_secret)
# add_library(verilated_secret_shared SHARED $<TARGET_OBJECTS:verilated_secret>)
# set_target_properties(verilated_secret_shared PROPERTIES OUTPUT_NAME verilated_secret)
# target_link_libraries(example PRIVATE verilated_secret_static)
# Setup random seed
verilator_generate_key(KEY_INIT)
set(PROTECT_KEY ${KEY_INIT} CACHE STRING "Random seed for protection")
# Add the Verilated modules to the targets
verilate(verilated_secret
VERILATOR_ARGS --protect-lib verilated_secret
--protect-key ${PROTECT_KEY}
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/verilated_secret
SOURCES ../make_protect_lib/secret_impl.v)
# Include location of verilated_secret.sv wrapper
verilate(example
VERILATOR_ARGS "-I${CMAKE_CURRENT_BINARY_DIR}/verilated_secret"
SOURCES ../make_protect_lib/top.v)
+79
View File
@@ -0,0 +1,79 @@
######################################################################
#
# DESCRIPTION: Verilator CMake example usage
#
# This file shows usage of the CMake script.
# This makefile is here for testing the examples and should
# generally not be added to a CMake project.
#
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
#
######################################################################
######################################################################
# Set up variables
# If $VERILATOR_ROOT isn't in the environment, we assume it is part of a
# package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),)
VERILATOR_COVERAGE = verilator_coverage
else
export VERILATOR_ROOT
VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage
endif
######################################################################
# Check if CMake is installed and of correct version
ifeq ($(shell which cmake),)
TARGET := nocmake
else
CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
ifeq ($(CMAKE_GT_3_8),true)
TARGET := run
else
TARGET := oldcmake
endif
endif
default: $(TARGET)
run:
@echo
@echo "-- Verilator CMake protect_lib example"
@echo
@echo "-- CMake ----------------"
mkdir -p build && cd build && cmake ..
@echo
@echo "-- COMPILE -----------------"
cmake --build build
@echo
@echo "-- RUN ---------------------"
build/example
@echo
@echo "-- DONE --------------------"
@echo
clean mostlyclean distclean maintainer-clean:
@rm -rf build logs
nocmake:
@echo
@echo "%Skip: CMake has not been found"
@echo
oldcmake:
@echo
@echo "%Skip: CMake version is too old (need at least 3.8)"
@echo
+2
View File
@@ -0,0 +1,2 @@
build*
logs
+38
View File
@@ -0,0 +1,38 @@
######################################################################
#
# DESCRIPTION: Verilator CMake Example: Small CMakeLists.txt with tracing
#
# This is an example cmake script to build a verilog to systemc project
# using cmake and verilator.
#
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
#
######################################################################
# This example builds the make_tracing_c example using CMake
# To use it, run the following:
# cd /path/to/verilator/examples/cmake_tracing_c
# rm -rf build && mkdir build && cd build
# cmake ..
# cmake --build .
cmake_minimum_required(VERSION 3.8)
project(cmake_tracing_c)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
if (NOT verilator_FOUND)
message(FATAL_ERROR "Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable")
endif()
# Create a new executable target that will contain all your sources
add_executable(example ../make_tracing_c/sim_main.cpp)
# Add the Verilated circuit to the target
verilate(example COVERAGE TRACE
INCLUDE_DIRS "../make_tracing_c"
VERILATOR_ARGS -f ../make_tracing_c/input.vc -O2 -x-assign 0
SOURCES ../make_tracing_c/top.v)
+85
View File
@@ -0,0 +1,85 @@
######################################################################
#
# DESCRIPTION: Verilator CMake example usage
#
# This file shows usage of the CMake script.
# This makefile is here for testing the examples and should
# generally not be added to a CMake project.
#
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
#
######################################################################
######################################################################
# Set up variables
# If $VERILATOR_ROOT isn't in the environment, we assume it is part of a
# package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),)
VERILATOR_COVERAGE = verilator_coverage
else
export VERILATOR_ROOT
VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage
endif
######################################################################
# Check if CMake is installed and of correct version
ifeq ($(shell which cmake),)
TARGET := nocmake
else
CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
ifeq ($(CMAKE_GT_3_8),true)
TARGET := run
else
TARGET := oldcmake
endif
endif
default: $(TARGET)
run:
@echo
@echo "-- Verilator CMake tracing example"
@echo
@echo "-- CMake ----------------"
mkdir -p build && cd build && cmake ..
@echo
@echo "-- COMPILE -----------------"
cmake --build build
@echo
@echo "-- RUN ---------------------"
@mkdir -p logs
build/example +trace
@echo
@echo "-- COVERAGE ----------------"
$(VERILATOR_COVERAGE) --annotate logs/annotated logs/coverage.dat
@echo
@echo "-- DONE --------------------"
@echo "To see waveforms, open vlt_dump.vcd in a waveform viewer"
@echo
clean mostlyclean distclean maintainer-clean:
@rm -rf build logs
nocmake:
@echo
@echo "%Skip: CMake has not been found"
@echo
oldcmake:
@echo
@echo "%Skip: CMake version is too old (need at least 3.8)"
@echo
+7
View File
@@ -0,0 +1,7 @@
*.dmp
*.log
*.csrc
*.vcd
obj_*
logs
build*
+47
View File
@@ -0,0 +1,47 @@
######################################################################
#
# DESCRIPTION: Verilator CMake Example: Small CMakeLists.txt with SystemC tracing
#
# This is an example cmake script to build a verilog to SystemC project
# using CMake and Verilator.
#
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
#
######################################################################
# This example builds the tracing_sc example using CMake
# To use it, run the following:
# cd /path/to/verilator/examples/cmake_tracing_sc
# rm -rf build && mkdir build && cd build
# cmake ..
# cmake --build .
cmake_minimum_required(VERSION 3.8)
project(cmake_tracing_sc_example)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
if (NOT verilator_FOUND)
message(FATAL_ERROR "Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable")
endif()
# SystemC dependencies
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
# Find SystemC using SystemC's CMake integration
find_package(SystemCLanguage QUIET)
# Create a new executable target that will contain all your sources
add_executable(example ../make_tracing_sc/sc_main.cpp)
# Add the Verilated circuit to the target
verilate(example SYSTEMC COVERAGE TRACE
INCLUDE_DIRS "../make_tracing_sc"
VERILATOR_ARGS -f ../make_tracing_sc/input.vc -O2 -x-assign 0
SOURCES ../make_tracing_sc/top.v)
verilator_link_systemc(example)
+134
View File
@@ -0,0 +1,134 @@
######################################################################
#
# DESCRIPTION: Verilator CMake example usage
#
# This file shows usage of the CMake script.
# This makefile is here for testing the examples and should
# generally not be added to a CMake project.
#
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
#
######################################################################
######################################################################
# Set up variables
# If $VERILATOR_ROOT isn't in the environment, we assume it is part of a
# package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),)
VERILATOR_COVERAGE = verilator_coverage
else
export VERILATOR_ROOT
VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage
endif
######################################################################
# Check if CMake is installed and of correct version
ifeq ($(shell which cmake),)
TARGET := nocmake
else
CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
ifneq ($(CMAKE_GT_3_8),true)
TARGET := oldcmake
else
# Test existence of SYSTEMC_INCLUDE and SYSTEMC_LIBDIR environment variabless
ifneq (,$(SYSTEMC_INCLUDE))
ifneq (,${SYSTEMC_LIBDIR})
SYSTEMC_SET := true
endif
endif
# Test existence of SYSTEMC_ROOT environment variable
ifneq (SYSTEMC_SET, true)
ifneq (,${SYSTEMC_ROOT})
SYSTEMC_SET := true
endif
endif
# Test existence of SYSTEMC environment variable
ifneq (SYSTEMC_SET, true)
ifneq (,${SYSTEMC})
SYSTEMC_SET := true
endif
endif
# Test whether SystemC is installed with CMake support
# This will print a CMake error about processing arguments that can (currently) be ignored.
ifneq (SYSTEMC_SET, true)
FINDSC := $(shell mkdir -p build && cd build && cmake --find-package -DNAME=SystemCLanguage -DCMAKE_USE_PTHREADS_INIT=ON -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST -DThreads_FOUND=ON)
ifneq (,$(findstring SystemCLanguage found,$(FINDSC)))
SYSTEMC_SET := true
endif
endif
ifeq ($(SYSTEMC_SET), true)
TARGET := run
else
TARGET := nosc
endif
endif
endif
default: $(TARGET)
run:
@echo
@echo "-- Verilator CMake SystemC tracing example"
@echo
@echo "-- CMake ----------------"
mkdir -p build && cd build && cmake ..
@echo
@echo "-- COMPILE -----------------"
cmake --build build
@echo
@echo "-- RUN ---------------------"
@mkdir -p logs
build/example +trace
@echo
@echo "-- COVERAGE ----------------"
$(VERILATOR_COVERAGE) --annotate logs/annotated logs/coverage.dat
@echo
@echo "-- DONE --------------------"
@echo "To see waveforms, open vlt_dump.vcd in a waveform viewer"
@echo
clean mostlyclean distclean maintainer-clean:
@rm -rf build logs
nocmake:
@echo
@echo "%Skip: CMake has not been found"
@echo
oldcmake:
@echo
@echo "%Skip: CMake version is too old (need at least 3.8)"
@echo
nosc:
@echo
@echo "%Skip: CMake could not find SystemC."
@echo "% Make sure that either:"
@echo "% - The environment variables SYSTEMC_INCLUDE and SYSTEMC_LIBDIR are exported."
@echo "% - Or, the environment variable SYSTEMC_ROOT is exported."
@echo "% - Or, The environment variable SYSTEMC is exported."
@echo "% - Or, if the SystemC installation provides CMake support,"
@echo "% that its installation prefix is in CMAKE_PREFIX_PATH."
@echo "% Also that the C++ standard of the SystemC library is the same as this example."
@echo "% Please see the Verilator documentation's CMake section for more information."
@echo
@@ -5,7 +5,7 @@
# This calls the object directory makefile. That allows the objects to
# be placed in the "current directory" which simplifies the Makefile.
#
# Copyright 2003-2017 by Wilson Snyder. This program is free software; you can
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
@@ -21,10 +21,10 @@ endif
# This is intended to be a minimal example. Before copying this to start a
# real project, it is better to start with a more complete example,
# e.g. examples/tracing_c.
# e.g. examples/make_tracing_c.
# If $VERILATOR_ROOT isn't in the enviornment, we assume it is part of a
# package inatall, and verilator is in your path. Otherwise find the
# If $VERILATOR_ROOT isn't in the environment, we assume it is part of a
# package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator
@@ -42,7 +42,7 @@ default:
@echo "-- RUN ---------------------"
obj_dir/Vtop
@echo "-- DONE --------------------"
@echo "Note: Once this example is understood, see examples/tracing_c."
@echo "Note: Once this example is understood, see examples/make_tracing_c."
@echo "Note: Also see the EXAMPLE section in the verilator manpage/document."
######################################################################
@@ -5,7 +5,7 @@
# This calls the object directory makefile. That allows the objects to
# be placed in the "current directory" which simplifies the Makefile.
#
# Copyright 2003-2017 by Wilson Snyder. This program is free software; you can
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
@@ -21,10 +21,10 @@ endif
# This is intended to be a minimal example. Before copying this to start a
# real project, it is better to start with a more complete example,
# e.g. examples/tracing_sc.
# e.g. examples/make_tracing_sc.
# If $VERILATOR_ROOT isn't in the enviornment, we assume it is part of a
# package inatall, and verilator is in your path. Otherwise find the
# If $VERILATOR_ROOT isn't in the environment, we assume it is part of a
# package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator
@@ -51,7 +51,7 @@ run:
@echo "-- RUN ---------------------"
obj_dir/Vtop
@echo "-- DONE --------------------"
@echo "Note: Once this example is understood, see examples/tracing_sc."
@echo "Note: Once this example is understood, see examples/make_tracing_sc."
@echo "Note: Also see the EXAMPLE section in the verilator manpage/document."
######################################################################
+2
View File
@@ -0,0 +1,2 @@
obj_*
logs
+97
View File
@@ -0,0 +1,97 @@
######################################################################
#
# DESCRIPTION: Verilator Example: --protect-lib Makefile
#
# This calls the object directory makefiles. That allows the objects to
# be placed in the "current directory" which simplifies the Makefile.
#
# Copyright 2019 by Todd Strader. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
#
######################################################################
# Check for sanity to avoid later confusion
ifneq ($(words $(CURDIR)),1)
$(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)')
endif
######################################################################
# Set up variables
# If $VERILATOR_ROOT isn't in the environment, we assume it is part of a
# package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator
else
export VERILATOR_ROOT
VERILATOR = $(VERILATOR_ROOT)/bin/verilator
endif
VERILATOR_FLAGS =
# Generate C++
VERILATOR_FLAGS += -cc
# Optimize
VERILATOR_FLAGS += -O2 -x-assign 0
# Warn abount lint issues; may not want this on less solid designs
VERILATOR_FLAGS += -Wall
# Make waveforms
TOP_VERILATOR_FLAGS = $(VERILATOR_FLAGS) --trace
######################################################################
default: run
run:
@echo
@echo "-- Verilator --protect-lib example -_--------------------------"
@echo
@echo "-- VERILATE secret module -------------------------------------"
@echo " --protect-lib will produce both a static and shared library"
@echo " In this example the static library is used, but some"
@echo " simulators may require the shared library."
@echo "---------------------------------------------------------------"
$(VERILATOR) $(VERILATOR_FLAGS) --protect-lib verilated_secret -Mdir obj_dir_secret/ secret_impl.v
@echo
@echo "-- COMPILE protected library ----------------------------------"
@echo " This builds verilated_secret.sv, libverilated_secret.a and"
@echo " libverilated_secret.so which can be distributed apart from"
@echo " the source"
@echo "---------------------------------------------------------------"
$(MAKE) -j 4 -C obj_dir_secret -f Vsecret_impl.mk
@echo
@echo "-- VERILATE top module ----------------------------------------"
@echo " Use the SystemVerilog wrapper (verilated_secret.sv) and the"
@echo " library (libverilated_secret.a) generated from the previous"
@echo " step"
@echo "---------------------------------------------------------------"
$(VERILATOR) $(TOP_VERILATOR_FLAGS) --exe -LDFLAGS '-L../obj_dir_secret -lverilated_secret -static' top.v obj_dir_secret/verilated_secret.sv sim_main.cpp
@echo
@echo "-- COMPILE entire design --------------------------------------"
$(MAKE) -j 4 -C obj_dir -f Vtop.mk
@echo
@echo "-- RUN --------------------------------------------------------"
@mkdir -p logs
obj_dir/Vtop +trace
@echo
@echo "-- DONE -------------------------------------------------------"
@echo "To see waveforms, open logs/vlt_dump.vcd in a waveform viewer"
@echo
######################################################################
# Other targets
show-config:
$(VERILATOR) -V
maintainer-copy::
clean mostlyclean distclean maintainer-clean::
-rm -rf obj_dir* logs *.log core
+27
View File
@@ -0,0 +1,27 @@
// DESCRIPTION: Verilator: --protect-lib example secret module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2019 by Todd Strader.
// This module will be used as libsecret.a or libsecret.so without
// exposing the source.
module secret_impl(
input [31:0] a,
input [31:0] b,
output logic [31:0] x,
input clk);
logic [31:0] accum_q = 0;
logic [31:0] secret_value = 9;
initial $display("%m: initialized");
always @(posedge clk) begin
accum_q <= accum_q + a;
if (accum_q > 10)
x <= b;
else
x <= a + b + secret_value;
end
endmodule
+72
View File
@@ -0,0 +1,72 @@
// DESCRIPTION: Verilator: --protect-lib example module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2019 by Todd Strader.
//======================================================================
// See examples/tracing_c for notes on tracing
// Include common routines
#include <verilated.h>
#include "Vtop.h"
#if VM_TRACE
# include <verilated_vcd_c.h>
#endif
vluint64_t main_time = 0;
double sc_time_stamp() {
return main_time;
}
int main(int argc, char** argv, char** env) {
if (0 && argc && argv && env) {}
Verilated::debug(0);
Verilated::randReset(2);
Verilated::commandArgs(argc, argv);
// Construct the Verilated model, including the secret module
Vtop* top = new Vtop;
#if VM_TRACE
// When tracing, the contents of the secret module will not be seen
VerilatedVcdC* tfp = NULL;
const char* flag = Verilated::commandArgsPlusMatch("trace");
if (flag && 0==strcmp(flag, "+trace")) {
Verilated::traceEverOn(true);
VL_PRINTF("Enabling waves into logs/vlt_dump.vcd...\n");
tfp = new VerilatedVcdC;
top->trace(tfp, 99);
Verilated::mkdir("logs");
tfp->open("logs/vlt_dump.vcd");
}
#endif
top->clk = 0;
// Simulate until $finish
while (!Verilated::gotFinish()) {
main_time++;
top->clk = ~top->clk & 0x1;
top->eval();
#if VM_TRACE
if (tfp) tfp->dump(main_time);
#endif
}
// Final model cleanup
top->final();
// Close trace if opened
#if VM_TRACE
if (tfp) { tfp->close(); tfp = NULL; }
#endif
// Destroy model
delete top; top = NULL;
// Fin
exit(0);
}
+34
View File
@@ -0,0 +1,34 @@
// DESCRIPTION: Verilator: --protect-lib example module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2019 by Todd Strader.
// See also the EXAMPLE section in the verilator manpage/document.
module top (input clk);
integer cyc = 0;
logic [31:0] a = 0;
logic [31:0] b = 0;
logic [31:0] x;
verilated_secret secret (.a, .b, .x, .clk);
always @(posedge clk) begin
$display("[%0t] cyc=%0d a=%0d b=%0d x=%0d", $time, cyc, a, b, x);
cyc <= cyc + 1;
if (cyc == 0) begin
a <= 5;
b <= 7;
end else if (cyc == 1) begin
a <= 6;
b <= 2;
end else if (cyc == 2) begin
a <= 1;
b <= 9;
end else if (cyc > 3) begin
$display("Done");
$finish;
end
end
endmodule
@@ -5,7 +5,7 @@
# This calls the object directory makefile. That allows the objects to
# be placed in the "current directory" which simplifies the Makefile.
#
# Copyright 2003-2017 by Wilson Snyder. This program is free software; you can
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
@@ -20,8 +20,8 @@ endif
######################################################################
# Set up variables
# If $VERILATOR_ROOT isn't in the enviornment, we assume it is part of a
# package inatall, and verilator is in your path. Otherwise find the
# If $VERILATOR_ROOT isn't in the environment, we assume it is part of a
# package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator
@@ -52,6 +52,9 @@ VERILATOR_FLAGS += --coverage
# Add this trace to get a backtrace in gdb
#VERILATOR_FLAGS += --gdbbt
# Input files for Verilator
VERILATOR_INPUT = -f input.vc top.v sim_main.cpp
######################################################################
default: run
@@ -61,7 +64,7 @@ run:
@echo
@echo "-- VERILATE ----------------"
$(VERILATOR) $(VERILATOR_FLAGS) -f input.vc top.v sim_main.cpp
$(VERILATOR) $(VERILATOR_FLAGS) $(VERILATOR_INPUT)
@echo
@echo "-- COMPILE -----------------"
@@ -72,11 +75,13 @@ run:
@echo
@echo "-- RUN ---------------------"
@rm -rf logs
@mkdir -p logs
obj_dir/Vtop +trace
@echo
@echo "-- COVERAGE ----------------"
@rm -rf logs/annotated
$(VERILATOR_COVERAGE) --annotate logs/annotated logs/coverage.dat
@echo
@@ -5,7 +5,7 @@
#
# This is executed in the object directory, and called by ../Makefile
#
# Copyright 2003-2017 by Wilson Snyder. This program is free software; you can
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
@@ -17,6 +17,9 @@ default: Vtop
# Include the rules made by Verilator
include Vtop.mk
# Use OBJCACHE (ccache) if using gmake and its installed
COMPILE.cc = $(OBJCACHE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
#######################################################################
# Compile flags
@@ -7,8 +7,6 @@
// Include common routines
#include <verilated.h>
#include <sys/stat.h> // mkdir
// Include model header, generated from Verilating "top.v"
#include "Vtop.h"
@@ -20,26 +18,30 @@
// Current simulation time (64-bit unsigned)
vluint64_t main_time = 0;
// Called by $time in Verilog
double sc_time_stamp () {
return main_time; // Note does conversion to real, to match SystemC
double sc_time_stamp() {
return main_time; // Note does conversion to real, to match SystemC
}
int main(int argc, char** argv, char** env) {
// This is a more complicated example, please also see the simpler examples/hello_world_c.
// This is a more complicated example, please also see the simpler examples/make_hello_c.
// Prevent unused variable warnings
if (0 && argc && argv && env) {}
// Pass arguments so Verilated code can see them, e.g. $value$plusargs
Verilated::commandArgs(argc, argv);
// Set debug level, 0 is off, 9 is highest presently used
// May be overridden by commandArgs
Verilated::debug(0);
// Randomization reset policy
// May be overridden by commandArgs
Verilated::randReset(2);
// Pass arguments so Verilated code can see them, e.g. $value$plusargs
// This needs to be called before you create any model
Verilated::commandArgs(argc, argv);
// Construct the Verilated model, from Vtop.h generated from Verilating "top.v"
Vtop* top = new Vtop; // Or use a const unique_ptr, or the VL_UNIQUE_PTR wrapper
Vtop* top = new Vtop; // Or use a const unique_ptr, or the VL_UNIQUE_PTR wrapper
#if VM_TRACE
// If verilator was invoked with --trace argument,
@@ -51,7 +53,7 @@ int main(int argc, char** argv, char** env) {
VL_PRINTF("Enabling waves into logs/vlt_dump.vcd...\n");
tfp = new VerilatedVcdC;
top->trace(tfp, 99); // Trace 99 levels of hierarchy
mkdir("logs", 0777);
Verilated::mkdir("logs");
tfp->open("logs/vlt_dump.vcd"); // Open the dump file
}
#endif
@@ -90,11 +92,16 @@ int main(int argc, char** argv, char** env) {
// Evaluate model
top->eval();
#if VM_TRACE
// Dump trace data for this cycle
if (tfp) tfp->dump(main_time);
#endif
// Read outputs
VL_PRINTF ("[%" VL_PRI64 "d] clk=%x rstl=%x iquad=%" VL_PRI64 "x"
" -> oquad=%" VL_PRI64"x owide=%x_%08x_%08x\n",
main_time, top->clk, top->reset_l, top->in_quad,
top->out_quad, top->out_wide[2], top->out_wide[1], top->out_wide[0]);
VL_PRINTF("[%" VL_PRI64 "d] clk=%x rstl=%x iquad=%" VL_PRI64 "x"
" -> oquad=%" VL_PRI64"x owide=%x_%08x_%08x\n",
main_time, top->clk, top->reset_l, top->in_quad,
top->out_quad, top->out_wide[2], top->out_wide[1], top->out_wide[0]);
}
// Final model cleanup
@@ -102,12 +109,12 @@ int main(int argc, char** argv, char** env) {
// Close trace if opened
#if VM_TRACE
if (tfp) { tfp->close(); }
if (tfp) { tfp->close(); tfp = NULL; }
#endif
// Coverage analysis (since test passed)
#if VM_COVERAGE
mkdir("logs", 0777);
Verilated::mkdir("logs");
VerilatedCov::write("logs/coverage.dat");
#endif
@@ -5,7 +5,7 @@
// ======================================================================
// This is intended to be a complex example of several features, please also
// see the simpler examples/hello_world_c.
// see the simpler examples/make_hello_c.
module top
(
@@ -14,18 +14,18 @@ module top
input fastclk,
input reset_l,
output [1:0] out_small,
output [39:0] out_quad,
output [69:0] out_wide,
output wire [1:0] out_small,
output wire [39:0] out_quad,
output wire [69:0] out_wide,
input [1:0] in_small,
input [39:0] in_quad,
input [69:0] in_wide
);
// Connect up the outputs, using some trivial logic
wire [1:0] out_small = ~reset_l ? '0 : (in_small + 2'b1);
wire [39:0] out_quad = ~reset_l ? '0 : (in_quad + 40'b1);
wire [69:0] out_wide = ~reset_l ? '0 : (in_wide + 70'b1);
assign out_small = ~reset_l ? '0 : (in_small + 2'b1);
assign out_quad = ~reset_l ? '0 : (in_quad + 40'b1);
assign out_wide = ~reset_l ? '0 : (in_wide + 70'b1);
// And an example sub module. The submodule will print stuff.
sub sub (/*AUTOINST*/
@@ -5,7 +5,7 @@
# This calls the object directory makefile. That allows the objects to
# be placed in the "current directory" which simplifies the Makefile.
#
# Copyright 2003-2017 by Wilson Snyder. This program is free software; you can
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
@@ -20,8 +20,8 @@ endif
######################################################################
# Set up variables
# If $VERILATOR_ROOT isn't in the enviornment, we assume it is part of a
# package inatall, and verilator is in your path. Otherwise find the
# If $VERILATOR_ROOT isn't in the environment, we assume it is part of a
# package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator
@@ -52,6 +52,9 @@ VERILATOR_FLAGS += --coverage
# Add this trace to get a backtrace in gdb
#VERILATOR_FLAGS += --gdbbt
# Input files for Verilator
VERILATOR_INPUT = -f input.vc top.v sc_main.cpp
# Check if SC exists via a verilator call (empty if not)
SYSTEMC_EXISTS := $(shell $(VERILATOR) --getenv SYSTEMC_INCLUDE)
@@ -69,10 +72,10 @@ run:
@echo
@echo "-- VERILATE ----------------"
$(VERILATOR) $(VERILATOR_FLAGS) -f input.vc top.v sc_main.cpp
$(VERILATOR) $(VERILATOR_FLAGS) $(VERILATOR_INPUT)
@echo
@echo "-- COMPILE ----------------="
@echo "-- COMPILE -----------------"
# To compile, we can either just do what Verilator asks,
# or call a submakefile where we can override the rules ourselves
# $(MAKE) -j 4 -C obj_dir -f Vtop.mk
@@ -80,11 +83,13 @@ run:
@echo
@echo "-- RUN ---------------------"
@rm -rf logs
@mkdir -p logs
obj_dir/Vtop +trace
@echo
@echo "-- COVERAGE ----------------"
@rm -rf logs/annotated
$(VERILATOR_COVERAGE) --annotate logs/annotated logs/coverage.dat
@echo
@@ -92,6 +97,7 @@ run:
@echo "To see waveforms, open vlt_dump.vcd in a waveform viewer"
@echo
######################################################################
# Other targets
@@ -5,7 +5,7 @@
#
# This is executed in the object directory, and called by ../Makefile
#
# Copyright 2003-2017 by Wilson Snyder. This program is free software; you can
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
@@ -17,6 +17,9 @@ default: Vtop
# Include the rules made by Verilator
include Vtop.mk
# Use OBJCACHE (ccache) if using gmake and its installed
COMPILE.cc = $(OBJCACHE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
#######################################################################
# Compile flags
@@ -20,19 +20,23 @@
#include "Vtop.h"
int sc_main(int argc, char* argv[]) {
// This is a more complicated example, please also see the simpler examples/hello_world_c.
// This is a more complicated example, please also see the simpler examples/make_hello_c.
// Prevent unused variable warnings
if (0 && argc && argv) {}
// Pass arguments so Verilated code can see them, e.g. $value$plusargs
Verilated::commandArgs(argc, argv);
// Set debug level, 0 is off, 9 is highest presently used
// May be overridden by commandArgs
Verilated::debug(0);
// Randomization reset policy
// May be overridden by commandArgs
Verilated::randReset(2);
// Pass arguments so Verilated code can see them, e.g. $value$plusargs
// This needs to be called before you create any model
Verilated::commandArgs(argc, argv);
// General logfile
ios::sync_with_stdio();
@@ -94,10 +98,10 @@ int sc_main(int argc, char* argv[]) {
const char* flag = Verilated::commandArgsPlusMatch("trace");
if (flag && 0==strcmp(flag, "+trace")) {
cout << "Enabling waves into logs/vlt_dump.vcd...\n";
VerilatedVcdSc* tfp = new VerilatedVcdSc;
top->trace (tfp, 99);
mkdir("logs", 0777);
tfp->open ("logs/vlt_dump.vcd");
tfp = new VerilatedVcdSc;
top->trace(tfp, 99); // Trace 99 levels of hierarchy
Verilated::mkdir("logs");
tfp->open("logs/vlt_dump.vcd");
}
#endif
@@ -107,13 +111,15 @@ int sc_main(int argc, char* argv[]) {
// Flush the wave files each cycle so we can immediately see the output
// Don't do this in "real" programs, do it in an abort() handler instead
if (tfp) tfp->flush();
#endif
// Apply inputs
if (VL_TIME_Q() > 1 && VL_TIME_Q() < 10) {
reset_l = !1; // Assert reset
reset_l = !1; // Assert reset
} else if (VL_TIME_Q() > 1) {
reset_l = !0; // Deassert reset
reset_l = !0; // Deassert reset
}
#endif
// Simulate 1ns
#if (SYSTEMC_VERSION>=20070314)
sc_start(1,SC_NS);
@@ -122,20 +128,23 @@ int sc_main(int argc, char* argv[]) {
#endif
}
// Close Waves
#if VM_TRACE
if (tfp) tfp->close();
#endif
// Final model cleanup
top->final();
// Close trace if opened
#if VM_TRACE
if (tfp) { tfp->close(); tfp = NULL; }
#endif
// Coverage analysis (since test passed)
#if VM_COVERAGE
mkdir("logs", 0777);
Verilated::mkdir("logs");
VerilatedCov::write("logs/coverage.dat");
#endif
// Destroy model
delete top; top = NULL;
// Fin
return 0;
}
@@ -49,7 +49,7 @@ module sub
// An example assertion
always_ff @ (posedge clk) begin
AssertionExample: assert (!reset_l || count_c<100);
AssertionExample: assert(!reset_l || count_c<100);
end
// And example coverage analysis
@@ -5,7 +5,7 @@
// ======================================================================
// This is intended to be a complex example of several features, please also
// see the simpler examples/hello_world_c.
// see the simpler examples/make_hello_c.
module top
(
@@ -14,18 +14,18 @@ module top
input fastclk,
input reset_l,
output [1:0] out_small,
output [39:0] out_quad,
output [69:0] out_wide,
output wire [1:0] out_small,
output wire [39:0] out_quad,
output wire [69:0] out_wide,
input [1:0] in_small,
input [39:0] in_quad,
input [69:0] in_wide
);
// Connect up the outputs, using some trivial logic
wire [1:0] out_small = ~reset_l ? '0 : (in_small + 2'b1);
wire [39:0] out_quad = ~reset_l ? '0 : (in_quad + 40'b1);
wire [69:0] out_wide = ~reset_l ? '0 : (in_wide + 70'b1);
assign out_small = ~reset_l ? '0 : (in_small + 2'b1);
assign out_quad = ~reset_l ? '0 : (in_quad + 40'b1);
assign out_wide = ~reset_l ? '0 : (in_wide + 70'b1);
// And an example sub module. The submodule will print stuff.
sub sub (/*AUTOINST*/
+6
View File
@@ -0,0 +1,6 @@
obj_*
copied
*.csv
*.dot
*.dmp
*.pdf
+62
View File
@@ -0,0 +1,62 @@
######################################################################
#
# DESCRIPTION: Verilator Example: XML tests
#
# Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
#
######################################################################
# This makefile is not intended to be useful as an example itself,
# it is just to run the small example scripts in this directory.
# If $VERILATOR_ROOT isn't in the environment, we assume it is part of a
# package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator
else
export VERILATOR_ROOT
VERILATOR = $(VERILATOR_ROOT)/bin/verilator
endif
DOT = dot
PYTHON = python3
PYTHON_VERSION := $(shell ${PYTHON} --version 2>&1)
PYTHON_VERSION_FULL := $(wordlist 2,4,$(subst ., ,${PYTHON_VERSION}))
PYTHON_VERSION_MAJOR := $(word 1,${PYTHON_VERSION_FULL})
PYTHON_VERSION_MINOR := $(word 2,${PYTHON_VERSION_FULL})
PYTHON_GE_3_5 := $(shell [ ${PYTHON_VERSION_MAJOR} -eq 3 -a ${PYTHON_VERSION_MINOR} -ge 5 ] && echo true)
ifeq (${PYTHON_GE_3_5},true)
default: test
else
default: python_message
endif
python_message:
@echo "Found Python version ${PYTHON_VERSION}, but require >= 3.5"
test: \
test-vl_file_copy \
test-vl_hier_graph \
test-vl_file_copy:
@echo "-- vl_file_copy example"
$(PYTHON) vl_file_copy -odir copied top.v
@cmp copied/top.v top.v
@cmp copied/sub.v sub.v
test-vl_hier_graph:
@echo "-- vl_hier_graph example"
$(PYTHON) vl_hier_graph -o graph.dot top.v
@echo "Manually run: " $(DOT) -Tpdf -o graph.pdf graph.dot
######################################################################
maintainer-copy::
clean mostlyclean distclean maintainer-clean::
-rm -rf obj_dir *.log *.csv *.dmp *.dot *.vpd *.pdf core copied
+17
View File
@@ -0,0 +1,17 @@
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2019 by Wilson Snyder.
// ======================================================================
module sub
#(parameter type TYPE_t = logic)
(
input TYPE_t in,
output TYPE_t out
);
// Some simple logic
always_comb out = ~ in;
endmodule
+32
View File
@@ -0,0 +1,32 @@
// DESCRIPTION: Verilator: Verilog example module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2019 by Wilson Snyder.
// ======================================================================
module top
(
input clk,
input fastclk,
input reset_l,
output wire [1:0] out_small,
output wire [39:0] out_quad,
output wire [69:0] out_wide,
input [1:0] in_small,
input [39:0] in_quad,
input [69:0] in_wide
);
sub #(.TYPE_t(logic [1:0])) sub_small
(.in(in_small),
.out(out_small));
sub #(.TYPE_t(logic [39:0])) sub_quad
(.in(in_quad),
.out(out_quad));
sub #(.TYPE_t(logic [69:0])) sub_wide
(.in(in_wide),
.out(out_wide));
endmodule
+112
View File
@@ -0,0 +1,112 @@
#!/usr/bin/env python3
# -*- Python -*- See copyright, etc below
######################################################################
import argparse
import os
import re
import subprocess
import sys
import tempfile
import xml.etree.ElementTree as ET
from shutil import copy2
from pprint import pprint,pformat
#######################################################################
class VlFileCopy:
def __init__(self,
verilator_args, # presently all verilator options are passed-thru
# ideally this script would check against options mentioned in help
debug=0,
output_dir='copied'): # directory name we output file uses
self.debug = debug
xml_temp = tempfile.NamedTemporaryFile()
args = ['--xml-output', xml_temp.name,
'--bbox-sys', # Parse some stuff can't translate
'--bbox-unsup',
'--prefix vlxml'] # So we know name of .xml output
args += verilator_args
self.run_verilator(args)
self.tree = ET.parse(xml_temp.name)
os.makedirs(output_dir, 0o777, True)
# Find and copy the files
root = self.tree.getroot()
xfiles = root.find('files')
for xfile in xfiles.findall('file'):
filename = xfile.get('filename')
if not re.match('^<', filename): # e.g. <built-in>
if self.debug:
print("\tcp %s %s" % (filename, output_dir))
copy2(filename, output_dir)
def run_verilator(self, args):
"""Run Verilator command, check errors"""
if os.getenv("VERILATOR_ROOT"):
command = os.getenv("VERILATOR_ROOT") + "/bin/verilator"
else:
command = "verilator"
command += ' ' + ' '.join(args)
if self.debug:
print("\t%s " % command)
status = subprocess.call(command, shell=True)
if status != 0:
raise Exception("Command failed running Verilator with '"+command+"', stopped")
#######################################################################
if __name__=='__main__':
parser = argparse.ArgumentParser(
allow_abbrev=False,
formatter_class=argparse.RawTextHelpFormatter,
description=
"""Example of using Verilator XML output to copy a list of files to an
output directory (-odir, defaults to 'copied'), e.g. to easily create a
tarball of the design to pass to others.
Example usage:
vl_file_copy -f input.vc top.v -odir mycopy
# This will make at least mycopy/top.v
""",
epilog=
"""All other arguments are pass-thru to Verilator: e.g.:
+define+<var>=<value> Set preprocessor define
-F <file> Parse options from a file, relatively
-f <file> Parse options from a file
-G<name>=<value> Overwrite toplevel parameter
+incdir+<dir> Directory to search for includes
+libext+<ext>+[ext]... Extensions for finding modules
-v <filename> Verilog library
-y <dir> Directory to search for modules
This file ONLY is placed into the Public Domain, for any use, without
warranty, 2019 by Wilson Snyder."""
)
parser.add_argument('-debug', '--debug',
action='store_const', const=9,
help='enable debug')
parser.add_argument('-odir', '--odir',
action='store', metavar='directory', required=True,
help='target output directory')
(args, rem) = parser.parse_known_args()
print("NOTE: vl_file_copy is only an example starting point for writing your own tool.")
# That is:
# 1. We will accept basic patches
# 2. We are not expecting to make this globally useful. (e.g. we don't cleanup obj_dir)
# 3. "make install" will not install this.
# 4. This has not had production-worthy validation.
fc = VlFileCopy(output_dir = args.odir,
debug = args.debug,
verilator_args = rem)
######################################################################
### Local Variables:
### compile-command: "./vl_file_copy -h ; VERILATOR_ROOT=$V4 ./vl_file_copy +define+thru top.v"
### End:
+136
View File
@@ -0,0 +1,136 @@
#!/usr/bin/env python3
# -*- Python -*- See copyright, etc below
######################################################################
import argparse
import os
import re
import subprocess
import sys
import tempfile
import xml.etree.ElementTree as ET
from shutil import copy2
from pprint import pprint,pformat
#######################################################################
class VlHierGraph:
def __init__(self,
verilator_args, # presently all verilator options are passed-thru
# ideally this script would check against options mentioned in help
debug=0,
output_filename='graph.dot'): # output filename
self.debug = debug
self.next_vertex_number = 0
self.name_to_number = {}
xml_temp = tempfile.NamedTemporaryFile()
args = ['--xml-output', xml_temp.name,
'--bbox-sys', # Parse some stuff can't translate
'--bbox-unsup',
'--prefix vlxml'] # So we know name of .xml output
args += verilator_args
self.run_verilator(args)
self.tree = ET.parse(xml_temp.name)
with open(output_filename, "w") as fh:
# For more serious purposes, use the python graphviz package instead
fh.write("digraph {\n")
fh.write(" dpi=300;\n")
fh.write(" order=LR;\n")
fh.write(" node [fontsize=8 shape=\"box\" margin=0.01 width=0 height=0]")
fh.write(" edge [fontsize=6]")
# Find cells
root = self.tree.getroot()
netlist = root.find('netlist')
for module in netlist.findall('module'):
# origNames are before parameterization, name if after
mod_name = module.get('name')
mod_number = self.name_to_vertex_number(mod_name)
fh.write(" n%d [label=\"%s\""
% (mod_number, mod_name))
if module.get('topModule'):
fh.write(" color=\"red\" rank=1")
fh.write("];\n")
for instance in module.findall('instance'):
inst_name = instance.get('name')
def_name = instance.get('defName')
def_number = self.name_to_vertex_number(def_name)
fh.write(" n%d->n%d [label=\"%s\"];\n"
% (mod_number, def_number, inst_name));
fh.write("}\n")
def name_to_vertex_number(self, name):
if not name in self.name_to_number:
self.next_vertex_number += 1
self.name_to_number[name] = self.next_vertex_number
return self.name_to_number[name]
def run_verilator(self, args):
"""Run Verilator command, check errors"""
if os.getenv("VERILATOR_ROOT"):
command = os.getenv("VERILATOR_ROOT") + "/bin/verilator"
else:
command = "verilator"
command += ' ' + ' '.join(args)
if self.debug:
print("\t%s " % command)
status = subprocess.call(command, shell=True)
if status != 0:
raise Exception("Command failed running Verilator with '"+command+"', stopped")
#######################################################################
if __name__=='__main__':
parser = argparse.ArgumentParser(
allow_abbrev=False,
formatter_class=argparse.RawTextHelpFormatter,
description=
"""Example of using Verilator XML output to create a .dot file showing the
design module hierarchy.
Example usage:
vl_hier_graph -f input.vc top.v -o graph.dot
dot -Tpdf -o graph.pdf graph.dot
""",
epilog=
"""All other arguments are pass-thru to Verilator: e.g.:
+define+<var>=<value> Set preprocessor define
-F <file> Parse options from a file, relatively
-f <file> Parse options from a file
-G<name>=<value> Overwrite toplevel parameter
+incdir+<dir> Directory to search for includes
+libext+<ext>+[ext]... Extensions for finding modules
-v <filename> Verilog library
-y <dir> Directory to search for modules
This file ONLY is placed into the Public Domain, for any use, without
warranty, 2019 by Wilson Snyder."""
)
parser.add_argument('-debug', '--debug',
action='store_const', const=9,
help='enable debug')
parser.add_argument('-o', '--o',
action='store', metavar='filename', required=True,
help='output filename')
(args, rem) = parser.parse_known_args()
print("NOTE: vl_hier_graph is only an example starting point for writing your own tool.")
# That is:
# 1. We will accept basic patches
# 2. We are not expecting to make this globally useful. (e.g. we don't cleanup obj_dir)
# 3. "make install" will not install this.
# 4. This has not had production-worthy validation.
fc = VlHierGraph(output_filename = args.o,
debug = args.debug,
verilator_args = rem)
######################################################################
### Local Variables:
### compile-command: "./vl_hier_graph -h ; VERILATOR_ROOT=$V4 ./vl_hier_graph +define+thru top.v"
### End:
+547
View File
@@ -0,0 +1,547 @@
/*
FastLZ - lightning-fast lossless compression library
Copyright (C) 2007 Ariya Hidayat ([email protected])
Copyright (C) 2006 Ariya Hidayat ([email protected])
Copyright (C) 2005 Ariya Hidayat ([email protected])
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include "fastlz.h"
#if !defined(FASTLZ__COMPRESSOR) && !defined(FASTLZ_DECOMPRESSOR)
/*
* Always check for bound when decompressing.
* Generally it is best to leave it defined.
*/
#define FASTLZ_SAFE
/*
* Give hints to the compiler for branch prediction optimization.
*/
#if defined(__GNUC__) && (__GNUC__ > 2)
#define FASTLZ_EXPECT_CONDITIONAL(c) (__builtin_expect((c), 1))
#define FASTLZ_UNEXPECT_CONDITIONAL(c) (__builtin_expect((c), 0))
#else
#define FASTLZ_EXPECT_CONDITIONAL(c) (c)
#define FASTLZ_UNEXPECT_CONDITIONAL(c) (c)
#endif
/*
* Use inlined functions for supported systems.
*/
#if defined(__GNUC__) || defined(__DMC__) || defined(__POCC__) || defined(__WATCOMC__) || defined(__SUNPRO_C)
#define FASTLZ_INLINE inline
#elif defined(__BORLANDC__) || defined(_MSC_VER) || defined(__LCC__)
#define FASTLZ_INLINE __inline
#else
#define FASTLZ_INLINE
#endif
/*
* Prevent accessing more than 8-bit at once, except on x86 architectures.
*/
#if !defined(FASTLZ_STRICT_ALIGN)
#define FASTLZ_STRICT_ALIGN
#if defined(__i386__) || defined(__386) /* GNU C, Sun Studio */
#undef FASTLZ_STRICT_ALIGN
#elif defined(__i486__) || defined(__i586__) || defined(__i686__) || defined(__amd64) /* GNU C */
#undef FASTLZ_STRICT_ALIGN
#elif defined(_M_IX86) /* Intel, MSVC */
#undef FASTLZ_STRICT_ALIGN
#elif defined(__386)
#undef FASTLZ_STRICT_ALIGN
#elif defined(_X86_) /* MinGW */
#undef FASTLZ_STRICT_ALIGN
#elif defined(__I86__) /* Digital Mars */
#undef FASTLZ_STRICT_ALIGN
#endif
#endif
/* prototypes */
int fastlz_compress(const void* input, int length, void* output);
int fastlz_compress_level(int level, const void* input, int length, void* output);
int fastlz_decompress(const void* input, int length, void* output, int maxout);
#define MAX_COPY 32
#define MAX_LEN 264 /* 256 + 8 */
#define MAX_DISTANCE 8192
#if !defined(FASTLZ_STRICT_ALIGN)
#define FASTLZ_READU16(p) *((const flzuint16*)(p))
#else
#define FASTLZ_READU16(p) ((p)[0] | (p)[1]<<8)
#endif
#define HASH_LOG 13
#define HASH_SIZE (1<< HASH_LOG)
#define HASH_MASK (HASH_SIZE-1)
#define HASH_FUNCTION(v,p) { v = FASTLZ_READU16(p); v ^= FASTLZ_READU16(p+1)^(v>>(16-HASH_LOG));v &= HASH_MASK; }
#undef FASTLZ_LEVEL
#define FASTLZ_LEVEL 1
#undef FASTLZ_COMPRESSOR
#undef FASTLZ_DECOMPRESSOR
#define FASTLZ_COMPRESSOR fastlz1_compress
#define FASTLZ_DECOMPRESSOR fastlz1_decompress
static FASTLZ_INLINE int FASTLZ_COMPRESSOR(const void* input, int length, void* output);
static FASTLZ_INLINE int FASTLZ_DECOMPRESSOR(const void* input, int length, void* output, int maxout);
#include "fastlz.c"
#undef FASTLZ_LEVEL
#define FASTLZ_LEVEL 2
#undef MAX_DISTANCE
#define MAX_DISTANCE 8191
#define MAX_FARDISTANCE (65535+MAX_DISTANCE-1)
#undef FASTLZ_COMPRESSOR
#undef FASTLZ_DECOMPRESSOR
#define FASTLZ_COMPRESSOR fastlz2_compress
#define FASTLZ_DECOMPRESSOR fastlz2_decompress
static FASTLZ_INLINE int FASTLZ_COMPRESSOR(const void* input, int length, void* output);
static FASTLZ_INLINE int FASTLZ_DECOMPRESSOR(const void* input, int length, void* output, int maxout);
#include "fastlz.c"
int fastlz_compress(const void* input, int length, void* output)
{
/* for short block, choose fastlz1 */
if(length < 65536)
return fastlz1_compress(input, length, output);
/* else... */
return fastlz2_compress(input, length, output);
}
int fastlz_decompress(const void* input, int length, void* output, int maxout)
{
/* magic identifier for compression level */
int level = ((*(const flzuint8*)input) >> 5) + 1;
if(level == 1)
return fastlz1_decompress(input, length, output, maxout);
if(level == 2)
return fastlz2_decompress(input, length, output, maxout);
/* unknown level, trigger error */
return 0;
}
int fastlz_compress_level(int level, const void* input, int length, void* output)
{
if(level == 1)
return fastlz1_compress(input, length, output);
if(level == 2)
return fastlz2_compress(input, length, output);
return 0;
}
#else /* !defined(FASTLZ_COMPRESSOR) && !defined(FASTLZ_DECOMPRESSOR) */
static FASTLZ_INLINE int FASTLZ_COMPRESSOR(const void* input, int length, void* output)
{
const flzuint8* ip = (const flzuint8*) input;
const flzuint8* ip_bound = ip + length - 2;
const flzuint8* ip_limit = ip + length - 12;
flzuint8* op = (flzuint8*) output;
const flzuint8* htab[HASH_SIZE];
const flzuint8** hslot;
flzuint32 hval;
flzuint32 copy;
/* sanity check */
if(FASTLZ_UNEXPECT_CONDITIONAL(length < 4))
{
if(length)
{
/* create literal copy only */
*op++ = length-1;
ip_bound++;
while(ip <= ip_bound)
*op++ = *ip++;
return length+1;
}
else
return 0;
}
/* initializes hash table */
for (hslot = htab; hslot < htab + HASH_SIZE; hslot++)
*hslot = ip;
/* we start with literal copy */
copy = 2;
*op++ = MAX_COPY-1;
*op++ = *ip++;
*op++ = *ip++;
/* main loop */
while(FASTLZ_EXPECT_CONDITIONAL(ip < ip_limit))
{
const flzuint8* ref;
flzuint32 distance;
/* minimum match length */
flzuint32 len = 3;
/* comparison starting-point */
const flzuint8* anchor = ip;
/* check for a run */
#if FASTLZ_LEVEL==2
if(ip[0] == ip[-1] && FASTLZ_READU16(ip-1)==FASTLZ_READU16(ip+1))
{
distance = 1;
/* ip += 3; */ /* scan-build, never used */
ref = anchor - 1 + 3;
goto match;
}
#endif
/* find potential match */
HASH_FUNCTION(hval,ip);
hslot = htab + hval;
ref = htab[hval];
/* calculate distance to the match */
distance = anchor - ref;
/* update hash table */
*hslot = anchor;
/* is this a match? check the first 3 bytes */
if(distance==0 ||
#if FASTLZ_LEVEL==1
(distance >= MAX_DISTANCE) ||
#else
(distance >= MAX_FARDISTANCE) ||
#endif
*ref++ != *ip++ || *ref++!=*ip++ || *ref++!=*ip++)
goto literal;
#if FASTLZ_LEVEL==2
/* far, needs at least 5-byte match */
if(distance >= MAX_DISTANCE)
{
if(*ip++ != *ref++ || *ip++!= *ref++)
goto literal;
len += 2;
}
match:
#endif
/* last matched byte */
ip = anchor + len;
/* distance is biased */
distance--;
if(!distance)
{
/* zero distance means a run */
flzuint8 x = ip[-1];
while(ip < ip_bound)
if(*ref++ != x) break; else ip++;
}
else
for(;;)
{
/* safe because the outer check against ip limit */
if(*ref++ != *ip++) break;
if(*ref++ != *ip++) break;
if(*ref++ != *ip++) break;
if(*ref++ != *ip++) break;
if(*ref++ != *ip++) break;
if(*ref++ != *ip++) break;
if(*ref++ != *ip++) break;
if(*ref++ != *ip++) break;
while(ip < ip_bound)
if(*ref++ != *ip++) break;
break;
}
/* if we have copied something, adjust the copy count */
if(copy)
/* copy is biased, '0' means 1 byte copy */
*(op-copy-1) = copy-1;
else
/* back, to overwrite the copy count */
op--;
/* reset literal counter */
copy = 0;
/* length is biased, '1' means a match of 3 bytes */
ip -= 3;
len = ip - anchor;
/* encode the match */
#if FASTLZ_LEVEL==2
if(distance < MAX_DISTANCE)
{
if(len < 7)
{
*op++ = (len << 5) + (distance >> 8);
*op++ = (distance & 255);
}
else
{
*op++ = (7 << 5) + (distance >> 8);
for(len-=7; len >= 255; len-= 255)
*op++ = 255;
*op++ = len;
*op++ = (distance & 255);
}
}
else
{
/* far away, but not yet in the another galaxy... */
if(len < 7)
{
distance -= MAX_DISTANCE;
*op++ = (len << 5) + 31;
*op++ = 255;
*op++ = distance >> 8;
*op++ = distance & 255;
}
else
{
distance -= MAX_DISTANCE;
*op++ = (7 << 5) + 31;
for(len-=7; len >= 255; len-= 255)
*op++ = 255;
*op++ = len;
*op++ = 255;
*op++ = distance >> 8;
*op++ = distance & 255;
}
}
#else
if(FASTLZ_UNEXPECT_CONDITIONAL(len > MAX_LEN-2))
while(len > MAX_LEN-2)
{
*op++ = (7 << 5) + (distance >> 8);
*op++ = MAX_LEN - 2 - 7 -2;
*op++ = (distance & 255);
len -= MAX_LEN-2;
}
if(len < 7)
{
*op++ = (len << 5) + (distance >> 8);
*op++ = (distance & 255);
}
else
{
*op++ = (7 << 5) + (distance >> 8);
*op++ = len - 7;
*op++ = (distance & 255);
}
#endif
/* update the hash at match boundary */
HASH_FUNCTION(hval,ip);
htab[hval] = ip++;
HASH_FUNCTION(hval,ip);
htab[hval] = ip++;
/* assuming literal copy */
*op++ = MAX_COPY-1;
continue;
literal:
*op++ = *anchor++;
ip = anchor;
copy++;
if(FASTLZ_UNEXPECT_CONDITIONAL(copy == MAX_COPY))
{
copy = 0;
*op++ = MAX_COPY-1;
}
}
/* left-over as literal copy */
ip_bound++;
while(ip <= ip_bound)
{
*op++ = *ip++;
copy++;
if(copy == MAX_COPY)
{
copy = 0;
*op++ = MAX_COPY-1;
}
}
/* if we have copied something, adjust the copy length */
if(copy)
*(op-copy-1) = copy-1;
else
op--;
#if FASTLZ_LEVEL==2
/* marker for fastlz2 */
*(flzuint8*)output |= (1 << 5);
#endif
return op - (flzuint8*)output;
}
static FASTLZ_INLINE int FASTLZ_DECOMPRESSOR(const void* input, int length, void* output, int maxout)
{
const flzuint8* ip = (const flzuint8*) input;
const flzuint8* ip_limit = ip + length;
flzuint8* op = (flzuint8*) output;
flzuint8* op_limit = op + maxout;
flzuint32 ctrl = (*ip++) & 31;
int loop = 1;
do
{
const flzuint8* ref = op;
flzuint32 len = ctrl >> 5;
flzuint32 ofs = (ctrl & 31) << 8;
if(ctrl >= 32)
{
#if FASTLZ_LEVEL==2
flzuint8 code;
#endif
len--;
ref -= ofs;
if (len == 7-1)
#if FASTLZ_LEVEL==1
len += *ip++;
ref -= *ip++;
#else
do
{
code = *ip++;
len += code;
} while (code==255);
code = *ip++;
ref -= code;
/* match from 16-bit distance */
if(FASTLZ_UNEXPECT_CONDITIONAL(code==255))
if(FASTLZ_EXPECT_CONDITIONAL(ofs==(31 << 8)))
{
ofs = (*ip++) << 8;
ofs += *ip++;
ref = op - ofs - MAX_DISTANCE;
}
#endif
#ifdef FASTLZ_SAFE
if (FASTLZ_UNEXPECT_CONDITIONAL(op + len + 3 > op_limit))
return 0;
if (FASTLZ_UNEXPECT_CONDITIONAL(ref-1 < (flzuint8 *)output))
return 0;
#endif
if(FASTLZ_EXPECT_CONDITIONAL(ip < ip_limit))
ctrl = *ip++;
else
loop = 0;
if(ref == op)
{
/* optimize copy for a run */
flzuint8 b = ref[-1];
*op++ = b;
*op++ = b;
*op++ = b;
for(; len; --len)
*op++ = b;
}
else
{
#if !defined(FASTLZ_STRICT_ALIGN)
const flzuint16* p;
flzuint16* q;
#endif
/* copy from reference */
ref--;
*op++ = *ref++;
*op++ = *ref++;
*op++ = *ref++;
#if !defined(FASTLZ_STRICT_ALIGN)
/* copy a byte, so that now it's word aligned */
if(len & 1)
{
*op++ = *ref++;
len--;
}
/* copy 16-bit at once */
q = (flzuint16*) op;
op += len;
p = (const flzuint16*) ref;
for(len>>=1; len > 4; len-=4)
{
*q++ = *p++;
*q++ = *p++;
*q++ = *p++;
*q++ = *p++;
}
for(; len; --len)
*q++ = *p++;
#else
for(; len; --len)
*op++ = *ref++;
#endif
}
}
else
{
ctrl++;
#ifdef FASTLZ_SAFE
if (FASTLZ_UNEXPECT_CONDITIONAL(op + ctrl > op_limit))
return 0;
if (FASTLZ_UNEXPECT_CONDITIONAL(ip + ctrl > ip_limit))
return 0;
#endif
*op++ = *ip++;
for(--ctrl; ctrl; ctrl--)
*op++ = *ip++;
loop = FASTLZ_EXPECT_CONDITIONAL(ip < ip_limit);
if(loop)
ctrl = *ip++;
}
}
while(FASTLZ_EXPECT_CONDITIONAL(loop));
return op - (flzuint8*)output;
}
#endif /* !defined(FASTLZ_COMPRESSOR) && !defined(FASTLZ_DECOMPRESSOR) */
+107
View File
@@ -0,0 +1,107 @@
/*
FastLZ - lightning-fast lossless compression library
Copyright (C) 2007 Ariya Hidayat ([email protected])
Copyright (C) 2006 Ariya Hidayat ([email protected])
Copyright (C) 2005 Ariya Hidayat ([email protected])
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef FASTLZ_H
#define FASTLZ_H
#include <inttypes.h>
#define flzuint8 uint8_t
#define flzuint16 uint16_t
#define flzuint32 uint32_t
#define FASTLZ_VERSION 0x000100
#define FASTLZ_VERSION_MAJOR 0
#define FASTLZ_VERSION_MINOR 0
#define FASTLZ_VERSION_REVISION 0
#define FASTLZ_VERSION_STRING "0.1.0"
#if defined (__cplusplus)
extern "C" {
#endif
/**
Compress a block of data in the input buffer and returns the size of
compressed block. The size of input buffer is specified by length. The
minimum input buffer size is 16.
The output buffer must be at least 5% larger than the input buffer
and can not be smaller than 66 bytes.
If the input is not compressible, the return value might be larger than
length (input buffer size).
The input buffer and the output buffer can not overlap.
*/
int fastlz_compress(const void* input, int length, void* output);
/**
Decompress a block of compressed data and returns the size of the
decompressed block. If error occurs, e.g. the compressed data is
corrupted or the output buffer is not large enough, then 0 (zero)
will be returned instead.
The input buffer and the output buffer can not overlap.
Decompression is memory safe and guaranteed not to write the output buffer
more than what is specified in maxout.
*/
int fastlz_decompress(const void* input, int length, void* output, int maxout);
/**
Compress a block of data in the input buffer and returns the size of
compressed block. The size of input buffer is specified by length. The
minimum input buffer size is 16.
The output buffer must be at least 5% larger than the input buffer
and can not be smaller than 66 bytes.
If the input is not compressible, the return value might be larger than
length (input buffer size).
The input buffer and the output buffer can not overlap.
Compression level can be specified in parameter level. At the moment,
only level 1 and level 2 are supported.
Level 1 is the fastest compression and generally useful for short data.
Level 2 is slightly slower but it gives better compression ratio.
Note that the compressed data, regardless of the level, can always be
decompressed using the function fastlz_decompress above.
*/
int fastlz_compress_level(int level, const void* input, int length, void* output);
#if defined (__cplusplus)
}
#endif
#endif /* FASTLZ_H */

Some files were not shown because too many files have changed in this diff Show More