Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nextpnr-himbaechel cannot find Fmax but nextpnr-gowin can #1446

Open
ju-sh opened this issue Jan 30, 2025 · 8 comments
Open

nextpnr-himbaechel cannot find Fmax but nextpnr-gowin can #1446

ju-sh opened this issue Jan 30, 2025 · 8 comments

Comments

@ju-sh
Copy link

ju-sh commented Jan 30, 2025

For a gowin FPGA, I was trying a simple ring adder like this:

// counter.v
module counter
(
    input clk,
    output [5:0] led
);

localparam WAIT_TIME = 2700000;
reg [5:0] ledCounter = 0;
reg [23:0] clockCounter = 0;

always @(posedge clk) begin
    clockCounter <= clockCounter + 1;
    if (clockCounter == WAIT_TIME) begin
        clockCounter <= 0;
        if (ledCounter == 0)
          ledCounter <= 1;
        else
          ledCounter <= ledCounter << 1;
    end
end

assign led = ~ledCounter;
endmodule

The constraints file tangnano9k.cst is:

IO_LOC "clk" 52;
IO_PORT "clk" PULL_MODE=UP;
IO_LOC "led[0]" 10;
IO_LOC "led[1]" 11;
IO_LOC "led[2]" 13;
IO_LOC "led[3]" 14;
IO_LOC "led[4]" 15;
IO_LOC "led[5]" 16;

The following commands worked:

$ yosys -p "read_verilog counter.v; synth_gowin -top counter -json counter.json"
$ nextpnr-gowin --json counter.json --freq 27 --write counter_pnr.json \
  --device GW1NR-LV9QN88PC6/I5 --family GW1N-9C --cst tangnano9k.cst

and gave

Max frequency for clock 'clk_IBUF_I_O': 290.53 MHz (PASS at 27.00 MHz)

But when I tried nextpnr-himbaechel instead of nextpnr-gowin, it
gave this message: No Fmax available; no interior timing paths found in design

The command used was:

nextpnr-himbaechel --json counter.json --freq 27 --write counter_pnr.json \
  --device GW1NR-LV9QN88PC6/I5 -l pnr.log --report report.json \
  --vopt family=GW1N-9C --vopt cst=tangnano9k.cst \
  --placed-svg placed.svg \
  --routed-svg routed.svg

Any idea why this is happening?

@yrabbit
Copy link
Contributor

yrabbit commented Jan 30, 2025

Are you using the nextpnr master branch?

max.mp4

@ju-sh
Copy link
Author

ju-sh commented Jan 31, 2025

No, I was on version 0.7.

$ nextpnr-himbaechel --version
"nextpnr-himbaechel" -- Next Generation Place and Route (Version nextpnr-0.7)

$ nextpnr-gowin --version
"nextpnr-gowin" -- Next Generation Place and Route (Version nextpnr-0.7)

Let me try with master.

@yrabbit
Copy link
Contributor

yrabbit commented Jan 31, 2025

v0.7 --> Jan 24, 2024
so it's a little behind.

@ju-sh
Copy link
Author

ju-sh commented Feb 4, 2025

I got an error while trying to build nextpnr.

Did I miss any installation step?

I am on:

  • Debian 11
  • gcc 13.3.0
  • cmake 3.27.2
  • nextpnr commit: 81ccada

This was the output:

$ cmake .. -DARCH="himbaechel" -DHIMBAECHEL_UARCH="gowin"
-- Building with IPO
-- C++ compiler does NOT support #embed
-- Found Boost: /nix/store/yb341ica1gpjasc02g4a4ijbkgjfjy3v-boost-1.81.0-dev/lib/cmake/Boost-1.81.0/BoostConfig.cmake (found version "1.81.0") found components: filesystem program_options iostreams system thread
-- Could NOT find pybind11 (missing: pybind11_DIR)
-- Using built-in pybind11
-- pybind11 v2.12.1
-- Found Boost: /nix/store/yb341ica1gpjasc02g4a4ijbkgjfjy3v-boost-1.81.0-dev/lib/cmake/Boost-1.81.0/BoostConfig.cmake (found version "1.81.0") found components: program_options filesystem system
-- Configuring architecture: himbaechel
-- Configuring Himbächel microarchitecture: gowin
-- gowin_bba executable: /home/username/venvs/auto/bin/gowin_bba
-- Apycula install prefix: (not set, using Python: /home/username/venvs/auto/bin/python3.9)
-- Enabled Himbaechel-Gowin devices: GW1N-1;GW1NZ-1;GW1N-4;GW1N-9;GW1N-9C;GW1NS-4;GW2A-18;GW2A-18C
-- Configuring done (0.8s)
-- Generating done (0.0s)
-- Build files have been written to: /media/user/nextpnr/build



