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

Improvements to the HDL build #103

Draft
wants to merge 37 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2e5353f
eliminate unnecessary slices and fix RX demodulator output width
twitzelbos Dec 2, 2023
1459b95
fix the broadcaster width in the receiver part
twitzelbos Dec 3, 2023
d946118
incorporated new DAC core that uses the 14 MSB of a 16 bit DAC word
twitzelbos Dec 3, 2023
ef0bb7c
new DAC core
twitzelbos Dec 3, 2023
d7bd152
reduced bitwidth of fir filter and adjusted floating point format
twitzelbos Dec 5, 2023
b14a5eb
remove fp conversion from FPGA and move into server
twitzelbos Dec 6, 2023
4bc6050
set execution permission on cross-build script
twitzelbos Dec 6, 2023
270d9cc
added packing to union, probably not necessary
twitzelbos Dec 6, 2023
c4d535e
don't build device tree by default
twitzelbos Sep 16, 2024
b6bd107
add .Xil to gitignore
twitzelbos Sep 16, 2024
2db1ea8
updated the Makefile to use the 2024.1 device tree compiler
twitzelbos Sep 16, 2024
c5dfb1c
start moving properties for the ports to the ports.tcl
twitzelbos Sep 16, 2024
48d8b80
remove unused tcl script
twitzelbos Sep 16, 2024
8d0e4f8
remove a bunch of unneeded shell scripts
twitzelbos Sep 16, 2024
1712a04
reverting some of the changes I made
twitzelbos Sep 16, 2024
0a3ae44
fully reverted the ports.xdc file
twitzelbos Sep 16, 2024
4088a74
modify the board file to pass the validator
twitzelbos Sep 16, 2024
0cd4b16
more updates to board files for schema validity and IO standards
twitzelbos Sep 16, 2024
1cffead
deleted empty connections section from snickerdoodle_black board
twitzelbos Sep 16, 2024
b33970a
add board files for the digilent eclypse Z7 board
twitzelbos Sep 16, 2024
5cd53f5
add the eclypse boards to the vivado repo path
twitzelbos Sep 16, 2024
a5e8e21
Merge branch 'main' into feature/cleanup-blockdesign
twitzelbos Sep 17, 2024
a4e3b6f
Merge pull request #104 from OpenMRI/feature/cleanup-blockdesign
twitzelbos Sep 17, 2024
91aa941
Merge branch 'main-next' into feature/HDL-build-improvements
twitzelbos Sep 22, 2024
8d33269
renamed the projects folder for clarity
twitzelbos Sep 22, 2024
9c57daf
updated to newer versions of python packages for relax2
twitzelbos Sep 22, 2024
a658a5b
my initial attempts at building an async fifo for
twitzelbos Sep 22, 2024
a9d104c
small syntax issues
twitzelbos Sep 22, 2024
a650013
fixed the system verilog test bench.
twitzelbos Sep 22, 2024
b614452
adding some documentation
twitzelbos Sep 22, 2024
e59b2ad
more documentation
twitzelbos Sep 22, 2024
cd21c0c
completed the verilator testbench first try
twitzelbos Sep 22, 2024
042f1c3
tiny Makefile improvement to include gtkwave
twitzelbos Sep 22, 2024
83d9c7f
removed gtkwave from the Makefile
twitzelbos Sep 22, 2024
734415c
updated reference to display tool
twitzelbos Sep 22, 2024
9f1d242
update my async fifo to use double flop gray code synchronizers
twitzelbos Sep 22, 2024
ca1f8a7
add almost_full and almost_empty flags for improved flow control
twitzelbos Sep 22, 2024
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
3 changes: 2 additions & 1 deletion HDL/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ uImage
devicetree.dtb
*~
tmp/
vivado*
vivado*
.Xil/
4 changes: 2 additions & 2 deletions HDL/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RM = rm -rf

VIVADO_VER = $(shell vivado -version | grep "v20" | sed -r 's/.*v(20[0-9]{2}.[0-9]).*/\1/g')

DTREE_TAG = xlnx_rel_v2022.2
DTREE_TAG = xlnx_rel_v2024.1

