nmigen.git
3 years agoclean up Cat and Repl after realising that Value.cast will pass through
Luke Kenneth Casson Leighton [Wed, 13 Oct 2021 10:51:37 +0000 (11:51 +0100)]
clean up Cat and Repl after realising that Value.cast will pass through
something that is already derived from Value (UserValue) unmodified

3 years agoadd redirection of __Slice__ to allow overrides for advanced behaviour
Luke Kenneth Casson Leighton [Sun, 10 Oct 2021 11:33:49 +0000 (12:33 +0100)]
add redirection of __Slice__ to allow overrides for advanced behaviour
    without changing fundamental language characteristics or semantics of nmigen
    https://bugs.libre-soc.org/show_bug.cgi?id=458

3 years agocomment clarification, add missing default value "stride=1" to Value.__Part__
Luke Kenneth Casson Leighton [Tue, 5 Oct 2021 17:19:51 +0000 (18:19 +0100)]
comment clarification, add missing default value "stride=1" to Value.__Part__

3 years agoModule._check_signed_cond() performs a Value.cast (now self._AstType.cast)
Luke Kenneth Casson Leighton [Sat, 2 Oct 2021 15:28:28 +0000 (16:28 +0100)]
Module._check_signed_cond() performs a Value.cast (now self._AstType.cast)
in each instance it is used (for m.If and m.Elif).  therefore, why not
move the bool check-and-convert *into* Module._check_signed_cond()

3 years agopart of the nmigen Type (2) dsl.Module abstraction from Type (1) ast.*
Luke Kenneth Casson Leighton [Sat, 2 Oct 2021 15:24:42 +0000 (16:24 +0100)]
part of the nmigen Type (2) dsl.Module abstraction from Type (1) ast.*
dsl.Module is passed in an AST Type which it may use to convert its
If, Elif and Switch statements to

3 years agoadd test in Repl where integers are passed in as the Value. they end up being
Luke Kenneth Casson Leighton [Thu, 30 Sep 2021 12:59:02 +0000 (13:59 +0100)]
add test in Repl where integers are passed in as the Value.  they end up being
passed to Const which ascertains how much space is needed.

for proper Type 1 (ast) nmigen language abstraction, a test is needed
(similar to the one in ast.Mux for bool) which converts *only* integers
to Value, preserving existing behaviour.  there was no unit test for
this case

3 years agoadd Value.considered_bool() function
Luke Kenneth Casson Leighton [Thu, 30 Sep 2021 12:50:18 +0000 (13:50 +0100)]
add Value.considered_bool() function

testing len(Value) == 1 is one of the rare places that makes an assumption
between Type 1 (Ast) low-level nmigen language constructs and
between Type 2 (dsl.Module) high-level nmigen language constructs.

a "Value.considered_bool()" function de-couples that assumption and allows
for a proper separation between Type 1 and Type 2 nmigen language
constructs, providing a clean design where Liskov Substitution Principle
may successfully be applied at the Type I (ast) level

3 years agoadd redirection of __Part__ to allow overrides for advanced behaviour
Luke Kenneth Casson Leighton [Wed, 29 Sep 2021 15:53:32 +0000 (16:53 +0100)]
add redirection of __Part__ to allow overrides for advanced behaviour
without changing fundamental language characteristics or semantics of nmigen
https://bugs.libre-soc.org/show_bug.cgi?id=458

3 years agowhitespace cleanup and provide warning not to use Type (2) dsl.Module nmigen
Luke Kenneth Casson Leighton [Wed, 29 Sep 2021 15:48:55 +0000 (16:48 +0100)]
whitespace cleanup and provide warning not to use Type (2) dsl.Module nmigen
language constructs in overrides of Type (1) AST language constructs

3 years agominor cleanup of __Cat__ and Cat to more compact code
Luke Kenneth Casson Leighton [Wed, 29 Sep 2021 12:32:39 +0000 (13:32 +0100)]
minor cleanup of __Cat__ and Cat to more compact code