$ make -j8
[  0%] Built target nextpnr_place
[  1%] Building CXX object 3rdparty/json11/CMakeFiles/json11.dir/json11.cpp.o
[  1%] Built target nextpnr_route
[  2%] Building CXX object bba/CMakeFiles/bbasm.dir/main.cc.o
[  2%] Built target oourafft
[  2%] Built target nextpnr_kernel
[  4%] Linking CXX static library libjson11.a
[  4%] Built target json11
[  5%] Linking CXX executable bbasm
[  5%] Built target bbasm
[ 10%] Generating chipdb-GW1N-9.bba
[ 10%] Generating chipdb-GW1N-1.bba
[ 10%] Generating chipdb-GW1N-9C.bba
[ 14%] Generating chipdb-GW2A-18C.bba
[ 14%] Generating chipdb-GW1NZ-1.bba
[ 14%] Generating chipdb-GW1NS-4.bba
[ 16%] Generating chipdb-GW1N-4.bba
[ 17%] Generating chipdb-GW2A-18.bba
Traceback (most recent call last):
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1496, in <module>
Traceback (most recent call last):
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1496, in <module>
    main()
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1455, in main
    main()
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1455, in main
    create_packages(ch, db)
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1253, in create_packages
    create_packages(ch, db)
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1253, in create_packages
    if variant in db.sip_cst and pkgname in db.sip_cst[variant]:
    if variant in db.sip_cst and pkgname in db.sip_cst[variant]:
AttributeError: 'Device' object has no attribute 'sip_cst'
AttributeError: 'Device' object has no attribute 'sip_cst'
make[2]: *** [himbaechel/uarch/gowin/CMakeFiles/nextpnr-himbaechel-gowin-chipdb.dir/build.make:129: himbaechel/uarch/gowin/chipdb-GW1N-1.bba] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [himbaechel/uarch/gowin/CMakeFiles/nextpnr-himbaechel-gowin-chipdb.dir/build.make:136: himbaechel/uarch/gowin/chipdb-GW1NZ-1.bba] Error 1
Traceback (most recent call last):
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1496, in <module>
    main()
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1455, in main
    create_packages(ch, db)
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1253, in create_packages
    if variant in db.sip_cst and pkgname in db.sip_cst[variant]:
AttributeError: 'Device' object has no attribute 'sip_cst'
Traceback (most recent call last):
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1496, in <module>
    main()
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1455, in main
    create_packages(ch, db)
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1253, in create_packages
    if variant in db.sip_cst and pkgname in db.sip_cst[variant]:
AttributeError: 'Device' object has no attribute 'sip_cst'
Traceback (most recent call last):
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1496, in <module>
    main()
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1455, in main
    create_packages(ch, db)
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1253, in create_packages
    if variant in db.sip_cst and pkgname in db.sip_cst[variant]:
AttributeError: 'Device' object has no attribute 'sip_cst'
Traceback (most recent call last):
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1496, in <module>
    main()
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1455, in main
    create_packages(ch, db)
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1253, in create_packages
    if variant in db.sip_cst and pkgname in db.sip_cst[variant]:
