Commit Graph

927 Commits

Author SHA1 Message Date
Miodrag Milanović
e12093201a
CMake: Add include guards when IMPORT_BBA_FILES is used (#1438) 2025-01-23 10:54:37 +01:00
Catherine
90d746f79e CMake: add support for exporting and importing .bba files.
This is useful for certain cross-compilation workloads, and to cache
rarely changing build products.

To use this functionality, build e.g. as follows:

    cmake . -B build-export -DEXPORT_BBA_FILES=../bba-files -DARCH=all
    cmake --build build-export -t nextpnr-all-bba

    cmake . -B build-import -DIMPORT_BBA_FILES=../bba-files -DARCH=all
    cmake --build build-import
2025-01-23 07:49:12 +00:00
Catherine
cd7f7c12f1 CMake: refactor architecture-specific build system parts.
Two user-visible changes were made:
* `-DUSE_RUST` is replaced with `-DBUILD_RUST`, by analogy with
  `-DBUILD_PYTHON`
* `-DCOVERAGE` was removed as it doesn't work with either modern GCC
  or Clang
2025-01-21 17:13:03 +00:00
Catherine
bb2336ad73 Fix #embed support in bbasm and use it when available.
This removes the atomic rename for bbasm outputs because it embeds
the resulting paths into the `.cc` files in embed mode. In any case
the write should be fast enough to not be a big risk for interrupted
builds.

This was tested with Clang 19 only (gcc hasn't had a release that
supports `#embed` yet).
2025-01-21 17:13:03 +00:00
Catherine
f5776a6d64 CMake: eliminate family.cmake/CMakeLists.txt split.
While it served a purpose (granting the ability to build `.bba` files
separately from the rest of nextpnr), it made things excessively
convoluted, especially around paths.

This commit removes the ability to pre-generate chip databases. As far
as I know, I was the primary user of that feature. It can be added back
if there is demand for it.

In exchange the per-family `CMakeLists.txt` files are now much easier
to understand.
2025-01-21 17:13:03 +00:00
Catherine
a951faa16d CMake: extract bbasm compilation into a function.
This fully preserves existing functionality, although the `embed` mode
is untested and seems broken.
2025-01-21 17:13:03 +00:00
Catherine
d214308f5f CMake: reformat for consistency.
Normalize keywords to:

    if (...)
    elseif (...)
    else()
    endif()

    foreach (...)
    endforeach()

    other(...)

Normalize whitespace to 4 spaces.
2025-01-16 11:36:44 +01:00
Catherine
574f504787 Find all components of Python at the same time.
This is explicitly recommended by the FindPython module documentation
and is required to avoid failed builds on some systems. See:
https://cmake.org/cmake/help/latest/module/FindPython.html
2025-01-13 03:29:43 +00:00
myrtle
55bd760808
ice40: Don't constrain multiple potentially-incompatible FFs to same tile (#1413)
Signed-off-by: gatecat <gatecat@ds0.me>
2025-01-02 11:08:42 +01:00
myrtle
854549a5ab
ice40: Fix missing clock pin types (#1380)
Signed-off-by: gatecat <gatecat@ds0.me>
2024-10-04 08:07:13 +02:00
gatecat
9b51c6e337 clangformat
Signed-off-by: gatecat <gatecat@ds0.me>
2024-09-30 14:51:33 +02:00
TG
ba293437e0 ice40: Fix Python bindings for pip iterators 2024-07-03 15:09:27 +02:00
dragonmux
cb4db2d368 ice40: Fixed unused parameters and spurious ; warnings in some of the headers 2024-01-04 10:39:45 +01:00
Lofty
1bbcc5f2c4 (broken) third round of review fixes 2024-01-03 13:42:18 +01:00
Lofty
d2297b1ba0 Add Rust FFI bindings 2024-01-03 13:42:18 +01:00
gatecat
4a4025192a run clangformat
Signed-off-by: gatecat <gatecat@ds0.me>
2023-12-26 09:54:34 +01:00
Lofty
d1083fd348 static/ice40: bug fixes for ultraplus 2023-12-13 11:37:20 +01:00
Lofty
e3c44dd20a ice40: add IO group to static 2023-11-07 08:18:35 +01:00
Lofty
d6f54fd9df ice40: add static placer support 2023-10-29 08:46:33 +01:00
gatecat
f9825c3130 ice40: only set/clear negclk bit if IO clock actually used
Signed-off-by: gatecat <gatecat@ds0.me>
2023-09-08 09:15:27 +02:00
rowanG077
914999673c Rip out budgets 2023-06-20 10:57:10 +02:00
rowanG077
cb4846a58d build: push INSTALL_PREFIX from env to cmake var 2023-06-12 14:11:36 +02:00
gatecat
b3c33bd0ab ice40: Fix BRAM NegClk bitstream logic
Signed-off-by: gatecat <gatecat@ds0.me>
2023-03-20 18:54:57 +01:00
gatecat
e4fcd3740d cmake: Make HeAP placer always-enabled
Signed-off-by: gatecat <gatecat@ds0.me>
2023-03-17 10:38:11 +01:00
gatecat
1dcc2f777d ice40: Add python binding for write_bitstream
Signed-off-by: gatecat <gatecat@ds0.me>
2023-02-28 18:46:35 +01:00
myrtle
b5125aac31
Merge pull request #1090 from rowanG077/ecp5-propagate-dcsc-clk-ct
ecp5: Propagate clock constraints through DCSC
2023-02-13 10:25:07 +01:00
rowanG077
9e8f8b7b45 streamline constant_net detection 2023-02-06 17:05:28 +01:00
Sylvain Munaut
582410629b ice40: Don't assert on unknown extra_config bits if they are 0
Bits are 0 by default anyway, so if they are unknown (because icestorm
is too od) but we want them at 0 ... it's not much of an issue.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2023-02-01 15:14:18 +01:00
Sylvain Munaut
49ae495344 ice40: Add support for PLL ICEGATE function
Technically you can enable it independently on CORE and GLOBAL
output, but this is not exposed in the classic primitive, so
we do the same as icecube2 and enable/disable it for both output
path depending on the argument

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2023-02-01 11:41:35 +01:00
Sylvain Munaut
f50d4c1ed1 ice40: Support for undriven / unconnected output ports
If a port specified as output (and thus had a $nextpnr_obuf inserted)
is undriven (const `z` or const `x`), we make sure to not enable
the output driver. Also enable pull-ups if it was requested by the user.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2023-01-29 22:35:19 +01:00
Sylvain Munaut
0cf5006e3b ice40: Rework pull-up attribute copy to SB_IO blocks
We try to copy the attribute only when there is a chance for
the output driver to not be active.

Note that this can _also_ happen when a port is specified as
output but has a TBUF, which the previous code wasn't handling.

We could copy the attribute "all-the-time" but this would
mean if a user specified a `-pullup yes` in the PCF for a
permanently driven output pin, we'd be burning power for
nothing.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2023-01-29 22:35:19 +01:00
Sean Anderson
df99b4ff6c ice40: Add debugs to isBelLocationValid for SB_IO
When there is a constraint conflict while placing IOs, the user gets an
error message such as

ERROR: Bel 'X0/Y27/io1' of type 'SB_IO' is not valid for cell 'my_pin' of type 'SB_IO'

While this identifies the problematic cell, it does not explain why
there is a problem. Add some verbose messages to allow users to
determine where the problem is. This can result in something like

Info: Net '$PACKER_VCC_NET' for cell 'my_pin' conflicts with net 'ce' for 'ce_pin'

which provides something actionable.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-12-07 10:32:38 +01:00
gatecat
603b60da8d api: add explain_invalid option to isBelLocationValid
Signed-off-by: gatecat <gatecat@ds0.me>
2022-12-07 10:27:58 +01:00
gatecat
e260ac33ab refactor: ArcBounds -> BoundingBox
Signed-off-by: gatecat <gatecat@ds0.me>
2022-12-07 10:00:53 +01:00
gatecat
c62a947a28 api: Make NetInfo* of checkPipAvailForNet const
Signed-off-by: gatecat <gatecat@ds0.me>
2022-12-02 14:20:39 +01:00
Tyler
613d84fb72
Correct Not Equal operator implementation in ice40
I noticed this during my work reimplementing nextpnr, and it seems to be dead and wrong, or at least dead. Either way I think this is what was intended unless anyone can correct me.
2022-10-17 01:19:51 -07:00
gatecat
a16d184956 ice40: Fix handling of carry out route-thru via 25,14
Signed-off-by: gatecat <gatecat@ds0.me>
2022-09-26 09:33:38 +02:00
gatecat
a920ffcf70 ice40: implement checkPipAvailForNet
Signed-off-by: gatecat <gatecat@ds0.me>
2022-09-20 14:15:10 +02:00
gatecat
0a8c411692 ice40: Fix UltraPlus BRAM clock polarity
Signed-off-by: gatecat <gatecat@ds0.me>
2022-09-14 09:24:49 +02:00
Adam Sampson
19160f10ae Use CMake's Python3 rather than PythonInterp in subdirs 2022-08-21 17:48:01 +01:00
gatecat
c60fb94b6c refactor: Use IdString::in instead of || chains
Signed-off-by: gatecat <gatecat@ds0.me>
2022-08-10 18:58:22 +01:00
gatecat
77c82b0fbf refactor: id(stringf(...)) to new idf(...) helper
Signed-off-by: gatecat <gatecat@ds0.me>
2022-08-10 10:57:46 +01:00
gatecat
6122f172e3 ice40: Fix accidental creation of empty ports
Signed-off-by: gatecat <gatecat@ds0.me>
2022-06-25 15:56:16 +01:00
gatecat
27966f101f ice40: Fix propagation of constraints through SB_GB
Signed-off-by: gatecat <gatecat@ds0.me>
2022-05-08 12:44:03 +01:00
gatecat
d3ba259db2 ice40: Avoid chain finder from mixing up chains by only allowing I3 chaining at end
Signed-off-by: gatecat <gatecat@ds0.me>
2022-04-11 18:46:44 +01:00
gatecat
92a58a2631 ci: Restructure and move entirely to GH actions from Cirrus
Signed-off-by: gatecat <gatecat@ds0.me>
2022-04-08 18:42:39 +01:00
gatecat
336124b879 ice40: Fix wirenames containing / which is the list separator
Signed-off-by: gatecat <gatecat@ds0.me>
2022-03-30 20:57:00 +01:00
gatecat
5a9ddc0675 ice40: Merge driving LUT<=2s into carry-only LCs
Signed-off-by: gatecat <gatecat@ds0.me>
2022-03-29 13:37:14 +01:00
gatecat
07c8506372 ice40: Improve error reporting for PLL conflicts
Signed-off-by: gatecat <gatecat@ds0.me>
2022-03-25 15:55:07 +00:00
gatecat
14d53dfec8 clangformat
Signed-off-by: gatecat <gatecat@ds0.me>
2022-03-17 19:24:05 +00:00