OpenFPGA系列(七)OpenFPGA Shell使用

笔记同步在我的个人网站进行更新,欢迎来访查看。
这篇博客将以一个demo为例介绍如何使用OpenFPGA Shell。
首先进入OpenFPGA/openfpga,输入 ./openfpga -i启动交互模式:
在这里插入图片描述
(1)使用 vpr,生成对应FPGA架构的基准电路的网表文件:

# Run VPR for the 'and' design
vpr ../openfpga_flow/vpr_arch/k6_frac_N10_tileable_40nm.xml ../openfpga_flow/benchmarks/micro_benchmark/and2/and2.blif --clock_modeling route

在这里插入图片描述
这里生成的文件会直接保存在OpenFPGA/openfpga目录下,目前我还不知道如何去设置输出目录的路径,等知道了再更新,这里我是手动整理的:
在这里插入图片描述
(2)读取适用于 openfpga的架构描述文件:

# Read OpenFPGA architecture definition
read_openfpga_arch -f ../openfpga_flow/openfpga_arch/k6_frac_N10_40nm_openfpga.xml

在这里插入图片描述
(3)继续读取 openfpga的仿真设置文件:

# Read OpenFPGA simulation settings
read_openfpga_simulation_setting -f ../openfpga_flow/openfpga_simulation_settings/auto_sim_openfpga.xml

在这里插入图片描述

(4)将openfpga架构文件链接到vpr架构文件上,并设置 activity_file,此文件在运行 yosys flow时会用到:

# Annotate the OpenFPGA architecture to VPR data base
# to debug use --verbose options
link_openfpga_arch --activity_file ../openfpga_flow/benchmarks/micro_benchmark/and2/and2.act --sort_gsb_chan_node_in_edges 

在这里插入图片描述
(5)检查并修正基准电路网表中的命名冲突,结果保存到 netlist_renaming.xml 文件中

# Check and correct any naming conflicts in the BLIF netlist
check_netlist_naming_conflict --fix --report ./netlist_renaming.xml

在这里插入图片描述
(6)生成模块图,这里添加了参数--compress_routing,作用是压缩路由模块,可以极大减小网表大小

# Build the module graph
#  - Enabled compression on routing architecture modules
#  - Enable pin duplication on grid modules
build_fabric --compress_routing 

在这里插入图片描述
(7)将FPGA Fabric图写入到指定文件中

# Write the fabric hierarchy of module graph to a file
# This is used by hierarchical PnR flows
write_fabric_hierarchy --file ./fabric_hierarchy.txt

在这里插入图片描述
在这里插入图片描述
类似于将.v文件导入vivado,自动生成的模块层次
在这里插入图片描述
(8)生成该架构FPGA Fabric的Verilog网表(实际上就是所有模块的verilog代码)

# Write the Verilog netlist for FPGA fabric
#  - Enable the use of explicit port mapping in Verilog netlist
write_fabric_verilog --file ./SRC --explicit_port_mapping --include_timing --print_user_defined_template --verbose 

在这里插入图片描述
在这里插入图片描述
至此从输入VPR架构文件,基准电路文件,openfpga的架构文件和仿真设置文件,到最终FPGA Fabric Verilog网表文件的生成 整个流程都完成了。
输入exit 退出 openfpga_shell。
在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

雪天鱼

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值