ubuntu18.04 icesugar 综合(yosys),布线(nextpnr),打包(icesorm)

安装依赖

sudo apt-get install build-essential clang bison flex libreadline-dev \
                     gawk tcl-dev libffi-dev git mercurial graphviz   \
                     xdot pkg-config python python3 libftdi-dev \
                     qt5-default python3-dev libboost-all-dev cmake libeigen3-dev
#Installing the IceStorm Tools (icepack, icebox, iceprog, icetime, chip databases):
git clone https://github.com/cliffordwolf/icestorm.git icestorm
cd icestorm
make -j$(nproc)
sudo make install
#Installing Arachne-PNR (place&route tool, predecessor to NextPNR):
git clone https://github.com/cseed/arachne-pnr.git arachne-pnr
cd arachne-pnr
make -j$(nproc)
sudo make install
#Installing NextPNR (place&route tool, Arachne-PNR replacement):
sudo apt-get install libeigen3-dev
git clone https://github.com/YosysHQ/nextpnr nextpnr
cd nextpnr
cmake . -DARCH=ice40 -DCMAKE_INSTALL_PREFIX=/usr/local
make -j$(nproc)
sudo make install
#Installing Yosys (Verilog synthesis):
git clone https://github.com/cliffordwolf/yosys.git yosys
cd yosys
make config-clang
make config-gcc
make -j$(nproc)
sudo make install

中国本地 icesugar

https://gitee.com/xiaoerlang0359/icesugar?_from=gitee_search

$sudo apt-get install libhidapi-dev
$sudo apt-get install libusb-1.0-0-dev

$ yosys -p "synth_ice40 -blif test.blif" led.v
$ arachne-pnr -d 5k -P sg48 -p led.pcf led.blif -o led.txt
$ icepack led.txt led.bin
$ iceprog led.bin

Makefile
# Makefile if条件语句内的语句每行尾要加分号";" 但后台运行的语句除外

filename=led
ICELINK_DIR=$(shell df | grep iCELink | awk '{print $$6}')


$(filename).bin:$(filename).txt
	icepack $(filename).txt $(filename).bin

$(filename).txt:$(filename).pcf $(filename).blif
	arachne-pnr -d 5k -P sg48 -p $(filename).pcf $(filename).blif -o $(filename).txt

$(filename).blif:$(filename).v
	yosys -p "synth_ice40 -blif $(filename).blif" $(filename).v


write:
	@if [ -d '$(ICELINK_DIR)' ]; \
     	then \
		cp $(filename).bin $(ICELINK_DIR); \
     	else \
		echo "iCELink not found"; \
		exit 1; \
     	fi
      //icesprog -o 0x100000 $(filename).bin
test:
	iverilog $(filename).v $(filename)_test.v -o $(filename)_test.out  #也可以使用`include "xxx.v" 包含多个文件
	./$(filename)_test.out
	@if [ -f "$(filename)_test.vcd" ]; \
	then \
		gtkwave $(filename)_test.vcd $(filename)_test.gtkw & \
	else \
		echo "$(filename)_test.vcd 未找到。"; \
	fi

使用Makefile

make #生成bin文件
make write #烧写bin文件
make test #模拟验证

#查看FPGA逻辑电路连接情况

#nextpnr-ice40         --up5k       --pcf    led.pcf        --asc        led.txt            --gui
sudo apt install libboost-python1.65.1
sudo apt install libboost-program-options1.65.1

#打开Makefile并把第1行使用filename=prescaler内容替换
sed -i '1c filename=prescaler' Makefile  
  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值