Zachary Snow [Wed, 20 Jan 2021 15:49:32 +0000 (08:49 -0700)]
verilog: allow spaces in macro arguments
Yosys Bot [Tue, 19 Jan 2021 00:10:05 +0000 (00:10 +0000)]
Bump version
whitequark [Mon, 18 Jan 2021 20:21:20 +0000 (20:21 +0000)]
Merge pull request #2547 from zachjs/plugin-so-dsym
Add plugin.so.dSYM to .gitignore
whitequark [Mon, 18 Jan 2021 20:20:52 +0000 (20:20 +0000)]
Merge pull request #2312 from antmicro/typedef-inout
Add support for user types in IOs
Zachary Snow [Mon, 18 Jan 2021 18:13:21 +0000 (11:13 -0700)]
Add plugin.so.dSYM to .gitignore
This artifact is automatically generated by the builtin clang on macOS
when -g is used.
Kamil Rakoczy [Wed, 8 Jul 2020 11:44:03 +0000 (13:44 +0200)]
Add typedef input/output test
Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
Kamil Rakoczy [Tue, 9 Jun 2020 07:53:00 +0000 (09:53 +0200)]
Fix input/output attributes when resolving typedef of wire
Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
Lukasz Dalek [Tue, 19 May 2020 15:13:04 +0000 (17:13 +0200)]
Parse package user type in module port list
Signed-off-by: Lukasz Dalek <ldalek@antmicro.com>
Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
Yosys Bot [Fri, 15 Jan 2021 00:10:05 +0000 (00:10 +0000)]
Bump version
Marcelina Kościelnicka [Thu, 14 Jan 2021 08:58:33 +0000 (09:58 +0100)]
opt_share: Fix X and CO signal width for shifted $alu in opt_share.
These need to be the same length as actual Y, not visible part of Y.
Fixes #2538.
Yosys Bot [Thu, 14 Jan 2021 00:10:05 +0000 (00:10 +0000)]
Bump version
Claire Xen [Wed, 13 Jan 2021 18:08:25 +0000 (19:08 +0100)]
Merge pull request #2537 from pepijndevos/spice
Add buffer option to spice backend
Pepijn de Vos [Wed, 13 Jan 2021 16:24:28 +0000 (17:24 +0100)]
add buffer option to spice backend
Yosys Bot [Tue, 5 Jan 2021 00:10:05 +0000 (00:10 +0000)]
Bump version
whitequark [Mon, 4 Jan 2021 14:04:17 +0000 (14:04 +0000)]
Merge pull request #2522 from tomverbeure/simlib_typos2
Fix some trivial typos.
Tom Verbeure [Mon, 4 Jan 2021 07:52:59 +0000 (23:52 -0800)]
Fix some trivial typos.
Yosys Bot [Sat, 2 Jan 2021 00:10:04 +0000 (00:10 +0000)]
Bump version
whitequark [Fri, 1 Jan 2021 09:49:00 +0000 (09:49 +0000)]
Merge pull request #2480 from YosysHQ/dave/nexus-lram
nexus: Add LRAM inference
whitequark [Fri, 1 Jan 2021 09:39:17 +0000 (09:39 +0000)]
Merge pull request #2512 from umarcor/plugin-err
plugin: enhance no-plugin error
whitequark [Fri, 1 Jan 2021 09:37:12 +0000 (09:37 +0000)]
Merge pull request #2515 from umarcor/fix/ghdl
makefile: fix GHDL vars, replace GHDL_DIR with GHDL_PREFIX
whitequark [Fri, 1 Jan 2021 09:32:26 +0000 (09:32 +0000)]
Merge pull request #2518 from zachjs/recursion
verilog: improved support for recursive functions
whitequark [Fri, 1 Jan 2021 09:31:49 +0000 (09:31 +0000)]
Merge pull request #2517 from zachjs/sv-tf-implied-direction
sv: complete support for implied task/function port directions
Zachary Snow [Fri, 1 Jan 2021 00:23:36 +0000 (17:23 -0700)]
verilog: improved support for recursive functions
Zachary Snow [Thu, 31 Dec 2020 23:14:35 +0000 (16:14 -0700)]
sv: complete support for implied task/function port directions
umarcor [Wed, 30 Dec 2020 06:06:52 +0000 (07:06 +0100)]
makefile: fix GHDL vars, replace GHDL_DIR with GHDL_PREFIX
Yosys Bot [Wed, 30 Dec 2020 00:10:06 +0000 (00:10 +0000)]
Bump version
umarcor [Mon, 28 Dec 2020 03:30:57 +0000 (04:30 +0100)]
plugin: enhance no-plugin error
whitequark [Tue, 29 Dec 2020 02:59:09 +0000 (02:59 +0000)]
Merge pull request #2509 from zachjs/issue-2427
Fix elaboration of whole memory words used as indices
whitequark [Tue, 29 Dec 2020 02:58:41 +0000 (02:58 +0000)]
Merge pull request #2514 from umarcor/feat/ghdl
makefile: add support for built-in ghdl-yosys-plugin
Yosys Bot [Tue, 29 Dec 2020 00:10:04 +0000 (00:10 +0000)]
Bump version
umarcor [Mon, 28 Dec 2020 01:24:41 +0000 (02:24 +0100)]
makefile: add support for built-in ghdl-yosys-plugin
Co-authored-by: Tristan Gingold <tgingold@free.fr>
Co-authored-by: whitequark <whitequark@whitequark.org>
whitequark [Mon, 28 Dec 2020 02:33:58 +0000 (02:33 +0000)]
Merge pull request #2511 from umarcor/feat/msys2-32
Update MSYS2 build system
whitequark [Mon, 28 Dec 2020 02:33:30 +0000 (02:33 +0000)]
Merge pull request #2507 from umarcor/fix/msys2
kernel/yosys.h: undef CONST on WIN32
umarcor [Sun, 27 Dec 2020 04:37:46 +0000 (05:37 +0100)]
makefile: rename msys2 to msys2-32, config PREFIX
umarcor [Sat, 26 Dec 2020 22:21:30 +0000 (23:21 +0100)]
kernel/yosys.h: undef CONST on WIN32
Yosys Bot [Mon, 28 Dec 2020 00:10:04 +0000 (00:10 +0000)]
Bump version
Claire Xen [Sun, 27 Dec 2020 15:33:58 +0000 (16:33 +0100)]
Merge pull request #2510 from YosysHQ/whitequark/CODEOWNERS-verilog-ast
CODEOWNERS: add @zachjs as Verilog/AST frontend owner
whitequark [Sun, 27 Dec 2020 05:00:04 +0000 (05:00 +0000)]
CODEOWNERS: add @zachjs as Verilog/AST frontend owner
Zachary Snow [Sun, 27 Dec 2020 04:38:13 +0000 (21:38 -0700)]
Fix elaboration of whole memory words used as indices
Yosys Bot [Sun, 27 Dec 2020 00:10:10 +0000 (00:10 +0000)]
Bump version
Miodrag Milanović [Sat, 26 Dec 2020 17:59:06 +0000 (18:59 +0100)]
Merge pull request #2506 from zachjs/const-arg-redeclare
Fix constants bound to redeclared function args
Zachary Snow [Sat, 26 Dec 2020 15:39:57 +0000 (08:39 -0700)]
Fix constants bound to redeclared function args
The changes in #2476 ensured that function inputs like `input x;`
retained their single-bit size when instantiated with a constant
argument and turned into a localparam. That change did not handle the
possibility for an input to be redeclared later on with an explicit
width, such as `integer x;`.
Yosys Bot [Thu, 24 Dec 2020 00:10:08 +0000 (00:10 +0000)]
Bump version
whitequark [Wed, 23 Dec 2020 23:36:13 +0000 (23:36 +0000)]
Merge pull request #2502 from ldoolitt/master
passes/pmgen/pmgen.py: trivial change to remove C++ compiler warnings
whitequark [Wed, 23 Dec 2020 23:15:56 +0000 (23:15 +0000)]
Merge pull request #2501 from zachjs/genrtlil-tern-sign
genrtlil: fix mux2rtlil generated wire signedness
whitequark [Wed, 23 Dec 2020 23:15:30 +0000 (23:15 +0000)]
Merge pull request #2476 from zachjs/const-arg-width
Fix constants bound to single bit arguments (fixes #2383)
Larry Doolittle [Wed, 23 Dec 2020 22:38:25 +0000 (14:38 -0800)]
passes/pmgen/pmgen.py: trivial change to remove C++ compiler warnings
Verified that the result still builds and passes self-tests
Zachary Snow [Wed, 23 Dec 2020 00:38:51 +0000 (17:38 -0700)]
genrtlil: fix mux2rtlil generated wire signedness
Yosys Bot [Wed, 23 Dec 2020 00:10:07 +0000 (00:10 +0000)]
Bump version
Zachary Snow [Sun, 6 Dec 2020 01:56:18 +0000 (18:56 -0700)]
Fix constants bound to single bit arguments (fixes #2383)
whitequark [Tue, 22 Dec 2020 12:00:38 +0000 (12:00 +0000)]
Merge pull request #2499 from whitequark/cxxrtl-fixes
cxxrtl: don't crash generating debug information for unused wires
whitequark [Tue, 22 Dec 2020 06:46:44 +0000 (06:46 +0000)]
cxxrtl: don't crash generating debug information for unused wires.
whitequark [Tue, 22 Dec 2020 06:15:04 +0000 (06:15 +0000)]
Merge pull request #2498 from StefanBruens/Fix_opt_lut
Fix use-after-free in LUT opt pass
whitequark [Tue, 22 Dec 2020 06:12:39 +0000 (06:12 +0000)]
Merge pull request #2497 from whitequark/cxxrtl-reflow
cxxrtl: completely rewrite netlist layout code
whitequark [Tue, 22 Dec 2020 00:07:45 +0000 (00:07 +0000)]
cxxrtl: split processes into sync and case nodes.
Similar to the treatment of black boxes, splitting processes into two
scheduling nodes adds sufficient freedom so that netlists with
well-behaved processes (e.g. those emitted by nMigen) can immediately
converge.
Because processes are not emitted into edge-triggered regions, this
approach has comparable performance to -O5 (without -noproc), which
is substantially slower than -O6.
whitequark [Mon, 21 Dec 2020 21:17:33 +0000 (21:17 +0000)]
kernel: undef Tcl macros interfering with cxxrtl.
whitequark [Mon, 21 Dec 2020 21:00:46 +0000 (21:00 +0000)]
cxxrtl: completely rewrite netlist layout code.
The exact shape of C++ code emitted by CXXRTL has a critical effect
on performance, both compile-time and runtime. CXXRTL's performance
greatly improved when it started localizing and inlining wires, not
only because this assists the optimizer and register allocator, but
also because inlining code into edge-triggered regions cuts the time
spent in eval() by at least a factor of two.
However, the logic of netlist layout has always been ad-hoc, fragile,
and very hard to understand and modify. After commit
ece25a45, which
introduced outlining, the same logic started being applied to two
distinct netlists at once instead of one, which barely worked.
This commit does four major changes:
* There is now a single unambiguous source of truth (per subgraph)
for the layout of any emitted wire.
* Netlist layout is now done entirely during analysis using well
known graph algorithms; no graph operations happen when emitting.
* Netlist layout now happens completely separately for eval() and
debug_eval() subgraphs.
* Unreachable (within subgraph scope) netlist nodes are now neither
emitted nor considered for wire inlining decisions.
The netlist layout code should also now closely match the described
semantics.
As a part of this large cleanup, it includes many miscellaneous
improvements:
* The "bare minimum" debug level introduced in commit
dd6a761d was
split into two levels; -g1 now emits debug information *only* for
inputs and state wires, and -g2 now emits debug information for
all public members. The old behavior matches -g2. This is done
to avoid bloat on low optimization levels.
* Debug aliases and inlined connections are now handled separately,
and complex RHS never interferes with inlined connections.
* Aliases to outlined wires now carry a pointer to the outline.
* Cell sync outputs can now be emitted in debug_eval().
* Black box debug information now includes comb/sync driver flags.
* The comment emitted for inlined cells is now accurate.
* Debug information statistics now has less noise.
* Netlist layout code is now much better documented.
Due to more precise inlining decisions, unmodified (i.e. with no
Yosys script being used) netlists now have much more logic inlined
into edge-triggered regions. On Minerva SoC SRAM, this improves
runtime by 20-25% across compilers and optimization levels.
Due to more precise reachability analysis, much less C++ code is now
emitted, especially at the maximum debug level. On Minerva SoC SRAM,
this improves clang compile time by 30-50% depending on options.
gcc is not affected.
StefanBruens [Tue, 22 Dec 2020 02:23:42 +0000 (03:23 +0100)]
Fix use-after-free in LUT opt pass
RTLIL::Module::remove(Cell* cell) calls `delete cell`.
Any subsequent accesses of `cell` then causes undefined behavior.
whitequark [Tue, 22 Dec 2020 01:31:25 +0000 (01:31 +0000)]
Merge pull request #2479 from zachjs/const-arg-hint
Allow constant function calls in constant function arguments
whitequark [Tue, 22 Dec 2020 01:30:29 +0000 (01:30 +0000)]
Merge pull request #2491 from zachjs/port-bind-sign
Sign extend port connections where necessary
Yosys Bot [Tue, 22 Dec 2020 00:10:05 +0000 (00:10 +0000)]
Bump version
whitequark [Mon, 21 Dec 2020 06:05:42 +0000 (06:05 +0000)]
cxxrtl: simplify logic choosing wire type. NFCI.
whitequark [Mon, 21 Dec 2020 06:04:10 +0000 (06:04 +0000)]
cxxrtl: clarify node use-def construction. NFCI.
whitequark [Mon, 21 Dec 2020 07:24:26 +0000 (07:24 +0000)]
cxxrtl: fix typo.
Marcelina Kościelnicka [Sat, 19 Dec 2020 17:14:06 +0000 (18:14 +0100)]
xilinx: Add some missing blackbox cells.
Marcelina Kościelnicka [Fri, 18 Dec 2020 19:51:26 +0000 (20:51 +0100)]
xilinx: Regenerate cells_xtra.v using Vivado 2020.2
whitequark [Mon, 21 Dec 2020 04:32:18 +0000 (04:32 +0000)]
Merge pull request #2496 from whitequark/cxxrtl-fixes
cxxrtl: various improvements
whitequark [Mon, 21 Dec 2020 02:15:55 +0000 (02:15 +0000)]
cxxrtl: speed up bit repeats (sign extends, etc).
On Minerva SoC SRAM, depending on the compiler, this change improves
overall time by 4-7%.
whitequark [Mon, 21 Dec 2020 00:22:50 +0000 (00:22 +0000)]
cxxrtl: speed up commits on clang.
On Minerva SoC SRAM compiled with clang-11, this change cuts commit
time in half (!) and overall time by 20%. When compiled with gcc-10,
there is no difference.
whitequark [Sun, 20 Dec 2020 14:48:16 +0000 (14:48 +0000)]
cxxrtl: use `static inline` instead of `inline` in the C API.
In C, non-static inline functions require an implementation elsewhere
(even though the body is right there in the header). It is basically
never desirable to use those as opposed to static inline ones.
Yosys Bot [Sun, 20 Dec 2020 00:10:10 +0000 (00:10 +0000)]
Bump version
whitequark [Sat, 19 Dec 2020 04:14:31 +0000 (04:14 +0000)]
Merge pull request #2487 from whitequark/cxxrtl-outlining
CXXRTL: implement zero-cost full coverage debug information through the magic✨ of outlining🪄🎀🧹
Zachary Snow [Fri, 18 Dec 2020 19:59:08 +0000 (12:59 -0700)]
Sign extend port connections where necessary
- Signed cell outputs are sign extended when bound to larger wires
- Signed connections are sign extended when bound to larger cell inputs
- Sign extension is performed in hierarchy and flatten phases
- genrtlil indirects signed constants through signed wires
- Other phases producing RTLIL may need to be updated to preserve
signedness information
- Resolves #1418
- Resolves #2265
Yosys Bot [Fri, 18 Dec 2020 00:10:05 +0000 (00:10 +0000)]
Bump version
Marcelina Kościelnicka [Wed, 16 Dec 2020 23:24:48 +0000 (00:24 +0100)]
xilinx: Add FDDRCPE and FDDRRSE blackbox cells.
These are necessary primitives for proper DDR support on Virtex 2 and
Spartan 3.
whitequark [Tue, 15 Dec 2020 03:46:06 +0000 (03:46 +0000)]
cxxrtl: print names of cells inlined in connections.
whitequark [Sun, 13 Dec 2020 18:16:55 +0000 (18:16 +0000)]
cxxrtl: disable optimization of debug_items().
Implementing outlining has greatly increased the amount of debug
information in a typical build, and consequently exposed performance
issues in C++ compilers, which are similar for both GCC and Clang;
the compile time of Minerva SoC SRAM increased almost twofold.
Although one would expect the slowdown to be caused by the increased
use of templates in `debug_eval()`, it is actually almost entirely
attributable to optimizations and codegen for `debug_items()`.
Fortunately, it is neither possible nor desirable to optimize
`debug_items()`: in most cases it is called exactly once, and its
body is a linear sequence of calls with unique arguments.
This commit turns off optimizations for `debug_items()` on GCC and
Clang, improving -Os compile time of Minerva SoC SRAM by ~40% (!)
whitequark [Sun, 13 Dec 2020 15:33:47 +0000 (15:33 +0000)]
cxxrtl: make alias analysis outlining-aware.
Before this commit, if a sequence of wires assigned in a chain would
terminate on a cell, none of the wires would get marked as aliases,
and typically all of the public wires would get outlined. The reason
for this behavior is that alias analysis predates outlining and in
fact runs before it.
After this commit, alias analysis runs after outlining and considers
outlined wires valid aliasees. More importantly, if the chained wires
contain any valid aliasees, then all of the wires are aliased to
the one that is topologically deepest.
Aliased wires incur virtually no overhead for the VCD writer, unlike
outlined wires that would otherwise take their place. On Minerva SoC
SRAM, size of the full VCD dump is reduced by ~65%, and throughput
is increased by ~55%.
Yosys Bot [Tue, 15 Dec 2020 00:10:06 +0000 (00:10 +0000)]
Bump version
Marcelina Kościelnicka [Mon, 14 Dec 2020 17:14:42 +0000 (18:14 +0100)]
timinginfo: Error instead of segfault on const signals.
Reported by @Ravenslofty
whitequark [Sun, 13 Dec 2020 07:44:27 +0000 (07:44 +0000)]
cxxrtl: add a "bare minimum" debug information level.
Useful to reduce overhead when no debug capabilities are necessary
except for access to design state.
whitequark [Sun, 13 Dec 2020 07:03:16 +0000 (07:03 +0000)]
cxxrtl: implement debug information outlining.
Aggressive wire localization and inlining is necessary for CXXRTL to
achieve high performance. However, that comes with a cost: reduced
debug information coverage. Previously, as a workaround, the `-Og`
option could have been used to guarantee complete coverage, at a cost
of a significant performance penalty.
This commit introduces debug information outlining. The main eval()
function is compiled with the user-specified optimization settings.
In tandem, an auxiliary debug_eval() function, compiled from the same
netlist, can be used to reconstruct the values of localized/inlined
signals on demand. To the extent that it is possible, debug_eval()
reuses the results of computations performed by eval(), only filling
in the missing values.
Benchmarking a representative design (Minerva SoC SRAM) shows that:
* Switching from `-O4`/`-Og` to `-O6` reduces runtime by ~40%.
* Switching from `-g1` to `-g2`, both used with `-O6`, increases
compile time by ~25%.
* Although `-g2` increases the resident size of generated modules,
this has no effect on runtime.
Because the impact of `-g2` is minimal and the benefits of having
unconditional 100% debug information coverage (and the performance
improvement as well) are major, this commit removes `-Og` and changes
the defaults to `-O6 -g2`.
We'll have our cake and eat it too!
whitequark [Sun, 13 Dec 2020 00:34:32 +0000 (00:34 +0000)]
cxxrtl: rename "elision" to "inlining". NFC.
"Elision" in this context is an unusual and not very descriptive term
whereas "inlining" is common and straightforward. Also, introducing
"inlining" makes it easier to introduce its dual under the obvious
name "outlining".
whitequark [Sat, 12 Dec 2020 20:24:53 +0000 (20:24 +0000)]
cxxrtl: fix outdated comment. NFC.
whitequark [Sun, 13 Dec 2020 00:54:12 +0000 (00:54 +0000)]
cxxrtl: use IdString::isPublic(). NFC.
Yosys Bot [Sun, 13 Dec 2020 00:10:07 +0000 (00:10 +0000)]
Bump version
whitequark [Sat, 12 Dec 2020 20:50:37 +0000 (20:50 +0000)]
kernel: make IdString::isPublic() const.
whitequark [Sat, 12 Dec 2020 19:55:57 +0000 (19:55 +0000)]
Merge pull request #2485 from whitequark/cxxrtl-cell-input-buffering
cxxrtl: don't overwrite buffered inputs
whitequark [Fri, 11 Dec 2020 23:30:32 +0000 (23:30 +0000)]
cxxrtl: don't overwrite buffered inputs.
Before this commit, a cell's input was always assigned like:
p_cell.p_input = (value...);
If `p_input` is buffered (e.g. if the design is built at -O0), this
is not correct. (In practice, this breaks clocking.) Unfortunately,
the incorrect design was compiled without diagnostics because wire<>
was move-assignable and also implicitly constructible from value<>.
After this commit, cell inputs are no longer incorrectly assumed to
always be unbuffered, and wires are not assignable from values.
Yosys Bot [Thu, 10 Dec 2020 00:10:10 +0000 (00:10 +0000)]
Bump version
Miodrag Milanović [Wed, 9 Dec 2020 10:19:30 +0000 (11:19 +0100)]
Merge pull request #2483 from YosysHQ/pmgen_nice_error
Return nice error in pmgen generated code, fixes #2482
Miodrag Milanovic [Wed, 9 Dec 2020 10:06:22 +0000 (11:06 +0100)]
Return nice error in pmgen generated code, fixes #2482
Yosys Bot [Wed, 9 Dec 2020 00:10:04 +0000 (00:10 +0000)]
Bump version
whitequark [Tue, 8 Dec 2020 07:32:11 +0000 (07:32 +0000)]
Merge pull request #2478 from whitequark/improve-bugpoint
bugpoint: various improvements
Zachary Snow [Mon, 7 Dec 2020 20:52:44 +0000 (13:52 -0700)]
Allow constant function calls in constant function arguments
David Shah [Mon, 7 Dec 2020 13:27:17 +0000 (13:27 +0000)]
nexus: Add LRAM inference
Signed-off-by: David Shah <dave@ds0.me>
whitequark [Mon, 7 Dec 2020 09:24:35 +0000 (09:24 +0000)]
bugpoint: add -wires option.
whitequark [Mon, 7 Dec 2020 08:27:25 +0000 (08:27 +0000)]
bugpoint: try to remove whole processes first.
whitequark [Mon, 7 Dec 2020 08:23:32 +0000 (08:23 +0000)]
bugpoint: accept quoted strings in -grep.
whitequark [Mon, 7 Dec 2020 08:42:45 +0000 (08:42 +0000)]
bugpoint: add -command option.