3 years agoadd redirection of __Cat__ to allow overrides for more advanced behaviour
Luke Kenneth Casson Leighton [Tue, 28 Sep 2021 17:02:53 +0000 (18:02 +0100)]
add redirection of __Cat__ to allow overrides for more advanced behaviour
without changing fundamental language characteristics or semantics in nmigen

https://bugs.libre-soc.org/show_bug.cgi?id=458

this one is slightly more involved than __Repl__, __Mux__, __Switch__ etc.
because Cat() can receive arbitrary objects including generators.
exactly as is done in what is now _InternalCat, the arguments need to
be flattened and individually Value.cast()ed, however *before* doing
so, the first argument needs to be inspected and treated separately,
because the first argument is the one on which __Cat__ shall be called.

    args[0].__Cat__(*args[1:])

therefore it must not be lowered because its type (a derivative of
UserValue) would be entirely lost through the Value.cast().

3 years agoadd redirection of __Repl__ to allow overrides for more advanced behaviour
Luke Kenneth Casson Leighton [Tue, 28 Sep 2021 16:34:00 +0000 (17:34 +0100)]
add redirection of __Repl__ to allow overrides for more advanced behaviour
without changing fundamental language characteristics or semantics in nmigen
https://bugs.libre-soc.org/show_bug.cgi?id=458

3 years agoremove Mux Value.cast before passing to 1st argument __Mux__
Luke Kenneth Casson Leighton [Tue, 28 Sep 2021 12:14:10 +0000 (13:14 +0100)]
remove Mux Value.cast before passing to 1st argument __Mux__
only one case requires Mux to perform Value.cast, which is when the sel
argument is a python bool

3 years agoadd redirection of __Assign__ to allow overrides for advanced behaviour
Luke Kenneth Casson Leighton [Mon, 27 Sep 2021 19:47:56 +0000 (20:47 +0100)]
add redirection of __Assign__ to allow overrides for advanced behaviour
without changing fundamental language characteristics or semantics of nmigen
https://bugs.libre-soc.org/show_bug.cgi?id=458

3 years agoadd redirection of __Switch__ to allow overrides for advanced behaviour
Luke Kenneth Casson Leighton [Mon, 27 Sep 2021 18:18:16 +0000 (19:18 +0100)]
add redirection of __Switch__ to allow overrides for advanced behaviour
without changing fundamental language characteristics or semantics in nmigen
https://bugs.libre-soc.org/show_bug.cgi?id=458

3 years agoadd redirection of __Mux__ to allow overrides for more advanced behaviour
Luke Kenneth Casson Leighton [Mon, 27 Sep 2021 17:33:44 +0000 (18:33 +0100)]
add redirection of __Mux__ to allow overrides for more advanced behaviour
without changing fundamental language characteristics or semantics in nmigen
https://bugs.libre-soc.org/show_bug.cgi?id=458

3 years agohdl.ast: simplify Mux implementation.
whitequark [Sat, 2 Oct 2021 14:18:02 +0000 (14:18 +0000)]
hdl.ast: simplify Mux implementation.

3 years agohdl.ast: add tests for casting bare integers in {Cat,Repl}.
whitequark [Sat, 2 Oct 2021 13:18:11 +0000 (13:18 +0000)]
hdl.ast: add tests for casting bare integers in {Cat,Repl}.

3 years agohdl.ast: remove quadratic time complexity in Statement.cast().
Anton Blanchard [Mon, 27 Sep 2021 01:00:56 +0000 (11:00 +1000)]
hdl.ast: remove quadratic time complexity in Statement.cast().

Using `sum(lst, [])` to flatten a list of lists has quadratic time
complexity. Use `chain.from_iterable()` instead. While not strictly
necessary to improve performance, convert to `map()`.

A test case writing out verilog for a 512k entry FIFO is 120x faster
with this applied.

3 years agovendor.xilinx: avoid using `/` for hierarchy in ISE constraint files.
H-S-S-11 [Sat, 25 Sep 2021 10:41:23 +0000 (11:41 +0100)]
vendor.xilinx: avoid using `/` for hierarchy in ISE constraint files.

3 years agoUnify Xilinx platforms into a single class, support more devices
Marcelina Kościelnicka [Wed, 16 Dec 2020 15:35:57 +0000 (16:35 +0100)]
Unify Xilinx platforms into a single class, support more devices

This merges existing code, and also adds support for:

- Virtex, Virtex E (also known as Spartan 2, Spartan 2E)
- Virtex 2, Virtex 2 Pro
- Spartan 3, Spartan 3E (in addition to existing Spartan 3A, Spartan 3A
  DSP support)
- Virtex 4
- Virtex 5
- Virtex 6
- ISE synthesis for Series 7

Fixes #552.

3 years ago_toolchain: Properly set compiler/linker executables on Gentoo
Adam Jeliński [Tue, 21 Sep 2021 08:33:26 +0000 (10:33 +0200)]
_toolchain: Properly set compiler/linker executables on Gentoo

The `test_toolchain_cxx.py` tests on Gentoo definitely use compiler and
linker set with `_so_cxx`-suffixed executables. Tests use a proper
executable instead of `c++` after this change.

Signed-off-by: Adam Jeliński <ajelinski@antmicro.com>
3 years agovendor.xilinx_{7series,ultrascale}: hierachical -> hierarchical
Robin Ole Heinemann [Mon, 16 Aug 2021 21:31:57 +0000 (23:31 +0200)]
vendor.xilinx_{7series,ultrascale}: hierachical -> hierarchical

Signed-off-by: Robin Ole Heinemann <robin.ole.heinemann@gmail.com>
3 years ago_toolchain: substitute '+' with 'X' in tool_env_var().
Jean-François Nguyen [Fri, 16 Jul 2021 17:16:56 +0000 (19:16 +0200)]
_toolchain: substitute '+' with 'X' in tool_env_var().

3 years agoREADME: update IRC channel.
whitequark [Thu, 20 May 2021 03:07:51 +0000 (03:07 +0000)]
README: update IRC channel.

3 years agorpc: fix parsing of negative signed parameters
Robin Ole Heinemann [Tue, 18 May 2021 18:43:16 +0000 (20:43 +0200)]
rpc: fix parsing of negative signed parameters

3 years agotest.test_hdl_ast.OperatorTestCase: remove duplicate test_bool
Robin Ole Heinemann [Tue, 18 May 2021 19:18:51 +0000 (21:18 +0200)]
test.test_hdl_ast.OperatorTestCase: remove duplicate test_bool

3 years agotests: rename tests with duplicate names
Robin Ole Heinemann [Tue, 18 May 2021 19:18:14 +0000 (21:18 +0200)]
tests: rename tests with duplicate names

3 years agotests.test_hdl_cd.ClockDomainTestCase.test_name: actually test domain with cd_ prefix
Robin Ole Heinemann [Tue, 18 May 2021 19:15:02 +0000 (21:15 +0200)]
tests.test_hdl_cd.ClockDomainTestCase.test_name: actually test domain with cd_ prefix

3 years ago*: remove unused variables
Robin Ole Heinemann [Tue, 18 May 2021 19:10:47 +0000 (21:10 +0200)]
*: remove unused variables

3 years ago*: remove unused imports
Robin Ole Heinemann [Tue, 18 May 2021 18:39:57 +0000 (20:39 +0200)]
*: remove unused imports

3 years agotests.hdl.dsl: add tests for mis-nested Switch/Case and FSM/State statements
Thomas Watson [Tue, 11 May 2021 02:02:29 +0000 (21:02 -0500)]
tests.hdl.dsl: add tests for mis-nested Switch/Case and FSM/State statements

3 years agohdl.dsl: raise SyntaxError for mis-nested If/Elif/Else statements
Thomas Watson [Tue, 11 May 2021 01:59:34 +0000 (20:59 -0500)]
hdl.dsl: raise SyntaxError for mis-nested If/Elif/Else statements

3 years agovendor.lattice_{ecp5,machxo_2_3l}: remove -forceAll from Diamond scripts. master
Adam Greig [Mon, 12 Apr 2021 09:48:20 +0000 (10:48 +0100)]
vendor.lattice_{ecp5,machxo_2_3l}: remove -forceAll from Diamond scripts.

Fixes #604.

3 years agoCI: fix sri-csl/formal-methods PPA series.
whitequark [Thu, 18 Mar 2021 23:56:52 +0000 (23:56 +0000)]
CI: fix sri-csl/formal-methods PPA series.

GHA's Ubuntu has been upgraded to Focal.

3 years agohdl.ast: handle int subclasses as slice start/stop values.
whitequark [Thu, 18 Mar 2021 23:52:23 +0000 (23:52 +0000)]
hdl.ast: handle int subclasses as slice start/stop values.

Fixes #601.

3 years agocompat.genlib.roundrobin: fix missing imports
dx-mon [Thu, 4 Feb 2021 03:10:44 +0000 (03:10 +0000)]
compat.genlib.roundrobin: fix missing imports

3 years agovendor.xilinx_7series: fix tool names for symbiflow.
nickoe [Sun, 31 Jan 2021 18:08:44 +0000 (19:08 +0100)]
vendor.xilinx_7series: fix tool names for symbiflow.

Prefix "tools" with symbiflow_ as is done for the QuickLogic Symbiflow
toolchain. Installing symbiflow gives me the tools with the preifx, so I
guess this is the correct way to move forward.

3 years agovendor.lattice_ecp5: correctly generate OE signaling when xdr=0
Katherine Temkin [Mon, 25 Jan 2021 15:41:45 +0000 (08:41 -0700)]
vendor.lattice_ecp5: correctly generate OE signaling when xdr=0

This fixes a logic bug introduced in
6ce2b21e196a0f93b82748ed046098331d20b3bf.

3 years agovendor.lattice_ecp5: replicate OE signal for each output bit.
Adam Greig [Sat, 23 Jan 2021 18:06:52 +0000 (18:06 +0000)]
vendor.lattice_ecp5: replicate OE signal for each output bit.

nextpnr can only pack OE FFs into IOLOGIC when there's one OFS1P3DX per
output, rather than one shared instance.

3 years agoREADME: add ChipEleven as a sponsor.
whitequark [Sat, 23 Jan 2021 03:26:42 +0000 (03:26 +0000)]
README: add ChipEleven as a sponsor.

3 years agodocs: Update up_counter to avoid deprecation warning
Joel Stanley [Fri, 15 Jan 2021 02:58:21 +0000 (13:28 +1030)]
docs: Update up_counter to avoid deprecation warning

nmigen/docs/_code/up_counter.py:44: DeprecationWarning: instead of nmigen.back.pysim.*, use nmigen.sim.*
  from nmigen.back.pysim import Simulator

3 years agovendor.lattice_ecp5: remove outdated comment in ECP5 platform.
Adam Greig [Thu, 14 Jan 2021 11:34:03 +0000 (11:34 +0000)]
vendor.lattice_ecp5: remove outdated comment in ECP5 platform.

Starting with nextpnr c6401413a, nextpnr does pack *FS1P3DX
into IOLOGIC cells.

3 years agolib.fifo.AsyncFIFOBuffered: fix output register accounting
Robin Ole Heinemann [Sat, 2 Jan 2021 23:17:48 +0000 (00:17 +0100)]
lib.fifo.AsyncFIFOBuffered: fix output register accounting

3 years agolib.fifo.AsyncFIFOBuffered: fix FFSynchronizer latency
Robin Ole Heinemann [Sat, 2 Jan 2021 23:14:26 +0000 (00:14 +0100)]
lib.fifo.AsyncFIFOBuffered: fix FFSynchronizer latency

3 years agolib.fifo: use proper clock domains in AsyncFIFO tests
Robin Ole Heinemann [Sat, 2 Jan 2021 23:13:46 +0000 (00:13 +0100)]
lib.fifo: use proper clock domains in AsyncFIFO tests

3 years agolib.fifo.AsyncFIFOBuffered: use FFSynchronizer instead of AsyncFFsynchronizer
Robin Ole Heinemann [Sat, 2 Jan 2021 23:12:31 +0000 (00:12 +0100)]
lib.fifo.AsyncFIFOBuffered: use FFSynchronizer instead of AsyncFFsynchronizer

AsyncFFsynchronizer only synchronizes one edge

3 years agoRevert "vendor.xilinx_7series: byte swap generated bitstream"
whitequark [Sat, 12 Dec 2020 22:08:57 +0000 (22:08 +0000)]
Revert "vendor.xilinx_7series: byte swap generated bitstream"

This reverts commit 14a5c42a8bd425a4882ba566b26e11bd6d1e1721.

3 years agohdl.ast: formatting. NFC.
whitequark [Sat, 12 Dec 2020 14:11:40 +0000 (14:11 +0000)]
hdl.ast: formatting. NFC.

3 years agohdl.ast: normalize case values to two's complement, not signed binary.
whitequark [Sat, 12 Dec 2020 12:42:12 +0000 (12:42 +0000)]
hdl.ast: normalize case values to two's complement, not signed binary.

This was an especially insidious bug because the minus character is
valid in case values but has a completely different meaning (wildcard
rather than sign).

Fixes #559.

3 years agoback.rtlil: give private items an appropriate name. NFCI.
whitequark [Sat, 12 Dec 2020 12:18:59 +0000 (12:18 +0000)]
back.rtlil: give private items an appropriate name. NFCI.

3 years agobuild.plat: make `verbose` work like all other overrides.
whitequark [Tue, 24 Nov 2020 23:07:09 +0000 (23:07 +0000)]
build.plat: make `verbose` work like all other overrides.

Fixes #497.

3 years agovendor.intel: implement `add_settings` (QSF) and `add_constraints` (SDC) overrides.
whitequark [Tue, 24 Nov 2020 20:35:58 +0000 (20:35 +0000)]
vendor.intel: implement `add_settings` (QSF) and `add_constraints` (SDC) overrides.

4 years agovendor.xilinx_spartan_3_6: fix typo.
whitequark [Sun, 22 Nov 2020 00:16:02 +0000 (00:16 +0000)]
vendor.xilinx_spartan_3_6: fix typo.

This was introduced in commit 2f8669ca.

Fixes #549.

4 years agohdl.ast: remove dead code. NFC.
whitequark [Sat, 21 Nov 2020 17:29:55 +0000 (17:29 +0000)]
hdl.ast: remove dead code. NFC.

See #548.

4 years agonmigen.hdl.rec: restore Record.shape().
awygle [Tue, 17 Nov 2020 19:36:58 +0000 (11:36 -0800)]
nmigen.hdl.rec: restore Record.shape().

This method was lost in commit abbebf8e.

4 years agosim._pyrtl: mask Mux selection operand.
Marcelina Kościelnicka [Sat, 14 Nov 2020 15:22:34 +0000 (16:22 +0100)]
sim._pyrtl: mask Mux selection operand.

Otherwise it behaves funny when it's eg. the result of operator ~.

4 years agovendor.quicklogic: enable SoC clock configuration
Jan Kowalewski [Fri, 13 Nov 2020 12:58:11 +0000 (13:58 +0100)]
vendor.quicklogic: enable SoC clock configuration

Signed-off-by: Jan Kowalewski <jkowalewski@antmicro.com>
4 years agovendor.quicklogic: write OpenOCD scripts as part of build process.
whitequark [Fri, 13 Nov 2020 05:44:16 +0000 (05:44 +0000)]
vendor.quicklogic: write OpenOCD scripts as part of build process.

The OpenOCD scripts for EOS-S3 are roughly equivalent to SVF files
for a more traditional FPGA, which we also produce, for some common
"default" configuration, as a part of the build process.

4 years agobuild.plat: TemplatedPlatform.iter_extra_files→Platform.iter_files.
whitequark [Tue, 10 Nov 2020 05:30:21 +0000 (05:30 +0000)]
build.plat: TemplatedPlatform.iter_extra_files→Platform.iter_files.

This function was added in commit 20553b14 in the wrong place, with
the wrong name, and without tests. Fix all that.

4 years agohdl.rec: proxy operators correctly.
awygle [Mon, 9 Nov 2020 20:20:25 +0000 (12:20 -0800)]
hdl.rec: proxy operators correctly.

Commit abbebf8e used __getattr__ to proxy Value methods called on
Record. However, that did not proxy operators like __add__ because
Python looks up the special operator methods directly on the class
and does not run __getattr__ if they are missing.

Instead of using __getattr__, explicitly enumerate and wrap every
Value method that should be proxied. This also ensures backwards
compatibility if more methods are added to Value later.

Fixes #533.

4 years agovendor.intel: add support for Cyclone V internal oscillator
Konrad Beckmann [Fri, 6 Nov 2020 11:35:18 +0000 (12:35 +0100)]
vendor.intel: add support for Cyclone V internal oscillator

When using the default clock "cyclonev_oscillator" on Cyclone V devices,
the internal oscillator will be used.

4 years agohdl.ast: deprecate UserValue in favor of ValueCastable.
whitequark [Fri, 6 Nov 2020 02:21:53 +0000 (02:21 +0000)]
hdl.ast: deprecate UserValue in favor of ValueCastable.

Closes #527.

4 years agosim.pysim: avoid redundant VCD updates.
whitequark [Fri, 6 Nov 2020 02:05:35 +0000 (02:05 +0000)]
sim.pysim: avoid redundant VCD updates.

This commit properly addresses a bug introduced in 2efeb05c and then
temporarily fixed in 58f1d4bc.

Fixes #429.

4 years agoexamples: clean up oudated code.
whitequark [Fri, 6 Nov 2020 01:52:00 +0000 (01:52 +0000)]
examples: clean up oudated code.

4 years agoFix commit 8313d6e7.
whitequark [Fri, 6 Nov 2020 01:54:25 +0000 (01:54 +0000)]
Fix commit 8313d6e7.

4 years agocli: update deprecated import.
whitequark [Fri, 6 Nov 2020 01:39:04 +0000 (01:39 +0000)]
cli: update deprecated import.

4 years agoCI: add CPython 3.9 to test matrix.
whitequark [Fri, 6 Nov 2020 01:41:35 +0000 (01:41 +0000)]
CI: add CPython 3.9 to test matrix.

4 years agoCI: run testsuite with -Werror.
whitequark [Fri, 6 Nov 2020 01:38:03 +0000 (01:38 +0000)]
CI: run testsuite with -Werror.

4 years agovendor.lattice_{ice40,ecp5}: clean up $verilog_initial_trigger wires.
whitequark [Fri, 6 Nov 2020 01:31:14 +0000 (01:31 +0000)]
vendor.lattice_{ice40,ecp5}: clean up $verilog_initial_trigger wires.

These only matter in simulation and after conversion to Verilog.
During synthesis they cause Yosys to produce warnings:

  Warning: Wire $verilog_initial_trigger has an unprocessed 'init' attribute.

4 years agohdl.rec: migrate Record from UserValue to ValueCastable.
awygle [Fri, 6 Nov 2020 01:10:39 +0000 (17:10 -0800)]
hdl.rec: migrate Record from UserValue to ValueCastable.

Closes #528.

4 years agohdl.ast: implement ValueCastable.
awygle [Fri, 6 Nov 2020 00:20:54 +0000 (16:20 -0800)]
hdl.ast: implement ValueCastable.

Closes RFC issue #355.

4 years agovendor.quicklogic: part→package
whitequark [Thu, 5 Nov 2020 07:36:13 +0000 (07:36 +0000)]
vendor.quicklogic: part→package

4 years agovendor.xilinx_7series: byte swap generated bitstream
Norbert Braun [Mon, 2 Nov 2020 21:00:17 +0000 (22:00 +0100)]
vendor.xilinx_7series: byte swap generated bitstream

The Zynq driver in the FPGA Manager framework on Linux expects bitstreams that
are byte swapped with respect to what the Vivado command
`write_bitstream -bin_file` produces. Thus, use the `write_cfgmem` command with
appropriate options to generate the bitstream (.bin file).

Fixes #519.

4 years agolib.fifo: fix {r,w}_level in AsyncFIFOBuffered
Jaro Habiger [Tue, 18 Aug 2020 11:11:30 +0000 (13:11 +0200)]
lib.fifo: fix {r,w}_level in AsyncFIFOBuffered

4 years agolib.fifo: fix level on fifo full
Jaro Habiger [Tue, 3 Nov 2020 09:10:07 +0000 (10:10 +0100)]
lib.fifo: fix level on fifo full

4 years agovendor.lattice_ice40: zero-pad CLKHF_DIV in SB_HFOSC instance.
David Lattimore [Mon, 2 Nov 2020 06:19:47 +0000 (17:19 +1100)]
vendor.lattice_ice40: zero-pad CLKHF_DIV in SB_HFOSC instance.

Fixes #520.

4 years agovendor.quicklogic: utilize internal SoC clock in EOS-S3
Jan Kowalewski [Wed, 21 Oct 2020 12:24:41 +0000 (14:24 +0200)]
vendor.quicklogic: utilize internal SoC clock in EOS-S3

Signed-off-by: Jan Kowalewski <jkowalewski@antmicro.com>
4 years agovendor.quicklogic: fix toolchain nomenclature
Jan Kowalewski [Tue, 20 Oct 2020 10:46:58 +0000 (12:46 +0200)]
vendor.quicklogic: fix toolchain nomenclature

Signed-off-by: Jan Kowalewski <jkowalewski@antmicro.com>
4 years agolib.fifo.AsyncFFSynchronizer: check input and output signal width
Robin Ole Heinemann [Tue, 27 Oct 2020 23:41:01 +0000 (00:41 +0100)]
lib.fifo.AsyncFFSynchronizer: check input and output signal width

4 years agosetup: link to latest docs if VCS information is not available.
Ben Newhouse [Tue, 27 Oct 2020 01:16:25 +0000 (01:16 +0000)]
setup: link to latest docs if VCS information is not available.

4 years agobuild.dsl: clean up inversion logic.
whitequark [Mon, 26 Oct 2020 19:50:21 +0000 (19:50 +0000)]
build.dsl: clean up inversion logic.

  * Add invert= argument to DiffPairs() constructor, like in Pins().
  * Make PinsN() and DiffPairsN() pass invert= to the corresponding
    construtor instead of mutating.

4 years agoback.{verilog,rtlil}: adjust $verilog_initial_trigger insertion.
whitequark [Sun, 25 Oct 2020 01:59:46 +0000 (01:59 +0000)]
back.{verilog,rtlil}: adjust $verilog_initial_trigger insertion.

To track upstream changes.

4 years agoCI: disable codecov project status.
whitequark [Sun, 25 Oct 2020 00:13:39 +0000 (00:13 +0000)]
CI: disable codecov project status.

Every PR should be covered by tests, and codecov patch statuses are
extremely useful. However, codecov project statuses mostly create
noise because project-wide coverage in nMigen is currently primarily
informational.

4 years agolib.fifo.AsyncFIFO: fix incorrect latency of r_level.
anuejn [Sat, 24 Oct 2020 14:58:23 +0000 (16:58 +0200)]
lib.fifo.AsyncFIFO: fix incorrect latency of r_level.

Co-authored-by: Andrew Wygle <awygle@gmail.com>
4 years agotests: make spec directory name unique per test method.
anuejn [Thu, 22 Oct 2020 21:38:44 +0000 (23:38 +0200)]
tests: make spec directory name unique per test method.

4 years agosim._pyrtl: sign extend RHS of assignment.
whitequark [Thu, 22 Oct 2020 16:08:38 +0000 (16:08 +0000)]
sim._pyrtl: sign extend RHS of assignment.

Fixes #502.

