yosys.git
4 years agocxxrtl: add (*cxxrtl.{comb,sync}*) annotations on black box outputs.
whitequark [Tue, 21 Apr 2020 21:48:17 +0000 (21:48 +0000)]
cxxrtl: add (*cxxrtl.{comb,sync}*) annotations on black box outputs.

If the annotations are not used, this commit does not alter semantics
at all, other than removing elision of outputs of black box cells.
(Elision of such outputs is expected to be too rare to have any
noticeable benefit, and the implementation was somewhat of a hack.)

The (* cxxrtl.comb *) annotation alters the semantics of the output
of the black box it is applied to such that, if the black box
converges immediately, no additional delta cycle is necessary to
propagate the computed combinatorial value upwards in hierarchy.

The (* cxxrtl.sync *) annotation alters the semantics of the output
of the black box it is applied to such as to remove any uses of
the black box by the wires connected to this output, and break false
feedback arcs arising from conservative modeling of dependencies of
the black box.

Although currently these attributes are only recognized on black
boxes, if separate compilation is added in the future, it could also
emit and consume them.

4 years agocxxrtl: s/sync_{wire,type}/edge_{wire,type}/. NFC.
whitequark [Tue, 21 Apr 2020 18:46:36 +0000 (18:46 +0000)]
cxxrtl: s/sync_{wire,type}/edge_{wire,type}/. NFC.

The attribute for this is called (* cxxrtl.edge *), and there is
a planned attribute (* cxxrtl.sync *) that would cause blackbox
cell outputs to be added to sync defs rather than comb defs.
Rename the edge detector related stuff to avoid confusion.

4 years agocxxrtl: use one delta cycle for immediately converging netlists.
whitequark [Tue, 21 Apr 2020 15:51:09 +0000 (15:51 +0000)]
cxxrtl: use one delta cycle for immediately converging netlists.

If it is statically known that eval() will converge in one delta
cycle (that is, the second commit() will always return `false`)
because the design contains no feedback or buffered wires, then
there is no need to run the second delta cycle at all.

After this commit, the case where eval() always converges immediately
is detected and the second delta cycle is omitted. As a result,
Minerva SRAM SoC runs ~25% faster.

4 years agocxxrtl: add -O6, a shortcut for running `proc; flatten`.
whitequark [Tue, 21 Apr 2020 15:33:12 +0000 (15:33 +0000)]
cxxrtl: add -O6, a shortcut for running `proc; flatten`.

People judge a compiler backend by the first impression, and
the metric they judge it for is speed. -O6 does severely impact
debuggability, but it provides equally massive gains in performance,
so use it by default.

4 years agocxxrtl: unbuffer module input wires.
whitequark [Tue, 21 Apr 2020 14:49:36 +0000 (14:49 +0000)]
cxxrtl: unbuffer module input wires.

Module input wires are never set by the module, so it is unnecessary
to buffer them. Although important for all inputs, this is especially
critical for clocks, since after this commit, hierarchy levels no
longer add delta cycles. As a result, Minerva SRAM SoC runs ~73%
faster when flattened, and ~264% (!!) faster when hierarchical.

4 years agocxxrtl: simplify generated edge detection logic.
whitequark [Tue, 21 Apr 2020 13:59:42 +0000 (13:59 +0000)]
cxxrtl: simplify generated edge detection logic.

This commit changes the way edge detectors are represented in
generated code from a variable that is set in commit() and reset in
eval() to a function that considers .curr and .next of the clock
wire. Behavior remains the same. Besides being simpler to generate
and providing more opportunities for optimization, this commit paves
way for unbuffering module inputs.

4 years agocxxrtl: localize wires with multiple comb drivers, too.
whitequark [Tue, 21 Apr 2020 13:33:42 +0000 (13:33 +0000)]
cxxrtl: localize wires with multiple comb drivers, too.

Before this commit, any wire that was not driven by an output port of
exactly one comb cell would not be localized, even if there were no
feedback arcs through that wire. This would cause the wire to become
buffered and require (often quite a few) extraneous delta cycles
during evaluation. To alleviate this problem, -O5 was running
`splitnets -driver`.

