1
0
mirror of https://github.com/YosysHQ/nextpnr.git synced 2026-04-24 19:40:12 +00:00

352 Commits

Author SHA1 Message Date
gatecat
d5e6bfc74e clangformat
Signed-off-by: gatecat <gatecat@ds0.me>
2026-04-20 15:45:20 +02:00
gatecat
f2e650223a xilinx: Routeability tuning
Signed-off-by: gatecat <gatecat@ds0.me>
2026-04-20 15:44:45 +02:00
myrtle
2a84cc9c55 xilinx: Add LUT route-thru pips (#1703)
Signed-off-by: gatecat <gatecat@ds0.me>
2026-04-20 11:47:38 +02:00
mrcmry
33e1c9033b Improve file open error messages (#1700)
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.
2026-04-19 16:41:47 +02:00
gatecat
28fefe6172 xilinx: Allow loading post-place JSON for router dev
Signed-off-by: gatecat <gatecat@ds0.me>
2026-04-17 10:47:04 +02:00
gatecat
0fa7ee0ce5 xilinx: Improve delay estimate
Signed-off-by: gatecat <gatecat@ds0.me>
2026-04-17 10:20:32 +02:00
sylefeb
e6ecd8fab4 gatemate: removing recursion in GateMateImpl::reassign_bridges (#1697)
* gatemate: removing recursion in GateMateImpl::reassign_bridges

* gatemate: improving comments in GateMateImpl:reassign_bridges

* gatemate: making naming more consistent, adding comments about the need for recursion removal
2026-04-12 09:13:48 +02:00
gatecat
a3bccdd33d xilinx: Use clock router for MMCMs too
Signed-off-by: gatecat <gatecat@ds0.me>
2026-04-09 14:22:06 +02:00
gatecat
f99422dcad xilinx: Better use global clocking resources
Signed-off-by: gatecat <gatecat@ds0.me>
2026-04-09 13:37:52 +02:00
sylefeb
f688fc080c gatemate: adding missing iomanip header for std::setprecision (#1695) 2026-04-09 10:22:18 +02:00
YRabbit
764c6a6696 Gowin. Implement CLKDIV. (#1691)
Add CLKDIV — a frequency divider with ratios of 1, 2, 3, 3.5, 4,
5, 6, 7, and 8.

A direct, non-switchable connection to CLKDIV2 makes placement more
difficult — we have to account for CLKDIV2’s occupancy for IOLOGIC and,
if necessary, duplicate the cell, as well as create clusters of CLKDIV
and CLKDIV2.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2026-04-06 15:34:34 +02:00
YRabbit
c7da64d8c8 Gowin. Implement GW5A HCLK and CLKDIV2. (#1687)
* Gowin. Implement GW5A HCLK and CLKDIV2.

HCLK pins have been added for the GW5A series, and the placement of
CLKDIV2 primitives has been updated to account for the specific
characteristics of this chip series.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>

* Gowin. Fix style.

* Gowin. Fix style.

---------

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2026-04-03 09:40:45 +02:00
myrtle
c6b876fc85 control set awareness in the HeAP legaliser (#1678)
* xilinx: Index control sets

Signed-off-by: gatecat <gatecat@ds0.me>

* heap: data structure for control sets

Signed-off-by: gatecat <gatecat@ds0.me>

* heap: fail faster on control set mismatch

Signed-off-by: gatecat <gatecat@ds0.me>

* xilinx: Reduce control set search radius

Signed-off-by: gatecat <gatecat@ds0.me>

* Fix compiler warning

Signed-off-by: gatecat <gatecat@ds0.me>

* heap: Allow disabling control set awareness for comparison/debug

Signed-off-by: gatecat <gatecat@ds0.me>

* heap: Add some notes about control sets

Signed-off-by: gatecat <gatecat@ds0.me>

* heap: Fix typo and regression

Signed-off-by: gatecat <gatecat@ds0.me>

* heap: Add a schedule for ctrlset search radius

Signed-off-by: gatecat <gatecat@ds0.me>

* heap: Tidy up

Signed-off-by: gatecat <gatecat@ds0.me>

---------

Signed-off-by: gatecat <gatecat@ds0.me>
2026-04-02 13:36:50 +02:00
myrtle
10c5997007 xilinx: Improve LUT/CARRY->FF packing (#1683)
Signed-off-by: gatecat <gatecat@ds0.me>
2026-04-01 11:22:00 +02:00
Balint Cristian
497d685139 xilinx: Use proper xray-db device family subfolder (#1680) 2026-04-01 11:10:07 +02:00
gatecat
a7c3bfe6e6 clangformat
Signed-off-by: gatecat <gatecat@ds0.me>
2026-03-24 19:06:31 +01:00
gatecat
fcc1a33f75 xilinx: Derive clock constraints through PLLs
Signed-off-by: gatecat <gatecat@ds0.me>
2026-03-24 14:08:37 +01:00
Miodrag Milanovic
2ace82d9ce gatemate: force chipdb bump 2026-03-18 13:14:56 +01:00
gatecat
e652226630 xilinx: Prohibit IDELMUXE3 route throughs
Signed-off-by: gatecat <gatecat@ds0.me>
2026-03-17 10:34:59 +00:00
YRabbit
cd36c9f0d5 GOWIN. BUGFIX. BSRAM port renaming. (#1669)
* GOWIN. BUGFIX. BSRAM port renaming.

The renumbering of the BSRAM pins has been corrected.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>

* GOWIN. Comment BSRAM port renaming

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>

---------

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2026-03-14 20:52:05 +00:00
Justin
2c16785078 gowin: add DL-series latch cell support (#1652)
* gowin: add DL-series latch cell support

Teach the himbaechel Gowin backend to recognize and place all 12
DL-series latch primitives onto DFF BEL sites. Latches use the CLK
pin for the gate signal and share placement resources with DFFs.

* gowin: convert latches to DFFs with LATCH attribute during packing

Instead of teaching all DFF infrastructure about 12 DL latch types,
pack_latches() converts them to corresponding DFF types early and sets
a LATCH attribute. This attribute is picked up by gowin_pack to set
REGMODE=LATCH instead of FF.

* gowin: exclude latch gate signals from clock buffer promotion

Latch cells are mapped to DFFs with a LATCH attribute, so their gate
signal drives the CLK port. This caused pack_buffered_nets to promote
the gate signal onto a global clock buffer (BUFG), which has different
timing/initialization behavior and caused the first gate transition
to be lost. Skip CLK pins on cells with the LATCH attribute when
checking for clock users.

* gowin: update latch message to be user friendly.
2026-03-14 19:12:08 +00:00
Justin
77c5c67ade fix: handle string DRIVE property in pack_io without crashing (#1668)
* fix: handle string DRIVE property in pack_io without crashing

The XDC parser stores all set_property values as string Properties,
but pack_io.cc called as_int64() on DRIVE which asserts !is_string.

Rather than converting numeric values to integer Properties in the
XDC parser (which risks breaking properties like LOC that downstream
code reads via to_string()/as_string()), fix the consumption site
in pack_io.cc to convert string values to integers when needed.

* refactor: use int_or_default for DRIVE property parsing

Replace manual is_string/as_int64 branching with int_or_default(),
which already handles both Property types with proper error reporting.
2026-03-14 07:01:10 +00:00
gatecat
84856bd669 gowin: Add timings for BRAM
Signed-off-by: gatecat <gatecat@ds0.me>
2026-03-11 15:24:40 +00:00
YRabbit
e9b7da5a0f GOWIN. Fix DP when READ_MODE=1
Dual Port has a defective output register. This only manifests itself at
small data widths and only on -C chips.

That is, Tangprimer20k (GW2A-18) works perfectly, while Tangnano20k
(GW2A-18C) stutters. The same story with GW1N-9 and GW1N-9C.

Fortunately, the fix has long been included in nextpnr for SDP memory,
so all that remains is to call the same function for Dual Port.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2026-03-10 07:17:22 +01:00
gatecat
62f24f6fae gowin: Add SLICE BELs to gui
Signed-off-by: gatecat <gatecat@ds0.me>
2026-03-09 12:36:24 +01:00
YRabbit
111f085d64 GOWIN. Fix dual port CE-OCE.
We are fixing a hardware error - in BYPASS mode, dual port bsram
requires synchronization of CE and OCE signals for some data widths.

We are also getting rid of port renaming in the loop, but not all of
them yet.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2026-03-09 12:23:01 +01:00
gatecat
4ace8952d3 xilinx: Support cascaded IOSERDES and TMDS
Signed-off-by: gatecat <gatecat@ds0.me>
2026-03-05 13:59:35 +01:00
YRabbit
4f27338b23 GOWIN. Refactor port renaming (1)
Use common function for ADC/PLL/Flash ports.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2026-03-05 09:17:43 +01:00
gatecat
8c40db213a xilinx: Stub predictDelay implementation
Signed-off-by: gatecat <gatecat@ds0.me>
2026-03-04 11:28:10 +01:00
gatecat
f177c39c0b xilinx: Mark global buffers as such for HeAP/SA
Signed-off-by: gatecat <gatecat@ds0.me>
2026-03-04 09:54:20 +01:00
gatecat
fcaafbaa08 static: Fix NaN on a big xilinx design
Signed-off-by: gatecat <gatecat@ds0.me>
2026-03-04 09:46:08 +01:00
YRabbit
dd4d3056eb Gowin. DSP. Refactor port renaming.
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2026-03-04 09:04:55 +01:00
YRabbit
008ccae25b Gowin. DSP. Implement MULT27X36.
The new multiplier is made from two 27x18 units by switching inputs and
creating a cluster connected via CASO->CASI.

A second pass was required to process the multipliers created on the
fly—the processing of DSP cells was separated into a separate function,
which resulted in a large diff, but in reality there were very few
changes.

An important point is that in the 5A series, there is a gap between
adjacent DSPs in one row. There are still SIA/CASI wires, so the DSPs on
either side of the gap are connected, but the distance between them is
greater than usual. We take this fact into account based on the gap
coordinates from the chip database.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2026-03-04 09:04:55 +01:00
myrtle
575689b7e4 himbaechel: Enable use of electrostatic placer (#1657)
Signed-off-by: gatecat <gatecat@ds0.me>
2026-03-03 12:19:41 +01:00
myrtle
eba9764645 xilinx: Import timings for BRAM (#1653)
Signed-off-by: gatecat <gatecat@ds0.me>
2026-03-02 10:10:55 +01:00
YRabbit
6235ba21e3 Gowin.DSP. Add MULTALU27X18. (#1650)
This primitive occupies one DSP block entirely and can be connected into
complex chains both by arguments (shifting operands from SOA to SIA) and
by results (CASO->CASI cascades).

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2026-02-26 12:25:10 +01:00
myrtle
e953c250a4 himbaechel: Add getDefaultRouter, default to router2 for gatemate (#1649)
Signed-off-by: gatecat <gatecat@ds0.me>
2026-02-25 16:16:36 +01:00
gatecat
0d3a578539 run clangformat
Signed-off-by: gatecat <gatecat@ds0.me>
2026-02-25 11:18:14 +01:00
Miodrag Milanović
b0d6b97936 gatemate: floorplanning [sc-168] (#1607)
* gatemate: add CCF floorplanning parser

* apply constraints

* cleanup

* print detected region and error if not found

* Add wildcard matching

* Validate placebox and use official coordinate system

* Fix some messages
2026-02-25 10:05:36 +01:00
mrcmry
0c970d6891 gatemate: improve --help and error messages (#1639)
* gatemate: improve mode arg error message

* gatemate: fix initial capitals and periods in log_*() messages

* gatemate: replace operation -> performance for mode in help and log_*()

This is the term used both in the datasheet and the primitive library PDF.
2026-02-25 09:39:05 +01:00
Miodrag Milanović
a60fdbb9a2 gatemate: initial support for MX4b (#1624) 2026-02-25 08:47:27 +01:00
Miodrag Milanović
b8a6559a3f gatemate: add CP lines as clock and general routing [sc-184] (#1638)
* gatemate: add alternate clock routes

* use additional pins

* Fix clock router and timings

* Fix DDR nets

* Test passtrough concept

* remove not used variable

* wip

* handle pip masks

* Cleanup

* create CPE_CPLINES cells and set properties on them

* Fix pip masking

* rough code to break cplines into subnets

* add ports to cell

* mux bridges need cell bel pins too

* fix multiplier output register packing

* remove empty if

* Fix ODDR

* Add options to disable some pips

* Use resources info

* mask field to resource field

* produce valid netlist with propagation netlist at least

* adapt reassign_cplines for internal resource pips

* Handle block and resources

* fix formatting

* It is required to set all mandatory properties now

* arch API for resources

* current progress

* Add option to skip bridges

* perform per-wire resource congestion costing

* Added no-cpe-cp option

* resource bugfix

* comment out spammy debug message

* Fix routing conflicts issues

* allow only some pass trough for clock router

* handle inversion bits for pass signals

* verify inversion before/after assigning bridges

* we care only if there is net

* Revert "we care only if there is net"

This reverts commit 3da2769e31.

* Revert "verify inversion before/after assigning bridges"

This reverts commit 8613ee17c8.

* chipdb version bump

* clangformat

* cleanup

* cleanup

* Initial conversion to GroupId

* Keep group info in pip extra

* Cleanup headers

* Initialize resource efficiently

* Addressing review comments

* improve resource docs

* Make CP lines not use as clocks as default

---------

Co-authored-by: Lofty <dan.ravensloft@gmail.com>
2026-02-25 08:22:16 +01:00
myrtle
501b36e646 gowin placement performance improvements, phase 3 (#1646)
* gowin: Improve placer performance

Signed-off-by: gatecat <gatecat@ds0.me>

* Add blocker cells for LUTRAM

Signed-off-by: gatecat <gatecat@ds0.me>

* gowin: Faster validity checks

Signed-off-by: gatecat <gatecat@ds0.me>

* heap: Improve macro handling, in verbose report per cell type

Signed-off-by: gatecat <gatecat@ds0.me>

---------

Signed-off-by: gatecat <gatecat@ds0.me>
2026-02-24 20:56:54 +01:00
gatecat
1f4d3fdc91 Add a workaround for DCI for now
Signed-off-by: gatecat <gatecat@ds0.me>
2026-02-21 20:17:34 +01:00
gatecat
fc1f50937c xilinx: Enable MMCM related pips
Signed-off-by: gatecat <gatecat@ds0.me>
2026-02-21 20:17:34 +01:00
gatecat
05e6915369 xilinx: Fix RAM256X1S packing
Signed-off-by: gatecat <gatecat@ds0.me>
2026-02-21 20:17:34 +01:00
gatecat
0cd6e72d5f xilinx: Add MMCM support
Signed-off-by: gatecat <gatecat@ds0.me>
2026-02-21 20:17:34 +01:00
gatecat
c0ff514582 xilinx: Work around missing kintex7 timing for now
Signed-off-by: gatecat <gatecat@ds0.me>
2026-02-21 17:52:08 +01:00
YRabbit
d43c09d070 Gowin. Divide packer. (#1645)
Split the packer into several files.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2026-02-21 08:11:39 +01:00
YRabbit
5bbaac8572 Gowin. Implement GW5A DSP. (#1641)
* Gowin. DSP. Implement MULT12x12.

The 5A series DSP differs from previous ones. Many things have been
greatly simplified: there are only two control signals of one type per
cell (2 CLK, 2 CE and 2 RESET), and these signals are now explicitly
specified in the DSP attributes, which makes the automatic assignment
mechanism unnecessary for them.

The DSP occupies 3 cells instead of nine due to the exclusion of 4
low-bit multipliers - now there are only two 12x12. There will naturally
be clusters, but they will be simpler and consist of other primitives.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>

* Gowin. Implement MULTADDALU12X12.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>

---------

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2026-02-20 07:48:22 +01:00