4 years agohdl.dsl: error on Elif immediately nested in an If.
whitequark [Thu, 22 Oct 2020 13:23:06 +0000 (13:23 +0000)]
hdl.dsl: error on Elif immediately nested in an If.

I.e. on this code, which is currently not only wrongly accepted but
also results in completely unexpected RTL:

    with m.If(...):
        with m.Elif(...):
            ...

Fixes #500.

4 years agovendor.quicklogic: fix syntax
Jan Kowalewski [Mon, 19 Oct 2020 10:09:50 +0000 (12:09 +0200)]
vendor.quicklogic: fix syntax

Signed-off-by: Jan Kowalewski <jkowalewski@antmicro.com>
4 years agosetup.py: Exclude "tests" package
Xiretza [Mon, 19 Oct 2020 17:23:43 +0000 (19:23 +0200)]
setup.py: Exclude "tests" package

67b957d moved the tests from nmigen/test/ to tests/, and removed the
exclude= parameter from find_packages() in setup.py. However, even if
the new location is not inside the module tree, it is still found by
find_packages(), resulting in a stray "tests" module on the system.

4 years agohdl.ir: Update error message for Instance arguments
Xiretza [Fri, 16 Oct 2020 16:36:56 +0000 (18:36 +0200)]
hdl.ir: Update error message for Instance arguments

48d4ee4 added the option to specify attributes using Instance arguments,
but the error message wasn't updated accordingly.

4 years agoREADME: Quicklogic EOS S3 is now supported.
whitequark [Thu, 15 Oct 2020 18:10:39 +0000 (18:10 +0000)]
README: Quicklogic EOS S3 is now supported.

4 years agoCI: fix code coverage collection.
whitequark [Thu, 15 Oct 2020 18:09:04 +0000 (18:09 +0000)]
CI: fix code coverage collection.

This has been broken since commit d71e19e2 (2020-07-22).

4 years agovendor.quicklogic: new platform.
Jan Kowalewski [Thu, 15 Oct 2020 18:02:25 +0000 (20:02 +0200)]
vendor.quicklogic: new platform.

Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
Signed-off-by: Jan Kowalewski <jkowalewski@antmicro.com>
Co-authored-by: Kamil Rakoczy <krakoczy@antmicro.com>
4 years agotests: keep comments up to date. NFC.
whitequark [Thu, 15 Oct 2020 17:02:50 +0000 (17:02 +0000)]
tests: keep comments up to date. NFC.

4 years agobuild.plat: avoid type confusion in _check_feature.
whitequark [Thu, 15 Oct 2020 08:54:48 +0000 (08:54 +0000)]
build.plat: avoid type confusion in _check_feature.

Before this commit, `_check_feature(valid_xdrs=0)` would mean that
XDR buffers are not supported. Only `_check_feature(valid_xdrs=())`
was intended to be an indicator of that.

4 years agohdl.mem: document ReadPort and WritePort.
Jean-François Nguyen [Tue, 15 Sep 2020 00:20:35 +0000 (02:20 +0200)]
hdl.mem: document ReadPort and WritePort.

Fixes #496.

4 years agovendor.lattice_{ecp5,machxo_2_3l}: explain how to set up NMIGEN_ENV_Diamond on Windows.
William D. Jones [Sat, 29 Aug 2020 19:34:57 +0000 (15:34 -0400)]
vendor.lattice_{ecp5,machxo_2_3l}: explain how to set up NMIGEN_ENV_Diamond on Windows.

4 years agosetup: synchronize builtin-yosys dependency.
whitequark [Thu, 27 Aug 2020 13:39:42 +0000 (13:39 +0000)]
setup: synchronize builtin-yosys dependency.

4 years agoback.verilog: use `proc -nomux` if it is available.
whitequark [Thu, 27 Aug 2020 13:03:15 +0000 (13:03 +0000)]
back.verilog: use `proc -nomux` if it is available.

Yosys offers no stability guarantees for individual `proc_*` passes,
though so far it worked out fine. This commit changes the Verilog
backend to use `proc -nomux` instead, which is guaranteed to have
backwards-compatible behavior.

Fixes #479.