However, this solution was mistaken. Because `splitnets -driver`
followed by `opt_clean -purge` would produce more nets with multiple
drivers, it would have to be iterated to fixpoint. Moreover, even if
this was done, it would not be sufficient because `opt_clean -purge`
does not currently remove wires with the `\init` attribute (and it
is not desirable to remove such wires, since they correspond to
registers and may be useful for debugging).

The proper solution is to consider the condition in which a wire
may be localized. Specifically, if there are no feedback arcs through
this wire, and no part of the wire is driven by an output of a sync
cell, then the wire holds no state and is localizable.

After this commit, the original condition for not localizing a wire
is replaced by a check for any sync cell driving it. This makes it
unnecessary to run `splitnets -driver` in the majority of cases
to get a design with no buffered wires, and -O5 no longer includes
that pass. As a result, Minerva SRAM SoC no longer has any buffered
wires, and runs ~27% faster.

In addition, this commit prepares the flow graph for introduction
of sync outputs of black boxes.

Co-authored-by: Jean-François Nguyen <jf@lambdaconcept.com>
4 years agocxxrtl: detect buffered comb wires, not just feedback wires.
whitequark [Mon, 20 Apr 2020 16:44:51 +0000 (16:44 +0000)]
cxxrtl: detect buffered comb wires, not just feedback wires.

Any buffered combinatorial wires (including, as a subset, feedback
wires) will prevent the design from always converging in one delta
cycle. Before this commit, only feedback wires were detected. After
this commit, any buffered combinatorial wires, including feedback
wires, are detected.

Co-authored-by: Jean-François Nguyen <jf@lambdaconcept.com>
4 years agoMerge pull request #1961 from whitequark/paramod-original-name
whitequark [Tue, 21 Apr 2020 01:43:20 +0000 (01:43 +0000)]
Merge pull request #1961 from whitequark/paramod-original-name

ast, rpc: record original name of $paramod\* as \hdlname attribute

4 years agotests: remove write_ilang
Eddie Hung [Mon, 20 Apr 2020 22:42:29 +0000 (15:42 -0700)]
tests: remove write_ilang

4 years agoMerge pull request #1972 from YosysHQ/eddie/bug1970
Eddie Hung [Mon, 20 Apr 2020 18:39:13 +0000 (11:39 -0700)]
Merge pull request #1972 from YosysHQ/eddie/bug1970

 abc9_ops: -prep_lut to be more robust

4 years agoabc9: -prep_lut to be more robust
Eddie Hung [Mon, 20 Apr 2020 16:39:35 +0000 (09:39 -0700)]
abc9: -prep_lut to be more robust

4 years agoabc9: add testcase reduced from #1970
Eddie Hung [Mon, 20 Apr 2020 16:38:29 +0000 (09:38 -0700)]
abc9: add testcase reduced from #1970

4 years agoMerge pull request #1964 from YosysHQ/claire/sformatf
Claire Wolf [Mon, 20 Apr 2020 12:51:40 +0000 (14:51 +0200)]
Merge pull request #1964 from YosysHQ/claire/sformatf

Extend support for format strings in Verilog front-end

4 years agoMerge pull request #1967 from whitequark/cxxrtl-blackbox-attributes
whitequark [Sun, 19 Apr 2020 19:59:42 +0000 (19:59 +0000)]
Merge pull request #1967 from whitequark/cxxrtl-blackbox-attributes

cxxrtl: provide attributes to black box factories, too

4 years agocxxrtl: provide attributes to black box factories, too.
whitequark [Sun, 19 Apr 2020 16:22:02 +0000 (16:22 +0000)]
cxxrtl: provide attributes to black box factories, too.

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.

4 years agoExtend support for format strings in Verilog front-end
Claire Wolf [Sat, 18 Apr 2020 12:08:51 +0000 (14:08 +0200)]
Extend support for format strings in Verilog front-end

