Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mingxuan Li
openairinterface5G
Commits
53f38740
Commit
53f38740
authored
4 years ago
by
Sakthivel Velumani
Browse files
Options
Downloads
Patches
Plain Diff
updating ulsim to take samples from exernal source
parent
3367b0f1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openair1/SIMULATION/NR_PHY/ulsim.c
+40
-29
40 additions, 29 deletions
openair1/SIMULATION/NR_PHY/ulsim.c
with
40 additions
and
29 deletions
openair1/SIMULATION/NR_PHY/ulsim.c
+
40
−
29
View file @
53f38740
...
...
@@ -183,6 +183,7 @@ int main(int argc, char **argv)
int
pucch_tgt_snrx10
=
200
;
int
ibwps
=
24
;
int
ibwp_rboffset
=
41
;
int
params_from_file
=
0
;
if
(
load_configmodule
(
argc
,
argv
,
CONFIG_ENABLECMDLINEONLY
)
==
0
)
{
exit_fun
(
"[NR_ULSIM] Error, configuration module init failed
\n
"
);
}
...
...
@@ -419,6 +420,10 @@ int main(int argc, char **argv)
}
break
;
case
'Q'
:
params_from_file
=
1
;
break
;
default:
case
'h'
:
printf
(
"%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId
\n
"
,
argv
[
0
]);
...
...
@@ -440,7 +445,7 @@ int main(int argc, char **argv)
printf
(
"-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file
\n
"
);
//printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n");
printf
(
"-F Input filename (.txt format) for RX conformance testing
\n
"
);
printf
(
"-G
raw file containing RRC configuration (generated by gNB
)
\n
"
);
printf
(
"-G
Offset of samples to read from file (0 default
)
\n
"
);
printf
(
"-M Multiple SSB positions in burst
\n
"
);
printf
(
"-N Nid_cell
\n
"
);
printf
(
"-O oversampling factor (1,2,4,8,16)
\n
"
);
...
...
@@ -450,6 +455,7 @@ int main(int argc, char **argv)
printf
(
"-P Print ULSCH performances
\n
"
);
printf
(
"-T Enable PTRS, arguments list L_PTRS{0,1,2} K_PTRS{2,4}, e.g. -T 2 0 2
\n
"
);
printf
(
"-U Change DMRS Config, arguments list DMRS TYPE{0=A,1=B} DMRS AddPos{0:3}, e.g. -U 2 0 2
\n
"
);
printf
(
"-Q If -F used, read parameters from file
\n
"
);
exit
(
-
1
);
break
;
...
...
@@ -723,6 +729,7 @@ int main(int argc, char **argv)
//for (int i=0;i<16;i++) printf("%f\n",gaussdouble(0.0,1.0));
snrRun
=
0
;
int
n_errs
=
0
;
int
read_errors
=
0
;
int
slot_offset
=
frame_parms
->
get_samples_slot_timestamp
(
slot
,
frame_parms
,
0
);
int
slot_length
=
slot_offset
-
frame_parms
->
get_samples_slot_timestamp
(
slot
-
1
,
frame_parms
,
0
);
...
...
@@ -732,35 +739,39 @@ int main(int argc, char **argv)
// 800 samples is N_TA_OFFSET for FR1 @ 30.72 Ms/s,
AssertFatal
(
frame_parms
->
subcarrier_spacing
==
30000
,
"only 30 kHz for file input for now (%d)
\n
"
,
frame_parms
->
subcarrier_spacing
);
fseek
(
input_fd
,
file_offset
*
((
slot_length
<<
2
)
+
4000
+
16
),
SEEK_SET
);
fread
((
void
*
)
&
n_rnti
,
sizeof
(
int16_t
),
1
,
input_fd
);
printf
(
"rnti %x
\n
"
,
n_rnti
);
fread
((
void
*
)
&
nb_rb
,
sizeof
(
int16_t
),
1
,
input_fd
);
printf
(
"nb_rb %d
\n
"
,
nb_rb
);
int16_t
dummy
;
fread
((
void
*
)
&
start_rb
,
sizeof
(
int16_t
),
1
,
input_fd
);
//fread((void*)&dummy,sizeof(int16_t),1,input_fd);
printf
(
"rb_start %d
\n
"
,
start_rb
);
fread
((
void
*
)
&
nb_symb_sch
,
sizeof
(
int16_t
),
1
,
input_fd
);
//fread((void*)&dummy,sizeof(int16_t),1,input_fd);
printf
(
"nb_symb_sch %d
\n
"
,
nb_symb_sch
);
fread
((
void
*
)
&
start_symbol
,
sizeof
(
int16_t
),
1
,
input_fd
);
printf
(
"start_symbol %d
\n
"
,
start_symbol
);
fread
((
void
*
)
&
Imcs
,
sizeof
(
int16_t
),
1
,
input_fd
);
printf
(
"mcs %d
\n
"
,
Imcs
);
fread
((
void
*
)
&
rv_index
,
sizeof
(
int16_t
),
1
,
input_fd
);
printf
(
"rv_index %d
\n
"
,
rv_index
);
// fread((void*)&harq_pid,sizeof(int16_t),1,input_fd);
fread
((
void
*
)
&
dummy
,
sizeof
(
int16_t
),
1
,
input_fd
);
printf
(
"harq_pid %d
\n
"
,
harq_pid
);
fread
((
void
*
)
&
gNB
->
common_vars
.
rxdata
[
0
][
slot_offset
-
delay
],
sizeof
(
int16_t
),
slot_length
<<
1
,
input_fd
);
if
(
params_from_file
)
{
fseek
(
input_fd
,
file_offset
*
((
slot_length
<<
2
)
+
4000
+
16
),
SEEK_SET
);
read_errors
+=
fread
((
void
*
)
&
n_rnti
,
sizeof
(
int16_t
),
1
,
input_fd
);
printf
(
"rnti %x
\n
"
,
n_rnti
);
read_errors
+=
fread
((
void
*
)
&
nb_rb
,
sizeof
(
int16_t
),
1
,
input_fd
);
printf
(
"nb_rb %d
\n
"
,
nb_rb
);
int16_t
dummy
;
read_errors
+=
fread
((
void
*
)
&
start_rb
,
sizeof
(
int16_t
),
1
,
input_fd
);
//fread((void*)&dummy,sizeof(int16_t),1,input_fd);
printf
(
"rb_start %d
\n
"
,
start_rb
);
read_errors
+=
fread
((
void
*
)
&
nb_symb_sch
,
sizeof
(
int16_t
),
1
,
input_fd
);
//fread((void*)&dummy,sizeof(int16_t),1,input_fd);
printf
(
"nb_symb_sch %d
\n
"
,
nb_symb_sch
);
read_errors
+=
fread
((
void
*
)
&
start_symbol
,
sizeof
(
int16_t
),
1
,
input_fd
);
printf
(
"start_symbol %d
\n
"
,
start_symbol
);
read_errors
+=
fread
((
void
*
)
&
Imcs
,
sizeof
(
int16_t
),
1
,
input_fd
);
printf
(
"mcs %d
\n
"
,
Imcs
);
read_errors
+=
fread
((
void
*
)
&
rv_index
,
sizeof
(
int16_t
),
1
,
input_fd
);
printf
(
"rv_index %d
\n
"
,
rv_index
);
// fread((void*)&harq_pid,sizeof(int16_t),1,input_fd);
read_errors
+=
fread
((
void
*
)
&
dummy
,
sizeof
(
int16_t
),
1
,
input_fd
);
printf
(
"harq_pid %d
\n
"
,
harq_pid
);
}
fseek
(
input_fd
,
file_offset
*
sizeof
(
int16_t
)
*
2
,
SEEK_SET
);
read_errors
+=
fread
((
void
*
)
&
gNB
->
common_vars
.
rxdata
[
0
][
slot_offset
-
delay
],
sizeof
(
int16_t
),
slot_length
<<
1
,
input_fd
);
if
(
read_errors
==
0
)
exit
(
1
);
for
(
int
i
=
0
;
i
<
16
;
i
+=
2
)
printf
(
"slot_offset %d : %d,%d
\n
"
,
slot_offset
,
((
int16_t
*
)
&
gNB
->
common_vars
.
rxdata
[
0
][
slot_offset
])[
i
],
((
int16_t
*
)
&
gNB
->
common_vars
.
rxdata
[
0
][
slot_offset
])[
1
+
i
]);
slot_offset
,
((
int16_t
*
)
&
gNB
->
common_vars
.
rxdata
[
0
][
slot_offset
])[
i
],
((
int16_t
*
)
&
gNB
->
common_vars
.
rxdata
[
0
][
slot_offset
])[
1
+
i
]);
}
for
(
SNR
=
snr0
;
SNR
<
snr1
;
SNR
+=
snr_step
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment