Commit graph

910 commits

Author SHA1 Message Date
whitequark 75a466537e Update README. 2020-07-01 19:16:01 +00:00
whitequark 7fa4b348a9 docs/install: use pip/pip3 more consistently. 2020-07-01 08:58:36 +00:00
whitequark 6c0530cf4e docs: clarify naming. 2020-07-01 08:53:52 +00:00
whitequark 416b2531ae Revert "Add PEP 518 pyproject.toml."
This reverts commit 7fca037f9c.

This broke editable installs and has to be reverted due to a number
of pip issues:
  * pypa/pip#6375
  * pypa/pip#6434
  * pypa/pip#6438

We can put this back once PEP 517/518 support editable installs.
Until then the legacy behavior will suffice, and we should just teach
people to install the dependencies in virtualenvs or something...
2020-07-01 08:24:47 +00:00
whitequark 76c7e70582 docs: add a crude approximation of intersphinx toctrees.
This is a pretty awful hack. We could do this properly after one of
the following issues is fixed:
  * sphinx-doc/sphinx#701
  * sphinx-doc/sphinx#1836
2020-07-01 08:03:57 +00:00
whitequark 126f0be731 Gracefully handle missing dependencies.
Some people's workflows involve not using `pip`. This is not
a recommended way to use nMigen, but is prevalent enough for good
enough reason that we try to keep them working anyway.
2020-07-01 07:00:02 +00:00
whitequark f5670a9b71 docs/install: fix dead link. 2020-07-01 06:33:03 +00:00
whitequark 43da4e3f0a docs/install: quote special chars to avoid issues with extended glob. 2020-07-01 06:32:15 +00:00
whitequark f50303ca7c docs/install: explain how to install non-editable snapshot from git. 2020-07-01 06:15:16 +00:00
whitequark 7fca037f9c Add PEP 518 pyproject.toml.
This is necessary to be able to install nMigen into a virtualenv that
does not have `wheel` installed in certain cases.

See #349.
2020-07-01 05:58:34 +00:00
whitequark adbc947274 docs/install: use pip install --user on *nix. 2020-07-01 05:06:20 +00:00
whitequark 78c027fb36 docs/install: reduce repetition. 2020-07-01 04:11:51 +00:00
whitequark 7d25bd50c7 README: update to refer to documentation where applicable. 2020-07-01 04:08:02 +00:00
whitequark 20baea401b docs: reword slightly. 2020-07-01 03:59:16 +00:00
whitequark 9f731d185d docs: explain how to install GTKWave on Windows. 2020-07-01 03:47:02 +00:00
whitequark b0dbbb6b2a CI: build docs on all pushes, update only on master. 2020-07-01 03:37:29 +00:00
whitequark c20266164d docs: rewrite install instructions to be easier to understand. 2020-07-01 03:32:17 +00:00
whitequark 39c3bacb79 setup: link to proper location for docs. 2020-06-30 23:13:44 +00:00
whitequark 5048c5efc7 docs: fix syntax. 2020-06-30 22:29:43 +00:00
whitequark d5c297aa94 docs: fix CI workflow. 2020-06-30 22:28:12 +00:00
whitequark 9928b6067d docs: explain that pip3 install -e should be run after pulling. 2020-06-30 22:26:54 +00:00
whitequark 399b8f9863 Add (heavily work in progress) documentation.
To render correctly, the docs require:
 * pygments/pygments#1441
2020-06-30 22:21:16 +00:00
whitequark 8dacbbb2b2 Don't use pkg_resources.
This package is deprecated and introduces a massive amount of startup
latency. On my machine with 264 installed Python packages, it reduces
the time required to `import nmigen` from ~100ms to ~200ms.
2020-06-30 22:11:47 +00:00
whitequark 25ce260207 lib.cdc: update PulseSynchronizer to follow conventions.
Fixes #370.
2020-06-28 05:17:33 +00:00
whitequark 2606ee33ad back.pysim: simplify.
Remove _EvalContext, which was a level of indirection serving almost
no purpose. (The only case where it would be useful is repeatedly
resetting a simulation that, each time it is reset, would create new
signals to communicate with between coroutine processes. In that case
the signal states would not be persisted in _SimulatorState, but
would be removed with the _EvalContext that is recreated each time
the simulation is reset. But this could be solved with a weak map
instead.)

This regresses simulator startup time by 10-15% for unknown reasons
but is necessary to align pysim and future cxxsim.
2020-06-28 05:04:16 +00:00
Alan Green 303ea18cb6
_yosys: handle unparseable versions
Do not use yosys binaries with unparseable version numbers. This ensures
that nmigen always knows what version of yosys it is generating RTLIL
for.

The effect of this change is that if the version number of the system
yosys is unparsable, nmigen will attempt to fallback to the builtin
Yosys.