DTREE_DIR = tmp/device-tree-xlnx-$(DTREE_TAG)
DTREE_URL = https://github.com/Xilinx/device-tree-xlnx/
Expand All @@ -34,7 +34,7 @@ DTREE_URL = https://github.com/Xilinx/device-tree-xlnx/
.PHONY: clean all xpr bit dtbo setup

.ONESHELL:
all: setup tmp/%.bin tmp/%.dtbo
all: setup tmp/%.bin


.ONESHELL:
Expand Down
19 changes: 15 additions & 4 deletions HDL/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

This directory contains all the HDL code of the ocra project. The code is organized in projects, which can be found in subdirectories of the projects folders.

In order to build the HDL code you need to have Xilinx Vitis 2022.2 full edition. We highly recommend that you use Linux, because the build system and other tooling relies on Linux. We are working on and recommend [Ubuntu 22.04 LTS](https://ubuntu.com/download/desktop).
In order to build the HDL code you need to have at least Xilinx Vitis 2022.2 full edition. This build has been tested up to Vitis 2024.1. We highly recommend that you use Linux, because the build system and other tooling relies on Linux. We are working on and recommend [Ubuntu 22.04 LTS or Ubuntu 24.04 LTS](https://ubuntu.com/download/desktop).

**Basic working knowledge of Linux and bash is more or less required to follow these instructions.**

In order to install Vitis you will need about 110 GB of free disk space, and you will need to register an account with Xilinx website (remember the password, because the installer will also require the same login credentials that you created on the Xilinx website. It is best to download the [Vitis web installer](https://www.xilinx.com/member/forms/download/xef.html?filename=Xilinx_Unified_2022.2_1014_8888_Lin64.bin).
In order to install Vitis you will need about 110 GB of free disk space, and you will need to register an account with Xilinx website (remember the password, because the installer will also require the same login credentials that you created on the Xilinx website. It is best to download the [Vitis web installer](https://account.amd.com/en/forms/downloads/xef.html?filename=FPGAs_AdaptiveSoCs_Unified_2024.1_0522_2023_Lin64.bin).

Vivado (the main tool in the Vitis package) is a bit of a beast and requires a reasonably powerful workstation.

Expand All @@ -15,15 +15,18 @@ All building of the HDL is done by a [GNU Makefile](https://www.gnu.org/software
This makes it straightforward to build multiple projects etc. from the command line without having to wrestle the Vivado GUI. This entire setup is based on the [red-pitaya-notes](https://github.com/pavel-demin/red-pitaya-notes) by Pavel Demin, and some of his architecture and cores can also be found in this repository.

This repository makes use of Vivado board files, which requires additional configuration of your Vivado/Vitis setup. In order to make everything work the following configuration steps need to be taken:
1. Add `source /tools/Xilinx/Vitis/2022.2/settings64.sh` to your `.bash_profile`
1. Add `source /tools/Xilinx/Vitis/2024.1/settings64.sh` to your `.bash_profile`
1. Define the environment variable OCRA_DIR in your `.bash_profile` to point to the ocra directory
2. Include the following in your local Vivado config (i.e. $HOME/.Xilinx/Vivado/2022.2/Vivado_init.tcl):
2. Include the following in your local Vivado config (i.e. $HOME/.Xilinx/Vivado/2024.1/Vivado_init.tcl):
```
# set up the OCRA project
set ocra_dir $::env(OCRA_DIR)
source $ocra_dir/HDL/scripts/Vivado_ocra_init.tcl
```

You may need to adjust the path of your Vitis installation as appropriate for this to be correct on your installation.


To get a quick start, assuming you have Vitis/Vivado configured in your path, you should be able to build the base_pl project for the snickerdoodle_black
```
cd $OCRA_DIR/HDL
Expand All @@ -35,4 +38,12 @@ Similarily, you can build the ocra_mri project for the stemlab_125_14 by calling
make NAME=ocra_mri BOARD=stemlab_125_14
```

This will build bitfiles that can be used with on a Linux installation on your Zynq so long it supports the fpga_manager. If you want to build a device tree and the associated files to create your own bootloader etc. you need to run

```
make dtbo NAME=ocra_mri BOARD=stemlab_125_14
```

Note that this requires the HSI tool xsct and the device tree compiler dtc.

This is pretty easy, isn't it?