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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
wangjie
OpenXG-RAN
Commits
d986d8bf
Commit
d986d8bf
authored
Oct 09, 2019
by
Francesco Mani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
csi-rs resource mapping (to be debugged and tested)
parent
f8f97a21
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
169 additions
and
14 deletions
+169
-14
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+1
-0
openair1/PHY/NR_TRANSPORT/nr_csi_rs.c
openair1/PHY/NR_TRANSPORT/nr_csi_rs.c
+164
-10
openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
+2
-2
openair1/PHY/defs_nr_common.h
openair1/PHY/defs_nr_common.h
+2
-2
No files found.
openair1/PHY/INIT/nr_init.c
View file @
d986d8bf
...
@@ -199,6 +199,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
...
@@ -199,6 +199,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
/// Transport init necessary for NR synchro
/// Transport init necessary for NR synchro
init_nr_transport
(
gNB
);
init_nr_transport
(
gNB
);
gNB
->
first_run_I0_measurements
=
1
;
gNB
->
first_run_I0_measurements
=
1
;
common_vars
->
rxdata
=
(
int32_t
**
)
malloc16
(
Prx
*
sizeof
(
int32_t
*
));
common_vars
->
rxdata
=
(
int32_t
**
)
malloc16
(
Prx
*
sizeof
(
int32_t
*
));
...
...
openair1/PHY/NR_TRANSPORT/nr_csi_rs.c
View file @
d986d8bf
...
@@ -21,20 +21,27 @@
...
@@ -21,20 +21,27 @@
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
#include "PHY/MODULATION/nr_modulation.h"
//#define NR_CSIRS_DEBUG
//#define NR_CSIRS_DEBUG
int
nr_generate_csi_rs
(
uint32_t
**
gold_csi_rs
,
int
nr_generate_csi_rs
(
uint32_t
**
gold_csi_rs
,
int32_t
*
txdataF
,
int32_t
**
txdataF
,
int16_t
amp
,
NR_DL_FRAME_PARMS
frame_parms
,
NR_DL_FRAME_PARMS
frame_parms
,
nfapi_nr_csi_rs_pdu_t
csi_params
)
nfapi_nr_csi_rs_pdu_t
csi_params
)
{
{
int16_t
mod_csi
[
frame_parms
.
symbols_per_slot
][
NR_MAX_CSI_RS_LENGTH
>>
1
];
uint16_t
b
=
csi_params
.
freq_domain
;
uint16_t
b
=
csi_params
.
freq_domain
;
uint8_t
size
,
ports
,
kprime
,
lprime
,
i
;
uint16_t
n
,
csi_bw
,
csi_start
,
p
,
k
,
l
,
mprime
,
na
,
kpn
,
csi_length
;
uint8_t
size
,
ports
,
kprime
,
lprime
,
i
,
gs
;
uint8_t
j
[
16
],
k_n
[
6
],
koverline
[
16
],
loverline
[
16
];
uint8_t
j
[
16
],
k_n
[
6
],
koverline
[
16
],
loverline
[
16
];
int
found
=
0
;
int
found
=
0
;
int
wf
,
wt
,
lp
,
kp
,
symb
;
uint8_t
fi
=
0
;
uint8_t
fi
=
0
;
double
rho
,
alpha
;
uint32_t
beta
;
switch
(
csi_params
.
row
)
{
switch
(
csi_params
.
row
)
{
// implementation of table 7.4.1.5.3-1 of 38.211
// implementation of table 7.4.1.5.3-1 of 38.211
...
@@ -55,7 +62,7 @@ int nr_generate_csi_rs(uint32_t **gold_csi_rs,
...
@@ -55,7 +62,7 @@ int nr_generate_csi_rs(uint32_t **gold_csi_rs,
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
i
=
0
;
i
<
size
;
i
++
)
{
j
[
i
]
=
0
;
j
[
i
]
=
0
;
loverline
[
i
]
=
csi_params
.
symb_l0
;
loverline
[
i
]
=
csi_params
.
symb_l0
;
koverline
[
i
]
=
k_n
[
0
]
+
i
<<
2
;
koverline
[
i
]
=
k_n
[
0
]
+
(
i
<<
2
)
;
}
}
break
;
break
;
...
@@ -115,7 +122,7 @@ int nr_generate_csi_rs(uint32_t **gold_csi_rs,
...
@@ -115,7 +122,7 @@ int nr_generate_csi_rs(uint32_t **gold_csi_rs,
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
i
=
0
;
i
<
size
;
i
++
)
{
j
[
i
]
=
i
;
j
[
i
]
=
i
;
loverline
[
i
]
=
csi_params
.
symb_l0
;
loverline
[
i
]
=
csi_params
.
symb_l0
;
koverline
[
i
]
=
k_n
[
0
]
+
i
<<
1
;
koverline
[
i
]
=
k_n
[
0
]
+
(
i
<<
1
)
;
}
}
break
;
break
;
...
@@ -172,7 +179,7 @@ int nr_generate_csi_rs(uint32_t **gold_csi_rs,
...
@@ -172,7 +179,7 @@ int nr_generate_csi_rs(uint32_t **gold_csi_rs,
}
}
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
i
=
0
;
i
<
size
;
i
++
)
{
j
[
i
]
=
i
;
j
[
i
]
=
i
;
loverline
[
i
]
=
csi_params
.
symb_l0
+
i
>>
1
;
loverline
[
i
]
=
csi_params
.
symb_l0
+
(
i
>>
1
)
;
koverline
[
i
]
=
k_n
[
i
%
2
];
koverline
[
i
]
=
k_n
[
i
%
2
];
}
}
break
;
break
;
...
@@ -233,7 +240,6 @@ int nr_generate_csi_rs(uint32_t **gold_csi_rs,
...
@@ -233,7 +240,6 @@ int nr_generate_csi_rs(uint32_t **gold_csi_rs,
koverline
[
i
]
=
k_n
[
i
];
koverline
[
i
]
=
k_n
[
i
];
}
}
break
;
break
;
}
case
11
:
case
11
:
ports
=
16
;
ports
=
16
;
...
@@ -249,11 +255,10 @@ int nr_generate_csi_rs(uint32_t **gold_csi_rs,
...
@@ -249,11 +255,10 @@ int nr_generate_csi_rs(uint32_t **gold_csi_rs,
}
}
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
i
=
0
;
i
<
size
;
i
++
)
{
j
[
i
]
=
i
;
j
[
i
]
=
i
;
loverline
[
i
]
=
csi_params
.
symb_l0
+
i
>>
2
;
loverline
[
i
]
=
csi_params
.
symb_l0
+
(
i
>>
2
)
;
koverline
[
i
]
=
k_n
[
i
%
4
];
koverline
[
i
]
=
k_n
[
i
%
4
];
}
}
break
;
break
;
}
case
12
:
case
12
:
ports
=
16
;
ports
=
16
;
...
@@ -352,9 +357,9 @@ int nr_generate_csi_rs(uint32_t **gold_csi_rs,
...
@@ -352,9 +357,9 @@ int nr_generate_csi_rs(uint32_t **gold_csi_rs,
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
i
=
0
;
i
<
size
;
i
++
)
{
j
[
i
]
=
i
;
j
[
i
]
=
i
;
if
(
i
<
8
)
if
(
i
<
8
)
loverline
[
i
]
=
csi_params
.
symb_l0
+
i
>>
2
;
loverline
[
i
]
=
csi_params
.
symb_l0
+
(
i
>>
2
)
;
else
else
loverline
[
i
]
=
csi_params
.
symb_l1
+
i
>>
4
;
loverline
[
i
]
=
csi_params
.
symb_l1
+
(
i
>>
4
)
;
koverline
[
i
]
=
k_n
[
i
%
4
];
koverline
[
i
]
=
k_n
[
i
%
4
];
}
}
break
;
break
;
...
@@ -402,5 +407,154 @@ int nr_generate_csi_rs(uint32_t **gold_csi_rs,
...
@@ -402,5 +407,154 @@ int nr_generate_csi_rs(uint32_t **gold_csi_rs,
}
}
// setting the frequency density from its index
switch
(
csi_params
.
freq_density
)
{
case
0
:
rho
=
0
.
5
;
break
;
case
1
:
rho
=
0
.
5
;
break
;
case
2
:
rho
=
1
;
break
;
case
3
:
rho
=
3
;
break
;
}
if
(
ports
==
1
)
alpha
=
rho
;
else
alpha
=
2
*
rho
;
// CDM group size from CDM type index
switch
(
csi_params
.
cdm_type
)
{
case
0
:
gs
=
1
;
break
;
case
1
:
gs
=
2
;
break
;
case
2
:
gs
=
4
;
break
;
case
3
:
gs
=
8
;
break
;
}
// according to 38.214 5.2.2.3.1 last paragraph
if
(
csi_params
.
start_rb
<
csi_params
.
bwp_start
)
csi_start
=
csi_params
.
bwp_start
;
else
csi_start
=
csi_params
.
start_rb
;
if
(
csi_params
.
nr_of_rbs
>
(
csi_params
.
bwp_start
+
csi_params
.
bwp_size
-
csi_start
))
csi_bw
=
csi_params
.
bwp_start
+
csi_params
.
bwp_size
-
csi_start
;
else
csi_bw
=
csi_params
.
nr_of_rbs
;
if
(
rho
<
1
)
csi_length
=
((
csi_bw
+
csi_start
)
>>
1
)
<<
kprime
;
else
csi_length
=
((
uint16_t
)
rho
*
(
csi_bw
+
csi_start
))
<<
kprime
;
// TRS
if
(
csi_params
.
csi_type
==
0
)
{
// ???
}
// NZP CSI RS
if
(
csi_params
.
csi_type
==
1
)
{
// assuming amp is the amplitude of SSB channels
switch
(
csi_params
.
power_control_offset_ss
)
{
case
0
:
beta
=
(
amp
*
ONE_OVER_SQRT2_Q15
)
>>
15
;
break
;
case
1
:
beta
=
amp
;
break
;
case
2
:
beta
=
(
amp
*
ONE_OVER_SQRT2_Q15
)
>>
14
;
break
;
case
3
:
beta
=
amp
<<
1
;
break
;
}
for
(
lp
=
0
;
lp
<=
lprime
;
lp
++
){
symb
=
csi_params
.
symb_l0
;
nr_modulation
(
gold_csi_rs
[
symb
+
lp
],
csi_length
,
DMRS_MOD_ORDER
,
mod_csi
[
symb
+
lp
]);
if
((
csi_params
.
row
==
5
)
||
(
csi_params
.
row
==
7
)
||
(
csi_params
.
row
==
11
)
||
(
csi_params
.
row
==
13
)
||
(
csi_params
.
row
==
16
))
nr_modulation
(
gold_csi_rs
[
symb
+
1
],
csi_length
,
DMRS_MOD_ORDER
,
mod_csi
[
symb
+
1
]);
if
((
csi_params
.
row
==
14
)
||
(
csi_params
.
row
==
13
)
||
(
csi_params
.
row
==
16
)
||
(
csi_params
.
row
==
17
))
{
symb
=
csi_params
.
symb_l1
;
nr_modulation
(
gold_csi_rs
[
symb
+
lp
],
csi_length
,
DMRS_MOD_ORDER
,
mod_csi
[
symb
+
lp
]);
if
((
csi_params
.
row
==
13
)
||
(
csi_params
.
row
==
16
))
nr_modulation
(
gold_csi_rs
[
symb
+
1
],
csi_length
,
DMRS_MOD_ORDER
,
mod_csi
[
symb
+
1
]);
}
}
}
// resource mapping according to 38.211 7.4.1.5.3
for
(
n
=
csi_start
;
n
<
(
csi_start
+
csi_bw
);
n
++
)
{
if
(
(
csi_params
.
freq_density
>
1
)
||
(
csi_params
.
freq_density
==
(
n
%
2
)))
{
// for freq density 0.5 checks if even or odd RB
for
(
int
ji
=
0
;
ji
<
size
;
ji
++
)
{
// loop over CDM groups
for
(
int
s
=
0
;
s
<
gs
;
s
++
)
{
// loop over each CDM group size
p
=
3000
+
s
+
j
[
ji
]
*
gs
;
// port index
for
(
kp
=
0
;
kp
<=
kprime
;
kp
++
)
{
// loop over frequency resource elements within a group
k
=
(
n
*
NR_NB_SC_PER_RB
)
+
koverline
[
ji
]
+
kp
;
// frequency index of current resource element
// wf according to tables 7.4.5.3-2 to 7.4.5.3-5
if
(
kp
==
0
)
wf
=
1
;
else
wf
=
-
2
*
(
s
%
2
)
+
1
;
na
=
n
*
alpha
;
kpn
=
(
rho
*
koverline
[
ji
])
/
NR_NB_SC_PER_RB
;
mprime
=
na
+
kp
+
kpn
;
// sequence index
for
(
lp
=
0
;
lp
<=
lprime
;
lp
++
)
{
// loop over frequency resource elements within a group
l
=
lp
+
loverline
[
ji
];
// wt according to tables 7.4.5.3-2 to 7.4.5.3-5
if
(
s
<
2
)
wt
=
1
;
else
if
(
s
<
4
)
wt
=
-
2
*
(
lp
%
2
)
+
1
;
else
if
(
s
<
6
)
wt
=
-
2
*
(
lp
/
2
)
+
1
;
else
{
if
((
lp
==
0
)
||
(
lp
==
3
))
wt
=
1
;
else
wt
=
-
1
;
}
// ZP CSI RS
if
(
csi_params
.
csi_type
==
2
)
{
((
int16_t
*
)
txdataF
[
p
-
3000
])[(
l
*
frame_parms
.
ofdm_symbol_size
+
k
)
<<
1
]
=
0
;
((
int16_t
*
)
txdataF
[
p
-
3000
])[((
l
*
frame_parms
.
ofdm_symbol_size
+
k
)
<<
1
)
+
1
]
=
0
;
}
else
{
((
int16_t
*
)
txdataF
[
p
-
3000
])[(
l
*
frame_parms
.
ofdm_symbol_size
+
k
)
<<
1
]
=
(
beta
*
wt
*
wf
*
mod_csi
[
l
][
mprime
<<
1
])
>>
15
;
((
int16_t
*
)
txdataF
[
p
-
3000
])[((
l
*
frame_parms
.
ofdm_symbol_size
+
k
)
<<
1
)
+
1
]
=
(
beta
*
wt
*
wf
*
mod_csi
[
l
][(
mprime
<<
1
)
+
1
])
>>
15
;
}
}
}
}
}
}
}
return
0
;
return
0
;
}
}
openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
View file @
d986d8bf
...
@@ -329,7 +329,7 @@ void free_nr_ru_prach_entry(RU_t *ru, int prach_id);
...
@@ -329,7 +329,7 @@ void free_nr_ru_prach_entry(RU_t *ru, int prach_id);
int
nr_generate_csi_rs
(
uint32_t
**
gold_csi_rs
,
int
nr_generate_csi_rs
(
uint32_t
**
gold_csi_rs
,
int32_t
*
txdataF
,
int32_t
*
txdataF
,
NR_DL_FRAME_PARMS
frame_parms
,
NR_DL_FRAME_PARMS
frame_parms
,
nfapi_nr_c
onfig_request_t
config
);
nfapi_nr_c
si_rs_pdu_t
csi_params
);
void
nr_decode_pucch1
(
int32_t
**
rxdataF
,
void
nr_decode_pucch1
(
int32_t
**
rxdataF
,
pucch_GroupHopping_t
pucch_GroupHopping
,
pucch_GroupHopping_t
pucch_GroupHopping
,
...
...
openair1/PHY/defs_nr_common.h
View file @
d986d8bf
...
@@ -82,8 +82,8 @@
...
@@ -82,8 +82,8 @@
#define NR_MAX_PDSCH_DMRS_LENGTH 3300 //275*6(k)*2(QPSK real+imag)
#define NR_MAX_PDSCH_DMRS_LENGTH 3300 //275*6(k)*2(QPSK real+imag)
#define NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD 104 // ceil(NR_MAX_PDSCH_DMRS_LENGTH/32)
#define NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD 104 // ceil(NR_MAX_PDSCH_DMRS_LENGTH/32)
#define NR_MAX_CSI_RS_LENGTH
5500 //275*10
(max allocation per RB)*2(QPSK)
#define NR_MAX_CSI_RS_LENGTH
4400 //275*8
(max allocation per RB)*2(QPSK)
#define NR_MAX_CSI_RS_INIT_LENGTH_DWORD 1
72
// ceil(NR_MAX_CSI_RS_LENGTH/32)
#define NR_MAX_CSI_RS_INIT_LENGTH_DWORD 1
38
// ceil(NR_MAX_CSI_RS_LENGTH/32)
#define NR_MAX_PUSCH_DMRS_LENGTH NR_MAX_PDSCH_DMRS_LENGTH
#define NR_MAX_PUSCH_DMRS_LENGTH NR_MAX_PDSCH_DMRS_LENGTH
#define NR_MAX_PUSCH_DMRS_INIT_LENGTH_DWORD NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD
#define NR_MAX_PUSCH_DMRS_INIT_LENGTH_DWORD NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD
...
...
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