Commit Graph

127 Commits

Author SHA1 Message Date
YRabbit
2b8a235776
Gowin. Add Input Edge Monitor (#1396)
Add sampling part to IO blocks (input only). This edge detector will
allow to dynamically adjust DDR decoding window in the future.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-11-27 09:57:34 +01:00
Miodrag Milanović
0e69425794
Add expandBoundingBox method to API (#1395)
* Add expandBoundingBox method to API

* Update API documentation
2024-11-26 10:13:41 +01:00
Miodrag Milanović
55035465aa
Himbaechel GUI (#1295)
* Extend Himbaechel API with gfx drawing methods

* Add bel drawing in example uarch

* changed API and added tile wire id in db

* extend API so we can distinguish CLK wires

* added bit more wires

* less horrid way of handling gfx ids

* loop wire range

* removed not needed brackets

* bump database version to 5

* Removed not used GfxFlags
2024-11-21 15:13:22 +01:00
YRabbit
9c2d96f86e
Gowin. FFs placement. (#1386)
* Gowin. FFs placement.

* Allow clusters to be created from FFs and LUTs;

* Immediately create pass-through LUTs from free LUTs adjacent to FF - at the same time ensure alternating use of LUT inputs;

* In case of constant networks, such pass-through LUTs are disconnected from networks altogether;

* Allow FF to be placed directly into SSRAM slides - this is useful when using synchronous reading.

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

* Gowin. Fix aux name creation

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

* Gowin. Use I3 for pass-trough LUTs

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

---------

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-10-22 12:49:44 +02:00
gatecat
7c459805f6 himbaechel: Bump DB version for package extra_data addition
Signed-off-by: gatecat <gatecat@ds0.me>
2024-10-09 15:21:10 +02:00
Pepijn de Vos
028be1462a
apicula: add support for magic sip pins (#1370)
* apicula: add support for magic sip pins

* fix nullptr check

* DDR fix by xiwang

* WIP support for setting the iostd

* add iostd
2024-10-09 15:16:36 +02:00
YRabbit
65cf6d8da7
Gowin. Fix the port check for connectivity. (#1376)
* Gowin. Fix the port check for connectivity.

What happens is that it's not enough to check for a network, we also
need to make sure that the network is functional: has src and sinks.

And the style edits - they get automatically when I make sure to run
clang-format10.

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

* Gowin. Fix the port check for connectivity.

What happens is that it's not enough to check for a network, we also
need to make sure that the network is functional: has src and sinks

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

---------

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-10-02 22:36:36 +02:00
Adrien Prost-Boucle
7f33329fe1 Himbaechel Xilinx : XDC commands : Also search nets with lowercase for better interoperability with other synthesis tools and RTL languages 2024-10-01 15:24:40 +02:00
Adrien Prost-Boucle
3d00b97e0a Himbaechel Xilinx : Support get_nets with braces around net name in XDC commands 2024-10-01 15:24:40 +02:00
Adrien Prost-Boucle
a9cc7f453d Himbaechel Xilinx : Support multiple nets per command 2024-10-01 15:24:40 +02:00
Adrien Prost-Boucle
ff9ba9e090 Himbaechel Xilinx : More warning messages about unsupported things in XDC file 2024-10-01 15:24:40 +02:00
gatecat
9b51c6e337 clangformat
Signed-off-by: gatecat <gatecat@ds0.me>
2024-09-30 14:51:33 +02:00
gatecat
1967db170d xilinx: Support for complex IOLOGIC
Signed-off-by: gatecat <gatecat@ds0.me>
2024-09-27 17:37:46 +02:00
gatecat
24fc33c014 xilinx: Basic I/ODDR support
Signed-off-by: gatecat <gatecat@ds0.me>
2024-09-27 17:09:15 +02:00
gatecat
d3c0f945da xilinx: Fix BRAM placement, clangformat
Signed-off-by: gatecat <gatecat@ds0.me>
2024-09-27 16:24:47 +02:00
gatecat
38e5faca85 xilinx: Fix workaround for unsupported xdc construct
Signed-off-by: gatecat <gatecat@ds0.me>
2024-09-27 16:07:38 +02:00
gatecat
e4dfd4e622 xilinx: Support single-port LUTRAM variants
Signed-off-by: gatecat <gatecat@ds0.me>
2024-09-26 18:11:01 +02:00
gatecat
7516b8950a xilinx: Few more stub timings
Signed-off-by: gatecat <gatecat@ds0.me>
2024-09-26 17:30:36 +02:00
gatecat
118ecbc6b3 xilinx: Remove unnecessary assert
Signed-off-by: gatecat <gatecat@ds0.me>
2024-09-26 15:58:16 +02:00
gatecat
c90d872e35 xilinx: Filter out another missing pip type
Signed-off-by: gatecat <gatecat@ds0.me>
2024-09-26 15:56:20 +02:00
Adrien Prost-Boucle
437fb70ed3 Himbaechel xilinx : Fix packing of cascaded DSP 2024-09-24 12:06:56 +02:00
Adrien Prost-Boucle
9da05b6001 Himbaechel xilinx : DSP packing : Emit a non-fatal error message 2024-09-24 12:06:56 +02:00
Adrien Prost-Boucle
2031a067a0 Himbaechel xilinx : More flexibility about types of DSP parameters 2024-09-24 12:06:56 +02:00
Adrien Prost-Boucle
81bf92a855 Himbaechel xilinx : DSP packing : Disable clustering 2024-09-24 12:06:56 +02:00
Adrien Prost-Boucle
8a0e062520 Himbaechel xilinx : DSP packing : Improve code efficiency 2024-09-24 12:06:56 +02:00
Adrien Prost-Boucle
9bea22ed1e Himbaechel xilinx : DSP packing : Fix identification of cascaded ports and share identification code 2024-09-24 12:06:56 +02:00
Adrien Prost-Boucle
ad9a54cc69 Himbaechel xilinx : More cascaded input ports for which routing is skipped 2024-09-24 12:06:56 +02:00
Adrien Prost-Boucle
04f5f80766 Himbaechel xilinx : Add safety check in DSP packing for 7-series 2024-09-24 12:06:56 +02:00
Adrien Prost-Boucle
db0c99199e Himbaechel xilinx : Add support of DSP packing for 7-series 2024-09-24 12:06:56 +02:00
YRabbit
50bd8d09b0
Gowin. Implement the EMCU primitive. (#1366)
* Gowin. Implement the EMCU primitive.

Add support for the GW1NSR-4C's embedded Cortex-M3 processor. Since it
uses flash in its own way, we disable additional flash processing for
this case.

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

* Gowin. Fix merge.

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

---------

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-09-12 08:53:39 +01:00
YRabbit
ff7b8535bc
Gowin. Add DHCEN primitive. (#1349)
* Gowin. Add DHCEN primitive.

This primitive allows you to dynamically turn off and turn on the
networks of high-speed clocks.

This is done tracking the routes to the sinks and if the route passes
through a special HCLK MUX (this may be the input MUX or the output MUX,
as well as the interbank MUX), then the control signal of this MUX is
used.

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

* Gowin. Change the DHCEN binding

Use the entire PIP instead of a wire - avoids normalisation and may also
be useful in the future when calculating clock stuff.

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

---------

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-09-11 10:18:26 +01:00
YRabbit
4d1de4532a
Gowin. BUGFIX. Create all Clock Pips. (#1358)
Some Clocks PIPS were not created due to a check for the presence of a
delay class, now all wires are attributed to the class so that there is
no longer any need for this check.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-09-05 21:39:26 +01:00
YRabbit
4cf7afedf7
Gowin. Implement the UserFlash primitive (#1357)
* Gowin. Implement the UserFlash primitive

Some Gowin chips have embedded flash memory accessible from the fabric.
Here we add primitives that allow access to this memory.

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

* Gowin. Fix cell creation

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

---------

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-09-04 11:55:35 +01:00
YRabbit
32e2d9223c Gowin. BUGFIX. Timing
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-08-21 11:27:59 +01:00
YRabbit
01737a400c Gowin. Add clock wires delays.
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-08-21 10:58:55 +01:00
Lofty
ccdc2f6f13 himbaechel/gowin: add timing information 2024-08-21 10:58:55 +01:00
Adrien Prost-Boucle
fa55e93848 Himbaechel xilinx : Fix regex to parse Zynq device names 2024-08-19 21:06:45 +01:00
Saviour Owolabi
e9e7dce23d
Himbaechel Gowin: HCLK Support (#1340)
* Himbaechel Gowin: Add support for CLKDIV and CLKDIV2

* Himbaechel Gowin: Add support for CLKDIV and CLKDIV2

* Gowin Himbaechel: HCLK Bug fixes and corrections
2024-08-03 15:57:22 +02:00
YRabbit
11d335c7ce Gowin. Fix GW2A-18(c) DCS and DQCE
We filter out PIPs from these chips that bypass DCS.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-08-02 14:12:16 +02:00
YRabbit
10a5a44b81 Gowin. Implement clock management primitives.
DQCE and DCS primitives are added.

DQCE allows the internal logic to enable or disable the clock network in
the quadrant. When clock network is disabled, all logic drivern by this
clock is no longer toggled, thus reducing the total power consumtion of
the device.

DCS allows you to select one of four sources for two clock wires (6 and 7).
Wires 6 and 7 have not been used up to this point.

Since "hardware" primitives operate strictly in their own quadrants,
user-specified primitives are converted into one or more "hardware"
primitives as needed.

Also:
  - minor edits to make the most of helper functions like connectPorts()
  - when creating bases, the corresponding constants are assigned to the
    VCC and GND wires, but for now huge nodes are used because, for an
    unknown reason, the constants mechanism makes large examples
    inoperable. So for now we remain on the nodes.

Compatible with older Apicula databases.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-08-02 14:12:16 +02:00
YRabbit
f17caa2379 Gowin. BUGFIX. Fix placement checks
It was not taken into account that there are only 6 ALUs per cell. As a
result, on complex designs where ALUs and LUT-based memory are involved
and there are many LUTs (like in the RISCV emulator), there were
sometimes false positives about placement conflicts.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-07-29 11:31:59 +01:00
YRabbit
eb099a9244 Gowin. Bugfix.
The statement in the Gowin documentation that in the reading mode
"READ_MODE=0" the output register is not used and the OCE signal is
ignored is not confirmed by practice - if the OCE was left unconnected
or connected to the constant network, then a change in output data was
observed even with CE=0, as well as the absence of such at CE=1.

Synchronizing CE and OCE helps and the memory works properly in complex
systems such as RISC-V emulation and i8080 emulation (with 32K RAM and
16K BSRAM based ROM), but there is no theoretical basis for this fix, so
it is a hack.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-07-09 14:18:35 +02:00
YRabbit
1871afe9b9 Gowin. Taking into account the features of ROM
For pROM(X9) primitives in images generated by Gowin IDE, there is an
interesting recommunication of inputs depending on the data bit depth.
For example, in some cases, a high logical level may be applied to the
Write Enable input, which, let’s say, is not entirely usual for Read
Only memory.

Here we will do similar manipulations.

In addition, several minor bug fixes are included:

 - Fixed bit numbering for non-X9 series primitives.
 - Fixed decoder generation for BLKSEL - do not assume unused inputs are
   connected to GND.
 - Use default values for BSRAM parameters - don't assume their
   mandatory presence.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-07-09 14:18:35 +02:00
Miodrag Milanovic
cecd6b3f4d Document context related calls in HimbaechelAPI 2024-07-08 16:45:24 +02:00
Miodrag Milanovic
6b5b21e165 Enable user to override setupArchContext in Himbaechel arch 2024-07-08 16:45:24 +02:00
YRabbit
7dd4a8c1d5 Gowin. Implement power saving primitive
As the board on the GW1N-1 chip becomes a rarity, its replacement is the
Tangnano1k board with the GW1NZ-1 chip. This chip has a unique mechanism
for turning off power to important things such as OSC, PLL, etc.

Here we introduce a primitive that allows energy saving to be controlled
dynamically.

We also bring the names of some functions to uniformity.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-07-08 16:44:49 +02:00
YRabbit
0639681b73 Gowin. Fix BSRAM block selection.
In the images generated by Gowin IDE, the signals for dynamic BSRAM
block selection (BLKSEL[2:0]) are not always connected directly to the
ports - some chips add LUT2, LUT3 or LUT4 to turn these signals into
Clock Enable.  Apparently there are chips with an error in the operation
of these ports.

Here we make such a decoder instead of using ports directly.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-07-03 15:09:13 +02:00
YRabbit
2e8280a949 Gowin. Fix pipeline mode in BSRAM.
It seems that the internal registers on the BSRAM output pins in
READ_MODE=1'b1 (pipeline) mode do not function properly because in the
images generated by Gowin IDE an external register is added to each pin,
and the BSRAM itself switches to READ_MODE=1'b0 (bypass) mode .

This is observed on Tangnano9k and Tangnano20k boards.

Here we repeat this fix.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-06-25 11:14:02 +02:00
YRabbit
8f87918230 Gowin. Add fix for Single Port BSRAM
Add description of BSRAM harness

In some cases, Gowin IDE adds a number of LUTs and DFFs to the BSRAM. Here we are trying to add similar elements.

More details with pictures: https://github.com/YosysHQ/apicula/blob/master/doc/bsram-fix.md

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2024-06-25 11:14:02 +02:00
gatecat
a29a17f8f2 clangformat
Signed-off-by: gatecat <gatecat@ds0.me>
2024-06-18 13:54:12 +02:00