| 20 | |
| 21 | |
| 22 | |
| 23 | === Prerequisites === |
| 24 | |
| 25 | In order to access COSMOS-SB2, create a reservation in COSMOS testbed and have it approved by the reservation service. Access to the resources is granted after the reservation is confirmed. Please follow the process shown on the COSMOS getting [https://wiki.cosmos-lab.org/wiki/GettingStarted started page] to get started. |
| 26 | |
| 27 | === Resources Required === |
| 28 | |
| 29 | * 2 USRP N310 SDRs ({{{sdr1-s1-lg1}}} and {{{sdr1-md1}}} in SB2) |
| 30 | * 2 IBM 28GHz PAAMs ({{{rfdev2-1}}} and {{{rfdev2-2}}} in SB2 ) |
| 31 | * 1 Server ({{{srv1-lg1}}}) |
| 32 | |
| 33 | The current hardware connection in SB2 as shown below |
| 34 | * {{{sdr1-s1-lg1}}} RF2 TX/RX -- {{{rfdev2-1}}} IC0/TX/H, {{{sdr1-s1-lg1}}} RF2 RX2 -- {{{rfdev2-1}}} IC1/RX/H |
| 35 | * {{{sdr1-s1-lg1}}} RF3 TX/RX -- {{{rfdev2-1}}} IC0/TX/V, {{{sdr1-s1-lg1}}} RF3 RX2 -- {{{rfdev2-1}}} IC1/RX/V |
| 36 | * {{{sdr1-md1}}} RF2 TX/RX -- {{{rfdev2-2}}} IC0/TX/H, {{{sdr1-md1}}} RF2 RX2 -- {{{rfdev2-2}}} IC1/RX/H |
| 37 | * {{{sdr1-md1}}} RF3 TX/RX -- {{{rfdev2-2}}} IC0/TX/V, {{{sdr1-md1}}} RF2 RX2 -- {{{rfdev2-2}}} IC1/RX/V |
| 38 | |
| 39 | || [[Image(PAAM-2_2 .png, 600px)]] || |
| 40 | |
| 41 | The required software components used in this demo are already loaded to the {{{IBMPAAM-USRP-RT-Baseband.ndz}}} node image, the node image includes: |
| 42 | * Ubuntu 20.04, UHD 4.1.0 |
| 43 | * PAAM Control to initialize the PAAM boards to integrate with USRPs. |
| 44 | * PAAM CFO calibration. |
| 45 | * Agora-UHD: An UHD-integrated real-time baseband processing pipeline. Please refer to **{{{Cubic23}}} branch** at [https://github.com/Agora-wireless/Agora/tree/Cubic23/ here] for more information. |
| 46 | * Real-time visualization for the real-time DSP pipeline. |
| 47 | |
| 48 | |
| 49 | === Tutorial Setup === |
| 50 | |
| 51 | Follow the steps below to gain access to the sandbox console and set up nodes with appropriate images. |
| 52 | 1. If you don't have one already, sign up for a [https://www.cosmos-lab.org/portal-2/ COSMOS account] |
| 53 | 1. [wiki:/GettingStarted#MakeaReservation Create a resource reservation] on COSMOS SB2 |
| 54 | 1. [Documentation/Short/Login Login] into sandbox console {{{console.sb2.cosmos-lab.org}}}) with **four** SSH sessions. |
| 55 | 1. In **terminal 1**, make sure all the nodes and devices used in the experiment are turned off. Use the following command for SB2 |
| 56 | {{{#!shell |
| 57 | omf tell -a offh -t sdr1-s1-lg1,sdr1-md1,rfdev2-1,rfdev2-2,srv1-lg1 |
| 58 | }}} |
| 59 | 1. Load {{{IBMPAAM-USRP-RT-Baseband.ndz}}} on the server. |
| 60 | {{{#!shell |
| 61 | omf load -i IBMPAAM-USRP-RT-Baseband.ndz -t srv1-lg1 -r 0 |
| 62 | }}} |
| 63 | 1. Turn all the required resources on and check the status of all the resources. Use the following commands for SB2. |
| 64 | {{{#!shell |
| 65 | omf tell -a on -t sdr1-s1-lg1,sdr1-md1,rfdev2-1,rfdev2-2,srv1-lg1 |
| 66 | }}} |
| 67 | {{{#!shell |
| 68 | omf stat -t all |
| 69 | }}} |
| 70 | 1. {{{ssh}}} to the server with option -Y for using GUI for our live demo. |
| 71 | {{{#!shell |
| 72 | ssh -Y root@srv1-lg1 |
| 73 | }}} |
| 74 | 1. In **all the ssh sessions** for {{{srv1-lg1}}}, use the following to source the correct environment. |
| 75 | {{{#!shell |
| 76 | source /opt/intel/oneapi/setvars.sh --force --config="/opt/intel/oneapi/renew-config.txt" |
| 77 | }}} |
| 78 | |
| 79 | ==== Find and prepare USRPs ==== |
| 80 | * Upon logging into the server, set up the 10G data interfaces DATA1, DATA2 in **terminal 1**. |
| 81 | {{{#!shell |
| 82 | ifconfig DATA1 10.117.1.1 netmask 255.255.0.0 mtu 9000 up |
| 83 | ifconfig DATA2 10.118.1.1 netmask 255.255.0.0 mtu 9000 up |
| 84 | }}} |
| 85 | {{{#!shell |
| 86 | sudo sysctl -w net.core.rmem_max=536870912 |
| 87 | sudo sysctl -w net.core.wmem_max=536870912 |
| 88 | }}} |
| 89 | After running the above commands, you should see that the data interfaces have the appropriate IP addresses assigned. |
| 90 | {{{#!shell |
| 91 | root@srv1-lg1:~# ifconfig DATA1 |
| 92 | DATA1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 |
| 93 | inet6 fe80::1e34:daff:fe42:d4c prefixlen 64 scopeid 0x20<link> |
| 94 | ether 1c:34:da:42:0d:4c txqueuelen 1000 (Ethernet) |
| 95 | RX packets 21092 bytes 1881634 (1.8 MB) |
| 96 | RX errors 0 dropped 19183 overruns 0 frame 0 |
| 97 | TX packets 686 bytes 204975 (204.9 KB) |
| 98 | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 |
| 99 | root@srv1-lg1:~# ifconfig DATA2 |
| 100 | DATA2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 |
| 101 | inet6 fe80::1e34:daff:fe42:d4d prefixlen 64 scopeid 0x20<link> |
| 102 | ether 1c:34:da:42:0d:4d txqueuelen 1000 (Ethernet) |
| 103 | RX packets 21091 bytes 1881530 (1.8 MB) |
| 104 | RX errors 0 dropped 19184 overruns 0 frame 0 |
| 105 | TX packets 690 bytes 226549 (226.5 KB) |
| 106 | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 |
| 107 | }}} |
| 108 | |
| 109 | * Run {{{uhd_find_devices}}} to make sure that both USRP N310s can be reached: |
| 110 | {{{#!shell |
| 111 | [INFO] [UHD] linux; GNU C++ version 9.4.0; Boost_107100; UHD_4.1.0.HEAD-0-g25d617ca |
| 112 | -------------------------------------------------- |
| 113 | -- UHD Device 3 |
| 114 | -------------------------------------------------- |
| 115 | Device Address: |
| 116 | serial: 315A35A |
| 117 | addr: 10.117.2.1 |
| 118 | claimed: False |
| 119 | fpga: XG |
| 120 | mgmt_addr: 10.116.2.1 |
| 121 | mgmt_addr: 10.117.2.1 |
| 122 | product: n310 |
| 123 | type: n3xx |
| 124 | |
| 125 | |
| 126 | -------------------------------------------------- |
| 127 | -- UHD Device 4 |
| 128 | -------------------------------------------------- |
| 129 | Device Address: |
| 130 | serial: 3176DF7 |
| 131 | addr: 10.118.3.1 |
| 132 | claimed: False |
| 133 | fpga: XG |
| 134 | mgmt_addr: 10.116.3.1 |
| 135 | mgmt_addr: 10.118.3.1 |
| 136 | product: n310 |
| 137 | type: n3xx |
| 138 | }}} |
| 139 | |
| 140 | |
| 141 | ==== Configure IBM 28GHz PAAM ==== |
| 142 | COSMOS uses the IBM 28GHz PAAM API to configure and initialize the PAAM boards. |
| 143 | Under {{{PAAM_Control}}}, use the following command to configure the PAAM boards in **terminal 1**: |
| 144 | {{{#!shell |
| 145 | root@srv1-lg1:~/PAAM_Control# python3 main.py |
| 146 | }}} |
| 147 | The following message will print out to indicate that the PAAM board is being successfully configured: |
| 148 | {{{#!shell |
| 149 | Opened port to FPGA |
| 150 | Logged in to Petalinux |
| 151 | Started command parser on Zynq |
| 152 | sdpar_prog.py /version: Version is PAWR_v1.2.0 |
| 153 | Using baseline FPGA control IP |
| 154 | Reset the Phased Array |
| 155 | Initialization of IC 0 was successful |
| 156 | Initialization of IC 1 was successful |
| 157 | Initialization of IC 2 was successful |
| 158 | Initialization of IC 3 was successful |
| 159 | IC0 current: 2.2629521016617793 status: On |
| 160 | IC1 current: 1.3685239491691104 status: On |
| 161 | IC2 current: 0.19550342130987292 status: Off |
| 162 | IC3 current: 0.07820136852394917 status: Off |
| 163 | Closed port to Zynq |
| 164 | Opened port to FPGA |
| 165 | Logged in to Petalinux |
| 166 | Started command parser on Zynq |
| 167 | sdpar_prog.py /version: Version is PAWR_v1.2.0 |
| 168 | Using baseline FPGA control IP |
| 169 | Reset the Phased Array |
| 170 | Initialization of IC 0 was successful |
| 171 | Initialization of IC 1 was successful |
| 172 | Initialization of IC 2 was successful |
| 173 | Initialization of IC 3 was successful |
| 174 | IC0 current: 2.29227761485826 status: On |
| 175 | IC1 current: 1.3587487781036167 status: On |
| 176 | IC2 current: 0.15640273704789834 status: Off |
| 177 | IC3 current: 0.16617790811339198 status: Off |
| 178 | Closed port to Zynq |
| 179 | Experiment Started! |
| 180 | }}} |
| 181 | Notice this program will **hang** there to indicate that the PAAM board is on, if you wish to turn off the ICs on the PAAM boards, please **press {{{CTRL+C}}} once**. |
| 182 | |
| 183 | === (Optional) CFO Calibration for PAAM boards === |
| 184 | **This section introduces how to calibrate the CFO between the PAAM boards. It is not a necessary step for users who wants to run this tutorial.** \\ |
| 185 | \\ |
| 186 | Since each 28 GHz PAAM board is driven by its own on-board phase lock loop (PLL), the CFO between two 28 GHz PAAM boards needs to be calibrated in order to establish a 28 GHz communication link. \\ |
| 187 | The following shows a coarse CFO calibration scheme: \\ |
| 188 | * In **terminal 1**, change the {{{cfoBS}}} value to be **0** in line 15 as: |
| 189 | {{{#!shell |
| 190 | vim PAAM_Control/main.py |
| 191 | }}} |
| 192 | * Configure and bring up the PAAM board as described previously: |
| 193 | {{{#!shell |
| 194 | root@srv1-lg1:~/PAAM_Control# python3 main.py |
| 195 | }}} |
| 196 | * In **terminal 2**, fix MATLAB licensing issue: |
| 197 | {{{#!shell |
| 198 | cd /usr/local/MATLAB/R2022b/bin |
| 199 | root@srv1-lg1:/usr/local/MATLAB/R2022b/bin# ./deactivate_matlab.sh |
| 200 | root@srv1-lg1:/usr/local/MATLAB/R2022b/bin# ./activate_matlab.sh |
| 201 | }}} |
| 202 | At the last step, MATLAB will ask for a username for the computer. Enter **root**. |
| 203 | * In **terminal 2**, direct to the CFO calibration folder and run the CFO estimation pipeline in {{{MATLAB}}}: |
| 204 | {{{#!shell |
| 205 | cd 5G_Pipeline |
| 206 | root@srv1-lg1:~/5G_Pipeline# matlab |
| 207 | }}} |
| 208 | In the prompted {{{MATLAB}}} command line, type and run: |
| 209 | {{{#!shell |
| 210 | >>main |
| 211 | }}} |
| 212 | * An example output would appear as: |
| 213 | {{{#!shell |
| 214 | CFO: 9.8310e+03 |
| 215 | SNR: 22.5722 |
| 216 | EVM: 12.7090 |
| 217 | BER: 0 |
| 218 | }}} |
| 219 | * Back to **terminal 1**, turn off PAAM board by pressing **{{{CTRL+C}}} once** |
| 220 | * Applied the above estimated CFO value to {{{cfoBS}}} in {{{5G_Pipeline/main.py}}} and restart the PAAM boards: |
| 221 | {{{#!shell |
| 222 | root@srv1-lg1:~/PAAM_Control# python3 main.py |
| 223 | }}} |
| 224 | |
| 225 | Based on the measurements we performed over 100+ times shown in the following probability density distributions of the estimated CFO values between the two PAAM boards, the CFO can be seen as a relatively constant value, hence, we pre-set the CFO to the PAAM board to be {{{97400}}} |
| 226 | {{{#!td |
| 227 | || [[Image(CFO_DL.png, 400px)]] || |
| 228 | }}} |
| 229 | {{{#!td |
| 230 | || [[Image(CFO_UL.png, 400px)]] || |
| 231 | }}} |
| 232 | |
| 233 | === Experiment Execution === |
| 234 | |
| 235 | ==== Bring up real-time visualization ==== |
| 236 | Please direct to the {{{~/Cubic23/Agora/files/log/csv}}} folder, where you will be able to see **3 types** Python visualization files. In **terminal 2**, use the following command to choose the visualization for the system. |
| 237 | * {{{cubic_timeD.py}}}: This visualization tool helps to visualize the raw IQ samples captured by Agora-UHD and the corresponding FFT. |
| 238 | {{{#!shell |
| 239 | root@srv1-lg1:~/Cubic23/Agora/files/log/csv# taskset -c 31 python3 cubic_timeD.py |
| 240 | }}} |
| 241 | * {{{cubic_conste.py}}}: This visualization tool helps to visualize the constellation Agora-UHD system get after demodulating the received signals |
| 242 | {{{#!shell |
| 243 | root@srv1-lg1:~/Cubic23/Agora/files/log/csv# taskset -c 32 python3 cubic_conste.py --SISO --QAM16 |
| 244 | }}} |
| 245 | {{{--SISO/--MIMO}}} chooses the mode to plot for either SISO case or MIMO case, {{{--QAM16/--QAM64}}} plots the corresponding reference point for different modulation types. |
| 246 | * {{{cubic_mimo.py}}} and {{{cubic.py}}}: This visualization tool helps to visualize the EVM, SNR, and BER readings for the Agora-UHD system. |
| 247 | {{{#!shell |
| 248 | root@srv1-lg1:~/Cubic23/Agora/files/log/csv# taskset -c 33 python3 cubic_mimo.py |
| 249 | }}} |
| 250 | We use {{{taskset}}} to specify dedicated cores to run the visualization tools to improve the Agora-UHD performance. |
| 251 | |
| 252 | ==== Run the experiment ==== |
| 253 | In **terminal 3**, bring up the UE as: |
| 254 | {{{#!shell |
| 255 | root@srv1-lg1:~/Cubic23/Agora# ./build/user --conf_file files/config/examples/ul-usrp-cubic.json |
| 256 | }}} |
| 257 | Once the UE finishes initializing, UE will be in waiting mode constantly checking for beacon signals send out by BS. \\ |
| 258 | \\ |
| 259 | In **terminal 4**, bring up BS as: |
| 260 | {{{#!shell |
| 261 | root@srv1-lg1:~/Cubic23/Agora# ./build/agora --conf_file files/config/examples/ul-usrp-cubic.json |
| 262 | }}} |
| 263 | You will be able to see the BS starts to receive and process the signals, while UE is able to detect BS and UE starts to transmit. |
| 264 | {{{#!shell |
| 265 | BS end |
| 266 | [02:095853][I] Main [frame 6399 + 0.56 ms]: Completed LDPC decoding (4 UL symbols) |
| 267 | [02:095876][I] Frame 6399 Summary: FFT (8 tasks): 0.0116162 ms (~0.000452769 + 0.00189833 + 0.00862035 ms), CSI (4 tasks): 0.0105033 ms (~0.000363756 + 0.00249357 + 0.00756129 ms), |
| 268 | Beamweights (768 tasks): 0.085955 ms (~0.0107782 + 0.00207422 + 0.0715803 ms), |
| 269 | Demul (3072 tasks): 0.190205 ms (~0.001613 + 0.12422 + 0.00181191 ms), |
| 270 | Decode (8 tasks): 0.0964143 ms (~2.69174e-05 + 0.0958194 + 0 ms), Total: 0.394694 ms |
| 271 | [02:095887][I] Main [frame 6400 + 0.60 ms since last frame]: Received first packet. Remaining packets in prev frame: 0 |
| 272 | [02:095900][I] Main [frame 6400 + 0.01 ms]: Received all pilots |
| 273 | frame_id 6400, ul_symbol_id 0, ant_id 0 |
| 274 | [02:095946][I] Main [frame 6400 + 0.06 ms]: FFT-ed all pilots |
| 275 | [02:095951][I] Frame 6400 Pilot Signal SNR (dB) Range at BS Antennas: User 0: [-6.0,27.2] (Possible bad antenna 1) User 1: [-4.0,28.5] (Possible bad antenna 0) |
| 276 | frame_id 6400, ul_symbol_id 0, ant_id 1 |
| 277 | [02:096012][I] Main [frame 6400 + 0.12 ms]: Received all packets |
| 278 | [02:096109][I] Main [frame 6400 + 0.22 ms]: Completed ZF beamweight calc |
| 279 | [02:096446][I] Main [frame 6400 + 0.56 ms]: Completed demodulation |
| 280 | symbol id is: 6 |
| 281 | [02:096463][I] Frame 6400 Constellation: |
| 282 | EVM 13.3263 11.3116 |
| 283 | , SNR 17.5058 18.9295 |
| 284 | True SNR is: 29.4157 |
| 285 | }}} |
| 286 | {{{#!shell |
| 287 | UE End: |
| 288 | [02:552790][I] PhyUe [frame 6767 + 0.84 ms since last frame]: Received first packet. Remaining packets in prev frame: 0 |
| 289 | [02:552793][I] PhyUe [frame 6767 + 0.00 ms]: Received all packets |
| 290 | [02:552834][I] PhyUe [frame 6767 + 0.04 ms]: Completed encoding |
| 291 | [02:552838][I] PhyUe [frame 6767 + 0.05 ms]: Completed modulation |
| 292 | [02:552874][I] PhyUe [frame 6767 + 0.08 ms]: Completed iFFT |
| 293 | [02:552955][I] PhyUe [frame 6767 + 0.17 ms]: Completed TX |
| 294 | }}} |
| 295 | |
| 296 | ==== Observe the results ==== |
| 297 | Figures below show the result of our visualization tools. |
| 298 | {{{#!td |
| 299 | Raw IQ and the corresponding FFT |
| 300 | || [[Image(16QAM-FFT.png, 600px)]] || |
| 301 | }}} |
| 302 | {{{#!td |
| 303 | EVM, SNR and BER |
| 304 | || [[Image(16QAM-EVM-SNR.png, 600px)]] || |
| 305 | }}} |
| 306 | \\ |
| 307 | {{{#!td |
| 308 | MIMO with 16QAM |
| 309 | || [[Image(16QAM-MIMO.png, 600px)]] || |
| 310 | }}} |
| 311 | {{{#!td |
| 312 | SISO with 64QAM |
| 313 | || [[Image(64QAM-SISO.png, 600px)]] || |
| 314 | }}} |
| 315 | |
| 316 | ==== Finish the experiments ==== |
| 317 | When the experiments are completed, make sure to clean up and turn off the PAAMs, Agora-UHD and the visualizations.[**{{{CTRL+C}}}** in **terminal 1, 2, 3 & 4**] |