README.md 2.76 KB
Newer Older
1
# Firmware  project running in IPP-HGW on IPFN ATCA-MIMO-ISOL V2.1 Hardware Boards
2
## Xilinx Kintex 7 FPGA Module
Bernardo Carvalho's avatar
Bernardo Carvalho committed
3
 * The ATCA contains an FPGA plugin Module [Trenz TE0741](https://wiki.trenz-electronic.de/display/PD/TE0741)
4
5
6

## Getting started

Bernardo Carvalho's avatar
Bernardo Carvalho committed
7
8
1.  Prerequisites
 * The Master branch in currently using [Vivado Design Suite](https://www.xilinx.com/support/download.html),
Bernardo Carvalho's avatar
Bernardo Carvalho committed
9
 version 2022.1, which needs a valid license to compile projects using Xilinx Kintex-7 XC7K325T FPGA
10

Bernardo Carvalho's avatar
Bernardo Carvalho committed
11
12
2.  Checkout the latest release, and `cd atca-mimo-v2-adc` to the folder
3. Create and build the project in Vivado **Project Mode** (with GUI)
13
14
15
16
17

Open Vivado IDE and do:
```
 Menu Tools->Run Tcl Script-> "scripts/project_create.tcl"
 You will need to (re-)generate IP cores in used in the Project, at least 
Bernardo Carvalho's avatar
Bernardo Carvalho committed
18
 PCIe XDMA endpoint/DMA engine.
19
20

```
Bernardo Carvalho's avatar
Bernardo Carvalho committed
21
Project files will be generated in `vivado_project` folder
22

Bernardo Carvalho's avatar
Bernardo Carvalho committed
23
4. (optional) Build the project in Vivado **non-Project Mode** (CLI in Linux)
24

Bernardo Carvalho's avatar
Bernardo Carvalho committed
25
* Open a Linux console and Run:
26
```
Bernardo Carvalho's avatar
Bernardo Carvalho committed
27
 [~]source [...]/Xilinx/Vivado/2022.1/settings64.sh
28
29
30
31
32
33
 [~]time vivado -mode batch -source project_implement.tcl

```

 Generated files will be in `out` folder.

Bernardo Carvalho's avatar
Bernardo Carvalho committed
34
 The Project should compile in ~ 15 minutes on a Intel i7 4-core Machine.
35

Bernardo Carvalho's avatar
Bernardo Carvalho committed
36
37
38

## Program the FPGA (Kintex 7).
1. Program in **non-Project Mode**, for temporary testing.
39
40
41
```
 [~]vivado -mode batch -source scripts/program_fpga.tcl
```
Bernardo Carvalho's avatar
Bernardo Carvalho committed
42
* You may need to change the reference ID to your JTAG programmer. 
Bernardo Carvalho's avatar
Bernardo Carvalho committed
43
* This may be well connected a remote machine running the Xilinx Hardware [Server](https://www.xilinx.com/member/forms/download/xef-vivado.html?filename=Xilinx_HW_Server_Lin_2019.2_1106_2127.tar.gz).
Bernardo Carvalho's avatar
Bernardo Carvalho committed
44
(You may need use the same Vivado version!), or a remote Xilinx programmer
45

Bernardo Carvalho's avatar
Bernardo Carvalho committed
46
47
2. Program the FPGA configuration Memory and reboot FPGA.
* Run Vivado GUI
48
```
Bernardo Carvalho's avatar
Bernardo Carvalho committed
49
50
 source /opt/Xilix/Vivado_Lab/2020.2/settings.sh
 vivado_lab&
51
```
Bernardo Carvalho's avatar
Bernardo Carvalho committed
52
53
54
* Connect to remote Xilinx Program and add configuration memory
* Trenz Module has a SPI Memory type `s25fl256sxxxxxx0-spi-x1_x2_x4`
* Program SPI with default parameters and reboot
55
    
56

Bernardo Carvalho's avatar
Bernardo Carvalho committed
57
## Linux Sofware
58

Bernardo Carvalho's avatar
Bernardo Carvalho committed
59
* Driver code, C++ API and tools were now moved to a different repository:
60

Bernardo Carvalho's avatar
Bernardo Carvalho committed
61
62
[MPCDF Gitlab](https://gitlab.mpcdf.mpg.de/bcar/dma_ip_drivers)  
Forked from Xilinx github [xdma drivers](https://github.com/Xilinx/dma_ip_drivers) 
63

Bernardo Carvalho's avatar
Bernardo Carvalho committed
64
* Driver should compile in recent version >= 4.x.y kernels  
65
Go to `XDMA/linux-kernel/xdma`and run:
66
67
- `make`

Bernardo Carvalho's avatar
Bernardo Carvalho committed
68
69
70
71
 * Load driver in root mode with
    - `$ insmod adc_xdma.ko`
    - install driver permanently with `make install`
    - Check driver loading and troubleshoot with `dmesg`
72

Bernardo Carvalho's avatar
Bernardo Carvalho committed
73
### If you reprogram FPGA, reboot machine or reload driver with:
74
```
Bernardo Carvalho's avatar
Bernardo Carvalho committed
75
76
echo 1 > /sys/bus/pci/devices/0000\:07\:00.0/remove
# Youi may need to change the correct device number, check with 'lspci | grep Xilinx'
77
78
echo 1 > /sys/bus/pci/rescan
```