Signed-off-by: Claire Wolf <claire@symbioticeda.com>
4 years agoMerge pull request #1963 from whitequark/cxxrtl-blackboxes
whitequark [Sat, 18 Apr 2020 09:21:14 +0000 (09:21 +0000)]
Merge pull request #1963 from whitequark/cxxrtl-blackboxes

cxxrtl: add support for simple and templated C++ black boxes

4 years agocxxrtl: add templated black box support.
whitequark [Sat, 18 Apr 2020 08:04:57 +0000 (08:04 +0000)]
cxxrtl: add templated black box support.

4 years agocxxrtl: make eval() and commit() inline in blackboxes.
whitequark [Sat, 18 Apr 2020 02:14:20 +0000 (02:14 +0000)]
cxxrtl: make eval() and commit() inline in blackboxes.

This change is a preparation for template blackboxes. It has no
effect on current generated code.

4 years agocxxrtl: add simple black box support.
whitequark [Fri, 17 Apr 2020 01:41:08 +0000 (01:41 +0000)]
cxxrtl: add simple black box support.

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.

4 years agocxxrtl: use ID::X instead of ID(X). NFC.
whitequark [Wed, 15 Apr 2020 17:39:14 +0000 (17:39 +0000)]
cxxrtl: use ID::X instead of ID(X). NFC.

4 years agoast, rpc: record original name of $paramod\* as \hdlname attribute.
whitequark [Sat, 18 Apr 2020 03:43:15 +0000 (03:43 +0000)]
ast, rpc: record original name of $paramod\* as \hdlname attribute.

The $paramod name mangling is not invertible (the \ character, which
separates the module name from the parameters, is valid in the module
name itself), which does not stop people from trying to invert it.

This commit makes it easy to invert the name mangling by storing
the original name explicitly, and fixes the firrtl backend to use
the newly introduced attribute.

4 years agoMerge pull request #1955 from whitequark/cxxrtl-sync_always
whitequark [Fri, 17 Apr 2020 21:36:59 +0000 (21:36 +0000)]
Merge pull request #1955 from whitequark/cxxrtl-sync_always

cxxrtl: correctly handle `sync always` rules

4 years agoMerge pull request #1952 from boqwxp/add_edge_location
whitequark [Fri, 17 Apr 2020 18:57:00 +0000 (18:57 +0000)]
Merge pull request #1952 from boqwxp/add_edge_location

Verilog frontend: add source location in more parser rules

4 years agocxxrtl: correctly handle `sync always` rules.
whitequark [Fri, 17 Apr 2020 09:43:13 +0000 (09:43 +0000)]
cxxrtl: correctly handle `sync always` rules.

Fixes #1948.

4 years agoMerge pull request #1954 from YosysHQ/dave/fix-stdout-conflict
whitequark [Fri, 17 Apr 2020 09:07:49 +0000 (09:07 +0000)]
Merge pull request #1954 from YosysHQ/dave/fix-stdout-conflict

qbfsat: Fix illegal use of 'stdout' identifier

4 years agoMerge pull request #1951 from whitequark/rtlil-string_attribute
whitequark [Fri, 17 Apr 2020 09:06:40 +0000 (09:06 +0000)]
Merge pull request #1951 from whitequark/rtlil-string_attribute

rtlil: add AttrObject::{get,set}_string_attribute, AttrObject::has_attribute

4 years agoqbfsat: Fix illegal use of 'stdout' identifier
David Shah [Fri, 17 Apr 2020 07:42:39 +0000 (08:42 +0100)]
qbfsat: Fix illegal use of 'stdout' identifier

Signed-off-by: David Shah <dave@ds0.me>
4 years agoSet Verilog source location for explicit blocks (`begin` ... `end`).
Alberto Gonzalez [Fri, 17 Apr 2020 06:23:03 +0000 (06:23 +0000)]
Set Verilog source location for explicit blocks (`begin` ... `end`).

