Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-RAN
Commits
96ff859c
Commit
96ff859c
authored
Mar 13, 2024
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shiftTooManyBitsSigned
parent
9cc53a43
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
61 deletions
+47
-61
common/utils/nr/nr_common.h
common/utils/nr/nr_common.h
+7
-1
openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c
openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c
+0
-1
openair1/PHY/NR_TRANSPORT/nr_pbch.c
openair1/PHY/NR_TRANSPORT/nr_pbch.c
+3
-3
openair1/PHY/TOOLS/tools_defs.h
openair1/PHY/TOOLS/tools_defs.h
+0
-5
openair1/SCHED_NR/phy_procedures_nr_gNB.c
openair1/SCHED_NR/phy_procedures_nr_gNB.c
+7
-6
openair1/SIMULATION/TOOLS/gauss.c
openair1/SIMULATION/TOOLS/gauss.c
+12
-14
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
+18
-31
No files found.
common/utils/nr/nr_common.h
View file @
96ff859c
...
...
@@ -169,12 +169,18 @@ uint32_t nr_timer_elapsed_time(NR_timer_t timer);
extern
const
nr_bandentry_t
nr_bandtable
[];
static
inline
int
get_num_dmrs
(
uint16_t
dmrs_mask
)
{
static
inline
int
get_num_dmrs
(
uint16_t
dmrs_mask
)
{
int
num_dmrs
=
0
;
for
(
int
i
=
0
;
i
<
16
;
i
++
)
num_dmrs
+=
((
dmrs_mask
>>
i
)
&
1
);
return
(
num_dmrs
);
}
static
__attribute__
((
always_inline
))
inline
int
count_bits_set
(
uint64_t
v
)
{
return
__builtin_popcountll
(
v
);
}
uint64_t
reverse_bits
(
uint64_t
in
,
int
n_bits
);
void
reverse_bits_u8
(
uint8_t
const
*
in
,
size_t
sz
,
uint8_t
*
out
);
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c
View file @
96ff859c
...
...
@@ -32,7 +32,6 @@
#include "common/utils/nr/nr_common.h"
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
#include <assert.h>
#include <stdlib.h>
#include <stdint.h>
...
...
openair1/PHY/NR_TRANSPORT/nr_pbch.c
View file @
96ff859c
...
...
@@ -265,10 +265,10 @@ int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu,
pbch
->
pbch_a
|=
n_hf
<<
28
;
// half frame index bit
if
(
Lmax
==
64
)
for
(
int
i
=
0
;
i
<
3
;
i
++
)
pbch
->
pbch_a
|=
(
(
ssb_index
>>
(
5
-
i
))
&
1
)
<<
(
29
+
i
);
// resp. 6th, 5th and 4th bits of ssb_index
for
(
int
i
=
0
;
i
<
3
;
i
++
)
pbch
->
pbch_a
|=
(
uint32_t
)((
ssb_index
>>
(
5
-
i
))
&
1
)
<<
(
29
+
i
);
// resp. 6th, 5th and 4th bits of ssb_index
else
pbch
->
pbch_a
|=
((
ssb_sc_offset
>>
4
)
&
1
)
<<
29
;
//MSB of k_SSB (bit index 4)
pbch
->
pbch_a
|=
((
ssb_sc_offset
>>
4
)
&
1
)
<<
29
;
//MSB of k_SSB (bit index 4)
LOG_D
(
PHY
,
"After extra byte: pbch_a = 0x%08x
\n
"
,
pbch
->
pbch_a
);
...
...
openair1/PHY/TOOLS/tools_defs.h
View file @
96ff859c
...
...
@@ -813,11 +813,6 @@ double interp(double x, double *xs, double *ys, int count);
void
simde_mm128_separate_real_imag_parts
(
simde__m128i
*
out_re
,
simde__m128i
*
out_im
,
simde__m128i
in0
,
simde__m128i
in1
);
void
simde_mm256_separate_real_imag_parts
(
simde__m256i
*
out_re
,
simde__m256i
*
out_im
,
simde__m256i
in0
,
simde__m256i
in1
);
static
__attribute__
((
always_inline
))
inline
int
count_bits_set
(
uint64_t
v
)
{
return
__builtin_popcountll
(
v
);
}
#ifdef __cplusplus
}
#endif
...
...
openair1/SCHED_NR/phy_procedures_nr_gNB.c
View file @
96ff859c
...
...
@@ -544,13 +544,14 @@ void fill_ul_rb_mask(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
int
rb2
=
0
;
int
prbpos
=
0
;
for
(
int
symbol
=
0
;
symbol
<
14
;
symbol
++
)
{
for
(
int
m
=
0
;
m
<
9
;
m
++
)
{
for
(
int
symbol
=
0
;
symbol
<
14
;
symbol
++
)
{
for
(
int
m
=
0
;
m
<
9
;
m
++
)
{
gNB
->
rb_mask_ul
[
symbol
][
m
]
=
0
;
for
(
int
i
=
0
;
i
<
32
;
i
++
)
{
prbpos
=
(
m
*
32
)
+
i
;
if
(
prbpos
>
gNB
->
frame_parms
.
N_RB_UL
)
break
;
gNB
->
rb_mask_ul
[
symbol
][
m
]
|=
(
gNB
->
ulprbbl
[
prbpos
]
>
0
?
1
:
0
)
<<
i
;
for
(
int
i
=
0
;
i
<
32
;
i
++
)
{
prbpos
=
(
m
*
32
)
+
i
;
if
(
prbpos
>
gNB
->
frame_parms
.
N_RB_UL
)
break
;
gNB
->
rb_mask_ul
[
symbol
][
m
]
|=
(
gNB
->
ulprbbl
[
prbpos
]
>
0
?
1U
:
0
)
<<
i
;
}
}
}
...
...
openair1/SIMULATION/TOOLS/gauss.c
View file @
96ff859c
...
...
@@ -25,28 +25,24 @@
#include "defs.h"
unsigned
int
*
generate_gauss_LUT
(
unsigned
char
Nbits
,
unsigned
char
L
)
{
unsigned
int
*
LUT_ptr
,
i
;
LUT_ptr
=
(
unsigned
int
*
)
malloc
((
1
<<
(
Nbits
-
1
))
*
sizeof
(
int
));
unsigned
int
*
generate_gauss_LUT
(
unsigned
char
Nbits
,
unsigned
char
L
)
{
unsigned
int
*
LUT_ptr
=
calloc
((
1U
<<
(
Nbits
-
1
)),
sizeof
(
int
));
assert
(
LUT_ptr
);
for
(
i
=
0
;
i
<
(
1
<<
(
Nbits
-
1
));
i
++
)
{
LUT_ptr
[
i
]
=
(
unsigned
int
)((
double
)((
unsigned
int
)(
1
<<
31
))
*
erf
(
i
*
L
/
(
double
)(
1
<<
(
Nbits
-
1
))));
for
(
i
nt
i
=
0
;
i
<
(
1
<<
(
Nbits
-
1
));
i
++
)
{
LUT_ptr
[
i
]
=
(
unsigned
int
)((
double
)((
unsigned
int
)(
1
U
<<
31
))
*
erf
(
i
*
L
/
(
double
)(
1
<<
(
Nbits
-
1
))));
#ifdef LUTDEBUG
printf
(
"pos %
u : LUT_ptr[%u]=%x (%f)
\n
"
,
i
,
i
,
LUT_ptr
[
i
],(
double
)(
erf
(
i
*
L
/
(
double
)(
1
<<
(
Nbits
-
1
)))));
printf
(
"pos %
d : LUT_ptr[%d]=%x (%f)
\n
"
,
i
,
i
,
LUT_ptr
[
i
],
(
double
)(
erf
(
i
*
L
/
(
double
)(
1
<<
(
Nbits
-
1
)))));
#endif //LUTDEBUG
}
return
(
LUT_ptr
);
}
int
gauss
(
unsigned
int
*
gauss_LUT
,
unsigned
char
Nbits
)
{
int
gauss
(
unsigned
int
*
gauss_LUT
,
unsigned
char
Nbits
)
{
unsigned
int
search_pos
,
step_size
,
u
,
tmp
,
tmpm1
,
tmpp1
,
s
;
// Get a 32-bit uniform random-variable
u
=
taus
();
...
...
@@ -127,8 +123,10 @@ void main(int argc,char **argv) {
// printf("%d\n",gauss(gauss_LUT_ptr,Nbits));
}
printf
(
"Tail probability = %e(%x)
\n
"
,
2
*
erfc
((
double
)
L
*
gauss_LUT_ptr
[(
1
<<
(
Nbits
-
1
))
-
1
]
/
(
unsigned
int
)(
1
<<
31
)),
gauss_LUT_ptr
[(
1
<<
(
Nbits
-
1
))
-
1
]);
printf
(
"max %d, min %d, mean %f, stddev %f, Pr(maxnum)=%e(%d)
\n
"
,
maxg
,
ming
,
meang
,
sqrt
(
varg
),(
double
)
maxnum
/
Ntrials
,
maxnum
);
printf
(
"Tail probability = %e(%x)
\n
"
,
2
*
erfc
((
double
)
L
*
gauss_LUT_ptr
[(
1U
<<
(
Nbits
-
1
))
-
1
]
/
(
unsigned
int
)(
1U
<<
31
)),
gauss_LUT_ptr
[(
1U
<<
(
Nbits
-
1
))
-
1
]);
printf
(
"max %d, min %d, mean %f, stddev %f, Pr(maxnum)=%e(%d)
\n
"
,
maxg
,
ming
,
meang
,
sqrt
(
varg
),
(
double
)
maxnum
/
Ntrials
,
maxnum
);
// for (i=0;i<(1<<Nhistbits);i++)
// printf("%d : %u\n",i,hist[i]);
free
(
gauss_LUT_ptr
);
...
...
openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
View file @
96ff859c
...
...
@@ -1686,19 +1686,15 @@ int get_nr_prach_occasion_info_from_index(uint8_t index,
uint8_t
*
N_dur
,
uint8_t
*
N_RA_slot
,
uint16_t
*
N_RA_sfn
,
uint8_t
*
max_association_period
)
{
uint8_t
*
max_association_period
)
{
int
x
;
int64_t
s_map
;
u
int64_t
s_map
;
uint8_t
format2
=
0xff
;
if
(
pointa
>
2016666
)
{
//FR2
x
=
table_6_3_3_2_4_prachConfig_Index
[
index
][
2
];
s_map
=
table_6_3_3_2_4_prachConfig_Index
[
index
][
5
];
for
(
int
i
=
0
;
i
<
64
;
i
++
)
{
if
(
(
s_map
>>
i
)
&
0x01
)
{
(
*
N_RA_sfn
)
++
;
}
}
*
N_RA_sfn
+=
count_bits_set
(
s_map
);
*
N_RA_slot
=
table_6_3_3_2_4_prachConfig_Index
[
index
][
7
];
// Number of RACH slots within a subframe
*
max_association_period
=
160
/
(
x
*
10
);
if
(
start_symbol
!=
NULL
&&
N_t_slot
!=
NULL
&&
N_dur
!=
NULL
&&
format
!=
NULL
){
...
...
@@ -1722,15 +1718,10 @@ int get_nr_prach_occasion_info_from_index(uint8_t index,
return
1
;
}
else
{
if
(
unpaired
)
{
x
=
table_6_3_3_2_3_prachConfig_Index
[
index
][
2
];
s_map
=
table_6_3_3_2_3_prachConfig_Index
[
index
][
4
];
for
(
int
i
=
0
;
i
<
64
;
i
++
)
{
if
(
(
s_map
>>
i
)
&
0x01
)
{
(
*
N_RA_sfn
)
++
;
}
}
*
N_RA_sfn
+=
count_bits_set
(
s_map
);
*
N_RA_slot
=
table_6_3_3_2_3_prachConfig_Index
[
index
][
6
];
// Number of RACH slots within a subframe
*
max_association_period
=
160
/
(
x
*
10
);
if
(
start_symbol
!=
NULL
&&
N_t_slot
!=
NULL
&&
N_dur
!=
NULL
&&
format
!=
NULL
){
...
...
@@ -1755,11 +1746,7 @@ int get_nr_prach_occasion_info_from_index(uint8_t index,
else
{
// FDD
x
=
table_6_3_3_2_2_prachConfig_Index
[
index
][
2
];
s_map
=
table_6_3_3_2_2_prachConfig_Index
[
index
][
4
];
for
(
int
i
=
0
;
i
<
64
;
i
++
)
{
if
(
(
s_map
>>
i
)
&
0x01
)
{
(
*
N_RA_sfn
)
++
;
}
}
*
N_RA_sfn
+=
count_bits_set
(
s_map
);
*
N_RA_slot
=
table_6_3_3_2_2_prachConfig_Index
[
index
][
6
];
if
(
start_symbol
!=
NULL
&&
N_t_slot
!=
NULL
&&
N_dur
!=
NULL
&&
format
!=
NULL
){
*
start_symbol
=
table_6_3_3_2_2_prachConfig_Index
[
index
][
5
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment