tinyfpga / TinyFPGA-BX

Other
273 stars 94 forks source link

support nextpnr instead of deprecated arachne-pnr #23

Open jrincayc opened 4 years ago

jrincayc commented 4 years ago

As the arachne-pnr github says: Arachne-pnr is not maintained anymore; use nextpnr instead, which is a complete functional replacement with major improvements.

The commands to use nextpnr-ice40 with the icestorm_template are:

yosys -p 'synth_ice40 -top top -blif top.blif -json top.json' top.v
nextpnr-ice40 --lp8k --package cm81   --json top.json --asc  top.asc --pcf  pins.pcf
icetime -d lp8k -mtr top.rpt top.asc
icepack top.asc top.bin
tinyprog -p top.bin
jrincayc commented 4 years ago

Suggested makefile for blif and json:

top.blif top.json &: top.v
    yosys -p 'synth_ice40 -top top -blif top.blif -json top.json' top.v

top.asc : $(PIN_DEF) top.json
    nextpnr-ice40 --lp8k --package cm81   --json top.json --asc  top.asc --pcf  pins.pcf
jrincayc commented 4 years ago

As a pattern:

%.blif %.json : %.v
    yosys -p 'synth_ice40 -top top -blif $@ -json $*.json' $<

%.asc: $(PIN_DEF) %.blif %.json
    nextpnr-ice40 --$(DEVICE) --package cm81   --json $*.json --asc $@ --pcf  $(PIN_DEF)