Skip to content

Commit 39c7601

Browse files
authored
Adapting the packer to the alternative P&R (#184)
* Adapting the packer to the alternative P&R nextpnr with gowin as the Himbaechel architecture mainly affects gowin_pack. At this experimental stage, I think it is wise not to mimic the old input format, but to support both for now. The new nextpnr output file has a format flag in the header, so it's easy to distinguish between the two. - new cell numbering, new wire naming, pips and bels are used. - LUT and DFF come separately, not as SLICE - I'm interested to see what comes out of this and how it affects all sorts of ALU and RAM - IO is purely nominal for now, just to make the LEDs and buttons work during the experiments. Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * global VCC/VSS and pass-through LUTs Himbaechel-gowin now supports global VCC/GND networks, let's adjust to their common naming. Allow the router to use any LUT input as a D flip-flops input, and create the LUT itself here by the actual input used. More freedom to the router:) Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Allow packig of all types of DFF Now that himbaechel-gowin has learned to place DFFs of all types by tracking the compatibility of CLK, CE and LSR inputs, as well as placing mutually compatible flip-flop types in adjacent slides, we can allow their packing. Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel. Add a wideluts support Pack MUX2_LUT5, MUX2_LUT6, MUX2_LUT7 and MUX2_LUT8. Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel. Add a ALU support Mode 2 "ADDSUB" only :) Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Fix LUTRAM error. As it turned out with the RAM16SDP4 primitive the WRE input is considered active at low level. To make it behave according to the documentation it was necessary to turn on the inverter on the LSR2 line. This will not "cure" attosoc, but may change the behavior:) Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Remove debug print Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Fix the RAM16DSDP4 unpack The bit order has been reversed Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Add clock lines for Himbaechel router Clock wires are described as Himbaechel nodes, which greatly reduces the code on the P&R side - there is no need for additional processing as for aliases. The sources for clocks that are dedicated pins are extracted and described. The clock fuzzer stays in place until there is a complete transition to the Himbaechel architecture - describing a clock network using aliases that describe the permanent connection of only a pair of wires quickly ceases to reflect the reality of having multiple wires permanently connected together. Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Implement clock as the Himbaechel nodes Clock wires are generated as Himbaechel nodes for all chips. Unfortunately they don't fit well on the alias mechanism so the clock fuzzer is left for generic-based nextpnr-gowin until later. Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Describe PLL outs and outs as Himbaechel nodes Support for all four GW2A-18 PLLs is added Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Change the presentation of unusual IOs More explicit mapping in the chip base of the dynamic IO configuration of the bottom of the chip. A list of possible configurations is provided, so far only one is used - simple output. Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Add Simplified IO to Himbaechel Also: - streamline the placement of GSR; - store in the database the correspondence of the tile type to its coordinates; - editing packaging and unpacking; - separate for Himbaechel ordinary clock wires from HCLK. Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * fix clock * Re-enable erroneously disabled clock fuzzer Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Store supported itypes of diffIO in the database - fix IO attribute assignment; - change the IO standards compatibility check. Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel gowin: Add IO HCLK - Added HCLK in the amount necessary for the functioning of DESER primitives. - Implementation of ODDR/C and OSER4 primitives is added. Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel gowin: Add OSER8 Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel-gowin. Add OSER10 and OVIDEO Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himabechel gowin. Add OSCx Added all types of OSCs through an experimental structure in the database: extra_cell_func. It describes additional cell functions by coordinates, not by type binding. Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel-gowin. Expand the use of extra features Use extra_func to store all additional cell functions such as GSR, OSC, and a link to HCLK pips is also placed here Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel-gowin. Add OSER16 and IDES16 Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel-gowin. All boards Added all HCLK for boards. Minor edits. Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel-gowin. Add the examples. For each supported board (GW1NS-2 excluded), the following examples are provided: - blinky, - shift, - blinky-tbuf, - blinky-oddr, - blinky-osc, - blinky-pll*, - elvds, - oddr-elvds, - tlvds, - oddr-tlvds, - pll-nanolcd*. * - where there is (is not available) a VGA connector. Attosoc is also provided for larger boards. For small boards with a VGA connector, the -noalu flag is used, but only because the required number of primitives does not fit into the board. There are no examples of DESER yet, not because of the functionality of the primitives. Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel-gowin. Slow attosoc firmware For the convenience of checking the correctness of prime numbers, the firmware is slowed down. This is done by cycles of the RISCV program itself, fpga is still running at its maximum frequency. Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * wip * Himbaechel-gowin. Reenable attosoc In addition to the previous commit, where examples were added for all OSER4, OSER8, OVIDEO, OSER10 and OSER16 primitive boards, ATTOSOC compilation for four boards is allowed here. Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel-gowin. Add the IDES tests Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel-gowin. Fix CFG and GSR fuses And also added very crude support for Tangnano20k, which is not working yet. Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel-gowin. Improve tangnano20k support Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel-gowin. Tangnano20k OSER Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel-gowin. Himbaechel examples with unpacking Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel-gowin. Add Himbaechel-nextpnr to CI For clarification of problem areas since Himbaechel-gowin nextpnr has not been merged yet. Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel-gowin. Fix CI Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * Himbaechel-gowin. Add descriptions Signed-off-by: YRabbit <rabbit@yrabbit.cyou> * fix mistype * Fix old PLL LCD example Signed-off-by: YRabbit <rabbit@yrabbit.cyou> --------- Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
1 parent 46ecf0c commit 39c7601

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+4909
-283
lines changed

.github/workflows/chipdb.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,27 @@ jobs:
155155
with:
156156
name: gw2a-18-stage
157157
path: GW2A-18*
158+
gw2a18c:
159+
runs-on: ubuntu-latest
160+
steps:
161+
- uses: actions/checkout@v3
162+
- name: Build gw2a-18c chipdb
163+
run: |
164+
docker pull pepijndevos/apicula:1.9.8
165+
docker run -v $(pwd):/usr/src/apicula pepijndevos/apicula:1.9.8 make apycula/GW2A-18C.pickle
166+
- name: Archive artifact
167+
uses: actions/upload-artifact@v3
168+
with:
169+
name: gw2a-18c-chipdb
170+
path: apycula/GW2A-18C.pickle
171+
- name: Archive stage artifact
172+
uses: actions/upload-artifact@v3
173+
with:
174+
name: gw2a-18C-stage
175+
path: GW2A-18C*
158176
pypi:
159177
runs-on: ubuntu-latest
160-
needs: [gw1n1, gw1nz1, gw1n9, gw1n9c, gw1n4, gw1ns2, gw1ns4, gw2a18]
178+
needs: [gw1n1, gw1nz1, gw1n9, gw1n9c, gw1n4, gw1ns2, gw1ns4, gw2a18, gw2a18c]
161179
steps:
162180
- uses: actions/checkout@v3
163181
- name: Download gw1n-1 chipdb
@@ -200,6 +218,11 @@ jobs:
200218
with:
201219
name: gw2a-18-chipdb
202220
path: apycula
221+
- name: Download gw2a-18c chipdb
222+
uses: actions/download-artifact@v3
223+
with:
224+
name: gw2a-18c-chipdb
225+
path: apycula
203226
- name: Set up Python
204227
uses: actions/setup-python@v4
205228
with:
@@ -278,7 +301,7 @@ jobs:
278301
sudo make install
279302
cd ../nextpnr
280303
git checkout ${{ matrix.nextpnr }}
281-
cmake . -DARCH=gowin
304+
cmake . -DARCH="gowin;himbaechel"
282305
make -j$(nproc)
283306
sudo make install
284307
cd ../examples

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ endif
66
.PHONY: all clean
77
all: apycula/GW1N-1.pickle apycula/GW1N-9.pickle apycula/GW1N-4.pickle \
88
apycula/GW1NS-2.pickle apycula/GW1NS-4.pickle apycula/GW1N-9C.pickle \
9-
apycula/GW1NZ-1.pickle apycula/GW2A-18.pickle
9+
apycula/GW1NZ-1.pickle apycula/GW2A-18.pickle apycula/GW2A-18C.pickle
1010

1111
%.json: apycula/dat19_h4x.py
1212
python3 -m apycula.dat19_h4x $*

apycula/attrids.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,8 @@
624624

625625
# config
626626
cfg_attrids = {
627+
'DONE_AS_GPIO': 0,
627628
'GSR': 2,
628-
'DONE_AS_GPIO': 4,
629629
'JTAG_AS_GPIO': 6,
630630
'READY_AS_GPIO': 7,
631631
'MSPI_AS_GPIO': 8,
@@ -649,6 +649,18 @@
649649
'FALSE': 9
650650
}
651651

652+
# global set/reset
653+
gsr_attrids = {
654+
'GSRMODE': 0,
655+
'SYNCMODE': 1,
656+
}
657+
658+
gsr_attrvals = {
659+
'UNKNOWN': 0,
660+
'ACTIVE_LOW': 1,
661+
'SYNC': 2,
662+
}
663+
652664
# iologic
653665
iologic_attrids = {
654666
'INMODE': 0,

0 commit comments

Comments
 (0)