Commit Graph

5006 Commits

Author SHA1 Message Date
Miodrag Milanović a530283600
Cleanup Context API (#1593)
* Cleanup Context API

* Remove exit to prvent crash
2025-10-23 14:44:14 +02:00
YRabbit c133d00e2e
Gowin. Take the arch arguments directly. (#1592)
Since ctx->getArchArgs() no longer returns architecture-specific
arguments, we read the args field directly.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2025-10-23 07:58:01 +02:00
myrtle c7cfb0aa4b
Remove use of boost system and filesystem (#1591)
Signed-off-by: gatecat <gatecat@ds0.me>
2025-10-22 15:01:21 +02:00
Miodrag Milanović 9ccd132437
himbaechel: add uarch specific options parsing (#1582)
* himbaechel: add uarch specific options parsing

* fix tests

* add reference to additional help

* review comments addressed

* cleanup and unify other uarch

* Adressed PR comments
2025-10-21 14:41:53 +02:00
Miodrag Milanović c6f408dfa7
gatemate: additional region handling (#1583)
* gatemate: Use GATEMATE_DIE attribute to select placement die

* add DIE parameter in CCF

* add penalty delay when crossing between dies

* Add predictDelay
2025-10-21 13:47:07 +02:00
Miodrag Milanović 924f3a50ab
gatemate: properly name timing and operational mode (#1587) 2025-10-21 13:46:34 +02:00
YRabbit dfef396dec
Gowin. Delete unused OBUFs. (#1581)
Paired with
6535995005

now that we may receive unattached OBUFs, we ignore them.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2025-10-17 14:16:52 +02:00
Miodrag Milanović 64db93e319
Google Test as submodule (#1579)
* remove copy of googletest from 3rdparty

* Add googletest as submodule

* Use googletest v1.17.0

* Update main CMakeLists.txt
2025-10-17 14:16:18 +02:00
Miodrag Milanović 6d187fb8d0
Update CI and README for Qt6 (#1584)
Co-authored-by: OpenProgger <openproggerfreak@gmail.com>
2025-10-17 14:16:07 +02:00
Miodrag Milanovic 9d7e1d0ad1 gatemate: bump chipdb to 1.9 2025-10-17 11:57:53 +02:00
Miodrag Milanović f19a67122f
gatemate: document clock distribution strategies (#1580)
* gatemate: document clock distribution strategies

* gatemate: rename option to strategy
2025-10-16 10:54:55 +02:00
Miodrag Milanovic f245185da8 clangformat 2025-10-15 15:38:35 +02:00
Miodrag Milanović 36045543c7
gatemate: support multiple clock distribution strategies (#1574)
* gatemate: support multiple clock distribution strategies

* error out on non supported cases

* Implement full use strategy

* Address review comments
2025-10-15 15:33:21 +02:00
Miodrag Milanović 17d42e41db
Make GUI able to compile on both Qt5 and Qt6 (#1576)
* Use QtPropertyBrowser for Qt5/6

* Fix cmake for python-console for consistency

* Make GUI compile for both Qt5 and Qt6

* Fix crash on init with Wayland on Qt6

* Cleanup

* disable deprecation warnings for now

* Relaxed cmake check for initial Qt6 test
2025-10-15 12:19:20 +02:00
YRabbit c7836625b9
Gowin. Add BSRAM SDP fix. (#1575)
In the GW5A series, the primitive SemiDual Port BSRAM cannot function
when the width of any of the ports is 32/36 bits - it is necessary to
divide one block into two identical ones, each of which will be
responsible for 16 bits.

Here, we perform such a division and, in addition, ensure that the new
cells resulting from the division undergo the same packing procedure as
the original ones.

Naturally, with some reservations (the AUX attribute is responsible for
this) - in the case of SP, when service elements are added, it makes
sense to do this immediately for 32-bit SP and only then divide.

Also, SDPs are currently being corrected for cases where both ports are
‘problematic’, but it may happen that one port is 32 and the other is,
say, 1/2/4/8/16. This has been left for the future.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2025-10-13 11:07:39 +02:00
egorxe 5194b5cc0a
MachXO2. Add support for several IO parameters. (#1572) 2025-10-13 11:06:44 +02:00
Lofty 35810c9f87
Rust cleanup (#1573)
* rust: formatting cleanup

* rust: explicitly mark as ISC license

* rust: use std::ffi C types instead of libc dependency
2025-10-10 16:04:19 +02:00
Gwenhael Goavec-Merou 4b00f58af5
himbaechel/uarch/gowin/cst.cc: added support for IO_LOC with _p/_n separated by a comma (#1571) 2025-10-08 14:26:50 +02:00
Simon Richter 5d45520bb2
ice40: Initialize context pointer in tests (#1568)
If the chipdb is not found, the Setup() call throws, but GTest still calls
TearDown, which then stumbles over the uninitialized pointer.

This makes the tests fail without valgrind errors or segfaults at least.
2025-10-06 09:12:32 +02:00
Miodrag Milanović e7f9060efb
placer_heap: fix clamping to region (#1569) 2025-10-06 09:08:24 +02:00
YRabbit e9bac6961a
Gowin. GW5A series BSRAM fix. (#1564)
In the new series of chips, the SemiDual Port primitive has one RESET
pin instead of two in previous versions - RESETA and RESETB.

Physically, the two pins are still there and both must be connected,
with RESETA being constant.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2025-10-04 15:03:33 +02:00
YRabbit 57f70aeeb8
Gowin. Remove the special status of corner tiles. (#1565)
Over time, it became clear that the special status of corner tiles is
handled in other parts of the toolchain, and in the GW5A chip series, it
began to interfere—in this series, IO can be located in the corners.

So we move the only function (creating VCC and GND) to the extra
function itself, and at the same time create a mechanism for explicitly
specifying the location of these sources in Apicula when necessary.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2025-10-04 15:02:53 +02:00
Miodrag Milanović ad76625d4d
gatemate: respect keep attribute and prevent crash with BEL set (#1566) 2025-10-02 11:27:44 +02:00
Miodrag Milanovic e16bd45b01 clangformat 2025-09-30 14:20:45 +02:00
Miodrag Milanović abb52f81c2
gatemate: cleanup of PLL and BUFG (#1562)
* Check SER_CLK more

* Use connectPorts

* move rewire code

* Move data structures

* move placement decision for later

* cleanups

* find working layout

* clangformat

* Inverted input on ODDR

* Fix some tests

* Copy clocks for multi die

* cleanup

* reporting

* bugfix

* handle PLL special inputs

* Fix user globals

* Proper DDR per bank and cleanup

* Add extra data for die regions and create them

* Better forced_die implementation

* Copy region to newly generated cells, and update when constrained

* Update PLL error messages

* Add TODO comment
2025-09-30 13:00:02 +02:00
Lofty 125df9952c
advertise gatemate support in readme (#1563) 2025-09-30 10:05:36 +02:00
Miodrag Milanović 8381827fa5
gatemate: Include and use connection timing data (#1559)
* convert nodes to pips

* add plane info for node pips

* a few multiplier router fixes

* do not need node delay

* add pip delays

* cleanup

* tried fixing clock router

* add PLL delays

* fix clock routing

* Do not use actual pip delay, determine best by number of passed pips

* optimize

* proper parameter check

* more multiplier fixes

* another mult fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* another multiplier fix

* log number of clock net users

* Revert "Do not use actual pip delay, determine best by number of passed pips"

This reverts commit c66e422dd0.

We want to guarantee minimum clock skew, so we need pip delay.

* route clocks from source to sink

* add time spent to route_clock

* weakly-bind non-global clocks

* clangformat

* remove dead code

* Require version 1.8

* change to assert

* add revisits in clock router

---------

Co-authored-by: Lofty <dan.ravensloft@gmail.com>
2025-09-30 09:13:29 +02:00
Lofty 8f8181c717 rust: extend example_printnets to demo iterators 2025-09-30 07:59:08 +01:00
Lofty 0ee8181733 rust: rework ownership model 2025-09-30 07:59:08 +01:00
Lofty 2e4ef6f71f
rust: small updates (#1560) 2025-09-24 13:59:30 +02:00
YRabbit 22041ed5df
Gowin. GW5A chips. Implement the DCS primitive. (#1558)
The GW5A series is interesting—in this particular primitive, the inputs
have been renamed from CLKx to CLKINx. Everything else remains the same,
including functionality.

As an output, we will store in the chip database which prefix the DCS
inputs have.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2025-09-23 12:42:33 +02:00
YRabbit 1742d09edb
Gowin. GW5A series PLLs. (#1557)
PLLA-type PLLs are implemented, which are used in GW5A-25A chips.

These are six powerful PLLs, each of which can generate seven
independent frequencies.

Since these devices have an unusual configuration—their fuse bits are
located outside the main grid and therefore their Bels do not have
specific “correct” coordinates—the extra bel functions mechanism is used
to describe them. But all the complexity falls on the apicula part.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2025-09-20 07:51:01 +02:00
YRabbit 4ab735c690
Gowin. Optimize ALU. (#1556)
By replacing the operation of adding the input to itself with a
specially formed LUT, we free up two PIPs.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2025-09-17 07:50:41 +02:00
Patrick Urban 00cf81e463
gatemate: fix static and handle dynamic FIFO almost full/empty offsets (#1555)
* gatemate/pack_bram: fix CC_FIFO_40K almost full/empty parameters

* gatemate/pack_bram: fifo read/write pointers are 16 bit wide

* gatemate/pack_bram: handle dynamic almost full/empty offsets
2025-09-12 15:02:28 +02:00
Miodrag Milanovic b8d2372019 gatemate: BUFG must be optional 2025-09-10 14:42:47 +02:00
Miodrag Milanović 8ac7ed161a
gatemate: code cleanup and netlist fix (#1554) 2025-09-10 14:04:42 +02:00
myrtle 9715a1d565
heap: Allow chains to ripup other chains (opt-in only) (#1552)
Signed-off-by: gatecat <gatecat@ds0.me>
2025-09-05 09:02:19 +02:00
Miodrag Milanović 141abe60a6
gatemate: cleanup BRAM handling (#1551) 2025-09-05 08:37:29 +02:00
Miodrag Milanović 21bfda4165
gatemate: fix fourgroup for multi die (#1550) 2025-09-03 12:20:11 +02:00
Lofty f238e2c4a5
okami: remove (#1549) 2025-09-02 19:42:07 +02:00
Miodrag Milanović 3eb682bcbb
gatemate: use CPE bridge (#1538)
* Add bridge support

* Use bridge only if CPE is unused

* do not use CPE_MULT for MUX routing

* Fixed and documented

* delay for CPE_BRIDGE

* Convert bridge pips into bels

Co-authored-by: Miodrag Milanovic <mmicko@gmail.com>

* recursively reassign bridges

* reconnect cell ports to new nets

* handle inversion bits

* sort data in output for easier compare

* one to be removed after testing

* debug message

* Remove need for notifyPipChange

* use same logic for detecting bridge pips

* make sure that the pip used is the one assigned

* one wire may feed multiple ports

* remove #if

* clean up wire binding

* add debugging

* fix

* clangformat

* put back to error

* use tile instead of getting name out of bel/pip

* bump chipdb

* adressing review comments

* Addressed last one

---------

Co-authored-by: Lofty <dan.ravensloft@gmail.com>
2025-09-02 18:00:01 +02:00
Miodrag Milanović 4e4f4ab113
gatemate: update bounding box (#1548) 2025-09-02 14:04:28 +02:00
Miodrag Milanović 0399b8865e
gatemate: Enable placing RAM halfs (#1544)
* gatemate: Split BRAMs into halfs

* Cleanups

* move code arround

* optmize remapping halfs

* Name RAM cells

* fix cluster setting for cascade mode

* attach ECC pins

* rewire global clocks

* bump chip database version

* Fix KEEPER setting

* Fix conflict check

* cleanup
2025-09-02 08:03:22 +02:00
YRabbit a18bd2e055
Gowin. BUGFIX. Add data about gate wires. (#1547)
Very rarely (about once a year), the dedicated clock router would
malfunction, issuing an incorrect route.

The reason turned out to be the so-called gate wires to the global clock
wire system from the logic. Among the PIPs for which these wires are
sinks, there are PIPs where the sources are also clock wires.

This leads to the possibility of feeding the clock signal back into the
gate and again into the global clock MUX.

If handled carelessly, this can lead to a complete loop.

But the loop option itself is particularly useful in the case of DCS
(dynamic clock selection) - the fact is that because these primitives
have four clock inputs and each of them could theoretically address all
56 clock sources, but in practice there are not enough wires and the DCS
inputs cannot serve as sinks for all clock sources.

The simplest solution (and the one that currently works) is to use the
gate to re-enter the clock system, but this time changing the clock
source.

This commit explicitly marks wires as gates and removes the possibility
of looping (however unlikely it may be) where a loop is not needed.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2025-09-02 07:51:08 +02:00
YRabbit 7d2caf6939 Gowin. Fix style.
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2025-09-01 16:14:49 +01:00
YRabbit 75aa8d16ac Gowin. Implement on-chip oscillator.
A programmable on-chip crystal oscillator has been implemented for the
GW5A series.

A critical innovation in this series was the change in the nature of the
OSC output pin—it now belongs to the clock wires, and therefore the
routes must be made with a special global router, as there is no
possibility of using routing through general-purpose PIPs.

At the same time, we are transferring the outputs of all previous
generations of OSC to potential clock wires. At the moment, this will
not affect the way they are routed - they will still end up as segments
as before, but in the future we may optimize the mechanism.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2025-09-01 16:14:49 +01:00
YRabbit bc086c012f
Gowin. Optimize ALU wiring (#1543)
* Gowin. Optimize ALU wiring

Interestingly, although VCC and GND sources are present in each cell,
they cannot be connected directly to all LUT inputs. Instead, additional
PIPs are used.

A very simple ALU optimization: once we detect that one of the inputs is
a constant, we modify the main LUT that describes the ALU function so
that this primitive input is ignored, and then disconnect it from the
network, freeing up the PIP.
For example (unrealistic, since a real ALU LUT has a larger size and
service bits in the middle, etc.), the addition function of A and B when
A = 1 is converted from the general case (A isn't a constant and B isn't a
constant) to a special case:
0110 -> 0011

The renaming of ALU ports for ADD and SUB modes has also been
removed—this has already been done in the chip database as a fixed
change to the ALU LUT.

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

* Gowin. Fix the style.

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

---------

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2025-08-29 16:58:26 +02:00
Miodrag Milanovic e1ba78094f gatemate: clean data bitmask 2025-08-27 12:28:58 +02:00
Miodrag Milanovic 8ab9301dc4 clangformat 2025-08-27 10:37:39 +02:00
Miodrag Milanovic 2b203d21ae gatemate: add missing RAM port mapping 2025-08-27 10:37:10 +02:00