Commit Graph

1001 Commits

Author SHA1 Message Date
Aleksander Kiryk 31130c4b4a
Fix std:: to be parsed first (#3864) (#3928) 2023-02-03 09:04:16 -05:00
Larry Doolittle 9f9c84aa64
Internals: Avoid using <tab> in the middle of lines (#3913) 2023-01-29 22:39:22 -05:00
Wilson Snyder 7855a78a0f Support %p of union with real 2023-01-28 21:41:50 -05:00
Wilson Snyder 53835355b0 Add CFG_CXXFLAGS_STD so CFG_CXXFLAGS_STD_NEWEST can still exist (#3881) 2023-01-22 09:44:50 -05:00
Wilson Snyder bc7048e8d1 Convert verilator_includer to python3 2023-01-21 14:40:22 -05:00
Wilson Snyder c2bdd06fcc Fix VPI one-time timed callbacks (#2778). 2023-01-21 13:43:27 -05:00
Ilya Barkov 8918f17c17
Support class queue equality (#3895) 2023-01-21 13:20:02 -05:00
Wilson Snyder 317fe7a787 Fix VL_CPU_RELAX on MIPS/Armel/s390/sparc (#3891) 2023-01-19 17:22:28 -05:00
Wilson Snyder 6a60ace2c7 Commentary (#3887) 2023-01-18 18:21:53 -05:00
Andrew Nolte e5eb7d8930
Add VL_VALUE_STRING_MAX_WORDS override (#3869)
Co-authored-by: Andrew Nolte <anolte@hudson-trading.com>
2023-01-13 15:23:15 -05:00
Sören Tempel 78fe77db0f Fix compatibility with musl libc / Alpine Linux (#3845) 2023-01-05 15:50:25 -05:00
Larry Doolittle 2ab70ba452
Internals: Cleanup .txt file whitespace (#3842) 2023-01-05 05:00:54 -05:00
Wilson Snyder b24d7c83d3 Copyright year update 2023-01-01 10:18:39 -05:00
Larry Doolittle 80a144797d
Commentary: Fix more spelling (#3828) 2022-12-26 10:30:41 +01:00
Wilson Snyder c0499da28b Spelling fixes 2022-12-23 11:32:38 -05:00
Wilson Snyder 3ccb2e0f2d Fix initiation of function variables (#3815). 2022-12-23 10:51:52 -05:00
Krzysztof Bieganski bb44d4e4f2
Support clocking blocks (#3674) 2022-12-23 07:34:49 -05:00
Wilson Snyder d64971ba35 Fix some MSVC warnings. 2022-12-22 12:19:09 -05:00
Jevin Sweval 3340f7b0b4
Fix macOS weak symbols with -U linker flag (#3823) 2022-12-20 11:17:43 -05:00
Kamil Rakoczy 982fa3d7bb
Fix signed/unsigned comparison compile warning (#3822) 2022-12-19 10:52:19 -05:00
Kamil Rakoczy 7a15457511
Tests: Add multithreading attribute checks (#3748) 2022-12-16 11:19:27 -05:00
Kamil Rakoczy 4f7df4a915
Internals: Mark more VL_MT_SAFE functions (#3816). 2022-12-16 10:14:02 -05:00
Wilson Snyder 073af8e1f2 Fix to zero possibly uninitialized bits in replications (#3815) 2022-12-15 22:00:21 -05:00
Wilson Snyder 2eafd82696 Internals: Mark more VL_MT_SAFE functions (#3748). No functional change 2022-12-15 21:32:34 -05:00
Kamil Rakoczy 925fb921a2 Fix missing VL_REQUIRES in definition (#3804) 2022-12-14 21:16:16 -05:00
Kritik Bhimani 9d2f1c607a
Fix MSVCC issues (#3813) 2022-12-14 07:07:25 -05:00
Kritik Bhimani 7b073fec7d
Fix MSVC++ portability issues (#3812) 2022-12-12 18:45:32 -05:00
Wilson Snyder 424faa883e Internals: Mark more VL_MT_SAFE functions. No functional change 2022-12-11 23:10:59 -05:00
Wilson Snyder 61d6546400 Internals: Mark more VL_MT_SAFE functions. No functional change 2022-12-11 23:03:27 -05:00
Wilson Snyder a0e7930036 docs: Fix spelling 2022-12-09 22:39:41 -05:00
Kamil Rakoczy 5aa935d170
Internals: Add annotations for check attributes (#3803) 2022-12-09 07:12:26 -05:00
Wilson Snyder bcf58defe0 Update include/gtkwave from upstream 2022-12-08 07:30:23 -05:00
Wilson Snyder ea1b141d13 Support probablity distribution functions. 2022-12-04 17:30:51 -05:00
Wilson Snyder 84c7368621 Rename std.sv and add to install. 2022-12-03 11:31:26 -05:00
Larry Doolittle f27cf4c804
Commentary: Fix spelling in C++ comments (#3797) (#3798) 2022-12-02 18:46:38 -05:00
Wilson Snyder 338e875b70 Internals: Mark more VL_MT_SAFE functions. No functional change 2022-12-01 19:32:09 -05:00
Wilson Snyder 468a33b61c Move SystemC requirement out of .cpp files (#3507) 2022-11-29 22:44:37 -05:00
Wilson Snyder 8ff607f679 Deprecate verilated_fst_sc.cpp and verilated_vcd_sc.cpp (#3507) 2022-11-29 22:17:50 -05:00
Wilson Snyder 6143892619 Internals: Add some VL_UNLIKELY. No functional change. 2022-11-29 20:36:56 -05:00
Wilson Snyder 7d807a7e0e Commentary 2022-11-29 07:33:12 -05:00
Krzysztof Bieganski 68e1b473e2
Support `std::semaphore` and typed `std::mailbox` (#3708)
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2022-11-28 16:53:55 +01:00
Wilson Snyder 4452a9b10f Internals: Fix some VL_MT metacomments. 2022-11-28 07:08:34 -05:00
Larry Doolittle 6349e76abd
Remove $date from .vcd files (#3779) 2022-11-27 20:24:22 -05:00
Wilson Snyder f4be3d5d2b Fix empty string literals converting to string types (#3774). 2022-11-27 13:28:57 -05:00
Wilson Snyder 833780fac1 Internal: cppcheck fixes. No functional change intended. 2022-11-27 05:52:40 -05:00
Wilson Snyder a83ed6b06f Internals: Fix destructor calling virtual. No functional change intended. 2022-11-23 07:04:22 -05:00
github action 821dd070bf Apply 'make format' 2022-11-23 09:08:02 +00:00
Yves Mathieu 06fdf7be58
Add support of Events for VCD/FST traces (#3759) 2022-11-23 04:07:14 -05:00
Ryszard Rozak 57975c82b7
Support 'with' in unique, unique_index, min, max in queues (#3772) 2022-11-22 09:10:25 -05:00
Wilson Snyder 66d85b3381 Internals: Fix cppcheck warnings. No functional change intended. 2022-11-21 21:40:49 -05:00
Wilson Snyder 352d0b4582 Internals: Fix constructor style. 2022-11-20 13:11:01 -05:00
github action cd8528e83b Apply 'make format' 2022-11-18 00:14:05 +00:00
Wilson Snyder e8a1e4745c Support $stacktrace 2022-11-17 19:12:54 -05:00
Miodrag Milanović f782496092
Fix for mingw cross-compile, arm and riscv (#3752) 2022-11-16 05:34:25 -08:00
Wilson Snyder e6da59eecd Internals: Mark some VL_PURE functions. No functional change. 2022-11-15 09:18:47 -05:00
Wilson Snyder 04f68cbd99 Internals: Spacing 2022-11-13 21:58:18 -05:00
Wilson Snyder 8c6d1e53ca Internals: Fix some 'p' names, and make new base class for VlDeleter. No functional change intended. 2022-11-13 17:40:50 -05:00
Wilson Snyder 818347f99b Internals: Fix some unnecessary member paddings. No functional change intended. 2022-11-13 09:26:46 -05:00
Wilson Snyder 218dd4322b Fix C++11 warnings 2022-11-12 16:03:13 -05:00
Kamil Rakoczy 207bc2b18a Fix comment annotation
Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
2022-11-10 13:36:14 +00:00
Kamil Rakoczy d6126c4b32
Remove --no-threads; require --threads 1 for single threaded (#3703). 2022-11-05 08:47:34 -04:00
Geza Lore 65e08f4dbf Make all expressions derive from AstNodeExpr (#3721).
Apart from the representational changes below, this patch renames
AstNodeMath to AstNodeExpr, and AstCMath to AstCExpr.

Now every expression (i.e.: those AstNodes that represent a [possibly
void] value, with value being interpreted in a very general sense) has
AstNodeExpr as a super class. This necessitates the introduction of an
AstStmtExpr, which represents an expression in statement position, e.g :
'foo();' would be represented as AstStmtExpr(AstCCall(foo)). In exchange
we can get rid of isStatement() in AstNodeStmt, which now really always
represent a statement

Peak memory consumption and verilation speed are not measurably changed.

Partial step towards #3420
2022-11-03 16:02:16 +00:00
Wilson Snyder 0ed7aaeabd Update include/gtkwave/fstapi.c from upstream. 2022-10-27 21:37:09 -04:00
Kamil Rakoczy ed93a111c2
Fix deadlock in ``timeprecision`` when using systemC (#3707) 2022-10-26 04:50:28 -07:00
Krzysztof Bieganski fcf0d03cd4
Dynamic triggers for non-static contexts (#3599)
In non-static contexts like class objects or stack frames, the use of
global trigger evaluation is not feasible. The concept of dynamic
triggers allows for trigger evaluation in such cases. These triggers are
simply local variables, and coroutines are themselves responsible for
evaluating them. They await the global dynamic trigger scheduler object,
which is responsible for resuming them during the trigger evaluation
step in the 'act' eval region. Once the trigger is set, they await the
dynamic trigger scheduler once again, and then get resumed during the
resumption step in the 'act' eval region.

Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2022-10-22 14:05:39 +00:00
Wilson Snyder 9d02082801 Internals: Avoid VM_COVERAGE ifdef in library to get closer to libverilated.a 2022-10-21 17:09:06 -04:00
Krzysztof Bieganski 785c51dd0b
Fix emitting timing debug info with `--protect-ids` (#3689) (#3701) 2022-10-21 16:56:44 -04:00
Krzysztof Bieganski 444a4a760c
Support timing with more Clang and libc++ versions (#3669) (#3698) 2022-10-20 19:54:22 -04:00
Krzysztof Bieganski 8c3ca30c91
Fix print format warning on some platforms (#3699) 2022-10-20 10:15:29 -04:00
Wilson Snyder e7068369fe Fix $display of fixed-width numbers (#3565). 2022-10-18 21:10:35 -04:00
Kamil Rakoczy b6c116d4bf
Internals: Add VL_MT_SAFE annotations to const functions (#3681) 2022-10-18 17:07:09 -04:00
Kamil Rakoczy 54e3f15dce
Internals: Add attribute when using clang to VL_MT_SAFE and VL_MT_UNSAFE (#3685) 2022-10-18 05:15:33 -04:00
Krzysztof Bieganski 68927d4fd3
Make class ref typing stricter (#3671)
Prevents the possibility of assigning an integer to a class reference,
both at the SystemVerilog and the emitted C++ levels.

Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2022-10-13 14:33:15 +02:00
Wilson Snyder 6f9c585452 Spelling (#3664) 2022-10-09 14:18:14 -04:00
Krzysztof Bieganski 56ac054fb2
Internals: Refactor verilated_timing.* (#3653).
* Put suspended coroutine source location in a separate struct,
* Have `dump()` always print, wrap calls in `VL_DEBUG_IF`,
* Improve const correctness.
2022-10-03 11:40:30 -04:00
Wilson Snyder ced82cbac4 Internals: Add some internal coverage exclusions etc. No functional change. 2022-10-03 10:57:37 -04:00
Geza Lore 2fc1746ef5 Tracing: Clear offload buffer pointers when no longer needed
These are also used as a marker (when non-nullptr) when creating a
buffer. Reset them when they are not valid to avoid invalid write if a
buffer is created after a close (due to a subsequent re-open).

Fixes #3651.
2022-10-03 10:50:47 +01:00
Wilson Snyder 10fc1f757c Internals: cppcheck cleanups. No functional change intended. 2022-10-02 23:04:55 -04:00
Wilson Snyder 4367e03e46 Internals: Make VL_UNREACHABLE similar to std::unreachable() 2022-10-02 16:35:45 -04:00
Wilson Snyder c9634695a7 Fix std::exchange for C++11 compilers 2022-10-02 16:25:11 -04:00
Wilson Snyder 880cac2fdd Merge branch 'master' into develop-v5 2022-10-01 11:24:55 -04:00
Wilson Snyder 5ed882faf2 Fix unused compiler warning when not VL_THREADED. 2022-09-30 23:41:35 -04:00
Krzysztof Bieganski 9c2ead90d5
Add custom memory management for verilated classes (#3595)
This change introduces a custom reference-counting pointer class that
allows creating such pointers from 'this'. This lets us keep the
receiver object around even if all references to it outside of a class
method no longer exist. Useful for coroutine methods, which may outlive
all external references to the object.

The deletion of objects is deferred until the next time slot. This is to
make clearing the triggered flag on named events in classes safe
(otherwise freed memory could be accessed).
2022-09-28 18:54:18 -04:00
github action 91823c41c5 Apply 'make format' 2022-09-28 02:22:05 +00:00
Wilson Snyder c6bce636ee Merge branch 'master' into develop-v5 2022-09-27 22:19:04 -04:00
Wilson Snyder 75a70bee6d Update to clang-format-14 on Ubuntu22.04 2022-09-27 21:47:45 -04:00
Wilson Snyder d162619bd3 Merge branch 'master' into develop-v5 2022-09-20 20:06:21 -04:00
Mariusz Glebocki fc3ce29845
Improve Verilation memory by reducing V3Number size (#3521) 2022-09-20 16:46:47 -04:00
Geza Lore af305bf280 Merge branch 'master' into develop-v5 2022-09-16 16:24:36 +01:00
Geza Lore 38a8d7fb2e Remove redundant 'inline' keywords from definitions
Also add checks to t/t_dist_cppstyle
2022-09-16 15:52:25 +01:00
Geza Lore 0c70a0dcbf Remove redundant 'virtual' keywords from overridden methods
'virtual' is redundant when 'override' is present, so keep only
'override'.

Add t/t_dist_cppstyle.pl to check for this.
2022-09-16 15:19:38 +01:00
Geza Lore 27031ed688 Merge branch 'master' into develop-v5 2022-09-15 10:28:35 +01:00
github action e94cdcf29c Apply 'make format' 2022-09-05 22:43:09 +00:00
Mladen Slijepcevic 1af046986d
Fix thread saftey in SystemC VL_ASSIGN_SBW/WSB (#3494) (#3513). 2022-09-05 18:42:12 -04:00
Krzysztof Bieganski da7ad35577
Fix fork debug output (#3593)
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2022-09-05 11:27:24 +01:00
Wilson Snyder 819e8741cc Merge branch 'master' into develop-v5 2022-08-30 00:20:21 -04:00
Wilson Snyder 6a5f77b278 Internals: Cleanup some string/model constructors. No functional change. 2022-08-29 23:50:32 -04:00
Wilson Snyder 2358ced061 Rename tracing rolloverSize and add test (#3570). 2022-08-28 08:25:02 -04:00
Geza Lore 5c356a4680 Merge branch 'master' into develop-v5 2022-08-22 14:32:06 +01:00
Krzysztof Bieganski 39af5d020e
Timing support (#3363)
Adds timing support to Verilator. It makes it possible to use delays,
event controls within processes (not just at the start), wait
statements, and forks.

Building a design with those constructs requires a compiler that
supports C++20 coroutines (GCC 10, Clang 5).

The basic idea is to have processes and tasks with delays/event controls
implemented as C++20 coroutines. This allows us to suspend and resume
them at any time.

There are five main runtime classes responsible for managing suspended
coroutines:
* `VlCoroutineHandle`, a wrapper over C++20's `std::coroutine_handle`
  with move semantics and automatic cleanup.
* `VlDelayScheduler`, for coroutines suspended by delays. It resumes
  them at a proper simulation time.
* `VlTriggerScheduler`, for coroutines suspended by event controls. It
  resumes them if its corresponding trigger was set.
* `VlForkSync`, used for syncing `fork..join` and `fork..join_any`
  blocks.
* `VlCoroutine`, the return type of all verilated coroutines. It allows
  for suspending a stack of coroutines (normally, C++ coroutines are
  stackless).

There is a new visitor in `V3Timing.cpp` which:
  * scales delays according to the timescale,
  * simplifies intra-assignment timing controls and net delays into
    regular timing controls and assignments,
  * simplifies wait statements into loops with event controls,
  * marks processes and tasks with timing controls in them as
    suspendable,
  * creates delay, trigger scheduler, and fork sync variables,
  * transforms timing controls and fork joins into C++ awaits

There are new functions in `V3SchedTiming.cpp` (used by `V3Sched.cpp`)
that integrate static scheduling with timing. This involves providing
external domains for variables, so that the necessary combinational
logic gets triggered after coroutine resumption, as well as statements
that need to be injected into the design eval function to perform this
resumption at the correct time.

There is also a function that transforms forked processes into separate
functions.

See the comments in `verilated_timing.h`, `verilated_timing.cpp`,
`V3Timing.cpp`, and `V3SchedTiming.cpp`, as well as the internals
documentation for more details.

Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2022-08-22 13:26:32 +01:00