nextpnr icon indicating copy to clipboard operation
nextpnr copied to clipboard

YoWasp gowin_pack does not finish

Open threonyl opened this issue 9 months ago • 3 comments

Hi,

Great work on the project. It really demonstrates a true next step in hardware development.

I customized the toolchain-demo example for tang nano 9k and for some reason the build process gets stuck during gowin_pack indefinitely. I chose to open the issue here, as it seems most fitting. If not, I would appreciate a guide to a relevant resource. Here are my files for reference.

settings.json:

{
  "yowaspToolchain.bundles": [
    "@yowasp/[email protected]",
    "@yowasp/openfpgaloader",
    "@yowasp/[email protected]",
  ],
  "yowaspToolchain.buildCommands": [
    ["yosys", "top.v", "-p", "synth_gowin", "-o", "top_json.json"],
    ["nextpnr-himbaechel-gowin", "--json", "top_json.json", "--freq", "27" ,"--write", "top_pnr.json", "--device", "GW1NR-LV9QN88PC6/I5", "--vopt", "cst=tangnano9k.cst", "--vopt", "family=GW1N-9C"],
    ["gowin_pack", "-d", "GW1N-9C", "-o", "pack.fs", "top_pnr.json"],
    ["openFPGALoader", "-b", "tangnano9k", "pack.fs"]
  ]
}

tangnano9k.cst:

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;

top.v:

module top
(
    input clk,
    output [5:0] led
);

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

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

assign led = ~ledCounter;
endmodule

What am I doing wrong?

threonyl avatar Mar 21 '25 09:03 threonyl

YoWASP maintainer here. Glad you like the project.

You are not doing anything wrong, this is a YoWASP issue that somehow slipped CI. If you go to "Output" pane and pick "Extension Host", you will see:

2025-03-21 10:23:46.729 [error] https://cdn.jsdelivr.net/npm/@yowasp/[email protected]/gen/pyodide:1
Couldn't find the requested file /gen/pyodide in @yowasp/nextpnr-himbaechel-gowin.
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

SyntaxError: Invalid or unexpected token
    at new Script (node:vm:117:7)
    at importModuleCriminally ([worker eval]:372:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async PythonApplication.run (https://cdn.jsdelivr.net/npm/@yowasp/[email protected]/gen/bundle.js:660:49)

For me it actually seems to be hanging at the nextpnr step, not gowin_pack, but it's a bug either way.

~~Since this is a YoWASP-specific issue I will transfer it over to YoWASP/nextpnr repo.~~ oh, it's already here, perfect.

whitequark avatar Mar 21 '25 10:03 whitequark

You are using desktop VS Code, correct?

whitequark avatar Mar 21 '25 10:03 whitequark

You are using desktop VS Code, correct?

Hi again,

Sorry for the delay. Yes, I am using VS Code on desktop.

threonyl avatar Mar 22 '25 08:03 threonyl

Sorry for the wait. Version 0.4.0 of the extension should fix this issue. Let me know if it reoccurs.

whitequark avatar Jul 03 '25 01:07 whitequark