Commit Graph

5107 Commits

Author SHA1 Message Date
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
Leo Moser ca74f47c3f
Improvements to FABulous (#1692)
* fabulous: fix I0mux naming

Signed-off-by: Leo Moser <leomoser99@gmail.com>

* fabulous: pack more FF types: reset before enable

Signed-off-by: Leo Moser <leomoser99@gmail.com>

* fabulous: fix block tracking of FABULOUS_LC, improve debug messages, fix masking of 1

Signed-off-by: Leo Moser <leomoser99@gmail.com>

* fabulous: add 'corner' argument

Signed-off-by: Leo Moser <leomoser99@gmail.com>

---------

Signed-off-by: Leo Moser <leomoser99@gmail.com>
2026-04-09 11:38:36 +02:00
gatecat ae7843fbf0 ecp5: Fix case of one net driving multiple DCSs
Signed-off-by: gatecat <gatecat@ds0.me>
2026-04-09 10:34:22 +02:00
sylefeb f688fc080c
gatemate: adding missing iomanip header for std::setprecision (#1695) 2026-04-09 10:22:18 +02:00
myrtle 5d46a5eeea
ice40: Hide IO and PLL that can't be used from utilisation report (#1694)
Signed-off-by: gatecat <gatecat@ds0.me>
2026-04-08 14:28:53 +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
Lunaphied 25482d990f
nix: fix issue with latest apycula being needed and it not being in Nixpkgs stable (#1690)
* nix: fix issue with latest apycula being needed and it not being in Nixpkgs stable

* nix: we really should be using the latest version unless a regression happens tbh
2026-04-04 16:38:55 +02:00
myrtle 41032f9d77
cleanup: Remove dead files (#1688)
Signed-off-by: gatecat <gatecat@ds0.me>
2026-04-03 09:41:32 +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
Lunaphied d6b4d3ed3d
common: fix missing header in array2d.h (#1686)
This trips up my LSP and is technically wrong.
2026-04-02 21:37:20 +02:00
jdavidberger b8c350b3e4
Update pack.cc (#1685)
This fixes a memory issue. When you assign to base_iodelay_rules from itself, the LHS when you do `base_iodelay_rules[id_DELAYA] = base_iodelay_rules[id_DELAYB]`, can cause a heap allocation which possibly invalidates the memory of the RHS. 

This was found while running nextpnr under ASAN. It might be useful to add testing under libasan into CI.
2026-04-02 20:53:07 +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
jdavidberger 12bb6df237
Update archdefs.h (#1684)
Fix typo in != operator
2026-04-01 19:17:04 +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
mrcmry 4f5db1f7b9
gui: fix segfault when providing --sdc (#1682) 2026-04-01 11:09:00 +02:00
Lunaphied 77ccf518d5
nix: minor improvements for the nix shell to modernize it (#1677) 2026-03-26 21:12:30 +01: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
gatecat 5281b8d8af Revert "ecp5: Also promote EBRD_CLK to global"
This reverts commit e359390ad3.
2026-03-21 15:04:04 +01:00
gatecat e359390ad3 ecp5: Also promote EBRD_CLK to global
Signed-off-by: gatecat <gatecat@ds0.me>
2026-03-21 14:36:59 +01:00
gatecat 93fe10ceb1 heap: fix calculation of legalisation runtime
Signed-off-by: gatecat <gatecat@ds0.me>
2026-03-19 14:59:46 +01:00
Marcel Jung a13729951c
fabulous: check for _mux BEL suffix in all checks in fabulous.cc (#1674) 2026-03-18 19:45:58 +01:00
myrtle aeffe819de
heap: Refactor strict legaliser into multiple functions (#1671)
Signed-off-by: gatecat <gatecat@ds0.me>
2026-03-18 19:19:45 +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
Marcel Jung 54f160d855 fabulous: add support for the In/OutPass4_frame_config_mux BELs 2026-03-12 16:24:28 +00:00
Marcel Jung 002c0a1b68 fix: use the 'b prefix when writing a generic FABulous BEL to FASM, so the value is correctly interpreted in further steps 2026-03-12 14:55:04 +00:00
gatecat 84856bd669 gowin: Add timings for BRAM
Signed-off-by: gatecat <gatecat@ds0.me>
2026-03-11 15:24:40 +00:00
Rowan Goemans 60f02a200d ecp5/pack: split carry chains by re-driving CIN from S0
When splitting a carry chain the original COUT -> carry -> CIN
was preserved. This was not routable if the carry chain is split.
Instead now the COUT is wired to a feed out CC2C whose `S0` port
is the start of the new carry chain.
2026-03-11 14:04:50 +01: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
gatecat 8c2f8810d4 update picorv32.sh
Signed-off-by: gatecat <gatecat@ds0.me>
2026-03-04 09:02:13 +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
gatecat ab7aa9ffab ci: Actually build some himbaechel uarches
Signed-off-by: gatecat <gatecat@ds0.me>
2026-03-02 18:34:47 +01:00
Leo Moser 50c2ca21a3
fabulous: improve pcf implementation, create global clock only if necessary (#1654)
* fabulous: report port as unconstrained unless BEL attr set

Signed-off-by: Leo Moser <leomoser99@gmail.com>

* fabulous: only create global clock if needed

Signed-off-by: Leo Moser <leomoser99@gmail.com>

---------

Signed-off-by: Leo Moser <leomoser99@gmail.com>
2026-03-02 18:26:04 +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