AttributeError: 'Device' object has no attribute 'sip_cst'
make[2]: *** [himbaechel/uarch/gowin/CMakeFiles/nextpnr-himbaechel-gowin-chipdb.dir/build.make:143: himbaechel/uarch/gowin/chipdb-GW1N-4.bba] Error 1
make[2]: *** [himbaechel/uarch/gowin/CMakeFiles/nextpnr-himbaechel-gowin-chipdb.dir/build.make:164: himbaechel/uarch/gowin/chipdb-GW1NS-4.bba] Error 1
make[2]: *** [himbaechel/uarch/gowin/CMakeFiles/nextpnr-himbaechel-gowin-chipdb.dir/build.make:150: himbaechel/uarch/gowin/chipdb-GW1N-9.bba] Error 1
make[2]: *** [himbaechel/uarch/gowin/CMakeFiles/nextpnr-himbaechel-gowin-chipdb.dir/build.make:157: himbaechel/uarch/gowin/chipdb-GW1N-9C.bba] Error 1
Traceback (most recent call last):
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1496, in <module>
    main()
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1455, in main
    create_packages(ch, db)
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1253, in create_packages
    if variant in db.sip_cst and pkgname in db.sip_cst[variant]:
AttributeError: 'Device' object has no attribute 'sip_cst'
Traceback (most recent call last):
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1496, in <module>
    main()
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1455, in main
    create_packages(ch, db)
  File "/media/user/nextpnr/himbaechel/uarch/gowin/gowin_arch_gen.py", line 1253, in create_packages
    if variant in db.sip_cst and pkgname in db.sip_cst[variant]:
AttributeError: 'Device' object has no attribute 'sip_cst'
make[2]: *** [himbaechel/uarch/gowin/CMakeFiles/nextpnr-himbaechel-gowin-chipdb.dir/build.make:171: himbaechel/uarch/gowin/chipdb-GW2A-18.bba] Error 1
make[2]: *** [himbaechel/uarch/gowin/CMakeFiles/nextpnr-himbaechel-gowin-chipdb.dir/build.make:178: himbaechel/uarch/gowin/chipdb-GW2A-18C.bba] Error 1
make[1]: *** [CMakeFiles/Makefile2:597: himbaechel/uarch/gowin/CMakeFiles/nextpnr-himbaechel-gowin-chipdb.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

@yrabbit
Copy link
Contributor

yrabbit commented Feb 4, 2025

In all likelihood the old Apicula bases. Release 0.15 from October 20, 2024 should include these “sip_cst” fields.

@ju-sh
Copy link
Author

ju-sh commented Feb 5, 2025

Thanks. I updated apycula and that error disappeared.
But I got a new one though.

[ 30%] Building CXX object himbaechel/CMakeFiles/nextpnr-himbaechel.dir/arch_pybindings.cc.o
In file included from /usr/include/python3.9/Python.h:8,
                 from /media/user/nextpnr/common/kernel/pybindings.h:24,
                 from /media/user/nextpnr/himbaechel/arch_pybindings.h:25,
                 from /media/user/nextpnr/himbaechel/arch_pybindings.cc:22:
/usr/include/python3.9/pyconfig.h:3:12: fatal error: x86_64-linux-gnu/python3.9/pyconfig.h: No such file or directory
    3 | #  include <x86_64-linux-gnu/python3.9/pyconfig.h>
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [himbaechel/CMakeFiles/nextpnr-himbaechel.dir/build.make:104: himbaechel/CMakeFiles/nextpnr-himbaechel.dir/arch_pybindings.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:545: himbaechel/CMakeFiles/nextpnr-himbaechel.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

I have installed python3-dev package of debian and this header file is already present:

$ ls /usr/include/x86_64-linux-gnu/python3.9/pyconfig.h
/usr/include/x86_64-linux-gnu/python3.9/pyconfig.h

How can I let the compiler see it?

@yrabbit
Copy link
Contributor

yrabbit commented Feb 5, 2025

Unfortunately, I must say that this is where my knowledge ends. Something to do with specifying the path to the directory to search for .h-files.

@ju-sh
Copy link
Author

ju-sh commented Feb 12, 2025

I was able to build using cmake -DBUILD_PYTHON=OFF (found out about this from the chat room).
Not sure what features it disables though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants