Commit Graph

22 Commits

Author SHA1 Message Date
Peter Debacker
191c71edea
Fix cmake on macOS to mark weak symbols with -U linker flag (#3978) (#3979)
Co-authored-by: Peter Debacker <pdback@imec.be>
2023-02-23 17:27:29 -05:00
Zixi Li
8f87022496
Fix CMake bad C identifiers (#3948) (#3951) 2023-02-10 20:06:05 -05:00
Wilson Snyder
4aa3e72509 Fix cmake 3.12+ warnings on MSWIN. 2023-02-03 17:16:39 -05:00
Yoda Lee
80b291407b
Add cmake warning if multiple SOURCES w/o PREFIX (#3916) (#3927) 2023-02-02 22:08:13 -05:00
Wilson Snyder
b24d7c83d3 Copyright year update 2023-01-01 10:18:39 -05:00
Kamil Rakoczy
d6126c4b32
Remove --no-threads; require --threads 1 for single threaded (#3703). 2022-11-05 08:47:34 -04: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
Geza Lore
1d400dd98c
Configure tracing at run-time, instead of compile time (#3504)
All remaining use of conditional compilation in the tracing
implementation of the run-time library are replaced with the use of
VerilatedModel::traceConfig, and is now done at run-time.
2022-07-20 11:27:10 +01:00
Geza Lore
c7610ed044 Fix FST tracing thread in CMake build 2022-05-20 17:04:46 +01:00
Martin Stadler
cddbe4642f
Fix cmake rules to support higher-level targest (#3377) (#3386).
Don't add linker flags as generator expression to support linking `TARGET` to higher-level targets in a top-level CMakeLists.txt file.
2022-05-11 21:33:05 -04:00
Wilson Snyder
ca42be982c Copyright year update. 2022-01-01 08:26:40 -05:00
Martin Schmidt
b0c1ac7ea2
Add support of --trace-structs parameter for CMake (#2986) 2021-06-06 09:27:44 -04:00
Jonathan Drolet
2bf248bf60
Add TRACE_THREADS to CMake (#2934) 2021-05-08 08:18:08 -04:00
Wilson Snyder
bd602d0e2d Copyright year update 2021-01-01 10:29:54 -05:00
Wilson Snyder
8582aed66a Add --top option as alias of --top-module. 2020-12-05 16:58:17 -05:00
Yuri Victorovich
d07a6f81e4 Fix cmake-based verilated rebuilds (#2543) 2020-09-11 13:07:00 -04:00
Patrick Stewart
ef4f91ae5a
CMake: Unconditionally require C++11 or greater (#2522) 2020-08-28 00:01:47 -04:00
Geza Lore
d737266f64
Add OPT_GLOBAL to use for run-time library (#2373)
This allows compiling the run-time library with optimization even when OPT_FAST is not used in order to imporove model build speed, possibly during debug cycles.
2020-05-27 01:52:08 +01:00
Qingyao Sun
14643643c9
Fix compatibility problem with CMake policy CMP0025 (#2277)
Signed-off-by: Qingyao Sun <sunqingyao19970825@icloud.com>
2020-04-23 07:14:20 -04:00
Wilson Snyder
1ce360ed5b Add SPDX license identifiers. No functional change. 2020-03-21 11:24:24 -04:00
Wilson Snyder
f23fe8fd84 Update copyright year. 2020-01-06 18:05:53 -05:00
Patrick Stewart
1e4f471049 Add cmake support, bug1363.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2019-10-17 19:44:10 -04:00