aboutsummaryrefslogtreecommitdiffstats
path: root/backends/cxxrtl/cxxrtl.cc
Commit message (Collapse)AuthorAgeFilesLines
* cxxrtl: provide attributes to black box factories, too.whitequark2020-04-191-39/+47
| | | | | | | | | Both parameters and attributes are necessary because the parameters have to be the same between every instantiation of the cell, but attributes may well vary. For example, for an UART PHY, the type of the PHY (tty, pty, socket) would be a parameter, but configuration of the implementation specified by the type (socket address) would be an attribute.
* cxxrtl: add templated black box support.whitequark2020-04-181-16/+193
|
* cxxrtl: make eval() and commit() inline in blackboxes.whitequark2020-04-181-82/+103
| | | | | This change is a preparation for template blackboxes. It has no effect on current generated code.
* cxxrtl: add simple black box support.whitequark2020-04-181-70/+258
| | | | | | | This commit adds support for replacing RTLIL modules with CXXRTL black boxes. Black box port widths may not depend on the parameters with which it is instantiated (yet); the parameters may only be used to change the behavior of the black box.
* cxxrtl: use ID::X instead of ID(X). NFC.whitequark2020-04-181-107/+107
|
* cxxrtl: correctly handle `sync always` rules.whitequark2020-04-171-3/+13
| | | | Fixes #1948.
* cxxrtl: make ROMs writable, document memory::operator[].whitequark2020-04-161-2/+1
| | | | | | | | | | | There is no practical benefit from using `const memory` for ROMs; it uses an std::vector internally, which prevents contemporary compilers from constant-propagating ROM contents. (It is not clear whether they are permitted to do so.) However, there is a major benefit from using non-const `memory` for ROMs, which is the ability to dynamically fill the ROM for each individual simulation.
* cxxrtl: fix misleading example, caution about race conditions.whitequark2020-04-161-4/+13
| | | | Fixes #1944.
* cxxrtl: remove inaccurate comment. NFC.whitequark2020-04-161-2/+0
|
* cxxrtl: Fix handling of unclocked memory read portsDavid Shah2020-04-141-2/+3
| | | | Signed-off-by: David Shah <dave@ds0.me>
* Merge pull request #1922 from whitequark/write_cxxrtl-disconnected-outputswhitequark2020-04-141-0/+2
|\ | | | | write_cxxrtl: ignore disconnected module ports
| * write_cxxrtl: ignore disconnected module ports.whitequark2020-04-141-0/+2
| | | | | | | | | | | | E.g. port `q` in `submod x(.p(p), .q());`. Fixes #1920.
* | write_cxxrtl: enable separate compilation.whitequark2020-04-141-9/+81
|/ | | | | | This commit makes it possible to use several cxxrtl-generated files in one application, as well as compiling cxxrtl-generated code as a separate compilation unit.
* write_cxxrtl: add basic documentation.whitequark2020-04-091-1/+16
|
* write_cxxrtl: add support for $dlatch and $dlatchsr cells.whitequark2020-04-091-3/+16
| | | | Also, fix codegen for $dffe and $adff.
* write_cxxrtl: add support for $sr cell.whitequark2020-04-091-27/+35
| | | | | | Also, fix the semantics of SET/CLR inputs of the $dffsr cell, and fix the scheduling of async FF cells to consider ARST/SET/CLR->Q as a forward combinatorial arc.
* write_cxxrtl: add support for $slice and $concat cells.whitequark2020-04-091-1/+16
|
* write_cxxrtl: improve writable memory handling.whitequark2020-04-091-26/+23
| | | | | | This commit reduces space and time overhead for writable memories to O(write port count) in both cases; implements handling for write port priorities; and simplifies runtime representation of memories.
* write_cxxrtl: add support for hierarchical designs.whitequark2020-04-091-18/+107
| | | | | | | | | | | Hierarchical design simulations are generally much slower, but this comes with a major increase in flexibility: 1. Since the `flatten` pass currently does not support flattening of designs with processes, this is the only way to simulate such designs with cxxrtl. 2. Support for hierarchy paves way for simulation black boxes, which are necessary for e.g. replacing PHYs with C++ code that integrates with the host system.
* write_cxxrtl: avoid undefined behavior on out-of-bounds memory access.whitequark2020-04-091-38/+65
| | | | | | | | | | After this commit, if NDEBUG is not defined, out-of-bounds accesses cause assertion failures for reads and writes. If NDEBUG is defined, out-of-bounds reads return zeroes, and out-of-bounds writes are ignored. This commit also adds support for memories that start with a non-zero index (`Memory::start_offset` in RTLIL).
* write_cxxrtl: statically schedule comb logic and localize wires.whitequark2020-04-091-68/+364
| | | | | | This results in further massive gains in performance, modest decrease in compile time, and, for designs without feedback arcs, makes it possible to run eval() once per clock edge in certain conditions.
* write_cxxrtl: elide wires for results of comb cells used once.whitequark2020-04-091-35/+359
| | | | | This results in massive gains in performance, equally massive reduction in compile time, and improved readability.
* write_cxxrtl: new backend.whitequark2020-04-091-0/+904
This commit adds a basic implementation that isn't very performant but implements most of the planned features.