Commit 6a62f432 authored by lfq's avatar lfq

cap ssb data

parent d610c9a0
......@@ -105,8 +105,8 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
cset_start_symb = pdcch_pdu_rel15->StartSymbolIndex;
cset_nsymb = pdcch_pdu_rel15->DurationSymbols;
dci_idx = 0;
LOG_D(PHY, "pdcch: Coreset rb_offset %d, nb_rb %d BWP Start %d\n",rb_offset,n_rb,pdcch_pdu_rel15->BWPStart);
LOG_D(PHY, "pdcch: Coreset starting subcarrier %d on symbol %d (%d symbols)\n", cset_start_sc, cset_start_symb, cset_nsymb);
LOG_I(PHY, "pdcch: Coreset rb_offset %d, nb_rb %d BWP Start %d\n",rb_offset,n_rb,pdcch_pdu_rel15->BWPStart);
LOG_I(PHY, "pdcch: Coreset starting subcarrier %d on symbol %d (%d symbols)\n", cset_start_sc, cset_start_symb, cset_nsymb);
// DMRS length is per OFDM symbol
uint32_t dmrs_length = (n_rb+pdcch_pdu_rel15->BWPStart)*6; //2(QPSK)*3(per RB)*6(REG per CCE)
uint32_t encoded_length = dci_pdu->AggregationLevel*108; //2(QPSK)*9(per RB)*6(REG per CCE)
......
......@@ -85,8 +85,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
uint8_t dmrs_Type = rel15->dmrsConfigType;
int nb_re_dmrs;
uint16_t n_dmrs;
LOG_D(PHY,"pdsch: BWPStart %d, BWPSize %d, rbStart %d, rbsize %d\n",
rel15->BWPStart,rel15->BWPSize,rel15->rbStart,rel15->rbSize);
LOG_I(PHY,"pdsch: frame %d %d, BWPStart %d, BWPSize %d, rbStart %d, rbsize %d, symbol %d %d, nti %d\n", frame, slot,
rel15->BWPStart,rel15->BWPSize,rel15->rbStart,rel15->rbSize, rel15->StartSymbolIndex, rel15->NrOfSymbols, rel15->rnti);
if (rel15->dmrsConfigType==NFAPI_NR_DMRS_TYPE1) {
nb_re_dmrs = 6*rel15->numDmrsCdmGrpsNoData;
}
......
......@@ -44,7 +44,7 @@
#include "assertions.h"
#include <time.h>
#include <stdio.h>
// RU OFDM Modulator gNodeB
......@@ -326,7 +326,11 @@ void nr_feptx(void *arg) {
}
// RU FEP TX using thread-pool
int g_tempBuf[40*61440];
int g_freqBuf[40*61440];
int g_cnt = 0;
void nr_feptx_tp(RU_t *ru, int frame_tx, int slot) {
static int cnt = -1;
nfapi_nr_config_request_scf_t *cfg = &ru->gNB_list[0]->gNB_config;
int nbfeptx=0;
......@@ -362,6 +366,95 @@ void nr_feptx_tp(RU_t *ru, int frame_tx, int slot) {
delNotifiedFIFO_elt(req);
nbfeptx--;
}
#if 0
if (((frame_tx&1)==0) && (slot==0))
{
cnt++;
}
if ((cnt == 1) && ((frame_tx&1)==0) && (slot==0))
{
memset(g_tempBuf, 0, 61440*40*4);
memset(g_freqBuf, 0, 61440*40*4);
LOG_I(PHY,"00000\n");
}
if (cnt == 10)
{
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
int slot_offset = fp->get_samples_slot_timestamp(slot,fp,0);
int frame_offset = fp->get_samples_slot_timestamp(slot,fp,0) + 61440*20*(frame_tx%2);
memcpy(&g_tempBuf[frame_offset], (void *)&ru->common.txdata[0][slot_offset], 61440*4);
//memcpy(&g_freqBuf[frame_offset], (void *)&ru->common.txdataF_BF[0][4096*14*slot], 4096*14*4);
LOG_I(PHY, "gcnt %d,cnt %d, frame %d, slot %d, slot offset %d, frame offset %d\n", g_cnt, cnt, frame_tx, slot, slot_offset, frame_offset);
}
if ((cnt == 11) && ((frame_tx&1)==0) && (slot==0))
{
FILE *output_fd = NULL;
output_fd = fopen("2frame_data_time_v2.am","w");
if (output_fd==NULL) {
printf("Error opening \n");
}
LOG_I(PHY, "output data, g_cnt %d\n", g_cnt);
if (output_fd) {
fwrite(g_tempBuf,sizeof(int32_t),61440*40,output_fd);
fclose(output_fd);
}
#if 0
output_fd = fopen("2frame_data_freq_v2.am","w");
if (output_fd==NULL) {
printf("Error opening \n");
}
LOG_I(PHY, "output data, g_cnt %d\n", g_cnt);
if (output_fd) {
fwrite(g_freqBuf,sizeof(int32_t),61440*40,output_fd);
fclose(output_fd);
}
#endif
}
#endif
#if 1
if (((frame_tx&1)==0) && (slot==0))
{
if (cnt == -1)
{
memset(g_tempBuf, 0, 61440*40*4);
}
else if (cnt <40)
{
memcpy(&g_tempBuf[61440*cnt], (void *)&ru->common.txdata[0][0], 61440*4);
}
else if (cnt == 40)
{
FILE *output_fd = NULL;
output_fd = fopen("40slot_ssb_data_time.am","w");
if (output_fd==NULL) {
printf("Error opening \n");
}
LOG_I(PHY, "output data, g_cnt %d\n", g_cnt);
if (output_fd) {
fwrite(g_tempBuf,sizeof(int32_t),61440*40,output_fd);
fclose(output_fd);
}
}
cnt++;
}
#endif
stop_meas(&ru->ofdm_total_stats);
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM, 0 );
}
......@@ -426,6 +519,7 @@ void nr_fep_tp(RU_t *ru, int slot) {
delNotifiedFIFO_elt(req);
nbfeprx--;
}
stop_meas(&ru->ofdm_demod_stats);
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 0 );
}
......
......@@ -51,6 +51,7 @@ uint8_t SSB_Table[38]={0,2,4,6,8,10,12,14,254,254,16,18,20,22,24,26,28,30,254,25
extern uint8_t nfapi_mode;
extern int g_cnt;
void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_dl_tti_ssb_pdu ssb_pdu) {
NR_DL_FRAME_PARMS *fp=&gNB->frame_parms;
......@@ -80,7 +81,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_
fp->ssb_start_subcarrier = (12 * prb_offset + sc_offset);
LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier, prb_offset, sc_offset);
LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol);
LOG_I(PHY,"SS TX: frame %d, slot %d, start_symbol %d, fp->ssb_start_subcarrier %d, g_cnt %d\n",frame,slot, ssb_start_symbol, fp->ssb_start_subcarrier, g_cnt);
nr_generate_pss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp);
nr_generate_sss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp);
......@@ -110,6 +111,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_
AMP,
ssb_start_symbol,
n_hf, frame, cfg, fp);
g_cnt++;
}
......
......@@ -259,7 +259,7 @@ RUs = (
local_rf = "yes"
nb_tx = 2;
nb_rx = 2;
att_tx = 85;
att_tx = 75;
att_rx = 0;
bands = [78];
max_pdschReferenceSignalPower = -27;
......@@ -268,7 +268,7 @@ RUs = (
##beamforming 1x2 matrix: 1 layer x 2 antennas
#bf_weights = [0x00007fff, 0x0000];
bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
sdr_addrs = "dev=pciex:0,auxdac1=340";
sdr_addrs = "dev=pciex:0,auxdac1=1660";
clock_src = "internal";
}
......
......@@ -27,9 +27,10 @@ gNBs =
////////// Physical parameters:
sib1_tda = 15;
min_rxtxtime = 6;
pdsch_AntennaPorts_XP = 1;
pdsch_AntennaPorts_XP = 2;
pusch_AntennaPorts = 2;
do_CSIRS = 0;
do_CSIRS = 1;
do_SRS = 1;
ul_prbblacklist = "135,136,137,138"
pdcch_ConfigSIB1 = (
......@@ -61,7 +62,7 @@ gNBs =
#initialDownlinkBWP
#genericParameters
# this is RBstart=0,L=162 (275*(275-L+1))+(274-RBstart))
initialDLBWPlocationAndBandwidth = 31624;
initialDLBWPlocationAndBandwidth = 1099;
#
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
......@@ -82,7 +83,7 @@ gNBs =
pMax = 20;
#initialUplinkBWP
#genericParameters
initialULBWPlocationAndBandwidth = 31624;
initialULBWPlocationAndBandwidth = 1099;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1;
......@@ -262,12 +263,12 @@ RUs = (
att_rx = 0;
bands = [78];
max_pdschReferenceSignalPower = -27;
max_rxgain = 25;
max_rxgain = 45;
eNB_instances = [0];
##beamforming 1x2 matrix: 1 layer x 2 antennas
#bf_weights = [0x00007fff, 0x0000];
bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
sdr_addrs = "dev=pciex:0,auxdac1=340";
sdr_addrs = "dev=pciex:0,auxdac1=1660";
clock_src = "internal";
}
......@@ -276,7 +277,7 @@ RUs = (
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_SINGLE_THREAD";
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
......
......@@ -224,7 +224,7 @@ RUs = (
eNB_instances = [0];
#beamforming 1x4 matrix:
bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
sdr_addrs = "dev=pciex:0,auxdac1=340";
sdr_addrs = "dev=pciex:0,auxdac1=1660";
clock_src = "internal";
}
);
......
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