Fixes #409.
2020-06-23 12:12:02 +00:00
whitequark 706eb03e6b vendor.lattice_machxo2: add back as a compatibility shim. 2020-06-21 17:28:01 +00:00
Gwenhael Goavec-Merou 0aef5f4d48
vendor.lattice_machxo*: add MachXO3L support. 2020-06-21 17:24:47 +00:00
whitequark 868d49eccd back.verilog: refactor Yosys script generation. NFCI.
In commit 5f30bcbb, back.cxxsim gained a nicer way to generate
a script; this commit brings it to back.verilog too.
2020-06-14 09:38:32 +00:00
whitequark 5f30bcbb14 back.cxxrtl: allow injecting black boxes. 2020-06-14 09:25:54 +00:00
whitequark eddc397509 _yosys: add a way to retrieve Yosys data directory.
This is important for CXXRTL, since that's where its include files
are located.
2020-06-14 00:31:34 +00:00
whitequark 45c61969fc _yosys: fix typo in error message. 2020-06-14 00:03:36 +00:00
whitequark ca360917ba test: fix example test after commit a7b8ced9. 2020-06-11 16:36:08 +00:00
whitequark 545e49c2ca back.cxxrtl: new backend. 2020-06-11 16:19:40 +00:00
whitequark bddec3741e _yosys: translate Yosys warnings to Python warnings.
This isn't used yet (the only Yosys warning we can get is useless),
but will be handy for CXXRTL.
2020-06-11 16:12:52 +00:00
whitequark a7b8ced92c nmigen.cli: fix file type autodetection code. 2020-06-11 15:36:43 +00:00
whitequark 133d4f47d1 back.verilog: remove unused imports. NFC. 2020-06-11 15:17:49 +00:00
Adam Greig 02e30b53cc
hdl.xfrm: preserve allow_reset_less when transforming ResetSignal.
Fixes #400.
2020-06-06 11:43:25 +00:00
Shawn Anastasio 2f7c3bf443
hdl.rec: preserve shapes when constructing a layout.
Preserve the original user-provided shape, while still checking 
its validity. This allows Enum decoders to work when specifying
record fields with Enums.

Fixes #393.
2020-06-05 03:19:46 +00:00
whitequark 9c80c32c30 setup: exclude tests.
The inclusion of tests in the package was completely unintentional
and a result of my lack of knowledge of setuptools. If you are using
nmigen.test.utils, please copy the parts you need to your own code
because the nmigen.test code can and will change without notice.
2020-05-31 14:14:27 +00:00
whitequark afa4345903 vendor.lattice_ice40: reword confusing comment. NFC. 2020-05-31 10:21:45 +00:00
Robin Ole Heinemann 26a15b31f7 hdl.ast: fix typo 2020-05-24 16:56:15 +00:00
whitequark b9799b4c4a back.verilog: fall back to nmigen_yosys package.
The nmigen-yosys PyPI package provides a custom, minimal build of
Yosys that uses (at the moment) wasmtime-py to deliver a single
WASM binary that can run on many platforms, and eliminates the need
to build Yosys from source.

Not only does this lower barrier to entry for new nMigen developers,
but also decouples nMigen from Yosys' yearly release cycle, which
lets us use new features and drop workarounds for Yosys bugs earlier.

The source for the nmigen-yosys package is provided at:
  https://github.com/nmigen/nmigen-yosys
The package is built from upstream source and released automatically
with no manual steps.

Fixes #371.
2020-05-22 16:51:00 +00:00
whitequark eaf33fb6b5 Update .gitignore. 2020-05-21 10:41:23 +00:00
whitequark 43b1ed1bf6 vendor.intel: don't use write_verilog -decimal.
See commit 702e41ba for details.
2020-05-21 09:49:42 +00:00
whitequark 7238e58224 vendor.intel: double-quote Tcl values rather than brace-quoting.
For unknown reasons, Quartus treats {foo} and "foo" in completely
different ways, which is not true for normal Tcl code; specifically,
it preserves the braces if they are used. Because of this, since
commit 6cee2804, the vendor.intel package was completely broken.
2020-05-21 09:48:42 +00:00
whitequark 702e41ba3c vendor.xilinx_{7series,ultrascale}: don't use write_verilog -decimal.
In commit 892cff05, `-decimal` was used when writing Verilog for
Vivado targets because it treats (* keep=32'd1 *) and (* keep=1 *)
differently in violation of Verilog LRM. However, it is possible
to avoid that workaround by using (* keep="TRUE" *). Do that,
and remove `-decimal` to avoid special-casing 32-bit constants.

Refs #373.
2020-05-21 08:57:43 +00:00
whitequark 3420b683a3 build.plat: skip clock constraints on unused signals.
It's not very nice to add more internal mutable state to Platform
related classes, but our whole approach for Platform is inherently
stateful, and other solutions (like changing every individual vendor
platform to check for unused signals) are even worse.

Fixes #374.
2020-05-20 05:35:47 +00:00
whitequark 892cff059b vendor.xilinx_{7series,ultrascale}: add (*keep*) on constrained clocks.
If the clock signal is not a top-level port and has aliases, it can
be optimized out, and then the constraint will no longer apply.
To prevent this, make sure the constrained signal is preferred over
any aliases by using the `keep` attribute.

Vivado does not parse attributes like (* keep = 32'd1 *) as valid
even though, AFAICT, they are equivalent to (* keep = 1 *) or simply
(* keep *) per IEEE 1364. To work around this, use the solution we
currently use for Quartus, which is `write_verilog -decimal`.

Fixes #373.
2020-05-20 04:58:03 +00:00
whitequark 7ea81f5f06 hdl.ast: add const-shift operations.
Also, clean up the rotate code a bit.

Fixes #378.
2020-05-20 03:18:33 +00:00