fix(phy simulators): fix cmdline configmodule for CODING phy simulators
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "assertions.h"
|
#include "assertions.h"
|
||||||
#include "SIMULATION/TOOLS/sim.h"
|
#include "SIMULATION/TOOLS/sim.h"
|
||||||
|
#include "common/config/config_userapi.h"
|
||||||
#include "common/utils/load_module_shlib.h"
|
#include "common/utils/load_module_shlib.h"
|
||||||
#include "PHY/CODING/nrLDPC_extern.h"
|
#include "PHY/CODING/nrLDPC_extern.h"
|
||||||
//#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
|
//#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
|
||||||
@@ -402,7 +403,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
short block_length=8448; // decoder supports length: 1201 -> 1280, 2401 -> 2560
|
short block_length=8448; // decoder supports length: 1201 -> 1280, 2401 -> 2560
|
||||||
// default to check output inside ldpc, the NR version checks the outer CRC defined by 3GPP
|
// default to check output inside ldpc, the NR version checks the outer CRC defined by 3GPP
|
||||||
char *ldpc_version = "";
|
char *ldpc_version = NULL;
|
||||||
/* version of the ldpc decoder library to use (XXX suffix to use when loading libldpc_XXX.so */
|
/* version of the ldpc decoder library to use (XXX suffix to use when loading libldpc_XXX.so */
|
||||||
short max_iterations=5;
|
short max_iterations=5;
|
||||||
int n_segments=1;
|
int n_segments=1;
|
||||||
@@ -424,7 +425,19 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
short BG = 0, Zc;
|
short BG = 0, Zc;
|
||||||
|
|
||||||
while ((c = getopt (argc, argv, "q:r:s:S:l:G:n:d:i:t:u:hv:")) != -1)
|
if ((uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY)) == 0) {
|
||||||
|
exit_fun("[LDPCTEST] Error, configuration module init failed\n");
|
||||||
|
}
|
||||||
|
logInit();
|
||||||
|
|
||||||
|
while ((c = getopt (argc, argv, "--:q:r:s:S:l:G:n:d:i:t:u:hv:")) != -1) {
|
||||||
|
|
||||||
|
/* ignore long options starting with '--' and their arguments that are handled by configmodule */
|
||||||
|
/* with this opstring getopt returns 1 for non-option arguments, refer to 'man 3 getopt' */
|
||||||
|
if (c == 1 || c == '-')
|
||||||
|
continue;
|
||||||
|
|
||||||
|
printf("handling optarg %c\n",c);
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'q':
|
case 'q':
|
||||||
qbits = atoi(optarg);
|
qbits = atoi(optarg);
|
||||||
@@ -494,6 +507,7 @@ int main(int argc, char *argv[])
|
|||||||
exit(1);
|
exit(1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//printf("the decoder supports BG2, Kb=10, Z=128 & 256\n");
|
//printf("the decoder supports BG2, Kb=10, Z=128 & 256\n");
|
||||||
//printf(" range of blocklength: 1201 -> 1280, 2401 -> 2560\n");
|
//printf(" range of blocklength: 1201 -> 1280, 2401 -> 2560\n");
|
||||||
printf("block length %d: \n", block_length);
|
printf("block length %d: \n", block_length);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h"
|
#include "PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h"
|
||||||
#include "PHY/CODING/coding_defs.h"
|
#include "PHY/CODING/coding_defs.h"
|
||||||
#include "SIMULATION/TOOLS/sim.h"
|
#include "SIMULATION/TOOLS/sim.h"
|
||||||
|
#include "common/config/config_userapi.h"
|
||||||
//#include "common/utils/LOG/log.h"
|
//#include "common/utils/LOG/log.h"
|
||||||
#include "coding_unitary_defs.h"
|
#include "coding_unitary_defs.h"
|
||||||
//#define DEBUG_DCI_POLAR_PARAMS
|
//#define DEBUG_DCI_POLAR_PARAMS
|
||||||
@@ -32,7 +33,19 @@ int main(int argc, char *argv[])
|
|||||||
uint8_t aggregation_level = 8, decoderListSize = 8, logFlag = 0;
|
uint8_t aggregation_level = 8, decoderListSize = 8, logFlag = 0;
|
||||||
uint16_t rnti=0;
|
uint16_t rnti=0;
|
||||||
|
|
||||||
while ((arguments = getopt (argc, argv, "s:d:f:m:i:l:a:p:hqgFL:k:")) != -1) {
|
if ((uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY)) == 0) {
|
||||||
|
exit_fun("[POLARTEST] Error, configuration module init failed\n");
|
||||||
|
}
|
||||||
|
logInit();
|
||||||
|
|
||||||
|
while ((arguments = getopt (argc, argv, "--:s:d:f:m:i:l:a:p:hqgFL:k:")) != -1) {
|
||||||
|
|
||||||
|
/* ignore long options starting with '--' and their arguments that are handled by configmodule */
|
||||||
|
/* with this opstring getopt returns 1 for non-option arguments, refer to 'man 3 getopt' */
|
||||||
|
if (arguments == 1 || arguments == '-')
|
||||||
|
continue;
|
||||||
|
|
||||||
|
printf("handling optarg %c\n",arguments);
|
||||||
switch (arguments) {
|
switch (arguments) {
|
||||||
case 's':
|
case 's':
|
||||||
SNRstart = atof(optarg);
|
SNRstart = atof(optarg);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
|
#include "common/config/config_userapi.h"
|
||||||
#include "SIMULATION/TOOLS/sim.h"
|
#include "SIMULATION/TOOLS/sim.h"
|
||||||
#include "PHY/CODING/nrSmallBlock/nr_small_block_defs.h"
|
#include "PHY/CODING/nrSmallBlock/nr_small_block_defs.h"
|
||||||
#include "coding_unitary_defs.h"
|
#include "coding_unitary_defs.h"
|
||||||
@@ -26,7 +27,19 @@ int main(int argc, char *argv[])
|
|||||||
int8_t channelOutput_int8[NR_SMALL_BLOCK_CODED_BITS];
|
int8_t channelOutput_int8[NR_SMALL_BLOCK_CODED_BITS];
|
||||||
unsigned char qbits = 8;
|
unsigned char qbits = 8;
|
||||||
|
|
||||||
while ((arguments = getopt(argc, argv, "s:d:f:l:i:mhg")) != -1)
|
if ((uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY)) == 0) {
|
||||||
|
exit_fun("[SMALLBLOCKTEST] Error, configuration module init failed\n");
|
||||||
|
}
|
||||||
|
logInit();
|
||||||
|
|
||||||
|
while ((arguments = getopt(argc, argv, "--:s:d:f:l:i:mhg")) != -1) {
|
||||||
|
|
||||||
|
/* ignore long options starting with '--' and their arguments that are handled by configmodule */
|
||||||
|
/* with this opstring getopt returns 1 for non-option arguments, refer to 'man 3 getopt' */
|
||||||
|
if (arguments == 1 || arguments == '-')
|
||||||
|
continue;
|
||||||
|
|
||||||
|
printf("handling optarg %c\n",arguments);
|
||||||
switch (arguments) {
|
switch (arguments) {
|
||||||
case 's':
|
case 's':
|
||||||
SNRstart = atof(optarg);
|
SNRstart = atof(optarg);
|
||||||
@@ -69,6 +82,7 @@ int main(int argc, char *argv[])
|
|||||||
perror("[smallblocktest.c] Problem at argument parsing with getopt");
|
perror("[smallblocktest.c] Problem at argument parsing with getopt");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uint16_t mask = 0x07ff >> (11 - messageLength);
|
uint16_t mask = 0x07ff >> (11 - messageLength);
|
||||||
for (SNR = SNRstart; SNR <= SNRstop; SNR += SNRinc) {
|
for (SNR = SNRstart; SNR <= SNRstop; SNR += SNRinc) {
|
||||||
|
|||||||
Reference in New Issue
Block a user