Commit Graph

38 Commits

Author SHA1 Message Date
Wilson Snyder 0984fd045f Change `--trace` to `--trace-vcd`. 2025-04-05 10:46:39 -04:00
Wilson Snyder d5077a9d35 Commentary (#5919) 2025-04-05 09:45:07 -04:00
Wilson Snyder 844448655e Add `systemc_header_post 2025-03-28 22:40:21 -04:00
Wilson Snyder b4ef6ce860 Support `systemc_interface and related inside `class`. 2025-03-28 22:40:21 -04:00
Wilson Snyder 781bd3cc09 Commentary: Changes update 2025-03-09 13:15:53 -04:00
Geza Lore d9701e6406
Automatically split some packed variables (#5843)
This patch adds a heuristic to V3SplitVar, and it attempts to split up
packed variables that are only referenced via constant index,
non-overlapping bit/range selects. This can eliminate some UNOPTFLAT cases.
2025-03-09 10:31:01 -04:00
Wilson Snyder 8fbb725f34 Copyright year update. 2025-01-01 08:30:25 -05:00
Wilson Snyder 28718f964a
Fix tracing replicated hierarchical models (#5027) (#5029) 2024-03-30 16:00:52 -04:00
Wilson Snyder 91dd3c5fac Support 1800-2023 keywords. 2024-03-02 10:15:19 -05:00
Wilson Snyder d6f8ccd20b Add `unroll_disable` and `unroll_full` loop control metacomments (#3260). 2024-01-26 07:49:07 -05:00
Wilson Snyder e76f29e5ba Copyright year update 2024-01-01 03:19:59 -05:00
Wilson Snyder e5118661a7 Commentary 2023-11-24 13:02:05 -05:00
Wilson Snyder b68f101e81 Support preprocessing __LINE__ 2023-09-17 19:49:38 -04:00
Wilson Snyder b778784333 Add --annotate-points option, change multipoint on line reporting (#3876). 2023-02-08 20:22:54 -05:00
Joseph Nwabueze c8be50d40b
Add /*verilator public[flat|flat_rd|flat_rw| ]*/ metacomments (#3894) 2023-02-03 08:47:55 -05:00
Wilson Snyder b24d7c83d3 Copyright year update 2023-01-01 10:18:39 -05:00
Wilson Snyder b6cdae30f6 docs: Fix grammar. 2022-12-10 20:09:47 -05:00
Wilson Snyder a0e7930036 docs: Fix spelling 2022-12-09 22:39:41 -05:00
Wilson Snyder d61ad04f32 docs: Fix and test for AsciiDoc breaks (#3728) 2022-12-09 21:01:33 -05:00
Wilson Snyder 749aab0a56 Support triple-quote blocks. 2022-11-17 20:38:01 -05:00
Wilson Snyder e8a1e4745c Support $stacktrace 2022-11-17 19:12:54 -05:00
Wilson Snyder 3c77c7bb92 Support and 2022-11-16 21:10:54 -05:00
Wilson Snyder 63df87e220 Commentary 2022-10-22 12:18:28 -04:00
Wilson Snyder 22ce36012e Add VERILATOR_TIMING define (#3684) 2022-10-17 18:18:56 -04:00
Wilson Snyder 550a5111b7 Commentary 2022-09-20 20:28:43 -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 599d23697d
IEEE compliant scheduler (#3384)
This is a major re-design of the way code is scheduled in Verilator,
with the goal of properly supporting the Active and NBA regions of the
SystemVerilog scheduling model, as defined in IEEE 1800-2017 chapter 4.

With this change, all internally generated clocks should simulate
correctly, and there should be no more need for the `clock_enable` and
`clocker` attributes for correctness in the absence of Verilator
generated library models (`--lib-create`).

Details of the new scheduling model and algorithm are provided in
docs/internals.rst.

Implements #3278
2022-05-15 16:03:32 +01:00
Wilson Snyder c2328ef46a Spelling fixes. 2022-05-14 16:12:57 -04:00
Wilson Snyder e02f97854c Deprecate 'vluint64_t' and similar types (#3255). 2022-03-27 15:27:40 -04:00
Larry Doolittle 72a3c756ad
Commentary: Minor spelling fixes in docs/guide/*.rst (#3327) 2022-02-27 10:01:44 +00:00
Geza Lore f8c0169e82 Implement 'forceable' attribute
Using the 'forceable' directive in a configuration file, or the /*
verilator forceable */ metacomment on a variable declaration will
generate additional public signals that allow the specified signals to
be forced/released from the C++ code.
2022-01-16 15:31:37 +00:00
Wilson Snyder ca42be982c Copyright year update. 2022-01-01 08:26:40 -05:00
Wilson Snyder 04e0c7e4f1 Support tracing through --hierarchical/--lib-create libraries (#3200). 2021-11-27 17:07:27 -05:00
Wilson Snyder cff9f8143e Commentary 2021-11-17 07:06:43 -05:00
Wilson Snyder 4ef37d9411 Commentary 2021-10-25 19:53:41 -04:00
Geza Lore 60d5f0e86b
Emit model implementation as loose methods. (#3006)
This patch introduces the concept of 'loose' methods, which semantically
are methods, but are declared as global functions, and are passed an
explicit 'self' pointer. This enables these methods to be declared
outside the class, only when they are needed, therefore removing the
header dependency. The bulk of the emitted model implementation now uses
loose methods.
2021-06-13 14:33:11 +01:00
Wilson Snyder ac26d5889f Fix whitespace 2021-04-11 22:22:43 -04:00
Wilson Snyder adce7ecf4b Documentation has been rewritten into a book format. 2021-04-11 18:55:06 -04:00