Commit graph

83 commits

Author SHA1 Message Date
Alain Péteut
04c07715b4 build.plat: dedent overrides. 2019-06-16 12:40:52 +00:00
whitequark
efb2d773c3 build.{dsl,res,plat}: add PinsN and DiffPairsN. 2019-06-12 14:42:39 +00:00
whitequark
12e8fe484d build.dsl: fix precondition check in Pins. 2019-06-06 20:40:49 +00:00
whitequark
b45c5119f5 build.res: allow querying frequency of a previously constrained clock. 2019-06-05 12:51:53 +00:00
whitequark
c9879c795b build.{dsl,res,plat}: apply clock constraints to signals, not resources.
This adds the Clock() build DSL element, and adds a resource manager
function add_clock_constraint() that takes a Pin or a Signal.
Note that not all platforms, in particular not any nextpnr platforms
at the moment, can add constraints on arbitrary signals.

Fixes #86.
2019-06-05 08:52:30 +00:00
whitequark
ab3f103e5a build.dsl: replace extras= with Attrs().
This change proved more tricky than expected due to downstream
dependencies, so it also includes some secondary refactoring.
2019-06-05 07:02:08 +00:00
whitequark
c52cd72d3e Typos and style fixes. NFC. 2019-06-05 02:48:41 +00:00
whitequark
3adce21ce3 build.run: fix product extraction to work on Windows.
Before this commit, it would fail with a "Permission denied" error.
2019-06-04 11:40:56 +00:00
whitequark
63c4123f6e build.plat: hide executed commands in quiet builds on Windows. 2019-06-04 11:34:18 +00:00
whitequark
1d3e9c8331 build.plat: allow (easily) overriding with an empty string on Windows. 2019-06-04 11:33:51 +00:00
whitequark
4310254103 build.res: use ConstraintError iff a constraint invariant is violated.
In particular don't use it for type errors.
2019-06-04 11:00:11 +00:00
whitequark
316ba10207 build.run: simplify using build products locally, e.g. for programming. 2019-06-04 09:13:24 +00:00
whitequark
2763b403f1 build.res: simplify emission of port constraints on individual bits. 2019-06-04 08:39:03 +00:00
whitequark
3194b5c90b build.run: extract from build.plat. 2019-06-04 07:53:34 +00:00
whitequark
ed64880cc4 build.{plat,res}: add support for connectors.
Fixes #77.
2019-06-03 15:02:15 +00:00
whitequark
a013eb1f59 build.dsl: add support for connectors. 2019-06-03 13:47:00 +00:00
whitequark
41adcc3f97 vendor.fpga.lattice_ice40: implement differential input buffers. 2019-06-03 08:38:12 +00:00
whitequark
6fae06aea9 build.{dsl,plat,res}: allow dir="oe".
Although a dir="oe" pin is generally equivalent to dir="io" pin with
the i* signal(s) disconnected, they are not equivalent, because some
pins may not be able to support input buffers at all, either because
there are no input buffers, or because the input buffers are consumed
by some other resource.

E.g. this can happen on iCE40 when the input buffer is consumed by
a PLL.
2019-06-03 04:42:55 +00:00
whitequark
9ba2efd86b build.{res,plat}: use xdr=0 as default, not xdr=1.
The previous behavior was semantically incorrect.
2019-06-03 03:36:32 +00:00
whitequark
cd6488c782 build.res: allow requesting raw ports, with dir="-".
This provides an escape hatch for the case where the nMigen platform
code is not flexible enough, and a IO buffer primitive needs to be
instantiated directly.
2019-06-03 03:36:32 +00:00
whitequark
f417725b10 build.res: if not specified, request resource #0.
This markedly differs from oMigen system, which would request
consecutive resources. The difference is deliberate; most resources
are singular, so it does not matter for them, and for resources where
it does matter, which pins are requested should not depend on order
of execution of `platform.request`.
2019-06-03 02:54:17 +00:00
whitequark
dc17d06fe9 vendor.fpga.lattice_ice40: instantiate SB_IO and apply extras.
The PULLUP and PULLUP_RESISTOR extras are representable in the PCF
file. The IO_STANDARD extra, however, can only be an SB_IO parameter.
2019-06-03 02:51:59 +00:00
whitequark
fb01854372 build.{res,plat}: propagate extras to pin fragment factories.
This is necessary because on some platforms, like iCE40, extras
become parameters on an IO primitive, since the constraint file
format is not expressive enough for all of them.
2019-06-03 01:58:43 +00:00
whitequark
268fe6330e build.res: simplify. NFC. 2019-06-03 01:29:20 +00:00
whitequark
98497b2075 build.dsl: require a dict for extras instead of a stringly array.
Fixes #72.
2019-06-02 23:36:21 +00:00
whitequark
b1eab9fb3b build.plat: implement. 2019-06-01 16:43:27 +00:00
whitequark
53ddff9f33 build.res: always return a Pin record.
In the simple cases, a Pin record consisting of exactly one field
is equivalent in every way to this single field. In the more complex
case however, it can be used as a record, making the code more robust
such that it works with both bidirectional and unidirectional pins.
2019-06-01 16:41:30 +00:00
whitequark
8c1b5a26b3 build.res: accept a list of clocks in ConstraintManager constructor. 2019-06-01 15:41:41 +00:00
Jean-François Nguyen
d393c5ec64 build.res: add ConstraintManager. 2019-05-26 01:26:58 +00:00
whitequark
3a9fe31133 build.dsl: make Pins and DiffPairs iterable.
Returns pin names.
2019-05-25 22:43:48 +00:00
whitequark
48145cee02 build.dsl: improve repr of Pins() and DiffPairs(). 2019-05-25 22:43:23 +00:00
whitequark
a982fbe377 build.dsl: style. NFC. 2019-04-24 15:02:30 +00:00
Jean-François Nguyen
dd5bd1c88d build: add DSL for defining platform resources. 2019-04-24 11:49:01 +00:00