4 years agoAdd Verilog source location information to `AST_POSEDGE` and `AST_NEGEDGE` nodes.
Alberto Gonzalez [Fri, 17 Apr 2020 06:16:59 +0000 (06:16 +0000)]
Add Verilog source location information to `AST_POSEDGE` and `AST_NEGEDGE` nodes.

4 years agoMerge pull request #1898 from boqwxp/locations
whitequark [Fri, 17 Apr 2020 02:27:13 +0000 (02:27 +0000)]
Merge pull request #1898 from boqwxp/locations

Verilog frontend: add location information to parsed constants

4 years agoMerge pull request #1864 from boqwxp/cleanup_techmap_abc
whitequark [Fri, 17 Apr 2020 02:25:18 +0000 (02:25 +0000)]
Merge pull request #1864 from boqwxp/cleanup_techmap_abc

Clean up pseudo-private member usage and simplify `passes/techmap/abc.cc`

4 years agoMerge pull request #1888 from boqwxp/cleanup_scatter
whitequark [Fri, 17 Apr 2020 02:21:23 +0000 (02:21 +0000)]
Merge pull request #1888 from boqwxp/cleanup_scatter

Clean up `passes/cmds/scatter.cc`.

4 years agoMerge pull request #1882 from boqwxp/cleanup_rename
whitequark [Fri, 17 Apr 2020 02:20:54 +0000 (02:20 +0000)]
Merge pull request #1882 from boqwxp/cleanup_rename

Clean up pseudo-private member usage in `passes/cmds/rename.cc`.

4 years agoMerge pull request #1929 from YosysHQ/eddie/select_unset
whitequark [Thu, 16 Apr 2020 22:09:25 +0000 (22:09 +0000)]
Merge pull request #1929 from YosysHQ/eddie/select_unset

select: add select -unset option

4 years agortlil: add AttrObject::has_attribute.
whitequark [Thu, 16 Apr 2020 21:49:49 +0000 (21:49 +0000)]
rtlil: add AttrObject::has_attribute.

4 years agortlil: add AttrObject::{get,set}_string_attribute.
whitequark [Thu, 16 Apr 2020 21:43:03 +0000 (21:43 +0000)]
rtlil: add AttrObject::{get,set}_string_attribute.

And make {get,set}_src_attribute use those functions.

4 years agoMerge pull request #1947 from whitequark/cxxrtl-usability
whitequark [Thu, 16 Apr 2020 21:28:13 +0000 (21:28 +0000)]
Merge pull request #1947 from whitequark/cxxrtl-usability

cxxrtl: minor documentation and usability improvements

4 years agoAdd location information to `AST_CONSTANT` nodes.
Alberto Gonzalez [Fri, 10 Apr 2020 22:37:36 +0000 (22:37 +0000)]
Add location information to `AST_CONSTANT` nodes.

4 years agoUse `dict` instead of `std::map`.
Alberto Gonzalez [Tue, 14 Apr 2020 00:35:47 +0000 (00:35 +0000)]
Use `dict` instead of `std::map`.

Co-Authored-By: Eddie Hung <eddie@fpgeh.com>
4 years agoRevert to `stringf()` rather than stringstreams.
Alberto Gonzalez [Thu, 9 Apr 2020 19:31:12 +0000 (19:31 +0000)]
Revert to `stringf()` rather than stringstreams.

4 years agoClean up pseudo-private member usage in `passes/cmds/rename.cc`.
Alberto Gonzalez [Wed, 8 Apr 2020 07:22:10 +0000 (07:22 +0000)]
Clean up pseudo-private member usage in `passes/cmds/rename.cc`.

4 years agoReplace `std::map` with `dict`.
Alberto Gonzalez [Mon, 13 Apr 2020 19:37:01 +0000 (19:37 +0000)]
Replace `std::map` with `dict`.

Co-Authored-By: Eddie Hung <eddie@fpgeh.com>
4 years agoReplace pseudo-private member access to `connections_` in `passes/cmds/scatter.cc`.
Alberto Gonzalez [Thu, 9 Apr 2020 23:55:24 +0000 (23:55 +0000)]
Replace pseudo-private member access to `connections_` in `passes/cmds/scatter.cc`.

