Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update folding configuration for FPGA flow tutorial #1212

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 28 additions & 16 deletions tutorials/fpga_flow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,29 @@ This demo was created using Vivado 2022.1.
Prior to running, insure the following prerequisites have been met:
- Install FINN and prerequisites. The [Getting Started](https://finn.readthedocs.io/en/latest/getting_started.html#quickstart) section of the FINN documentation might be helpful for this.
- Ensure you have the `FINN_XILINX_PATH` and `FINN_XILINX_VERSION` env variables set appropriately for your install. For example:
> export FINN_XILINX_PATH=/opt/Xilinx
> export FINN_XILINX_VERSION=2022.1
```shell
export FINN_XILINX_PATH=/opt/Xilinx
export FINN_XILINX_VERSION=2022.1
```

- Set the env variable for your `finn` install top directory (where you cloned the FINN compiler repo):
> export FINN_ROOT=/home/foo/finn
```shell
export FINN_ROOT=/home/foo/finn
```

Then, change to `finn` install directory and invoke the build as follows:
> cd ${FINN_ROOT}
> ./run-docker.sh build_custom ${FINN_ROOT}/tutorials/fpga_flow/
```shell
cd ${FINN_ROOT}
./run-docker.sh build_custom ${FINN_ROOT}/tutorials/fpga_flow/
```

Alternatively, since the tutorials folder is already part of the FINN compiler installation, you can invoke it from within the Docker container:
> cd ${FINN_ROOT}
> ./run-docker.sh
> cd tutorials/fpga_flow
> python build.py
```shell
cd ${FINN_ROOT}
./run-docker.sh
cd tutorials/fpga_flow
python build.py
```

The build should finish in about 10 minutes, and the FINN docker will close on success.

Expand All @@ -59,12 +68,14 @@ The build should finish in about 10 minutes, and the FINN docker will close on s
### Examine the Stitched IP

Navigate to the stitched IP project directory:

> cd ${FINN_ROOT}/tutorials/fpga_flow/output_tfc_w0a1_fpga/stitched_ip
```shell
cd ${FINN_ROOT}/tutorials/fpga_flow/output_tfc_w0a1_fpga/stitched_ip
```

And, open the project:

> vivado finn_vivado_stitch_proj.xpr
```shell
vivado finn_vivado_stitch_proj.xpr
```

Explore the IPI board design and note the interfaces.

Expand All @@ -89,9 +100,10 @@ them under `${FINN_ROOT}/tutorials/fpga_flow/output_tfc_w0a1_fpga/sim`. Let's ex
the FINN compiler. Used for launching the testbench simulation.

You can now launch the simulation as follows:

> cd ${FINN_ROOT}/tutorials/fpga_flow/output_tfc_w0a1_fpga/sim
> vivado -mode gui -source make_sim_proj.tcl
```shell
cd ${FINN_ROOT}/tutorials/fpga_flow/output_tfc_w0a1_fpga/sim
vivado -mode gui -source make_sim_proj.tcl
```

The simulation should complete with:

Expand Down
15 changes: 7 additions & 8 deletions tutorials/fpga_flow/folding_config.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
{
"Defaults": {},
"Thresholding_Batch_0": {
"PE": 49,
"ram_style": "block"
"Thresholding_rtl_0": {
"PE": 49
},
"MatrixVectorActivation_0": {
"MVAU_hls_0": {
"PE": 16,
"SIMD": 49,
"ram_style": "block"
},
"MatrixVectorActivation_1": {
"MVAU_hls_1": {
"PE": 8,
"SIMD": 8,
"ram_style": "auto"
},
"MatrixVectorActivation_2": {
"MVAU_hls_2": {
"PE": 8,
"SIMD": 8,
"ram_style": "auto"
},
"MatrixVectorActivation_3": {
"MVAU_hls_3": {
"PE": 10,
"SIMD": 8,
"ram_style": "distributed"
},
"LabelSelect_Batch_0": {
"LabelSelect_hls_0": {
"PE": 1
}
}
Loading