RESOLVED build errors

This commit is contained in:
Mahesh
2020-11-24 18:49:41 +05:30
parent 87105d77cf
commit 56db8f4915
74 changed files with 265 additions and 2350 deletions
-97
View File
@@ -1,97 +0,0 @@
## Running using USRP
### PNF
```
sudo <oai_codebase>/cmake_targets/ran_build/build/nr-softmodem -O <oai_codebase>/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf --pnf
```
### VNF
```
sudo <oai_codebase>/cmake_targets/ran_build/build/nr-softmodem -O <oai_codebase>/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf --vnf
```
## Running using RF-Simulator
### PNF
```
sudo RFSIMULATOR=server <oai_codebase>/cmake_targets/ran_build/build/nr-softmodem -O <oai_codebase>/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf --pnf --parallel-config PARALLEL_SINGLE_THREAD --rfsim
```
### VNF
```
sudo <oai_codebase>/cmake_targets/ran_build/build/nr-softmodem -O <oai_codebase>/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf --vnf
```
# 20 July 2020
## Plan
### Task-A [packing]
* Modify `nfapi_p7_message_pack()` in `nfapi_p7.c`
* In the switch case, change the labels as well as the pack functions:
* `pack_dl_config_request` becomes `pack_dl_tti_request` [x]
* `pack_ul_config_request` becomes `pack_ul_tti_request` [x]
* `pack_hi_dci0_request` becomes `pack_ul_dci_request` [x]
* `pack_tx_request` becomes `pack_tx_data_request` [x]
### Task-B [unpacking]
* Modify `nfapi_p7_message_unpack()` in `nfapi_p7.c`
* `unpack_dl_tti_request` [x]
* `unpack_ul_tti_request` [x]
* `unpack_ul_dci_request` [x]
* `unpack_tx_data_request` [x]
* Similarly change all the `unpack` functions within the switch-case block.
* Modify the behaviour of `check_unpack_length()` for the new `TAGS`
* this is where the unpack functions are called
* `dl_tti_request` [x]
* `ul_tti_request` [x]
* `ul_dci_request` [x]
* `tx_data_request` [x]
* `nfapi_p7_message_unpack()` is called in `pnf_handle_dl_config_request()` in pnf_p7.c, so we need to add
* `pnf_handle_dl_tti_request` [x]
* `pnf_handle_ul_tti_request` [x]
* `pnf_handle_ul_dci_request` [x]
* `pnf_handle_tx_data_request`[x]
to handle DL P7 messages at pnf
* Added allocate and deallocate functions for all P7 DL messages in `pnf_p7.c`
* Added `is_nr_p7_request_in_window()` fn in `pnf_p7.c` that is called in P7 message handle fns
### Task-C
* Write the `ul_tti` alternative for `nfapi_vnf_p7_ul_config_req()` in `vnf_p7_interface.c` and other such functions.
* `dl_tti` is present as `nr_dl_config` [x]
* `ul_tti` [x]
* `ul_dci` [x]
* `tx_data` [x]
* Resolve the hard-coded areas in source code. [`HIGH-PRIORITY`] [x]
* Write the `ul_tti` equivalent for `oai_nfapi_dl_config_req` in `nfapi_vnf.c` and other such functions.
* `dl_tti` is present as `nr_dl_config` [x]
* `ul_tti` is present as `oai_nfapi_ul_tti_req()` [x]
* `ul_dci` is present as `oai_nfapi_ul_dci_req()` [x]
* `tx_data` is present as `oai_nfapi_tx_data_req()` [x]
* Check if `nr_schedule_response()` needs to be upgraded [x]
* only a couple of `NFAPI_MODE!=VNF_MODE` checks *can be added* before calling the functions to handle PDUs
* we need to add `NFAPI_MODE!=MONOLITHIC` checks before `oai_nfapi_dl_config_req` and other such fns [x]
* Sync with the latest stable commit in `develop` branch [`LOW-PRIORITY`]
* check deviations
### Task-D
* Write `send_mac_slot_indications()` which calls the `slot_indication` in `vnf_p7.c` file [x]
* Change the `vnf_handle_timing_info()` function that calls p7 message unpack fn and initializes the sfn and slot in `vnf_p7.c` file [x]
* Change pack and unpack functions `pack_timing_info()` and `unpack_timing_info()` [x]
* Change `nfapi_timing_info_t` structure to support P7 in NR [x]
* Change packing functions for timing info to support NR P7 procedures. [x]
### Testing
* Test by running VNF on a terminal and PNF in rfsim parallely
* If all works fine, move to UE testing.
* Check if the `FAPI` core functionality is not broken by running gNB in monolithic mode
* Check whether the code can support latency of 0.5 ms for oai_slot_indication
* Testing with a UE
* Run VNF
* Run PNF in rfsim
* Run UE in rfsim
* This can be done on parallel terminals on the same machine or different machine with the appropriate configuration
+35
View File
@@ -0,0 +1,35 @@
# Procedure to run nFAPI in 5G NR
## Conributed by 5G Testbed IISC
### Developers: Sudhakar B,Mahesh K,Gokul S,Aniq U.R
## Procedure to Build gNB and UE
The regular commands to build gNB and UE can be used
```
sudo ./build_oai --gNB --UE
```
## Procedure to run NR nFAPI using RF-Simulator
### VNF command
```
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf --vnf --noS1 --phy-test
```
### PNF command
```
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf --pnf --rfsim --phy-test --rfsimulator.serveraddr server
```
### UE command
```
sudo RFSIMULATOR=127.0.0.1 ./nr-uesoftmodem --rfsim --phy-test --rrc_config_path . -d
```
## Procedure to run NR nFAPI using Hardware
Will be updated as we have not yet currently tested on hardware
## Notes
* In order to acheive the synchronization between VNF and PNF and receive the P7 messages within the timing window the order in which we should run the modules on different terminals is UE->VNF->PNF
* Currently only downlink is functional and working as we are still working on uplink functionality
+9 -9
View File
@@ -1333,7 +1333,7 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
if (proc==NULL)
proc = &gNB->proc.L1_proc;
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu_list = req->dl_tti_pdu_list;
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu_list = req->dl_tti_request_body.dl_tti_pdu_list;
// TODO: NR_gNB_PDCCH not defined yet (check later)
#if 0
@@ -1342,25 +1342,25 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
pdcch_vars->num_dci = 0;
#endif
if (req->nPDUs)
if (req->dl_tti_request_body.nPDUs)
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() TX:%d/%d RX:%d/%d; sfn:%d, slot:%d, nGroup:%u, nPDUs: %u, nUE: %u, PduIdx: %u,\n",
__FUNCTION__, proc->frame_tx, proc->slot_tx, proc->frame_rx, proc->slot_rx, // TODO: change subframes to slot
req->SFN,
req->Slot,
req->nGroup,
req->nPDUs,
req->nUe,
req->PduIdx);
req->dl_tti_request_body.nGroup,
req->dl_tti_request_body.nPDUs,
req->dl_tti_request_body.nUe,
req->dl_tti_request_body.PduIdx);
for (int i=0; i<req->nPDUs; i++) {
for (int i=0; i<req->dl_tti_request_body.nPDUs; i++) {
// TODO: enable after adding gNB PDCCH:
// NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sfn/sf:%d PDU[%d] size:%d pdcch_vars->num_dci:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), i, dl_config_pdu_list[i].pdu_size,pdcch_vars->num_dci);
if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE) {
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu=&dl_tti_pdu_list[i];
memcpy(dl_tti_pdu,&dl_tti_pdu_list[i],sizeof(nfapi_nr_dl_tti_request_pdu_t));
//sfn=sfn+2;
handle_nfapi_nr_pdcch_pdu(gNB, sfn, slot, &dl_tti_pdu->pdcch_pdu);
int SFN=sfn+2;
handle_nfapi_nr_pdcch_pdu(gNB, SFN, slot, &dl_tti_pdu->pdcch_pdu);
//dl_tti_pdu_list[i].pdcch_pdu.pdcch_pdu_rel15.numDlDci++; // ?
// NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() pdcch_vars->num_dci:%d\n", __FUNCTION__, pdcch_vars->num_dci);
} else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_SSB_PDU_TYPE) {
+3 -3
View File
@@ -474,7 +474,7 @@ int wake_gNB_rxtx(PHY_VARS_gNB *gNB, uint16_t sfn, uint16_t slot) {
// The last (TS_rx mod samples_per_frame) was n*samples_per_tti,
// we want to generate subframe (n+N), so TS_tx = TX_rx+N*samples_per_tti,
// and proc->subframe_tx = proc->subframe_rx+sf_ahead
L1_proc->timestamp_tx = proc->timestamp_rx + (slot_ahead *fp->samples_per_tti);
L1_proc->timestamp_tx = proc->timestamp_rx + (slot_ahead *fp->samples_per_subframe);
L1_proc->frame_rx = proc->frame_rx;
L1_proc->slot_rx = proc->slot_rx;
L1_proc->frame_tx = (L1_proc->slot_rx > (19-slot_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx;
@@ -1610,8 +1610,8 @@ int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_tti_request_t *dl_config_req)
int retval = nfapi_vnf_p7_nr_dl_config_req(p7_config, dl_config_req);
dl_config_req->nPDUs = 0;
dl_config_req->nGroup = 0;
dl_config_req->dl_tti_request_body.nPDUs = 0;
dl_config_req->dl_tti_request_body.nGroup = 0;
if (retval!=0) {
@@ -171,10 +171,7 @@ typedef struct {
uint8_t prach_format;
/// Num RA
uint8_t num_ra;
<<<<<<< HEAD
=======
uint8_t prach_slot;
>>>>>>> fork_develop_new
uint8_t prach_start_symbol;
/// 38.211 (NCS 38.211 6.3.3.1).
uint16_t num_cs;
@@ -184,11 +181,8 @@ typedef struct {
uint8_t restricted_set;
/// see TS 38.211 (6.3.3.2).
uint16_t freq_msg1;
<<<<<<< HEAD
=======
// When multiple SSBs per RO is configured, this indicates which one is selected in this RO -> this is used to properly compute the PRACH preamble
uint8_t ssb_nb_in_ro;
>>>>>>> fork_develop_new
// nfapi_nr_ul_beamforming_t beamforming;
} fapi_nr_ul_config_prach_pdu;
@@ -69,11 +69,7 @@ typedef enum {
NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION= 0X86,
NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION= 0X87,
NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION= 0X88,
<<<<<<< HEAD
NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION= 0X89,
=======
NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION= 0X89
>>>>>>> fork_develop_new
//RESERVED 0X8a ~ 0xff
NFAPI_NR_PHY_MSG_TYPE_PNF_PARAM_REQUEST = 0x0100,
NFAPI_NR_PHY_MSG_TYPE_PNF_PARAM_RESPONSE = 0x0101,
@@ -1040,7 +1036,7 @@ typedef struct {
} nfapi_nr_dl_tti_request_pdu_t;
#define NFAPI_NR_MAX_DL_TTI_PDUS 32
/*
typedef struct {
/// Number of PDUs that are included in this message. All PDUs in the message are numbered in order. Value 0 -> 255
uint8_t nPDUs;
@@ -1053,7 +1049,7 @@ typedef struct {
/// This value is an index for number of PDU identified by nPDU in this message Value: 0 -> 255
uint8_t PduIdx[256][12];
} nfapi_nr_dl_tti_request_body_t;
*/
typedef struct {
nfapi_p7_message_header_t header;
@@ -1077,17 +1073,7 @@ typedef struct {
uint16_t SFN;
/// Slot number (0-19)
uint16_t Slot;
/// Number of PDUs that are included in this message. All PDUs in the message are numbered in order. Value 0 -> 255
uint8_t nPDUs;
/// Number of UEs in the Group included in this message. Value 0 -> 255
uint8_t nGroup;
/// List containing PDUs
nfapi_nr_dl_tti_request_pdu_t dl_tti_pdu_list[NFAPI_NR_MAX_DL_TTI_PDUS];
//nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu_list;
/// Number of UE in this group. For SU-MIMO, one group includes one UE only. For MU-MIMO, one group includes up to 12 UEs. Value 1 -> 12
uint8_t nUe[256];
/// This value is an index for number of PDU identified by nPDU in this message Value: 0 -> 255
uint8_t PduIdx[256][12];
nfapi_nr_dl_tti_request_body_t dl_tti_request_body;
nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_nr_dl_tti_request_t;
+18 -18
View File
@@ -899,27 +899,27 @@ static uint8_t pack_dl_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_
if (!(push16(pNfapiMsg->SFN , ppWritePackedMsg, end) &&
push16(pNfapiMsg->Slot , ppWritePackedMsg, end) &&
push8(pNfapiMsg->nGroup , ppWritePackedMsg, end) &&
push8(pNfapiMsg->nPDUs , ppWritePackedMsg, end) &&
pusharray8(pNfapiMsg->nUe ,256,pNfapiMsg->nGroup, ppWritePackedMsg, end)
push8(pNfapiMsg->dl_tti_request_body.nGroup , ppWritePackedMsg, end) &&
push8(pNfapiMsg->dl_tti_request_body.nPDUs , ppWritePackedMsg, end) &&
pusharray8(pNfapiMsg->dl_tti_request_body.nUe ,256,pNfapiMsg->dl_tti_request_body.nGroup, ppWritePackedMsg, end)
//pusharray8(pNfapiMsg->PduIdx[0] ,256,256, ppWritePackedMsg, end)
))
return 0;
int arr[12];
for(int i=0;i<pNfapiMsg->nGroup;i++)
for(int i=0;i<pNfapiMsg->dl_tti_request_body.nGroup;i++)
{
for(int j=0;j<pNfapiMsg->nUe[i];j++)
for(int j=0;j<pNfapiMsg->dl_tti_request_body.nUe[i];j++)
{
arr[j] = pNfapiMsg->PduIdx[i][j];
arr[j] = pNfapiMsg->dl_tti_request_body.PduIdx[i][j];
}
if(!(pusharray8(arr,12,pNfapiMsg->nUe[i],ppWritePackedMsg, end)))
if(!(pusharray8(arr,12,pNfapiMsg->dl_tti_request_body.nUe[i],ppWritePackedMsg, end)))
return 0;
}
for(int i=0;i<pNfapiMsg->nPDUs;i++)
for(int i=0;i<pNfapiMsg->dl_tti_request_body.nPDUs;i++)
{
if(!pack_dl_tti_request_body_value(&pNfapiMsg->dl_tti_pdu_list[i],ppWritePackedMsg,end))
if(!pack_dl_tti_request_body_value(&pNfapiMsg->dl_tti_request_body.dl_tti_pdu_list[i],ppWritePackedMsg,end))
return 0;
}
@@ -4555,9 +4555,9 @@ static uint8_t unpack_dl_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, vo
if (!(pull16(ppReadPackedMsg,&pNfapiMsg->SFN, end) &&
pull16(ppReadPackedMsg, &pNfapiMsg->Slot, end) &&
pull8(ppReadPackedMsg, &pNfapiMsg->nGroup, end) &&
pull8(ppReadPackedMsg, &pNfapiMsg->nPDUs, end) &&
pullarray8(ppReadPackedMsg,&pNfapiMsg->nUe ,256,pNfapiMsg->nGroup, end)
pull8(ppReadPackedMsg, &pNfapiMsg->dl_tti_request_body.nGroup, end) &&
pull8(ppReadPackedMsg, &pNfapiMsg->dl_tti_request_body.nPDUs, end) &&
pullarray8(ppReadPackedMsg,&pNfapiMsg->dl_tti_request_body.nUe ,256,pNfapiMsg->dl_tti_request_body.nGroup, end)
//pusharray8(pNfapiMsg->PduIdx[0] ,256,256, ppWritePackedMsg, end)
))
return 0;
@@ -4566,19 +4566,19 @@ static uint8_t unpack_dl_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, vo
// }
int arr[12];
for(int i=0;i<pNfapiMsg->nGroup;i++)
for(int i=0;i<pNfapiMsg->dl_tti_request_body.nGroup;i++)
{
for(int j=0;j<pNfapiMsg->nUe[i];j++)
for(int j=0;j<pNfapiMsg->dl_tti_request_body.nUe[i];j++)
{
arr[j] = pNfapiMsg->PduIdx[i][j];
arr[j] = pNfapiMsg->dl_tti_request_body.PduIdx[i][j];
}
if(!(pullarray8(ppReadPackedMsg,arr,12,pNfapiMsg->nUe[i], end)))
if(!(pullarray8(ppReadPackedMsg,arr,12,pNfapiMsg->dl_tti_request_body.nUe[i], end)))
return 0;
}
for(int i=0;i<pNfapiMsg->nPDUs;i++)
for(int i=0;i<pNfapiMsg->dl_tti_request_body.nPDUs;i++)
{
if(!unpack_dl_tti_request_body_value(ppReadPackedMsg, end, &pNfapiMsg->dl_tti_pdu_list[i]))
if(!unpack_dl_tti_request_body_value(ppReadPackedMsg, end, &pNfapiMsg->dl_tti_request_body.dl_tti_pdu_list[i]))
return 0;
}
+5 -5
View File
@@ -1609,10 +1609,13 @@ uint8_t is_nr_p7_request_in_window(uint16_t sfn,uint16_t slot, const char* name,
in_window = 1;
NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in window %d\n", current_sfn_slot_dec, name, recv_sfn_slot_dec);
}
else
{
{
NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is out of window %d (delta:%d) [max:%d]\n", current_sfn_slot_dec, name, recv_sfn_slot_dec, (current_sfn_slot_dec - recv_sfn_slot_dec), timing_window);
}
}//Need to add more cases
return in_window;
@@ -1677,9 +1680,6 @@ uint8_t is_p7_request_in_window(uint16_t sfnsf, const char* name, pnf_p7_t* phy)
void pnf_handle_dl_tti_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
{
//NFAPI_TRACE(NFAPI_TRACE_INFO, "DL_CONFIG.req Received\n");
struct timespec curr;
clock_gettime(CLOCK_MONOTONIC,&curr);
printf("\npnf_handle_dl_tti_request %d.%d\n",curr.tv_sec,curr.tv_nsec);
nfapi_nr_dl_tti_request_t* req = allocate_nfapi_dl_tti_request(pnf_p7);
if(req == NULL)