Commit Graph

39 Commits

Author SHA1 Message Date
Martin Stadler d1462f3120
Fix cmake `-Wno` compiler flag testing (#6145) 2025-07-09 19:31:42 -04:00
Wilson Snyder 993f65f3b4 Internals/CI: Format cmakefiles using mbake 2025-06-26 17:36:56 -04:00
Wilson Snyder 3ecd58460f Internals: Apply make format-json format-yaml. No functional change. 2025-04-16 07:34:57 -04:00
Zhouyi Shen 3694d153ae
Fix backward compatibility for `TRACE` option & Fix missing C++ regeneration when Verilog files are updated (#5934) 2025-04-12 17:49:41 -04:00
Andrew Voznytsa 9367e85c88
Add ccache support for generated cmake files (#5926) (#5930) 2025-04-12 16:02:31 -04:00
Wilson Snyder fc8e1b5a2e Fix several cmake issues, including TRACE_VCD 2025-04-10 07:49:58 -04:00
Wilson Snyder 0984fd045f Change `--trace` to `--trace-vcd`. 2025-04-05 10:46:39 -04:00
Andrew Voznytsa 6a48d3bb83
Add `--make json` to enable integration with non-make/cmake build systems (#5799) 2025-03-11 19:57:21 -04:00
Mateusz Gancarz 9b4509f7d9
Add `--trace-saif` for SAIF power traces (#5812) 2025-03-07 10:41:29 -05:00
Wilson Snyder 8fbb725f34 Copyright year update. 2025-01-01 08:30:25 -05:00
Aidan McNay ece0613e09
Commentary: Fix CMake comments (#5545) 2024-10-17 16:39:51 -04:00
Wilson Snyder 6c61a9aff3 Support objcache when compiling Verilated files with cmake. 2024-09-24 20:55:11 -04:00
Wilson Snyder a4085f3a06 Internals: Standardize format of CMake files with gersemi. No functional change intended. 2024-09-24 20:43:19 -04:00
Geza Lore 97680656d3
Remove unknown '--' form cmake -E (#5073)
After #5063, with cmake 3.22.1, I get test failures, saying:
    cmake -E env: unknown option '--'
The '--' is necessary so removing.
2024-04-27 11:09:59 +01:00
Michael Bikovitsky 4202ec2ab2
Fix CMake builds to export VERILATOR_ROOT (#5063) 2024-04-26 19:29:10 -04:00
Wilson Snyder e76f29e5ba Copyright year update 2024-01-01 03:19:59 -05:00
Vito Gamberini 837d9f9d77
Require CMake config minimum version 3.13 (#4389) (#4390) 2023-07-26 17:54:18 -04:00
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