Skip to content

Commit 5c7bc6e

Browse files
committed
polish readme
1 parent 1fa21bb commit 5c7bc6e

File tree

1 file changed

+46
-22
lines changed

1 file changed

+46
-22
lines changed

README.md

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# openwifi-hw
2+
23
<img src="./openwifi-logo.png" width="300">
34

45
**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
2425
**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.
2526

2627
Environment variable **BOARD_NAME** options:
28+
2729
- **zc706_fmcs2** ([Xilinx ZC706 board](https://www.xilinx.com/products/boards-and-kits/ek-z7-zc706-g.html) + [FMCOMMS2/3/4](https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/eval-ad-fmcomms2.html))
2830
- **zed_fmcs2** ([Xilinx zed board](https://www.xilinx.com/products/boards-and-kits/1-8dyf-11.html) + [FMCOMMS2/3/4](https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/eval-ad-fmcomms2.html)) -- Vivado license **NOT** needed
2931
- **adrv9364z7020** ([ADRV9364-Z7020 + ADRV1CRR-BOB](https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/adrv9364-z7020.html)) -- Vivado license **NOT** needed
@@ -37,55 +39,69 @@ Environment variable **BOARD_NAME** options:
3739

3840
## Build FPGA
3941

40-
* Pre-conditions:
42+
* Pre-conditions:
43+
4144
* Vivado 2021.1 with Vitis. You should have: your_Xilinx_install_directory/Vitis (NOT Vitis_HLS!)
4245
* 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.
4346
* Install the evaluation license of [Xilinx Viterbi Decoder](https://www.xilinx.com/products/intellectual-property/viterbi_decoder.html) into Vivado.
4447
* Ubuntu 18/20/22 LTS release (We test in these OS. Other OS might also work.)
4548
* Install required packages, such as `sudo apt install libtinfo5`
46-
4749
* Prepare Analgo Devices HDL library (only run once):
48-
```
50+
51+
```bash
4952
export XILINX_DIR=your_Xilinx_install_directory
5053
(Example: export XILINX_DIR=/opt/Xilinx. The Xilinx directory should include sth like: Downloads, SDK, Vivado, xic)
5154
./prepare_adi_lib.sh $XILINX_DIR
5255
```
56+
5357
* Prepare Analgo Devices specific ip (only run once for each board you have):
54-
```
58+
59+
```bash
5560
export BOARD_NAME=your_board_name
5661
(Example: export BOARD_NAME=zc706_fmcs2)
5762
./prepare_adi_board_ip.sh $XILINX_DIR $BOARD_NAME
5863
(Don't need to wait till the building end. When you see "Building ABCD project [...", you can stop it.)
5964
```
65+
6066
* Get the openofdm_rx into ip directory (only run once after openofdm is udpated):
61-
```
67+
68+
```bash
6269
./get_ip_openofdm_rx.sh
6370
```
71+
6472
* Generate ip_repo for the top level FPGA project (will take a while):
65-
```
73+
74+
```bash
6675
cd openwifi-hw/boards/$BOARD_NAME/
6776
../create_ip_repo.sh $XILINX_DIR
6877
```
78+
6979
* In the Vivado
70-
```
80+
81+
```bash
7182
source ./openwifi.tcl
7283
Click "Generate Bitstream" in the Vivado GUI.
7384
(Will take a while)
7485
File --> Export --> Export Hardware --> Next --> Include bitstream --> Next --> Next --> Finish
7586
```
87+
7688
* In Linux, store the FPGA files to a specific directory:
77-
```
89+
90+
```bash
7891
cd openwifi-hw/boards
7992
./sdk_update.sh $BOARD_NAME $OPENWIFI_HW_IMG_DIR
8093
```
94+
8195
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.
8296
8397
## Modify IP cores
8498
8599
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
87102
../create_vivado_proj.sh $XILINX_DIR ip_name.tcl
88103
```
104+
89105
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.
90106
91107
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
101117
* 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.
102118
* Normally you should see the top level testbench (..._tb.v) of that ip core in the Vivado "Sources" window (take openofdm_rx as example):
103119

104-
Go to the openofdm_rx IP directory, then run:
105-
./create_vivado_proj.sh $XILINX_DIR openofdm_rx.tcl
106-
Then in Vivado
107-
Sources --> Simulation Sources --> sim_1 --> dot11_tb
120+
Go to the openofdm_rx IP directory, then run:
121+
./create_vivado_proj.sh $XILINX_DIR openofdm_rx.tcl
122+
Then in Vivado
123+
Sources --> Simulation Sources --> sim_1 --> dot11_tb
108124
* To run the simulation, click "Run Simulation" --> "Run Behavoiral Simulation" under the "SIMULATION" in the "PROJECT MANAGER" window. It will take quite long time for 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.
109125
* 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 read test vectors and save the variables for checking later. Of course you can also check everything in the waveform window.
111127
* The openofdm_rx_pre_def.v also includes important definitions for the simulation.
112128
* 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.
113129
* 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:
114-
115-
SIMULATION --> Scope --> Name --> dot11_tb --> dot11_inst --> ofdm_decoder_inst --> viterbi_inst
130+
131+
SIMULATION --> Scope --> Name --> dot11_tb --> dot11_inst --> ofdm_decoder_inst --> viterbi_inst
116132
117133
## Conditional compile by verilog macro
118134
119135
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
121138
usage:
122139
Need at least 2 arguments: $XILINX_DIR $TCL_FILENAME
123140
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:
127144
- 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
128145
- 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
129146
```
147+
130148
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:
131-
```
149+
150+
```bash
132151
usage:
133152
create_ip_repo.sh $XILINX_DIR
134153
or
135154
create_ip_repo.sh $XILINX_DIR $IP1_NAME $DEF1 $DEF2 ... $IP2_NAME $DEF1 ...
136155
-IP_NAME: only xpu/tx_intf/rx_intf/openofdm_tx/openofdm_rx/side_ch are allowed
137156
- DEFx: will be "`define IP_NAME_DEFx" in ip_name_pre_def.v for $IP_NAME
138157
```
158+
139159
Example of enabling all ILA/DEBUG macros in all IPs:
140-
```
160+
161+
```bash
141162
./create_ip_repo.sh $XILINX_DIR xpu ENABLE_DBG tx_intf ENABLE_DBG rx_intf ENABLE_DBG openofdm_tx ENABLE_DBG openofdm_rx ENABLE_DBG side_ch ENABLE_DBG
142163
```
143164
@@ -146,6 +167,7 @@ Example of enabling all ILA/DEBUG macros in all IPs:
146167
There are two possible ways to upgrade openwifi design to new ADI release and Vivado.
147168
148169
Method 1: Vivado auto upgrading
170+
149171
- Create the openwifi design in the old/current Vivado version
150172
- Open the openwifi project in the new/target Vivado version
151173
- Let Vivado do the upgrading
@@ -155,21 +177,23 @@ Method 1: Vivado auto upgrading
155177
- You can check our commit on openwifi.tcl to find out what we have changed by the comparison
156178
157179
Method 2: Start from new Vivado and ADI HDL reference design, then add openwifi IP
180+
158181
- Create the openwifi design in the old/current Vivado version
159182
- Open the openwifi design with the new/target Vivado version
160183
- Use write_bd_tcl to write openwifi_ip Hierarchy to a .tcl
161-
```
184+
```bash
162185
write_bd_tcl -hier_blks [get_bd_cells /hier_mig] ./mig_hierarchy.tcl
163186
```
164187
- Create/open the new (or your own) ADI HDL reference design with the new/target Vivado version, then:
165-
```
188+
```bash
166189
source ./mig_hierarchy.tcl
167190
create_hier_cell_hier_mig / my_new_hierarchy
168191
```
169192
- The openwifi_ip sub-block (Hierarchy) should appear in your new design with new Vivado version.
170193
171194
Main reference: Vivado Design Suite User Guide: Designing IP Subsystems Using IP Integrator (UG994). Main command in that UG:
172-
```
195+
196+
```bash
173197
write_bd_tcl -hier_blks [get_bd_cells /hier_mig] ./mig_hierarchy.tcl
174198
source ./mig_hierarchy.tcl
175199
create_hier_cell_hier_mig / my_new_hierarchy

0 commit comments

Comments
 (0)