Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from YosysHQ:master #258

Open
wants to merge 1,429 commits into
base: master
Choose a base branch
from
Open

[pull] master from YosysHQ:master #258

wants to merge 1,429 commits into from

Conversation

pull[bot]
Copy link

@pull pull bot commented Apr 25, 2021

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull bot added the ⤵️ pull label Apr 25, 2021
@todo
Copy link

todo bot commented May 7, 2021

for more complex PLL type setups, we might want a toposort or iterative loop as the PLL must be placed

// TODO: for more complex PLL type setups, we might want a toposort or iterative loop as the PLL must be placed
// before the GBs it drives
for (auto cell : sorted(ctx->cells)) {
CellInfo *ci = cell.second;
const GlobalCellPOD *glb_cell = global_cell_info(ci->type);
if (glb_cell == nullptr)


This comment was generated by todo based on a TODO comment in 432b9d8 in #258. cc @YosysHQ.

@todo
Copy link

todo bot commented May 7, 2021

substantial performance improvements are probably possible, although of questionable benefit given

// TODO: substantial performance improvements are probably possible, although of questionable benefit given
// the low number of globals in a typical device...
BelId best_bel;
int shortest_distance = std::numeric_limits<int>::max();
for (auto bel : getBels()) {


This comment was generated by todo based on a TODO comment in 432b9d8 in #258. cc @YosysHQ.

mmicko and others added 27 commits October 2, 2023 14:49
Signed-off-by: gatecat <[email protected]>
Signed-off-by: gatecat <[email protected]>
Fixed incorrect use of attributes instead of parameters.

Signed-off-by: YRabbit <[email protected]>
…onnected

Currently a segfault happens when the DI port is not specified. Leaving
it unconnected is probably incorrect, but it shouldn't crash the placer.
Fix by adding a check.
Signed-off-by: gatecat <[email protected]>
whitequark and others added 30 commits January 13, 2025 03:29
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
Normalize keywords to:

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

    foreach (...)
    endforeach()

    other(...)

Normalize whitespace to 4 spaces.
The two main changes, done together in this commit, are:
* Eliminating most instances of `aux_source_directory()`, replacing
  them with explicit file listings; and
* Moving these file listings into respective subdirectories by
  representing respective nextpnr components as interface libraries.

In addition, the GUI CMake script tree was simplified since it had
a lot of unused/redundant code.

The `aux_source_directory()` command is not recommended for use by
CMake itself because it misses dependency changes when adding/removing
files, and consequently causes build failures requiring a clean rebuild.

This commit does not touch anything related to architectures/families,
which are very complex and redundant all on their own.
* Fix build using ubuntu-latest

* Update to latest icestorm
This accounts for the use of either the system or the vendored pybind11.

Fixes #1428.
This fully preserves existing functionality, although the `embed` mode
is untested and seems broken.
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.
Primarily, this commit makes both of them use the `BBAsm` functions
to build and compile `.bba` files.

In addition, Himbaechel targets are now aligned with the rest in
how they are configured: instead of having all uarches enabled with
all of the devices disabled (the opposite of the rest of nextpnr),
uarches must be enabled explicitly but they come with all devices
enabled (except for Xilinx, which does not have a list of devices).
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).
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
The impetus for this commit is the fact that it causes rare but
build-breaking race conditions when used with `make -jN` with `N > 1`.
These race conditions are difficult to track down or fix because of
the very rudmentary debugging tools provided by `make` and opaque
semantics of CMake's Makefile generator. They break the build by
running two `.bba` generation processes, then one of them renaming
the `.bba.new` file once it's done, leaving the other one to fail.

After reflection (as the author of this code path) and discussion with
community members who use it, I've concluded that this isn't the right
approach.
1. In practice, on targets where `-DSERIALIZE_CHIPDBS=` matters, you
   also care about other build steps, like linking nextpnr, which
   are not serializable this way. So you use a workaround anyway, like
   `make`ing individual targets instead.
2. The way to serialize the build with Make is the `-j1` option. Trying
   to work around `-jN` to make it work like `-j1` is inherently error
   prone. While there is some utility in not serializing C++ compilation
   this utility could be more easily achieved by providing a single
   target that builds all chipdbs, running `make <chipdb-target> -j1`,
   then running `make -jN` for the rest of the build.
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
In-tree builds pollute the source directory and make version control
more difficult to use effectively.
Under certain conditions (e.g., building on Fedora 42
using gcc-15.0.1), compilation fails with the following
error:

    "error: ‘uint8_t’ does not name a type"

Explicitly include <cstdint> to prevent that situation.

Signed-off-by: Gabriel Somlo <[email protected]>
Due to the way CMake-generated Makefiles evaluate dependencies, this
calls the `.bba` generation custom command twice, which then fails as
they both use the same `.bba.new` file as an output and one of them
moves it first.

This broke builds using `make -j` but not builds using
`make -j nextpnr-himbaechel-example`.
Adds output (MIPI_OBUF and MIPI_OBUF_A) and input (MIPI_IBUF) primitives
to allow the use of “real” MIPI (not emulation) ports capable of
operating in both HS and LP modes.

Signed-off-by: YRabbit <[email protected]>
Signed-off-by: YRabbit <[email protected]>
* Gowin. Add I3C io buffer.

A buffer is added that can operate as a normal IOBUF in PUSH-PULL mode
or switch to open-drain IOBUF mode.

Signed-off-by: YRabbit <[email protected]>

* Gowin. Turn a variable into a set of flags

Signed-off-by: YRabbit <[email protected]>

---------

Signed-off-by: YRabbit <[email protected]>
prjunnamed normalizes ports that are not present in the primitive
to be all-x. On iCE40, this can cause a false placement conflict
between `SB_IO` cells where one's clock input is `x` and another's is
some other net.
prjunnamed does not emit a net alias for toplevel ports. This works
fine for constraining IOs but breaks clock constraints. This commit
expands clock constraint application code to look up net aliases first,
ports second.
When -Wnarrowing is enabled, compilation of generated
chipdb*.bin.cc files produces a large number of messages:

  "narrowing conversion of ... from ‘int’ to ‘const char’ [-Wnarrowing]"

Explicitly using uint8_t instead of char when referencing
embedded chipdb arrays resolves these issues.

Suggested-by: Catherine <[email protected]>
Signed-off-by: Gabriel Somlo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.