2019-07-08 11:32:39 -05:00
# Tutorial
2019-07-08 11:30:26 -05:00
This tutorial purpose it to clarify how to use:
1. The full flow using fpga_flow.pl script
2. Architecture customization
Some keywords will be used during this tutorial:
2019-07-08 12:51:04 -05:00
* OPENFPGAPATHKEYWORD: refers to OpenFPGA folder full path
2019-07-08 11:30:26 -05:00
2019-07-08 12:51:04 -05:00
### Folder organization
2019-07-08 11:30:26 -05:00
OpenFPGA repository is organized as follow:
2019-07-08 12:51:04 -05:00
* **abc**: open source synthesys tool
* **ace2**: abc extension generating .act files
* **vpr7_x2p**: sources of modified vpr
* **yosys**: opensource synthesys tool
* **fpga_flow**: scripts and dependencies to run the complete flow
2019-07-08 17:18:08 -05:00
## 1. FPGA flow
2019-07-08 12:51:04 -05:00
The folder is organized as follow:
* **arch**: contains architectures description files
* **benchmarks**: contains Verilog and blif benchmarks + lists
* **configs**: contains configuration files to run fpga_flow.pl
* **scripts**: contains all the scripts required to run the flow
* **tech**: contains xml tech files for power estimation
2019-07-08 11:30:26 -05:00
fpga_flow.pl is saved in OPENFPGAPATHKEYWORD/fpga_flow/scripts. If we look in this folder, we can find some other scripts as:
2019-07-08 12:51:04 -05:00
* pro_blif.pl: rewrite a blif which has only 3 members in a .latch module
* rewrite_path_in_file.pl: target a keyword in a file and replace it
2019-07-08 11:30:26 -05:00
2019-07-09 15:28:14 -05:00
*Any script provides help if launch without argument*
2019-07-08 11:30:26 -05:00
fpga_flow.pl has dependencies which need to be configured. They are:
2019-07-08 12:51:04 -05:00
* configuration file, which provides dependencies path and flow type
* benchmark list file
2019-07-08 11:30:26 -05:00
2019-07-08 17:18:08 -05:00
### a. Configuration file
2019-07-08 11:30:26 -05:00
2019-07-08 11:36:58 -05:00
In this file paths have to be full path. Relative path could lead to errors.< br / >
2019-07-08 11:30:26 -05:00
The file is organized in 3 parts:
2019-07-08 17:18:08 -05:00
* **dir_path**: provides all the tools and repository path
* **flow_conf**: provides information on how the flow run
* **csv_tags**: *to complete*
2019-07-08 11:30:26 -05:00
While empty the file is as follow:
2019-07-08 11:36:58 -05:00
[dir_path]< br / >
script_base = OPENFPGAPATHKEYWORD/fpga_flow/scripts< br / >
2019-07-08 12:51:04 -05:00
benchmark_dir = *<Path to the folder containing all sources of the design>* < br />
2019-07-08 11:36:58 -05:00
yosys_path = OPENFPGAPATHKEYWORD/yosys< br / >
odin2_path = not_used< br / >
cirkit_path = not_used< br / >
abc_path = OPENFPGAPATHKEYWORD/abc< br / >
abc_mccl_path = OPENFPGAPATHKEYWORD/abc< br / >
abc_with_bb_support_path = OPENFPGAPATHKEYWORD/abc< br / >
mpack1_path = not_used< br / >
m2net_path = not_used< br / >
mpack2_path = not_used< br / >
vpr_path = OPENFPGAPATHKEYWORD/vpr7_x2p/vpr< br / >
2019-07-08 12:51:04 -05:00
rpt_dir = *<wherever you want logs to be saved>* < br />
2019-07-08 11:36:58 -05:00
ace_path = OPENFPGAPATHKEYWORD/ace2< br / >
[flow_conf]< br / >
flow_type = yosys_vpr *to use verilog input* < br />
2019-07-08 12:51:04 -05:00
vpr_arch = *<wherever the architecture file is saved>* < br />
2019-07-08 11:36:58 -05:00
mpack1_abc_stdlib = DRLC7T_SiNWFET.genlib # Use relative path under ABC folder is OK< br / >
m2net_conf = not_used< br / >
mpack2_arch = not_used< br / >
2019-07-08 12:51:04 -05:00
power_tech_xml = *<wherever the xml tech file is saved>* < br />
2019-07-08 11:36:58 -05:00
[csv_tags] *to complete* < br />
mpack1_tags = Global mapping efficiency:|efficiency:|occupancy wo buf:|efficiency wo buf:< br / >
mpack2_tags = BLE Number:|BLE Fill Rate: < br / >
vpr_tags = Netlist clb blocks:|Final critical path:|Total logic delay:|total net delay:|Total routing area:|Total used logic block area:|Total wirelength:|Packing took|Placement took|Routing took|Average net density:|Median net density:|Recommend no. of clock cycles:< br / >
vpr_power_tags = PB Types|Routing|Switch Box|Connection Box|Primitives|Interc Structures|lut6|ff< br / >
2019-07-08 11:30:26 -05:00
2019-07-08 12:51:04 -05:00
*An example of this file can be found at OPENFPGAPATHKEYWORD/fpga_flow/configs/tutorial/tuto.conf*
2019-07-08 17:18:08 -05:00
### b. Benchmark list
2019-07-08 12:51:04 -05:00
The benchmark folder contains 3 sub-folders:
2019-07-08 17:18:08 -05:00
* **Blif**: contains .blif and .act of benchmarks
* **List**: contains all benchmark list files
* **Verilog**: contains Verilog designs
2019-07-08 12:51:04 -05:00
2019-07-09 15:28:14 -05:00
Blif and Verilog folders are organized by folders with the name of projects. **Folder, top module and top module file must share the same name.** < br />
The benchmark list file can contain as many benchmarks as available in the same folder targetted by "benchmark_dir" variable from the configuration file. It's written as:< br / >
top_module/*.v,< int_value > ; where < int_value > is the number of channel/wire between each block.
2019-07-08 11:30:26 -05:00
2019-07-08 12:51:04 -05:00
*An example of this file can be found at OPENFPGAPATHKEYWORD/fpga_flow/benchmarks/List/tuto_benchmark.txt*
2019-07-08 17:18:08 -05:00
### c. Running fpga_flow.pl
Once the configuration is done, we can select which option we want to enable in fpga_flow. fpga_flow options don't exactly have the name of those listed in the [documentation ](https://openfpga.readthedocs.io/en/master/fpga_verilog/command_line_usage.html "documentation" ), which are used on the modifed version of vpr. Indeed, where vpr will take an option as "**--fpga_XXX**" fpgs_flow will call it "**-vpr_fpga_XXX**".< br />
Few options are only in fpga_flow:
2019-07-08 17:26:29 -05:00
* **-N**: number of LUT per CLB
* **-K**: LUT size/ number of input
* **-rpt < path > **: specifies wherever fpga_flow will write its report
* **-ace_d < int_value > **: specifies inputs average probability of switching
* **-multi_thread < int_value > **: specifies number of core to use
* **-end_flow_with_test**: uses Icarus Verilog to verify generated netlist
2019-07-08 17:18:08 -05:00
2019-07-09 15:28:14 -05:00
*An script example can be found at OPENFPGAPATHKEYWORD/fpga_flow/tuto_fpga_flow.sh*
2019-07-08 17:18:08 -05:00