Commit 315288de authored by MaheshK1995's avatar MaheshK1995

Hard-coded SLOT_CONFIG reception at PNF

parent f17fc6da
...@@ -64,15 +64,49 @@ ...@@ -64,15 +64,49 @@
} }
] ]
} }
{
"name": "(rfsim) PNF",
"type": "cppdbg",
"request": "launch",
"program": " /home/glab/NR_nfapi/openairinterface5g/cmake_targets/ran_build/build/nr-softmodem",
"args": ["RFSIMULATOR=server","-O",
"/home/glab/NR_nfapi/openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf",
"--pnf",
"--parallel-config",
"PARALLEL_SINGLE_THREAD",
"--rfsim"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
{ {
"name": "(gdb) Launch GNB", "name": "(gdb) Launch GNB",
"type": "cppdbg", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "/home/glab/NR_nfapi/openairinterface5g/cmake_targets/ran_build/build/nr-softmodem", "program": " /home/glab/NR_nfapi/openairinterface5g/cmake_targets/ran_build/build/nr-softmodem",
"args": ["-E",
"-O ",
"/home/glab/NR_nfapi/openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf","--parallel-config","PARALLEL_SINGLE_THREAD", // "/home/glab/NR_nfapi/openairinterface5g/cmake_targets/ran_build/build/nr-softmodem",
"--rfsim","--phy-test"], // "args": [,
// "-O ",
// "/home/glab/NR_nfapi/openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf",
// "--parallel-config",
// "PARALLEL_SINGLE_THREAD",
// "--rfsim",
// "--phy-test"],
"args":["-O","/home/glab/NR_nfapi/openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf"],
"stopAtEntry": false, "stopAtEntry": false,
"cwd": "${workspaceFolder}", "cwd": "${workspaceFolder}",
"environment": [], "environment": [],
......
# Changelog
### 14/06/20
* we are not clear on how the parameters are extracted from the config file
* in ssc struct
* for some values it is okay and for others it is zero (in `config_request`)
* This causes Assertion Failures leading to termination on PNF side.
### 15/06/20
* The values to config request are assigned in: `config_common()` in `config.c`
* need to add lines for `cfg->nfapi_config`
* the config request unpacked on pnf side still has some zero values, which causes assertional failure in from_nrarfcn()
### 16/06/20
* Config request is recived and unpacked correctly
* Regarding config response
* we are confused about its' struct definition
* it says list of TLVs in its entirety
* and we need to dyanmically insert the invalid TLVs after checking in a categorical fashion
* Need to think of a data structure to enable this feature.
```struct{
list of uint8_t tlvs
list of uint16_t tlvs
list of uint32_t tlvs
}list of tlvs
```
* Need the `N_RB` value to be non-zero and obtained from the config file. (carrier config grid size)
`int N_RB = gNB_config->carrier_config.dl_grid_size[gNB_config->ssb_config.scs_common.value].value;`
* how is this `gNB_config` assigned its values?
### 19/06/20
* `ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);` sloc: 1428 in `nr-ru.c`
* the `ru->rfdevice` has all members zero or null.
* This issue was solved by adding `sdr_addrs` to config file of PNF.
* `if (cfg->tdd_table.max_tdd_periodicity_list[nr_tti].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value==1`
* throws segmentation error
* `max_tdd_periodicity_list` is not assigned memory
# Changelog ## 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
```
### 14/06/20 ### VNF
* we are not clear on how the parameters are extracted from the config file ```
* in ssc struct 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
* for some values it is okay and for others it is zero (in `config_request`) ```
* This causes Assertion Failures leading to termination on PNF side.
### 15/06/20
* The values to config request are assigned in: `config_common()` in `config.c`
* need to add lines for `cfg->nfapi_config`
* the config request unpacked on pnf side still has some zero values, which causes assertional failure in from_nrarfcn()
### 16/06/20 ## Running using RF-Simulator
* Config request is recived and unpacked correctly ### PNF
* Regarding config response ```
* we are confused about its' struct definition 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
* it says list of TLVs in its entirety ```
* and we need to dyanmically insert the invalid TLVs after checking in a categorical fashion ### VNF
* Need to think of a data structure to enable this feature. ```
```struct{ 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
list of uint8_t tlvs ```
list of uint16_t tlvs \ No newline at end of file
list of uint32_t tlvs
}list of tlvs
```
* Need the `N_RB` value to be non-zero and obtained from the config file. (carrier config grid size)
`int N_RB = gNB_config->carrier_config.dl_grid_size[gNB_config->ssb_config.scs_common.value].value;`
* how is this `gNB_config` assigned its values?
### 19/06/20
* `ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);` sloc: 1428 in `nr-ru.c`
* the `ru->rfdevice` has all members zero or null.
* This issue was solved by adding `sdr_addrs` to config file of PNF.
* `if (cfg->tdd_table.max_tdd_periodicity_list[nr_tti].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value==1`
* throws segmentation error
* `max_tdd_periodicity_list` is not assigned memory
...@@ -704,7 +704,7 @@ static uint8_t pack_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_ ...@@ -704,7 +704,7 @@ static uint8_t pack_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_
pack_tlv(NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG, &(pNfapiMsg->ssb_table.ssb_subcarrier_offset), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG, &(pNfapiMsg->ssb_table.ssb_subcarrier_offset), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_TDD_PERIOD_TAG, &(pNfapiMsg->tdd_table.tdd_period), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_TDD_PERIOD_TAG, &(pNfapiMsg->tdd_table.tdd_period), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG, &(pNfapiMsg->nfapi_config.dl_ue_per_sf), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG, &(pNfapiMsg->nfapi_config.dl_ue_per_sf), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG, &(pNfapiMsg->nfapi_config.max_transmit_power), ppWritePackedMsg, end, &pack_uint16_tlv_value) && pack_tlv(NFAPI_NR_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG, &(pNfapiMsg->nfapi_config.max_transmit_power), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
pack_tlv(NFAPI_NR_NFAPI_NRARFCN_TAG, &(pNfapiMsg->nfapi_config.nrarfcn), ppWritePackedMsg, end, &pack_uint32_tlv_value) && pack_tlv(NFAPI_NR_NFAPI_NRARFCN_TAG, &(pNfapiMsg->nfapi_config.nrarfcn), ppWritePackedMsg, end, &pack_uint32_tlv_value) &&
...@@ -1644,6 +1644,7 @@ static uint8_t unpack_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, vo ...@@ -1644,6 +1644,7 @@ static uint8_t unpack_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, vo
{ NFAPI_NR_CONFIG_SSB_PERIOD_TAG, &(pNfapiMsg->ssb_table.ssb_period), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_SSB_PERIOD_TAG, &(pNfapiMsg->ssb_table.ssb_period), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG, &(pNfapiMsg->ssb_table.ssb_subcarrier_offset), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG, &(pNfapiMsg->ssb_table.ssb_subcarrier_offset), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_TDD_PERIOD_TAG, &(pNfapiMsg->tdd_table.tdd_period), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_TDD_PERIOD_TAG, &(pNfapiMsg->tdd_table.tdd_period), &unpack_uint8_tlv_value},
{ NFAPI_NR_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG, &(pNfapiMsg->nfapi_config.dl_ue_per_sf), &unpack_uint8_tlv_value}, { NFAPI_NR_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG, &(pNfapiMsg->nfapi_config.dl_ue_per_sf), &unpack_uint8_tlv_value},
{ NFAPI_NR_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG, &(pNfapiMsg->nfapi_config.max_transmit_power), &unpack_uint16_tlv_value}, { NFAPI_NR_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG, &(pNfapiMsg->nfapi_config.max_transmit_power), &unpack_uint16_tlv_value},
{ NFAPI_NR_NFAPI_NRARFCN_TAG, &(pNfapiMsg->nfapi_config.nrarfcn), &unpack_uint32_tlv_value}, { NFAPI_NR_NFAPI_NRARFCN_TAG, &(pNfapiMsg->nfapi_config.nrarfcn), &unpack_uint32_tlv_value},
......
...@@ -30,6 +30,25 @@ ...@@ -30,6 +30,25 @@
#include "nfapi_nr_interface_scf.h" #include "nfapi_nr_interface_scf.h"
#include "pnf.h" #include "pnf.h"
# if 1 // for hard-code (remove later)
#include "COMMON/platform_types.h"
#include "COMMON/platform_constants.h"
#include "common/ran_context.h"
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "NR_BCCH-BCH-Message.h"
#include "NR_ServingCellConfigCommon.h"
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
#include "SCHED_NR/phy_frame_config_nr.h"
#include "NR_MIB.h"
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_common.h"
#endif
#define MAX_SCTP_STREAMS 16 #define MAX_SCTP_STREAMS 16
void nfapi_pnf_phy_config_delete_all(nfapi_pnf_config_t* config) void nfapi_pnf_phy_config_delete_all(nfapi_pnf_config_t* config)
...@@ -353,6 +372,11 @@ void pnf_handle_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen) ...@@ -353,6 +372,11 @@ void pnf_handle_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
if(config->state == NFAPI_PNF_RUNNING) if(config->state == NFAPI_PNF_RUNNING)
{ {
nfapi_pnf_phy_config_t* phy = nfapi_pnf_phy_config_find(config, req.header.phy_id); nfapi_pnf_phy_config_t* phy = nfapi_pnf_phy_config_find(config, req.header.phy_id);
#if 1 // emulate set_config TLV reception (hard-code)
int tdd_return = set_tdd_config_nr(&req, 1, 7, 6, 2, 4);
#endif
if(phy) if(phy)
{ {
if(phy->state != NFAPI_PNF_PHY_RUNNING) if(phy->state != NFAPI_PNF_PHY_RUNNING)
...@@ -360,6 +384,8 @@ void pnf_handle_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen) ...@@ -360,6 +384,8 @@ void pnf_handle_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
if(config->config_req) if(config->config_req)
{ {
(config->config_req)(config, phy, &req); (config->config_req)(config, phy, &req);
} }
} }
else else
......
...@@ -118,7 +118,9 @@ int set_tdd_config_nr( nfapi_nr_config_request_scf_t *cfg, ...@@ -118,7 +118,9 @@ int set_tdd_config_nr( nfapi_nr_config_request_scf_t *cfg,
while(slot_number != nb_slots_to_set) { while(slot_number != nb_slots_to_set) {
if(nrofDownlinkSlots != 0) { if(nrofDownlinkSlots != 0) {
for (int number_of_symbol = 0; number_of_symbol < nrofDownlinkSlots*NR_NUMBER_OF_SYMBOLS_PER_SLOT; number_of_symbol++) { for (int number_of_symbol = 0; number_of_symbol < nrofDownlinkSlots*NR_NUMBER_OF_SYMBOLS_PER_SLOT; number_of_symbol++) {
cfg->tdd_table.max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[number_of_symbol%NR_NUMBER_OF_SYMBOLS_PER_SLOT].slot_config.value= 0; cfg->tdd_table.max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[number_of_symbol%NR_NUMBER_OF_SYMBOLS_PER_SLOT].slot_config.value= 0; // was 0, made 10 to check
// cfg->tdd_table.max_tdd_periodicity_list[slot_number].max_num_of_symbol_per_slot_list[number_of_symbol%NR_NUMBER_OF_SYMBOLS_PER_SLOT].slot_config.tl.tag= NFAPI_NR_CONFIG_SLOT_CONFIG_TAG;
if((number_of_symbol+1)%NR_NUMBER_OF_SYMBOLS_PER_SLOT == 0) if((number_of_symbol+1)%NR_NUMBER_OF_SYMBOLS_PER_SLOT == 0)
slot_number++; slot_number++;
...@@ -318,6 +320,7 @@ int nr_slot_select(nfapi_nr_config_request_scf_t *cfg, int nr_frame, int nr_tti) ...@@ -318,6 +320,7 @@ int nr_slot_select(nfapi_nr_config_request_scf_t *cfg, int nr_frame, int nr_tti)
return (NR_UPLINK_SLOT | NR_DOWNLINK_SLOT ); return (NR_UPLINK_SLOT | NR_DOWNLINK_SLOT );
} }
#if 1 // Hardcoding, change later
if (nr_frame%2 == 0) { if (nr_frame%2 == 0) {
for(int symbol_count=0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) { for(int symbol_count=0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
if (cfg->tdd_table.max_tdd_periodicity_list[nr_tti].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value==1) { if (cfg->tdd_table.max_tdd_periodicity_list[nr_tti].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value==1) {
...@@ -367,6 +370,11 @@ int nr_slot_select(nfapi_nr_config_request_scf_t *cfg, int nr_frame, int nr_tti) ...@@ -367,6 +370,11 @@ int nr_slot_select(nfapi_nr_config_request_scf_t *cfg, int nr_frame, int nr_tti)
return (NR_MIXED_SLOT); return (NR_MIXED_SLOT);
} }
} }
#else
return (NR_DOWNLINK_SLOT);
#endif
} }
/******************************************************************* /*******************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment