Commit 2e47f7be authored by root's avatar root

Merge branch 'gNB_mwc18_integration' of...

Merge branch 'gNB_mwc18_integration' of https://gitlab.eurecom.fr/oai-nr/openairinterface5g into gNB_mwc18_integration
parents 19038bf9 79f69589
......@@ -142,12 +142,12 @@ int test_ldpc(short No_iteration,
if (lift_size[i1] >= (double) block_length/Kb)
{
Zc = lift_size[i1];
// printf("%d\n",Zc);
//printf("%d\n",Zc);
break;
}
}
printf("BG %d, Zc %d, Kb %d\n",BG, Zc, Kb);
printf("ldpc_test: BG %d, Zc %d, Kb %d\n",BG, Zc, Kb);
no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length*(1/((float)nom_rate/(float)denom_rate)))/Zc;
// printf("puncture:%d\n",no_punctured_columns);
removed_bit=(nrows-no_punctured_columns-2) * Zc+block_length-(int)(block_length/((float)nom_rate/(float)denom_rate));
......@@ -160,28 +160,25 @@ int test_ldpc(short No_iteration,
//// encoder
start_meas(&time);
if (BG==1)
ldpc_encoder(test_input, channel_input,block_length,nom_rate,denom_rate);
else
ldpc_encoder_orig(test_input, channel_input,block_length,nom_rate,denom_rate,0);
//if (BG==1)
//ldpc_encoder(test_input, channel_input,block_length,nom_rate,denom_rate);
//else
ldpc_encoder_orig(test_input, channel_input,block_length,nom_rate,denom_rate,0);
stop_meas(&time);
start_meas(&time_optim);
if (BG==1) {
ldpc_encoder_optim(test_input, channel_input_optim,block_length,nom_rate,denom_rate,&tinput,&tprep,&tparity,&toutput);
}
ldpc_encoder_optim(test_input,channel_input_optim,block_length,nom_rate,denom_rate,&tinput,&tprep,&tparity,&toutput);
stop_meas(&time_optim);
for (i = 0; i < block_length+(nrows-no_punctured_columns) * Zc - removed_bit; i++)
if (channel_input[i]!=channel_input_optim[i]) printf("differ in pos %d (%d,%d)\n",i,
channel_input[i],
channel_input_optim[i]);
if (ntrials==1)
for (i = 0; i < block_length+(nrows-no_punctured_columns) * Zc - removed_bit; i++)
if (channel_input[i]!=channel_input_optim[i]) printf("differ in pos %d (%d,%d)\n",i,
channel_input[i],
channel_input_optim[i]);
//print_meas_now(&time, "", stdout);
//for (i=0;i<25344;i++)
// for (i=0;i<6400;i++)
//printf("channel_input[%d]=%d\n",i,channel_input[i]);
//printf("%d ",channel_input[i]);
if ((BG==2) && (Zc==128||Zc==256))
......@@ -253,7 +250,7 @@ int test_ldpc(short No_iteration,
int main(int argc, char *argv[])
{
unsigned int errors,crc_misses;
short block_length=22*384; // decoder supports length: 1201 -> 1280, 2401 -> 2560
short block_length=576; // decoder supports length: 1201 -> 1280, 2401 -> 2560
short No_iteration=25;
//double rate=0.333;
int nom_rate=1;
......@@ -262,7 +259,9 @@ int main(int argc, char *argv[])
unsigned char qbits=4;
unsigned int decoded_errors[100]; // initiate the size of matrix equivalent to size of SNR
int c,i=0;
int n_trials = 1;
randominit(0);
while ((c = getopt (argc, argv, "q:r:s:l:n:")) != -1)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -5,6 +5,7 @@
#include <types.h>
#include "assertions.h"
#include "PHY/TOOLS/time_meas.h"
#include "defs.h"
#include "ldpc384_byte.c"
#include "ldpc352_byte.c"
......@@ -15,12 +16,32 @@
#include "ldpc224_byte.c"
#include "ldpc208_byte.c"
#include "ldpc192_byte.c"
#include "ldpc176_byte.c"
#include "ldpc_BG2_Zc384_byte.c"
#include "ldpc_BG2_Zc352_byte.c"
#include "ldpc_BG2_Zc320_byte.c"
#include "ldpc_BG2_Zc288_byte.c"
#include "ldpc_BG2_Zc256_byte.c"
#include "ldpc_BG2_Zc240_byte.c"
#include "ldpc_BG2_Zc224_byte.c"
#include "ldpc_BG2_Zc208_byte.c"
#include "ldpc_BG2_Zc192_byte.c"
#include "ldpc_BG2_Zc176_byte.c"
#include "ldpc_BG2_Zc160_byte.c"
#include "ldpc_BG2_Zc144_byte.c"
#include "ldpc_BG2_Zc128_byte.c"
#include "ldpc_BG2_Zc120_byte.c"
#include "ldpc_BG2_Zc112_byte.c"
#include "ldpc_BG2_Zc104_byte.c"
#include "ldpc_BG2_Zc96_byte.c"
#include "ldpc_BG2_Zc88_byte.c"
#include "ldpc_BG2_Zc80_byte.c"
#include "ldpc_BG2_Zc72_byte.c"
void encode_parity_check_part_optim(unsigned char *c,unsigned char *d, short BG,short Zc,short Kb)
{
AssertFatal(BG==1,"BG %d is not supported yet\n",BG);
void encode_parity_check_part_optim(uint8_t *c,uint8_t *d, short BG,short Zc,short Kb)
{
if (BG==1)
{
......@@ -67,7 +88,7 @@ void encode_parity_check_part_optim(unsigned char *c,unsigned char *d, short BG,
case 128: break;
case 144: break;
case 160: break;
// case 176: ldpc176_byte(c,d); break;
case 176: ldpc176_byte(c,d); break;
case 192: ldpc192_byte(c,d); break;
case 208: ldpc208_byte(c,d); break;
case 224: ldpc224_byte(c,d); break;
......@@ -77,8 +98,69 @@ void encode_parity_check_part_optim(unsigned char *c,unsigned char *d, short BG,
case 320: ldpc320_byte(c,d); break;
case 352: ldpc352_byte(c,d); break;
case 384: ldpc384_byte(c,d); break;
default: AssertFatal(0,"BG %d Zc %d is not supported yet\n",BG,Zc); break;
}
}
else if (BG==2) {
switch (Zc)
{
case 2: break;
case 3: break;
case 4: break;
case 5: break;
case 6: break;
case 7: break;
case 8: break;
case 9: break;
case 10: break;
case 11: break;
case 12: break;
case 13: break;
case 14: break;
case 15: break;
case 16: break;
case 18: break;
case 20: break;
case 22: break;
case 24: break;
case 26: break;
case 28: break;
case 30: break;
case 32: break;
case 36: break;
case 40: break;
case 44: break;
case 48: break;
case 52: break;
case 56: break;
case 60: break;
case 64: break;
case 72: ldpc_BG2_Zc72_byte(c,d); break;
case 80: ldpc_BG2_Zc80_byte(c,d); break;
case 88: ldpc_BG2_Zc88_byte(c,d); break;
case 96: ldpc_BG2_Zc96_byte(c,d); break;
case 104: ldpc_BG2_Zc104_byte(c,d); break;
case 112: ldpc_BG2_Zc112_byte(c,d); break;
case 120: ldpc_BG2_Zc120_byte(c,d); break;
case 128: ldpc_BG2_Zc128_byte(c,d); break;
case 144: ldpc_BG2_Zc144_byte(c,d); break;
case 160: ldpc_BG2_Zc160_byte(c,d); break;
case 176: ldpc_BG2_Zc176_byte(c,d); break;
case 192: ldpc_BG2_Zc192_byte(c,d); break;
case 208: ldpc_BG2_Zc208_byte(c,d); break;
case 224: ldpc_BG2_Zc224_byte(c,d); break;
case 240: ldpc_BG2_Zc240_byte(c,d); break;
case 256: ldpc_BG2_Zc256_byte(c,d); break;
case 288: ldpc_BG2_Zc288_byte(c,d); break;
case 320: ldpc_BG2_Zc320_byte(c,d); break;
case 352: ldpc_BG2_Zc352_byte(c,d); break;
case 384: ldpc_BG2_Zc384_byte(c,d); break;
default: AssertFatal(0,"BG %d Zc %d is not supported yet\n",BG,Zc); break;
}
}
else {
AssertFatal(0,"BG %d is not supported yet\n",BG);
}
}
......@@ -155,7 +237,7 @@ int ldpc_encoder_optim(unsigned char *test_input,unsigned char *channel_input,sh
}
stop_meas(tinput);
if (BG==1) {
if ((BG==1) || (BG==2 && Zc>64)) {
// extend matrix
start_meas(tprep);
for (i1=0; i1 < ncols; i1++)
......@@ -178,17 +260,12 @@ int ldpc_encoder_optim(unsigned char *test_input,unsigned char *channel_input,sh
encode_parity_check_part_optim(c_extension, d, BG, Zc, Kb);
stop_meas(tparity);
}
else if (BG==2) {
else {
if (encode_parity_check_part_orig(c, d, BG, Zc, Kb, block_length)!=0) {
printf("Problem with encoder\n");
return(-1);
}
}
else {
printf("Problem with encoder\n");
return(-1);
}
start_meas(toutput);
// information part and puncture columns
memcpy(&channel_input[0], &c[2*Zc], (block_length-2*Zc)*sizeof(unsigned char));
......
......@@ -381,13 +381,16 @@ int wakeup_tx(PHY_VARS_eNB *eNB,RU_proc_t *ru_proc) {
eNB_rxtx_proc_t *proc_rxtx0=&proc->proc_rxtx[0];//RX
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
static int num_busy=0;
struct timespec wait;
wait.tv_sec=0;
wait.tv_nsec=5000000L;
if (proc_rxtx1->instance_cnt_rxtx == 0) {
LOG_E(PHY,"Frame %d, subframe %d: TX1 thread busy, dropping\n",proc_rxtx1->frame_rx,proc_rxtx1->subframe_rx);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DAQ_MBOX,++num_busy);
return(-1);
}
......
......@@ -775,8 +775,6 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
if (ru == RC.ru[0]) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU, proc->frame_rx );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU, proc->subframe_rx );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, proc->frame_tx );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU, proc->subframe_tx );
}
if (proc->first_rx == 0) {
......@@ -846,6 +844,8 @@ void tx_rf(RU_t *ru) {
flags = 4; // start of burst and end of burst (only one DL SF between two UL)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, proc->frame_tx );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU, proc->subframe_tx );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (proc->timestamp_tx-ru->openair0_cfg.tx_sample_advance)&0xffffffff );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
// prepare tx buffer pointers
......
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