route_mult binds dedicated, locked routing for each CC_MULT cluster with wires
computed from the cluster's placed location, reaching a couple of tiles outside
the cluster body (the A-passthrough column sits at root.x-1 and its switch-box
routes reach further). Nothing reserved those halo wires during placement and
there was no spacing rule between multiplier clusters, so once the placer packed
two clusters close enough their halos overlapped and route_mult double-bound a
shared wire -> abort in bindPip (base_arch.h: w2n_entry == nullptr). It was
seed-dependent and only surfaced on denser designs.
Add a placement-legality rule in isBelLocationValid: compute a multiplier
cluster's halo bounding box (its placed cells' bbox expanded by a margin that
covers route_mult's reach) and reject the placement if it overlaps another
multiplier cluster's halo. The multiplier cluster roots are cached once in
assign_cell_info (via the existing multiplier_* pools) so the check is cheap.
Verified on a design that reproducibly triggered the collision: seeds that
previously aborted in 'Routing multipliers' now place and route, and a seed that
already routed still routes (the rule does not over-constrain). Pairs with the
route_mult.cc change that turns the residual assert into an actionable error.
Co-Authored-By: Claude <noreply@anthropic.com>
find_and_bind_downhill_pip() bound multiplier halo pips unconditionally, so two
multiplier clusters placed close enough that their dedicated (locked) routing
overlaps would trip the opaque bindPip assertion (base_arch.h: w2n_entry == nullptr).
Make the primitive:
- idempotent when the destination wire is already part of THIS net's route
(a revisit of a shared start wire is a no-op, not an error);
- fail with an actionable message naming the wire and both contending nets when
a DIFFERENT net already holds the wire -- never silently drop the connection.
This does not yet prevent the collision (that needs a placement-spacing rule so
two multiplier clusters' halos cannot overlap); it converts an opaque abort into
a diagnosable error and removes a latent same-net re-bind assertion.
Co-Authored-By: Claude <noreply@anthropic.com>
When a PLL output is connected to a BUFG, it can only be connected to it.
The message is improved in mentioning it and listing all ports connected and the pll name.
This simplify debug.
Adding freeing of the addition/subtraction mode switch PIP.
We're limiting optimization to just one constant input—cases with two
constant inputs are rare, and this raises questions about how such ALUs
are generated in synthesis.
LUT knowledge calculations have been replaced with table
constants—faster and easier to verify.
Addresses https://github.com/YosysHQ/apicula/issues/514
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
POSIX allows any `int` value to be returned but specifies that only
the low 8 bits are available in some contexts:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/_exit.html
For reasons that aren't entirely clear, WASI requires the value to be
in range [0;126), and this is enforced with an assertion at runtime
level in Wasmtime. This should probably be fixed in Wasmtime but until
it is done there doesn't seem to be any harm in returning `125` instead
of `-1`. This also removes any discrepancy due to truncation.
* generic: Fix Python path not including the examples/ directory in the example
It seems that at some point, the embedded Python stopped including the
directory that nextpnr-generic was executed in inside of its sys.path.
This likely happened by de3d5be8 specifying an explicit argv to
the interpreter init function.
* generic: Improve the example for K != 4
Configuring K < 4 used to result in "dangling" inputs to the cells being
generated (those are just not driven by anything in the resulting Verilog/JSON).
Configuring K > 4 used to result in an assertion crash in cells.cc.
The ctx.setLutK call fixes both cases.
Define open_(o|i)fstream_and_log_error in log.h to:
- quote 'filename'
- add error cause to easier troubleshoot
- use existing consistent string style
- easily allows OS specific message
Introduce it when file are opened and add it where error message
was missing.