1.change inline usage in code and mvec in makefile to adapt to GCC version
[o-du/phy.git] / docs / run_l1.rst
1 ..    Copyright (c) 2019 Intel
2 ..
3 ..  Licensed under the Apache License, Version 2.0 (the "License");
4 ..  you may not use this file except in compliance with the License.
5 ..  You may obtain a copy of the License at
6 ..
7 ..      http://www.apache.org/licenses/LICENSE-2.0
8 ..
9 ..  Unless required by applicable law or agreed to in writing, software
10 ..  distributed under the License is distributed on an "AS IS" BASIS,
11 ..  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 ..  See the License for the specific language governing permissions and
13 ..  limitations under the License.
14
15 .. |br| raw:: html
16
17    <br />
18
19 Run L1 and Testmac
20 ===================
21
22 .. contents::
23     :depth: 3
24     :local:
25
26 Before you run L1, please make sure all the FH, WLS, and FAPI TM lib was built according to above relative chapters for each lib, or you can refer below quick build command to create these libs.
27
28 Build FH
29 ------------
30      under folder phy/fhi_lib::
31
32      #./build.sh
33
34 Build WLS
35 -------------
36      under folder phy/wls_lib::
37      #./build.sh
38
39 Build FAPI TM
40 --------------
41      under folder phy/fapi_5g/build::
42      #./build.sh
43
44 For the Bronze release, the L1 only has a binary image as well as the testmac which is an L2 test application, details of the L1 and testmac application are in https://github.com/intel/FlexRAN
45
46 Download L1 and testmac
47 ------------------------
48
49 Download L1 and testmac through https://github.com/intel/FlexRAN
50
51 CheckList Before Running the code
52 ---------------------------------
53 Before running the L1 and Testmac code make sure that you have built the wls_lib, FHI_lib and 5G_FAPI_TM using the instructions provided earlier in this 
54 document and in the order specified in this documentation.
55
56 Run L1 with testmac
57 --------------------
58 Three console windows are needed, one for L1 app, one for FAPI TM, one for testmac. They need to run in the following order L1-> FAPI TM-> testmac.
59 In each console window, the environment needs to be set using a shell script under folder phy/  example::
60
61      #source ./setupenv.sh
62
63 * Run L1 under folder FlexRAN/l1/bin/nr5g/gnb/l1 in timer mode using::
64
65      #l1.sh -e
66
67 **Note** that the markups dpdkBasebandFecMode and dpdkBasebandDevice needs to be adjusted in the relevant phycfg.xml under folder
68  FlexRAN/l1/bin/nr5g/gnb/l1 before starting L1. |br|
69  dpdkBasebandFecMode = 0 for LDPC Encoder/Decoder in software. |br|
70  dpdkBasebandFecMode = 1 for LDPC Encoder/Decoder in FPGA. (Not supported in the Bronze Release for the Open Source Community) |br|
71
72 * Run FAPI TM under folder phy/fapi_5g/bin::
73
74      #./oran_5g_fapi.sh --cfg=oran_5g_fapi.cfg
75
76 * Run testmac under folder FlexRAN/l1/bin/nr5g/gnb/testmac::
77
78      #./l2.sh
79
80 Once the application comes up, you will see a *<TESTMAC>* prompt. The same Unit tests can be run using the command:
81
82 - **run   testtype   numerology   bandwidth   testnum** where
83
84 - **testtype** is 0 (DL), 1 (UL) or 2 (FD)
85
86 - **numerology** [0 -> 4], 0=15khz, 1=30khz, 2=60khz, 3=120khz, 4=240khz
87
88 - **bandwidth** 5, 10, 15, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 400 (in Mhz)
89
90 - **testnum** is the Bit Exact TestNum. [1001 -> above]If this is left blank, then all tests under type testtype are run
91
92 testnum is always a 4 digit number. First digit represents the number of carriers to run.
93 For example, to run Test Case 5 for Uplink Rx mu=3, 100Mhz for 1 carrier, the command would be:
94 run 1 3 100 1005
95 All the pre-defined test cases for the Bronze Release are defined in the Test Cases section in https://github.com/intel/FlexRAN and also in the Test 
96 Cases section of this document.
97 If the user wants to run more slots (than specified in test config file) or change the mode or change the TTI interval of the test, then the command phystart can be used as follows:
98
99 - **phystart   mode   interval   num_tti**
100
101 - **mode** is 4 (ORAN compatible Radio) or 1 (Timer)
102
103 - **interval** is the TTI duration scaled as per Numerology (only used in timer mode).
104
105     - So if Numerology is 3 and this parameter is set to 1, then the interval will be programmed to 0.125 ms.
106     
107     - If this is set to 10, then interval is programmed to 1.25ms
108     
109 - **num_tti** is the total number of TTIs to run the test.
110
111     - If 0, then the test config file defines how many slots to run.
112     
113     - If a non zero number, then test is run for these many slots.
114     
115     - If the num_tti is more than the number of slots in config file, then the configuration is repeated till end of test.
116     
117     - So if num_tti=200 and num_slot from config file is 10, then the 10 slot configs are repeated 20 times in a cyclic fashion.
118     
119 - The default mode set at start of testmac is (phystart 1 10 0). So it is timer mode at 10ms TTI intervals running for duration specified in each test config file
120
121 - Once user manually types the phystart command on the l2 console, then all subsequent tests will use this phystart config till user changes it or testmac is restarted.
122
123 - If user wants to run a set of tests which are programmed in a cfg file (for example tests_customer.cfg):
124      ./l2.sh –testfile=tests_customer.cfg
125
126    example::
127
128       #./l2.sh --testfile=oran_bronze_rel_fec_sw.cfg
129
130 - This will run all the tests that are listed in the config file. Please see the tests_customer.cfg present in the release for example of how to program the tests 
131
132
133
134
135