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
b240bc48
Commit
b240bc48
authored
Oct 13, 2023
by
Quency Lin
Committed by
francescomani
Dec 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feat: improve layer mapping by 32 bits assignment
parent
c5aeaf03
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
279 additions
and
289 deletions
+279
-289
openair1/PHY/MODULATION/nr_modulation.c
openair1/PHY/MODULATION/nr_modulation.c
+52
-49
openair1/PHY/MODULATION/nr_modulation.h
openair1/PHY/MODULATION/nr_modulation.h
+14
-9
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+200
-201
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+0
-17
openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c
openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c
+6
-4
openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.h
openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.h
+2
-4
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
+1
-1
openair1/PHY/TOOLS/tools_defs.h
openair1/PHY/TOOLS/tools_defs.h
+4
-0
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+0
-4
No files found.
openair1/PHY/MODULATION/nr_modulation.c
View file @
b240bc48
...
...
@@ -241,71 +241,74 @@ void nr_modulation(uint32_t *in,
AssertFatal
(
false
,
"Invalid or unsupported modulation order %d
\n
"
,
mod_order
);
}
void
nr_layer_mapping
(
int16_t
**
mod_symbs
,
void
nr_layer_mapping
(
int
nbCodes
,
int
encoded_len
,
c16_t
mod_symbs
[
nbCodes
][
encoded_len
],
uint8_t
n_layers
,
int
layerSz
,
uint32_t
n_symbs
,
int16_t
**
tx_layers
)
c16_t
tx_layers
[
n_layers
][
layerSz
]
)
{
LOG_D
(
PHY
,
"Doing layer mapping for %d layers, %d symbols
\n
"
,
n_layers
,
n_symbs
);
switch
(
n_layers
)
{
case
1
:
memcpy
((
void
*
)
tx_layers
[
0
],
(
void
*
)
mod_symbs
[
0
],
(
n_symbs
<<
1
)
*
sizeof
(
int16_t
));
break
;
memcpy
(
tx_layers
[
0
],
mod_symbs
[
0
],
n_symbs
*
sizeof
(
**
mod_symbs
));
break
;
case
2
:
case
3
:
case
4
:
for
(
int
i
=
0
;
i
<
n_symbs
/
n_layers
;
i
++
)
for
(
int
l
=
0
;
l
<
n_layers
;
l
++
)
{
tx_layers
[
l
][
i
<<
1
]
=
mod_symbs
[
0
][(
n_layers
*
i
+
l
)
<<
1
];
tx_layers
[
l
][(
i
<<
1
)
+
1
]
=
mod_symbs
[
0
][((
n_layers
*
i
+
l
)
<<
1
)
+
1
];
}
for
(
int
i
=
0
;
i
<
n_symbs
/
n_layers
;
i
++
)
{
const
c16_t
*
base
=
mod_symbs
[
0
]
+
n_layers
*
i
;
for
(
int
l
=
0
;
l
<
n_layers
;
l
++
)
tx_layers
[
l
][
i
]
=
base
[
l
];
}
break
;
case
5
:
for
(
int
i
=
0
;
i
<
n_symbs
>>
1
;
i
++
)
for
(
int
l
=
0
;
l
<
2
;
l
++
)
{
tx_layers
[
l
][
i
<<
1
]
=
mod_symbs
[
0
][((
i
<<
1
)
+
l
)
<<
1
];
tx_layers
[
l
][(
i
<<
1
)
+
1
]
=
mod_symbs
[
0
][(((
i
<<
1
)
+
l
)
<<
1
)
+
1
];
}
for
(
int
i
=
0
;
i
<
n_symbs
/
3
;
i
++
)
for
(
int
l
=
2
;
l
<
5
;
l
++
)
{
tx_layers
[
l
][
i
<<
1
]
=
mod_symbs
[
1
][(
3
*
i
+
l
)
<<
1
];
tx_layers
[
l
][(
i
<<
1
)
+
1
]
=
mod_symbs
[
1
][((
3
*
i
+
l
)
<<
1
)
+
1
];
}
for
(
int
i
=
0
;
i
<
n_symbs
;
i
+=
2
)
{
const
int
txIdx
=
i
/
2
;
for
(
int
l
=
0
;
l
<
2
;
l
++
)
tx_layers
[
l
][
txIdx
]
=
mod_symbs
[
0
][
i
+
l
];
}
for
(
int
i
=
0
;
i
<
n_symbs
;
i
+=
3
)
{
const
int
txIdx
=
i
/
3
;
for
(
int
l
=
2
;
l
<
5
;
l
++
)
tx_layers
[
l
][
txIdx
]
=
mod_symbs
[
1
][
i
+
l
];
}
break
;
case
6
:
for
(
int
q
=
0
;
q
<
2
;
q
++
)
for
(
int
i
=
0
;
i
<
n_symbs
/
3
;
i
++
)
for
(
int
l
=
0
;
l
<
3
;
l
++
)
{
tx_layers
[
l
][
i
<<
1
]
=
mod_symbs
[
q
][(
3
*
i
+
l
)
<<
1
];
tx_layers
[
l
][(
i
<<
1
)
+
1
]
=
mod_symbs
[
q
][((
3
*
i
+
l
)
<<
1
)
+
1
];
}
for
(
int
i
=
0
;
i
<
n_symbs
;
i
+=
3
)
{
const
int
txIdx
=
i
/
3
;
for
(
int
l
=
0
;
l
<
3
;
l
++
)
tx_layers
[
l
][
txIdx
]
=
mod_symbs
[
q
][
i
+
l
];
}
break
;
case
7
:
for
(
int
i
=
0
;
i
<
n_symbs
/
3
;
i
++
)
for
(
int
l
=
0
;
l
<
3
;
l
++
)
{
tx_layers
[
l
][
i
<<
1
]
=
mod_symbs
[
1
][(
3
*
i
+
l
)
<<
1
];
tx_layers
[
l
][(
i
<<
1
)
+
1
]
=
mod_symbs
[
1
][((
3
*
i
+
l
)
<<
1
)
+
1
];
}
for
(
int
i
=
0
;
i
<
n_symbs
/
4
;
i
++
)
for
(
int
l
=
3
;
l
<
7
;
l
++
)
{
tx_layers
[
l
][
i
<<
1
]
=
mod_symbs
[
0
][((
i
<<
2
)
+
l
)
<<
1
];
tx_layers
[
l
][(
i
<<
1
)
+
1
]
=
mod_symbs
[
0
][(((
i
<<
2
)
+
l
)
<<
1
)
+
1
];
}
for
(
int
i
=
0
;
i
<
n_symbs
;
i
+=
3
)
{
const
int
txIdx
=
i
/
3
;
for
(
int
l
=
0
;
l
<
3
;
l
++
)
tx_layers
[
l
][
txIdx
]
=
mod_symbs
[
1
][
i
+
l
];
}
for
(
int
i
=
0
;
i
<
n_symbs
;
i
+=
4
)
{
const
int
txIdx
=
i
/
4
;
for
(
int
l
=
3
;
l
<
7
;
l
++
)
tx_layers
[
l
][
txIdx
]
=
mod_symbs
[
0
][
i
+
l
];
}
break
;
case
8
:
for
(
int
q
=
0
;
q
<
2
;
q
++
)
for
(
int
i
=
0
;
i
<
n_symbs
>>
2
;
i
++
)
for
(
int
l
=
0
;
l
<
3
;
l
++
)
{
tx_layers
[
l
][
i
<<
1
]
=
mod_symbs
[
q
][((
i
<<
2
)
+
l
)
<<
1
];
tx_layers
[
l
][(
i
<<
1
)
+
1
]
=
mod_symbs
[
q
][(((
i
<<
2
)
+
l
)
<<
1
)
+
1
];
}
for
(
int
i
=
0
;
i
<
n_symbs
;
i
+=
4
)
{
const
int
txIdx
=
i
/
4
;
for
(
int
l
=
0
;
l
<
3
;
l
++
)
tx_layers
[
l
][
txIdx
]
=
mod_symbs
[
q
][
i
+
l
];
}
break
;
default:
...
...
@@ -694,17 +697,17 @@ int nr_layer_precoder(int16_t **datatx_F_precoding, const char *prec_matrix, uin
((int16_t *)precodatatx_F)[1] = (int16_t)((((int16_t *)precodatatx_F)[1]*ONE_OVER_SQRT2_Q15)>>15);*/
}
int
nr_layer_precoder_cm
(
int16_t
**
datatx_F_precoding
,
int
*
prec_matrix
,
uint8_t
n_layers
,
int32_t
re_offset
)
c16_t
nr_layer_precoder_cm
(
int
n_layers
,
int
n_symbols
,
int
symSz
,
c16_t
datatx_F_precoding
[
n_layers
][
n_symbols
][
symSz
],
c16_t
*
prec_matrix
,
int
symbol
,
int
offset
)
{
int32_t
precodatatx_F
=
0
;
for
(
int
al
=
0
;
al
<
n_layers
;
al
++
)
{
int16_t
antenna_re
=
datatx_F_precoding
[
al
][
re_offset
<<
1
];
int16_t
antenna_im
=
datatx_F_precoding
[
al
][(
re_offset
<<
1
)
+
1
];
//printf("antenna precoding: %d %d\n",((int16_t *)&prec_matrix[al])[0],((int16_t *)&prec_matrix[al])[1]);
((
int16_t
*
)
&
precodatatx_F
)[
0
]
+=
(
int16_t
)(((
int32_t
)(
antenna_re
*
(((
int16_t
*
)
&
prec_matrix
[
al
])[
0
]))
-
(
int32_t
)(
antenna_im
*
(((
int16_t
*
)
&
prec_matrix
[
al
])[
1
])))
>>
15
);
((
int16_t
*
)
&
precodatatx_F
)[
1
]
+=
(
int16_t
)(((
int32_t
)(
antenna_re
*
(((
int16_t
*
)
&
prec_matrix
[
al
])[
1
]))
+
(
int32_t
)(
antenna_im
*
(((
int16_t
*
)
&
prec_matrix
[
al
])[
0
])))
>>
15
);
}
c16_t
precodatatx_F
=
{
0
};
for
(
int
al
=
0
;
al
<
n_layers
;
al
++
)
precodatatx_F
=
c16maddShift
(
datatx_F_precoding
[
al
][
symbol
][
offset
],
prec_matrix
[
al
],
precodatatx_F
,
15
);
return
precodatatx_F
;
}
openair1/PHY/MODULATION/nr_modulation.h
View file @
b240bc48
...
...
@@ -54,10 +54,13 @@ void nr_modulation(uint32_t *in,
@param[out] tx_layers, modulated symbols for each layer
*/
void
nr_layer_mapping
(
int16_t
**
mod_symbs
,
uint8_t
n_layers
,
uint32_t
n_symbs
,
int16_t
**
tx_layers
);
void
nr_layer_mapping
(
int
nbCodes
,
int
encoded_len
,
c16_t
mod_symbs
[
nbCodes
][
encoded_len
],
uint8_t
n_layers
,
int
layerSz
,
uint32_t
n_symbs
,
c16_t
tx_layers
[
n_layers
][
layerSz
]);
/*! \brief Perform NR layer mapping. TS 38.211 V15.4.0 subclause 7.3.1.3
@param[in] ulsch_ue, double Pointer to NR_UE_ULSCH_t struct
...
...
@@ -135,9 +138,11 @@ void apply_nr_rotation_RX(NR_DL_FRAME_PARMS *frame_parms,
@param[in] n_layers, number of DLSCH layers
*/
int
nr_layer_precoder
(
int16_t
**
datatx_F_precoding
,
const
char
*
prec_matrix
,
uint8_t
n_layers
,
int32_t
re_offset
);
int
nr_layer_precoder_cm
(
int16_t
**
datatx_F_precoding
,
int
*
prec_matrix
,
uint8_t
n_layers
,
int32_t
re_offset
);
c16_t
nr_layer_precoder_cm
(
int
n_layers
,
int
n_symbols
,
int
symSz
,
c16_t
datatx_F_precoding
[
n_layers
][
n_symbols
][
symSz
],
c16_t
*
prec_matrix
,
int
symbol
,
int
offset
);
#endif
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
View file @
b240bc48
This diff is collapsed.
Click to expand it.
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
View file @
b240bc48
...
...
@@ -74,18 +74,11 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch, uint16_t N_RB, const NR_DL_FRAME_PARM
free
(
harq
->
c
);
free
(
harq
->
pdu
);
int
nb_codewords
=
NR_MAX_NB_LAYERS
>
4
?
2
:
1
;
for
(
int
q
=
0
;
q
<
nb_codewords
;
q
++
)
free
(
dlsch
->
mod_symbs
[
q
]);
free
(
dlsch
->
mod_symbs
);
for
(
int
layer
=
0
;
layer
<
max_layers
;
layer
++
)
{
free
(
dlsch
->
txdataF
[
layer
]);
for
(
int
aa
=
0
;
aa
<
64
;
aa
++
)
free
(
dlsch
->
ue_spec_bf_weights
[
layer
][
aa
]);
free
(
dlsch
->
ue_spec_bf_weights
[
layer
]);
}
free
(
dlsch
->
txdataF
);
free
(
dlsch
->
ue_spec_bf_weights
);
}
...
...
@@ -103,10 +96,6 @@ NR_gNB_DLSCH_t new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, uint16_t N_RB)
uint32_t
dlsch_bytes
=
a_segments
*
1056
;
// allocated bytes per segment
NR_gNB_DLSCH_t
dlsch
;
int
txdataf_size
=
frame_parms
->
N_RB_DL
*
NR_SYMBOLS_PER_SLOT
*
NR_NB_SC_PER_RB
*
8
;
// max pdsch encoded length for each layer
dlsch
.
txdataF
=
(
int32_t
**
)
malloc16
(
max_layers
*
sizeof
(
int32_t
*
));
dlsch
.
ue_spec_bf_weights
=
(
int32_t
***
)
malloc16
(
max_layers
*
sizeof
(
int32_t
**
));
for
(
int
layer
=
0
;
layer
<
max_layers
;
layer
++
)
{
dlsch
.
ue_spec_bf_weights
[
layer
]
=
(
int32_t
**
)
malloc16
(
64
*
sizeof
(
int32_t
*
));
...
...
@@ -118,14 +107,8 @@ NR_gNB_DLSCH_t new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, uint16_t N_RB)
dlsch
.
ue_spec_bf_weights
[
layer
][
aa
][
re
]
=
0x00007fff
;
}
}
dlsch
.
txdataF
[
layer
]
=
(
int32_t
*
)
malloc16
((
txdataf_size
)
*
sizeof
(
int32_t
));
}
int
nb_codewords
=
NR_MAX_NB_LAYERS
>
4
?
2
:
1
;
dlsch
.
mod_symbs
=
(
int32_t
**
)
malloc16
(
nb_codewords
*
sizeof
(
int32_t
*
));
for
(
int
q
=
0
;
q
<
nb_codewords
;
q
++
)
dlsch
.
mod_symbs
[
q
]
=
(
int32_t
*
)
malloc16
(
txdataf_size
*
max_layers
*
sizeof
(
int32_t
));
NR_DL_gNB_HARQ_t
*
harq
=
&
dlsch
.
harq_process
;
bzero
(
harq
,
sizeof
(
NR_DL_gNB_HARQ_t
));
harq
->
b
=
malloc16
(
dlsch_bytes
);
...
...
openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c
View file @
b240bc48
...
...
@@ -65,14 +65,16 @@ void get_antenna_ports(uint8_t *ap, uint8_t n_symbs, uint8_t config) {
*
(
ap
+
i
)
=
i
;
}
void
get_Wt
(
int8_t
*
Wt
,
uint8_t
ap
,
uint8_t
config
)
{
void
get_Wt
(
int
*
Wt
,
const
int
ap
,
const
nfapi_nr_dmrs_type_e
config
)
{
for
(
int
i
=
0
;
i
<
2
;
i
++
)
*
(
Wt
+
i
)
=
(
config
==
NFAPI_NR_DMRS_TYPE1
)
?
(
pdsch_dmrs_1
[
ap
][
5
+
i
])
:
(
pdsch_dmrs_2
[
ap
][
5
+
i
]);
Wt
[
i
]
=
(
config
==
NFAPI_NR_DMRS_TYPE1
)
?
(
pdsch_dmrs_1
[
ap
][
5
+
i
])
:
(
pdsch_dmrs_2
[
ap
][
5
+
i
]);
}
void
get_Wf
(
int8_t
*
Wf
,
uint8_t
ap
,
uint8_t
config
)
{
void
get_Wf
(
int
*
Wf
,
const
int
ap
,
const
nfapi_nr_dmrs_type_e
config
)
{
for
(
int
i
=
0
;
i
<
2
;
i
++
)
*
(
Wf
+
i
)
=
(
config
==
NFAPI_NR_DMRS_TYPE1
)
?
(
pdsch_dmrs_1
[
ap
][
3
+
i
])
:
(
pdsch_dmrs_2
[
ap
][
3
+
i
]);
Wf
[
i
]
=
(
config
==
NFAPI_NR_DMRS_TYPE1
)
?
(
pdsch_dmrs_1
[
ap
][
3
+
i
])
:
(
pdsch_dmrs_2
[
ap
][
3
+
i
]);
}
uint8_t
get_delta
(
uint8_t
ap
,
uint8_t
config
)
{
...
...
openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.h
View file @
b240bc48
...
...
@@ -39,10 +39,8 @@
#define NR_PDSCH_DMRS_NB_ANTENNA_PORTS 12
void
get_antenna_ports
(
uint8_t
*
ap
,
uint8_t
n_symbs
,
uint8_t
config
);
void
get_Wt
(
int8_t
*
Wt
,
uint8_t
ap
,
uint8_t
config
);
void
get_Wf
(
int8_t
*
Wf
,
uint8_t
ap
,
uint8_t
config
);
void
get_Wt
(
int
*
Wt
,
const
int
ap
,
const
nfapi_nr_dmrs_type_e
config
);
void
get_Wf
(
int
*
Wf
,
const
int
ap
,
const
nfapi_nr_dmrs_type_e
config
);
uint8_t
get_delta
(
uint8_t
ap
,
uint8_t
config
);
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
View file @
b240bc48
...
...
@@ -116,7 +116,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
{
LOG_D
(
PHY
,
"nr_ue_ulsch_procedures hard_id %d %d.%d
\n
"
,
harq_pid
,
frame
,
slot
);
int
8_t
Wf
[
2
],
Wt
[
2
];
int
Wf
[
2
],
Wt
[
2
];
int
l_prime
[
2
],
delta
;
uint8_t
nb_dmrs_re_per_rb
;
int
i
;
...
...
openair1/PHY/TOOLS/tools_defs.h
View file @
b240bc48
...
...
@@ -193,6 +193,10 @@ extern "C" {
};
}
__attribute__
((
always_inline
))
inline
c16_t
c16mulRealShift
(
const
c16_t
a
,
const
int32_t
b
,
const
int
Shift
)
{
return
(
c16_t
){.
r
=
(
int16_t
)((
a
.
r
*
b
)
>>
Shift
),
.
i
=
(
int16_t
)((
a
.
i
*
b
)
>>
Shift
)};
}
__attribute__
((
always_inline
))
inline
c16_t
c16divShift
(
const
c16_t
a
,
const
c16_t
b
,
const
int
Shift
)
{
return
(
c16_t
)
{
.
r
=
(
int16_t
)((
a
.
r
*
b
.
r
+
a
.
i
*
b
.
i
)
>>
Shift
),
...
...
openair1/PHY/defs_gNB.h
View file @
b240bc48
...
...
@@ -142,10 +142,6 @@ typedef struct {
typedef
struct
{
/// Pointers to variables related to DLSCH harq process
NR_DL_gNB_HARQ_t
harq_process
;
/// TX buffers for UE-spec transmission (antenna layers 1,...,4 after to precoding)
int32_t
**
txdataF
;
/// Modulated symbols buffer
int32_t
**
mod_symbs
;
/// beamforming weights for UE-spec transmission (antenna ports 5 or 7..14), for each codeword, maximum 4 layers?
int32_t
***
ue_spec_bf_weights
;
/// Active flag for baseband transmitter processing
...
...
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