You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-22Lines changed: 46 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
# openwifi-hw
2
+
2
3
<imgsrc="./openwifi-logo.png"width="300">
3
4
4
5
**openwifi:** Linux mac80211 compatible full-stack IEEE802.11/Wi-Fi design based on SDR (Software Defined Radio).
@@ -24,6 +25,7 @@ Openwifi code has dual licenses. [AGPLv3](https://github.com/open-sdr/openwifi/b
24
25
**Pre-compiled FPGA files:****openwifi-hw-img** repository, boards/**$BOARD_NAME**/sdk/ has FPGA bit file, ila .ltx file (if ila inserted) and other initilization files.
* Vivado 2021.1 with Vitis. You should have: your_Xilinx_install_directory/Vitis (NOT Vitis_HLS!)
42
45
* You can add Vitis by running "Xilinx Design Tools --> Add Design Tools for Devices 2021.1" from Xilinx program group/menu in your OS start menu, or Help menu of Vivado.
43
46
* Install the evaluation license of [Xilinx Viterbi Decoder](https://www.xilinx.com/products/intellectual-property/viterbi_decoder.html) into Vivado.
44
47
* Ubuntu 18/20/22 LTS release (We test in these OS. Other OS might also work.)
45
48
* Install required packages, such as `sudo apt install libtinfo5`
46
-
47
49
* Prepare Analgo Devices HDL library (only run once):
48
-
```
50
+
51
+
```bash
49
52
export XILINX_DIR=your_Xilinx_install_directory
50
53
(Example: export XILINX_DIR=/opt/Xilinx. The Xilinx directory should include sth like: Downloads, SDK, Vivado, xic)
51
54
./prepare_adi_lib.sh $XILINX_DIR
52
55
```
56
+
53
57
* Prepare Analgo Devices specific ip (only run once for each board you have):
54
-
```
58
+
59
+
```bash
55
60
export BOARD_NAME=your_board_name
56
61
(Example: export BOARD_NAME=zc706_fmcs2)
57
62
./prepare_adi_board_ip.sh $XILINX_DIR$BOARD_NAME
58
63
(Don't need to wait till the building end. When you see "Building ABCD project [...", you can stop it.)
59
64
```
65
+
60
66
* Get the openofdm_rx into ip directory (only run once after openofdm is udpated):
61
-
```
67
+
68
+
```bash
62
69
./get_ip_openofdm_rx.sh
63
70
```
71
+
64
72
* Generate ip_repo for the top level FPGA project (will take a while):
65
-
```
73
+
74
+
```bash
66
75
cd openwifi-hw/boards/$BOARD_NAME/
67
76
../create_ip_repo.sh $XILINX_DIR
68
77
```
78
+
69
79
* In the Vivado
70
-
```
80
+
81
+
```bash
71
82
source ./openwifi.tcl
72
83
Click "Generate Bitstream" in the Vivado GUI.
73
84
(Will take a while)
74
85
File --> Export --> Export Hardware --> Next --> Include bitstream --> Next --> Next --> Finish
75
86
```
87
+
76
88
* In Linux, store the FPGA files to a specific directory:
77
-
```
89
+
90
+
```bash
78
91
cd openwifi-hw/boards
79
92
./sdk_update.sh $BOARD_NAME $OPENWIFI_HW_IMG_DIR
80
93
```
94
+
81
95
Above command will store the FPGA img (.xsa .ltx) and the related git info into another directory $OPENWIFI_HW_IMG_DIR that can be picked up by openwifi software building environment later on. Please check README of the openwifi repository.
82
96
83
97
## Modify IP cores
84
98
85
99
IP core project files are in "ip/ip_name" directory. "ip_name" example: xpu, tx_intf, etc. To create the IP project and do necessary work (modification, simulation, etc.), go to the ip/ip_name directory, then:
86
-
```
100
+
101
+
```bash
87
102
../create_vivado_proj.sh $XILINX_DIR ip_name.tcl
88
103
```
104
+
89
105
To apply your new/modified IP to the top level FPGA project, start from "../create_ip_repo.sh $XILINX_DIR" in the board directory (Build FPGA section) to integrate your modified IP to the board FPGA design.
90
106
91
107
If your IP modification is complicated and encounter error while running create_ip_repo.sh, you should check create_ip_repo.sh/ip_repo_gen.tcl/etc, understand and modify them accordingly (for example to include your new added files).
@@ -101,23 +117,24 @@ By default, 100MHz baseband clock is used. You can change the baseband clock by
101
117
* Create the ip core project in Vivado. To achieve this, you need to follow the "Modify IP cores" section to create the IP's Vivado project.
102
118
* Normally you should see the top level testbench (..._tb.v) of that ip core in the Vivado "Sources" window (take openofdm_rx as example):
* To run the simulation, click "Run Simulation" -->"Run Behavoiral Simulation" under the "SIMULATION"in the "PROJECT MANAGER" window. It will take quite long timefor the 1st time run due to the sub-ip-core compiling. Fortunately the sub-ip-core compiling is a time consuming step that occurs only one time.
109
125
* When the previous step is finished, you should see a simulation window displays many variable names and waveforms. Now click the small triangle, which points to the right and has "Run All (F3)" hints, on top to start the simulation.
110
-
* Please check the ..._tb.v to see how do we use $fopen, $fscanf and $fwrite to read test vectors and save the variables for checking later. Of course you can also check everything in the waveform window.
126
+
* Please check the ..._tb.v to see how do we use $fopen, $fscanf and $fwrite to readtest vectors and save the variables forchecking later. Of course you can also check everythingin the waveform window.
111
127
* The openofdm_rx_pre_def.v also includes important definitions for the simulation.
112
128
* After you modify some design files, just click the small circle with arrow, which has "Relaunch Simulation" hints, on top to re-launch the simulation.
113
129
* You can always drag the signals you need from the "SIMULATION" -->"Scope" window to the waveform window, and relaunch the simulation to check those signals' waveform. An example:
While working on a stand alone IP, the create_vivado_proj.sh could accept more arguments. Some arguments will be converted to verilog macro pre-defines into ip_name_pre_def.v, which can be included by IP source files to enable/disable some code blocks. Check more info by running create_vivado_proj.sh:
120
-
```
136
+
137
+
```bash
121
138
usage:
122
139
Need at least 2 arguments: $XILINX_DIR $TCL_FILENAME
123
140
More arguments (max 7) will be passed as arguments to the .tcl script to create ip_name_pre_def.v
@@ -127,17 +144,21 @@ Among these max 7 arguments:
127
144
- the 3rd-7th: User pre defines (assume it is ABC) for conditional compiling. Will be `define IP_NAME_ABC in ip_name_pre_def.v
128
145
- the 3rd exception: in the case of openofdm_rx, it indicates SAMPLE_FILE for simulation. Can be changed later in openofdm_rx_pre_def.v
129
146
```
147
+
130
148
While working on the top level FPGA project, the same verilog macro pre-defines should also be specified when running create_ip_repo.sh if you want the IP to be conditional compiled in the same way when you working on it in stand alone mode (when the IP project is created by create_vivado_proj.sh). Check more info by running create_ip_repo.sh:
0 commit comments