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 92 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
92 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
5a2fd85
adding a new core for SPI device control
twitzelbos Nov 13, 2024
fc5dbff
add the quadrature clock divider
twitzelbos Nov 13, 2024
d2d21a5
made the divider bit width parametrizable
twitzelbos Nov 13, 2024
2773614
moving some files aorund
twitzelbos Nov 20, 2024
abe6cbb
added some more test framework
twitzelbos Nov 20, 2024
ab248b2
remove unneeded testbench
twitzelbos Nov 20, 2024
196a5e1
do some more structure for the spi core
twitzelbos Nov 20, 2024
786b465
some more reformatting
twitzelbos Nov 20, 2024
5da57a1
fix the spi clock generation to match the 4 modes
twitzelbos Nov 20, 2024
0dd383c
cleanup
twitzelbos Nov 20, 2024
a8fb0af
intermediate state
twitzelbos Nov 21, 2024
8ef7a0b
add reset synchronizer core
twitzelbos Nov 21, 2024
05c2d3f
cleaned up code some more
twitzelbos Nov 21, 2024
560018c
add a second reset synchronizer into the spi clock domain
twitzelbos Nov 21, 2024
ccec38a
add to_spi_fifo_rd_en handling logic
twitzelbos Nov 21, 2024
b821a03
add some code to not write to the to_fabric fifo if nothing
twitzelbos Nov 21, 2024
5710e1c
fix the quadrature clock divider
twitzelbos Nov 30, 2024
c2db857
OMG
twitzelbos Dec 1, 2024
d49ca58
it is what it is
twitzelbos Dec 1, 2024
b9588ed
initial checkin
twitzelbos Dec 1, 2024
f976a69
Updated Makefile to clean more vcd files
twitzelbos Dec 1, 2024
407524a
make sure all 4 spi modes are correct
twitzelbos Dec 1, 2024
4be654d
moved the sampling of the read data into the spi_clk trigger
twitzelbos Dec 2, 2024
b5c9988
support all 4 SPI modes for the read sampling correctly
twitzelbos Dec 2, 2024
a3c8bca
add some more test cases and another surfer state
twitzelbos Dec 2, 2024
495ea1f
some cleanup
twitzelbos Dec 2, 2024
2eee600
added a TODO file
twitzelbos Dec 2, 2024
46adb2d
counters are still wrong
twitzelbos Dec 2, 2024
599dea8
first simplified "single clock" master, still needs work though
twitzelbos Dec 4, 2024
ed5b8f7
fix the 0th bit
twitzelbos Dec 5, 2024
4c74d46
fixed some of the vcd file names
twitzelbos Dec 5, 2024
4645f40
mode 0 read sampling added again
twitzelbos Dec 5, 2024
496839c
fixed testbench resets
twitzelbos Dec 5, 2024
31e66c2
switch to shift registers
twitzelbos Dec 6, 2024
ccfdcd6
added actually reading the data
twitzelbos Dec 6, 2024
6c58241
support mode 1 for both write and read
twitzelbos Dec 6, 2024
74678ef
support mode 2 correctly for write on cs assert
twitzelbos Dec 6, 2024
7ee69cf
simplified code a tad
twitzelbos Dec 6, 2024
f285530
implement reading from the to_fabric fifo
twitzelbos Dec 7, 2024
d364ec0
renamed the module
twitzelbos Dec 7, 2024
2174066
fixed a bug in Makefile
twitzelbos Dec 7, 2024
d46fc7b
Made an additional top-level module with built-in clock divider
twitzelbos Dec 7, 2024
4c22ec3
some more Makefile cleanups and more tests
twitzelbos Dec 7, 2024
79d8395
added some more tests
twitzelbos Dec 7, 2024
e13c1db
noted the next bug in the input shift register FSM
twitzelbos Dec 7, 2024
ccd86e1
fix the input register shifts
twitzelbos Dec 7, 2024
2fc3430
synchronize spi mode through fifo so it cannot change during a transa…
twitzelbos Dec 7, 2024
98ec50a
added one more task
twitzelbos Dec 7, 2024
5914461
cleanup in the read state
twitzelbos Dec 7, 2024
039c26a
added a combinatorial state transition machine
twitzelbos Dec 7, 2024
c9118eb
added the 4-input redpitaya as boardx
twitzelbos Dec 8, 2024
f277fbe
add new base_pl_new project
twitzelbos Dec 8, 2024
3554220
changed the design to operate with a single double frequency clock
twitzelbos Dec 10, 2024
f38c760
updated todo to reflect new problems
twitzelbos Dec 10, 2024
182ef9d
added the Avent ZUB-1CG MPSoc board
twitzelbos Dec 23, 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?