Co-Authored-By: N. Engelhardt <nak@symbioticeda.com>
4 years agoClean up `passes/cmds/scatter.cc`.
Alberto Gonzalez [Thu, 9 Apr 2020 05:34:28 +0000 (05:34 +0000)]
Clean up `passes/cmds/scatter.cc`.

4 years agotests: add select -unset tests
Eddie Hung [Tue, 14 Apr 2020 17:58:51 +0000 (10:58 -0700)]
tests: add select -unset tests

4 years agoselect: add select -unset option
Eddie Hung [Tue, 14 Apr 2020 17:58:42 +0000 (10:58 -0700)]
select: add select -unset option

4 years agoMerge pull request #1928 from YosysHQ/eddie/design_delete
Eddie Hung [Thu, 16 Apr 2020 17:51:09 +0000 (10:51 -0700)]
Merge pull request #1928 from YosysHQ/eddie/design_delete

kernel: add design -delete option

4 years agoMerge pull request #1896 from boqwxp/read_stdin_repl
whitequark [Thu, 16 Apr 2020 17:18:29 +0000 (17:18 +0000)]
Merge pull request #1896 from boqwxp/read_stdin_repl

Frontend: allow reading file input from stdin, like a REPL heredoc mode

4 years agoMerge pull request #1797 from epfl-vlsc/firrtl_backend_fileinfo
Claire Wolf [Thu, 16 Apr 2020 16:50:43 +0000 (18:50 +0200)]
Merge pull request #1797 from epfl-vlsc/firrtl_backend_fileinfo

Keep file information when emitting firrtl

4 years agocxxrtl: make ROMs writable, document memory::operator[].
whitequark [Thu, 16 Apr 2020 16:45:02 +0000 (16:45 +0000)]
cxxrtl: make ROMs writable, document memory::operator[].

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.

4 years agocxxrtl: fix misleading example, caution about race conditions.
whitequark [Thu, 16 Apr 2020 16:30:43 +0000 (16:30 +0000)]
cxxrtl: fix misleading example, caution about race conditions.

Fixes #1944.

4 years agocxxrtl: remove inaccurate comment. NFC.
whitequark [Wed, 15 Apr 2020 19:01:17 +0000 (19:01 +0000)]
cxxrtl: remove inaccurate comment. NFC.

4 years agoecp5: Force SIGNED ports to be 1 bit
David Shah [Thu, 16 Apr 2020 15:38:19 +0000 (16:38 +0100)]
ecp5: Force SIGNED ports to be 1 bit

Signed-off-by: David Shah <dave@ds0.me>
4 years agoMerge pull request #1927 from YosysHQ/eddie/design_remove_assert
Eddie Hung [Thu, 16 Apr 2020 15:06:12 +0000 (08:06 -0700)]
Merge pull request #1927 from YosysHQ/eddie/design_remove_assert

kernel: Design::remove(RTLIL::Module *) to check refcount_modules_

4 years agotests: add design -delete tests
Eddie Hung [Tue, 14 Apr 2020 17:34:23 +0000 (10:34 -0700)]
tests: add design -delete tests

4 years agokernel: add design -delete option
Eddie Hung [Tue, 14 Apr 2020 17:33:55 +0000 (10:33 -0700)]
kernel: add design -delete option

4 years agoMerge pull request #1915 from boqwxp/dict_move_semantics
whitequark [Thu, 16 Apr 2020 13:29:13 +0000 (13:29 +0000)]
Merge pull request #1915 from boqwxp/dict_move_semantics

kernel: Add `dict` support for rvalue references and C++11 move semantics.

4 years agoMerge pull request #1900 from Xiretza/suppress-makefile-echo
whitequark [Thu, 16 Apr 2020 13:28:34 +0000 (13:28 +0000)]
Merge pull request #1900 from Xiretza/suppress-makefile-echo

Suppress output of Makefile.conf when printing source versions

