Commit Graph

169 Commits

Author SHA1 Message Date
gatecat
4a4025192a run clangformat
Signed-off-by: gatecat <gatecat@ds0.me>
2023-12-26 09:54:34 +01:00
uis
a4d2244300 Fix printf formats 2023-11-13 13:59:51 +01:00
gatecat
54b2045726 clangformat
Signed-off-by: gatecat <gatecat@ds0.me>
2023-06-20 10:58:18 +02:00
rowanG077
914999673c Rip out budgets 2023-06-20 10:57:10 +02:00
YRabbit
1260f2f7d7 gowin: Add support for GW2A series chips
* Limited to Tangprimer 20k or GW2A-LV18PG256C8/I7 chip.
* Clock lines are disabled.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-06-20 10:48:48 +02:00
Meinhard Kissich
6c0b4443d5 Removes unnecessary argument 2023-06-16 16:46:09 +02:00
Meinhard Kissich
bbe9ea9d65 gowin: fixes default networks 2023-06-16 16:46:09 +02:00
YRabbit
354b7daf12
gowin: implement differential IO primitives (#1159)
* gowin: implement differential IO primitives

Adds missing TLVDS_IBUF/IOBUF/TBUF primitives, as well as all kinds of
LVDS emulation primitives.

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

* gowin: fix build

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

* gowin: support as differential not only pins A and B

The GW1N-1 and GW1NZ-1 chips have cells with pins up to I, we provide
support for such pins.

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

---------

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-05-19 08:59:19 +02:00
YRabbit
051bdb12b3 gowin: fix style
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-04-20 08:35:50 +02:00
YRabbit
729757d55e gowin: fix style
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-04-20 08:35:50 +02:00
YRabbit
fdc2769259 gowin: add a common mechanism for placing ports
If the port is in a different cell than the primitive, then use the alias mechanism.
Considerably compact code for OSC as an example.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-04-20 08:35:50 +02:00
YRabbit
71192dc7a3 gowin: Remove inherited code for ODDR(c)
Implement ODDR(c) as part of IOLOGIC and remove all old code associated
with those primitives.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-04-14 09:23:00 +02:00
YRabbit
62b8baa959 gowin: Fix style
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-04-12 14:35:17 +02:00
YRabbit
fddacb3dc1 gowin: implement IDES16 and OSER16 primitives
These are very cumbersome primitives that take up two cells and
consequently 4 IOLOGIC bels.
The primitives are implemented for the chips that contain them and are
supported by apicula GW1NSR-4C, GW1NR-9 and GW1NR-9C.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-04-12 14:35:17 +02:00
YRabbit
9bcefe46a8 gowin: Add implementation of IDDR and IDDRC primitives
Simple deserialization primitives are implemented for all supported boards.

Compatible with older apicula bases.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-04-06 08:41:54 +02:00
YRabbit
20b7f760d9 gowin: Add support for IDES primitives
* placement of IDES4, IVIDEO, IDES8 and IDES10 primitives is supported;
* primitives are implemented for the GW1N-1, GW1NZ-1, GW1NSR-4C,
  GW1NR-9, GW1NR-9C chips;
* tricks required for IOLOGIC to work on one side of the -9 and -9C
  chips are taken into account;

Compatible with old apicula bases.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-04-04 10:00:08 +02:00
YRabbit
b36e8a3013 gowin: bugfix
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-03-23 12:37:53 +01:00
YRabbit
c52906e8bc gowin: Rename questionable ports
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-03-23 12:37:53 +01:00
YRabbit
38eb1f05ff gowin: Change the way errors are processed
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-03-23 12:37:53 +01:00
YRabbit
95ace0fade gowin: Add support for OSER primitives
* placement of OSER4, OVIDEO, OSER8 and SER10 primitives is supported;
* primitives are implemented for the GW1N-1, GW1NZ-1, GW1NSR-4C,
  GW1NR-9, GW1NR-9C chips;
* the initial support for special HCLK clock wires is implemented to the
  extent necessary for OSER primitives to function;
* output to both regular IO and TLVDS_OBUF is supported;
* tricks required for IOLOGIC to work on one side of the -9 and -9C
  chips are taken into account;
* various edits, such as using idf() instead of the local buffer.

Compatible with old apicula bases.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-03-23 12:37:53 +01:00
gatecat
e4fcd3740d cmake: Make HeAP placer always-enabled
Signed-off-by: gatecat <gatecat@ds0.me>
2023-03-17 10:38:11 +01:00
uis
69fe654f02 gowin: Add bels for new types of oscillator 2023-02-06 21:45:55 +00:00
YRabbit
5d5ea57e21 gowin: Add PLL support for the GW1NS-2C chip
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-01-31 18:46:38 +10:00
YRabbit
aac36ecf3f gowin: Add PLL support for GW1NR-4 chips
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-01-31 08:58:33 +10:00
YRabbit
2829a7d70a gowin: Proper use of the C++ mechanisms
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-01-30 18:59:09 +10:00
YRabbit
6a1212a1e1 gowin: Add PLL support for the GW1NR-9 chip
And also unified the fixing of PLL to bels: the point is that PLL being
at a certain location has the possibility to use a direct implicit wire
to the clock source, but once we decide to use this direct wire, the PLL
can no longer be moved.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-01-30 12:49:57 +10:00
YRabbit
2d45d57b32 gowin: Add PLL support for the GW1NR-9C chip
This chip is used in the Tangnano9k board.

  * all parameters of the rPLL primitive are supported;
  * all PLL outputs are treated as clock sources and optimized routing
    is applied to them;
  * primitive rPLL on different chips has a completely different
    structure: for example in GW1N-1 it takes two cells, and in GW1NR-9C
    as many as four, despite this unification was carried out and
    different chips are processed by the same functions, but this led to
    the fact that you can not use the PLL chip GW1N-1 with the old
    apicula bases - will issue a warning and refuse to encode primitive.
    In other cases compatibility is supported.
  * Cosmetic change: the usage report shows the rPLL names without any
    service bels.
  * I use ctx->idf() on occasion, it's not a total redesign.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-01-26 20:26:05 +10:00
YRabbit
cc45f5ec48 gowin: improve error message
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-01-19 07:12:39 +10:00
YRabbit
ba4d7b1e9a gowin: to use the FB network detection function
The chip used in tangnano4k does not have such pins, but we call the
function anyway in the expectation of other chips.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-01-19 06:31:55 +10:00
YRabbit
b22eebac30 gowin: add a PLL primitive for the GW1NS-4 series
* both instances of the new PLLVR type are supported;
  * primitive placement is optimized for the use of dedicated PLL clock
    pins;
  * all 4 outputs of each primitive can use the clock nets (only 5 lines
    in total at the same time so far).

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2023-01-18 19:18:02 +10:00
YRabbit
b8ab3116b2 gowin: improve clock wire routing
The dedicated router for clock wires now understands not only the IO
pins but also the rPLL outputs as clock sources.

This simple router sets an optimal route, so it is now the default
router. It can be disabled with the --disable-globals command line flag
if desired, but this is not recommended due to possible clock skew.

Still for GW1N-4C there is no good router for clock wires as there
external quartz resonator is connected via PLL.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2022-12-30 11:55:39 +10:00
YRabbit
8424dc79d2 gowin: correct the delay calculation
And do a full enumeration when searching for a delay because it is not
yet clear whether the orderliness of the vector is guaranteed.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2022-12-29 11:17:45 +10:00
YRabbit
d6cbe4b7f8 gowin: fix build for wasm
A large number of global variables are not suitable for WASM, so
completely disable the graphics part where the main array of them is
used.  For other architectures GUI is still possible.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2022-12-21 16:13:08 +10:00
YRabbit
bc3d9f3108 gowin: not crush on unknown clock tap's sources
As preparation for possible changes to the clock wiring system.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2022-12-14 15:35:55 +10:00
YRabbit
aa8359c73e gowin: BUGFIX: Correctly handle resets
When a single primitive occupies several cells, care must be taken when
manipulating the parameters of that primitive: when creating cells, each
cell must receive a copy of all the parameters and not modify them
unnecessarily.  That is, if possible, it is better to make all parameter
changes before dividing the primitive into cells.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2022-12-09 12:55:22 +10:00
myrtle
0eb53d59d8
Merge pull request #1059 from YosysHQ/gatecat/validity-errors
Add new option for verbose validity errors, use for ice40
2022-12-07 16:19:55 +01:00
gatecat
603b60da8d api: add explain_invalid option to isBelLocationValid
Signed-off-by: gatecat <gatecat@ds0.me>
2022-12-07 10:27:58 +01:00
myrtle
519011533a
Merge pull request #1058 from YosysHQ/gatecat/bounds-refactor
refactor: rename ArcBounds -> BoundingBox and use this in HeAP
2022-12-07 10:26:17 +01:00
gatecat
e260ac33ab refactor: ArcBounds -> BoundingBox
Signed-off-by: gatecat <gatecat@ds0.me>
2022-12-07 10:00:53 +01:00
YRabbit
150a482b77 gowin: change the way networks are handled
Until a comprehensive clock router is developed, the order in which
private cases are handled is important.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2022-12-06 23:07:01 +10:00
YRabbit
2e68962a02 gowin: add PLL pins processing
Uses the information of the special input pins for the PLL in the
current chip. If such pins are involved, no routing is performed and
information about the use of implicit wires is passed to the packer.

The RESET and RESET_P inputs are now also disabled if they are connected
to VSS/VCC.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2022-12-04 15:06:44 +10:00
YRabbit
ec53ae0c3b gowin: add information about pin configurations
Includes information on additional pin functions such as RPLL_C_IN, GCLKC_3, SCLK and others.
This allows a decision to be made about special network routing of such pins

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2022-11-25 20:49:26 +10:00
YRabbit
378ca60a2f gowin: mark the PLL ports that are not in use
Unused ports are deactivated by special fuse combinations, rather than
being left dangling in the air.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2022-11-20 22:04:09 +10:00
YRabbit
d4642d918c gowin: add support for a more common chip
The GW1N-1 and GW1NZ-1 have a similar PLL, but the board with the former
chip is already very hard to buy, so let's experiment with a more
affordable chip.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2022-11-12 10:12:43 +10:00
YRabbit
9013b2de50 gowin: use ctx->idf() a bit
Replacing snprintf() with ctx->idf() in PLL commit, but not yet a
complete overhaul.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2022-11-11 09:19:16 +10:00
YRabbit
a84ded4793 gowin: add initial PLL support
The rPLL primitive for the simplest chip (GW1N-1) in the family is
processed. All parameters of the primitive are passed on to gowin_pack,
and general-purpose wires are used for routing outputs of the primitive.

Compatible with older versions of apicula, but in this case will refuse
to place the new primitive.

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2022-11-10 19:14:41 +10:00
gatecat
445d32497d run clangformat
Signed-off-by: gatecat <gatecat@ds0.me>
2022-10-17 12:35:02 +02:00
Lushay Labs
a7acda95f0
support windows line endings 2022-10-09 23:47:09 +03:00
YRabbit
e0539f0ed7 gowin: BUGFIX. Really memorize the chip
When it really needed to distinguish between the chips, this
unforgivable error was discovered :)

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
2022-08-25 11:52:29 +10:00
gatecat
c60fb94b6c refactor: Use IdString::in instead of || chains
Signed-off-by: gatecat <gatecat@ds0.me>
2022-08-10 18:58:22 +01:00