4 years agoMerge pull request #1937 from hzeller/consexpr-opportunity
whitequark [Thu, 16 Apr 2020 13:28:03 +0000 (13:28 +0000)]
Merge pull request #1937 from hzeller/consexpr-opportunity

Use static constexpr instead of static const where possible.

4 years agoMerge pull request #1943 from YosysHQ/dave/fix-1919
David Shah [Thu, 16 Apr 2020 12:48:20 +0000 (13:48 +0100)]
Merge pull request #1943 from YosysHQ/dave/fix-1919

ast: Fix handling of identifiers in the global scope

4 years agoopt_expr: Fix X and CO outputs for $alu identity-mapping rules.
Marcelina Kościelnicka [Tue, 14 Apr 2020 16:59:49 +0000 (18:59 +0200)]
opt_expr: Fix X and CO outputs for $alu identity-mapping rules.

4 years agoast: Fix handling of identifiers in the global scope
David Shah [Thu, 16 Apr 2020 09:27:59 +0000 (10:27 +0100)]
ast: Fix handling of identifiers in the global scope

Signed-off-by: David Shah <dave@ds0.me>
4 years agoRename overloaded `insert()` to `emplace()` and add overloaded versions for all possi...
Alberto Gonzalez [Wed, 15 Apr 2020 16:22:22 +0000 (16:22 +0000)]
Rename overloaded `insert()` to `emplace()` and add overloaded versions for all possible lvalue/rvalue combinationsfor its arguments.

4 years agoUse script-style heredoc syntax for REPL heredocs.
Alberto Gonzalez [Fri, 10 Apr 2020 20:06:12 +0000 (20:06 +0000)]
Use script-style heredoc syntax for REPL heredocs.

4 years agoAllow reading file input from stdin, improving REPL experience.
Alberto Gonzalez [Fri, 10 Apr 2020 19:30:22 +0000 (19:30 +0000)]
Allow reading file input from stdin, improving REPL experience.

4 years agoMerge pull request #1894 from YosysHQ/mingw_fix
Miodrag Milanović [Wed, 15 Apr 2020 15:43:31 +0000 (17:43 +0200)]
Merge pull request #1894 from YosysHQ/mingw_fix

Fix compile for mingw

4 years agoMerge pull request #1916 from YosysHQ/eddie/kernel_makeblackbox
Eddie Hung [Wed, 15 Apr 2020 15:42:39 +0000 (08:42 -0700)]
Merge pull request #1916 from YosysHQ/eddie/kernel_makeblackbox

kernel: Module::makeblackbox() to clear connections too

4 years agoMerge pull request #1933 from YosysHQ/eddie/zinit_more
Eddie Hung [Wed, 15 Apr 2020 15:36:25 +0000 (08:36 -0700)]
Merge pull request #1933 from YosysHQ/eddie/zinit_more

zinit: handle $__DFFS?E?_[NP][NP][01] too

4 years agoMerge pull request #1830 from boqwxp/qbfsat
N. Engelhardt [Wed, 15 Apr 2020 15:33:50 +0000 (17:33 +0200)]
Merge pull request #1830 from boqwxp/qbfsat

Add `qbfsat` command to integrate exists-forall solving and specialization

4 years agoFix the truth table for $_SR_* cells.
Marcelina Kościelnicka [Sat, 11 Apr 2020 14:03:19 +0000 (16:03 +0200)]
Fix the truth table for $_SR_* cells.

This brings the documented behavior for these cells in line with
$_DFFSR_* and $_DLATCHSR_*, which is that R has priority over S.
The models were already reflecting that behavior.

Also get rid of sim-synth mismatch in the models while we're at it.

4 years agoMerge pull request #1897 from YosysHQ/dave/bram-rejection-fix
David Shah [Wed, 15 Apr 2020 15:10:38 +0000 (16:10 +0100)]
Merge pull request #1897 from YosysHQ/dave/bram-rejection-fix

memory_bram: Fix ignorance of valid, matched rules

4 years agoFix compile for mingw
Miodrag Milanovic [Wed, 15 Apr 2020 14:38:09 +0000 (16:38 +0200)]
Fix compile for mingw

4 years agoGet rid of dffsr2dff.
Marcelina Kościelnicka [Sat, 11 Apr 2020 16:36:51 +0000 (18:36 +0200)]
Get rid of dffsr2dff.

This pass is a proper subset of opt_rmdff, which is called by opt, which
is called by every synth flow in the coarse part.  Thus, it never
actually does anything and can be safely removed.

4 years agoopt_clean: Add missing assignments to opt.did_something.
Marcelina Kościelnicka [Sat, 11 Apr 2020 14:59:10 +0000 (16:59 +0200)]
opt_clean: Add missing assignments to opt.did_something.

4 years agoMerge pull request #1918 from whitequark/simplify-improve_enum
whitequark [Wed, 15 Apr 2020 14:16:50 +0000 (14:16 +0000)]
Merge pull request #1918 from whitequark/simplify-improve_enum

ast/simplify: improve enum handling

4 years agosynth_intel_alm: VQM support
Dan Ravensloft [Wed, 15 Apr 2020 13:28:35 +0000 (14:28 +0100)]
synth_intel_alm: VQM support

4 years agoast/simplify: improve enum handling.
whitequark [Tue, 14 Apr 2020 03:25:22 +0000 (03:25 +0000)]
ast/simplify: improve enum handling.

Before this commit, enum values were serialized as attributes of form
  \enum_<width>_<value>
where <value> was a decimal signed integer.

This has multiple drawbacks:
  * Enums with large values would be hard to process for downstream
    tooling that cannot parse arbitrary precision decimals. (In fact
    Yosys also did not correctly process enums with large values,
    and would overflow `int`.)
  * Enum value attributes were not confined to their own namespace,
    making it harder for downstream tooling to enumerate all such
    attributes, as opposed to looking up any specific value.
  * Enum values could not include x or z, which are explicitly
    permitted in the SystemVerilog standard.

After this commit, enum values are serialized as attributes of form
  \enum_value_<value>
where <value> is a bit sequence of the appropriate width.

4 years agosetundef: Improve error messages.
Marcelina Kościelnicka [Wed, 15 Apr 2020 14:12:34 +0000 (16:12 +0200)]
setundef: Improve error messages.

Fixes #1092.

4 years agojson: Update format documentation.
Marcelina Kościelnicka [Tue, 14 Apr 2020 20:57:37 +0000 (22:57 +0200)]
json: Update format documentation.

Fixes #1693.

4 years agoMerge pull request #1930 from YosysHQ/claire/fix1876
Claire Wolf [Wed, 15 Apr 2020 14:01:19 +0000 (16:01 +0200)]
Merge pull request #1930 from YosysHQ/claire/fix1876

Fix handling of ternary with constant condition

4 years agosynth_intel_alm: alternative synthesis for Intel FPGAs
Dan Ravensloft [Tue, 19 Nov 2019 10:19:00 +0000 (10:19 +0000)]
synth_intel_alm: alternative synthesis for Intel FPGAs

By operating at a layer of abstraction over the rather clumsy Intel primitives,
we can avoid special hacks like `dffinit -highlow` in favour of simple techmapping.

This also makes the primitives much easier to manipulate, and more descriptive
(no more cyclonev_lcell_comb to mean anything from a LUT2 to a LUT6).

4 years agoabc9_ops: Add a check ensuring that connected port actually exists.
Marcelina Kościelnicka [Tue, 14 Apr 2020 13:44:17 +0000 (15:44 +0200)]
abc9_ops: Add a check ensuring that connected port actually exists.

4 years agoMerge pull request #1932 from YosysHQ/dave/cxxrtl-unclocked-read
whitequark [Wed, 15 Apr 2020 05:34:29 +0000 (05:34 +0000)]
Merge pull request #1932 from YosysHQ/dave/cxxrtl-unclocked-read

cxxrtl: Fix handling of unclocked memory read ports

4 years agoUse static constexpr instead of static const where possible.
Henner Zeller [Tue, 14 Apr 2020 21:19:38 +0000 (14:19 -0700)]
Use static constexpr instead of static const where possible.

In particular inside class declarations, a static const
assignment is technically not a definition, while constexpr is.

Signed-off-by: Henner Zeller <h.zeller@acm.org>
4 years agotests: zinit for new types
Eddie Hung [Tue, 14 Apr 2020 20:08:37 +0000 (13:08 -0700)]
tests: zinit for new types

4 years agozinit: handle $__DFFS?E?_[NP][NP][01] too
Eddie Hung [Tue, 14 Apr 2020 20:08:23 +0000 (13:08 -0700)]
zinit: handle $__DFFS?E?_[NP][NP][01] too

4 years agoopt_expr: Add more $alu optimizations.
Marcelina Kościelnicka [Mon, 13 Apr 2020 17:29:39 +0000 (19:29 +0200)]
opt_expr: Add more $alu optimizations.

Detect the places in the $alu where the carry bit is constant (due to
const A[i] == B[i] ^ BI) and split it into smaller $alu at these points.

Also, make the existing const-carry detection for low bits more generic
(now handles cases where both BI and CI are constant, but not equal to
one another).

Fixes #1912.

4 years agocxxrtl: Fix handling of unclocked memory read ports
David Shah [Tue, 14 Apr 2020 19:39:13 +0000 (20:39 +0100)]
cxxrtl: Fix handling of unclocked memory read ports

Signed-off-by: David Shah <dave@ds0.me>
4 years agotests: add testcases from #1876
Eddie Hung [Tue, 14 Apr 2020 19:39:10 +0000 (12:39 -0700)]
tests: add testcases from #1876

4 years agoFix 5bba9c3, closes #1876
Claire Wolf [Tue, 14 Apr 2020 19:05:07 +0000 (21:05 +0200)]
Fix 5bba9c3, closes #1876

Signed-off-by: Claire Wolf <claire@symbioticeda.com>
4 years agodffinit: Avoid setting init parameter to zero-length value.
Marcelina Kościelnicka [Tue, 14 Apr 2020 14:33:09 +0000 (16:33 +0200)]
dffinit: Avoid setting init parameter to zero-length value.

Fixes #1704.

4 years agodesign: do not delete when iterating over Design::modules() directly
Eddie Hung [Tue, 14 Apr 2020 17:43:05 +0000 (10:43 -0700)]
design: do not delete when iterating over Design::modules() directly

4 years agokernel: Design::remove(RTLIL::Module *) to check refcount_modules_
Eddie Hung [Tue, 14 Apr 2020 16:31:06 +0000 (09:31 -0700)]
kernel: Design::remove(RTLIL::Module *) to check refcount_modules_

4 years agoabc9_exe: verify -> &verify -s
Eddie Hung [Tue, 14 Apr 2020 14:54:11 +0000 (07:54 -0700)]
abc9_exe: verify -> &verify -s

4 years agotechmap: fix error message
Eddie Hung [Thu, 9 Apr 2020 21:31:59 +0000 (14:31 -0700)]
techmap: fix error message

4 years agoMerge pull request #1922 from whitequark/write_cxxrtl-disconnected-outputs
whitequark [Tue, 14 Apr 2020 14:37:48 +0000 (14:37 +0000)]
Merge pull request #1922 from whitequark/write_cxxrtl-disconnected-outputs

write_cxxrtl: ignore disconnected module ports

4 years agoMerge pull request #1921 from whitequark/write_cxxrtl-separate-compilation
whitequark [Tue, 14 Apr 2020 13:53:52 +0000 (13:53 +0000)]
Merge pull request #1921 from whitequark/write_cxxrtl-separate-compilation

write_cxxrtl: enable separate compilation

4 years agoMerge pull request #1917 from YosysHQ/eddie/abc9_delay_check
Eddie Hung [Tue, 14 Apr 2020 13:01:55 +0000 (06:01 -0700)]
Merge pull request #1917 from YosysHQ/eddie/abc9_delay_check

xaiger: add check for $__ABC9_DELAY model