Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OAI-RAN-5G-sheduler_MaxTBS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
MAQ5G-PFC
OAI-RAN-5G-sheduler_MaxTBS
Commits
fc13e200
Commit
fc13e200
authored
8 years ago
by
Sandeep Kumar
Browse files
Options
Downloads
Patches
Plain Diff
if header and data blocks seperated
parent
5541cafd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openair1/PHY/LTE_TRANSPORT/if4_tools.c
+47
-34
47 additions, 34 deletions
openair1/PHY/LTE_TRANSPORT/if4_tools.c
openair1/PHY/LTE_TRANSPORT/if4_tools.h
+18
-18
18 additions, 18 deletions
openair1/PHY/LTE_TRANSPORT/if4_tools.h
with
65 additions
and
52 deletions
openair1/PHY/LTE_TRANSPORT/if4_tools.c
+
47
−
34
View file @
fc13e200
...
...
@@ -48,21 +48,29 @@
void
send_IF4
(
PHY_VARS_eNB
*
eNB
,
eNB_rxtx_proc_t
*
proc
,
uint16_t
packet_type
)
{
LTE_DL_FRAME_PARMS
*
fp
=
&
eNB
->
frame_parms
;
int32_t
**
txdataF
=
eNB
->
common_vars
.
txdataF
[
0
];
int32_t
**
rxdataF
=
eNB
->
common_vars
.
rxdataF
[
0
];
uint16_t
symbol_id
,
element_id
;
uint16_t
db_fulllength
=
12
*
fp
->
N_RB_DL
;
uint16_t
db_halflength
=
db_fulllength
>>
1
;
int
slotoffsetF
=
(
proc
->
subframe_tx
)
*
(
fp
->
ofdm_symbol_size
)
*
((
fp
->
Ncp
==
1
)
?
12
:
14
)
+
1
;
int
blockoffsetF
=
slotoffsetF
+
fp
->
ofdm_symbol_size
-
db_halflength
;
IF4_dl_header_t
*
dl_header
=
NULL
;
IF4_ul_header_t
*
ul_header
=
NULL
;
IF4_prach_header_t
*
prach_header
=
NULL
;
int16_t
*
data_block
=
(
int16_t
*
)
malloc
(
db_fulllength
*
sizeof
(
int16_t
));
uint16_t
symbol_id
,
element_id
;
uint16_t
db_halflength
;
int
slotoffsetF
,
blockoffsetF
;
int16_t
*
data_block
=
NULL
;
// int16_t *txbuffer = (int16_t*)malloc(db_halflength*sizeof(int16_t));
// Caller: RCC - DL *** handle RRU case - UL and PRACH ***
if
(
packet_type
==
IF4_PDLFFT
)
{
IF4_dl_packet_t
*
dl_packet
=
(
IF4_dl_
packet
_t
*
)
malloc
(
sizeof_IF4_dl_
packet
_t
);
gen_IF4_dl_
packet
(
dl_packet
,
proc
);
dl_header
=
(
IF4_dl_
header
_t
*
)
malloc
(
sizeof_IF4_dl_
header
_t
);
gen_IF4_dl_
header
(
dl_header
,
proc
);
dl_packet
->
data_block
=
data_block
;
db_halflength
=
(
12
*
fp
->
N_RB_DL
)
>>
1
;
slotoffsetF
=
(
proc
->
subframe_tx
)
*
(
fp
->
ofdm_symbol_size
)
*
((
fp
->
Ncp
==
1
)
?
12
:
14
)
+
1
;
blockoffsetF
=
slotoffsetF
+
fp
->
ofdm_symbol_size
-
db_halflength
;
printf
(
"Problem here - db_half %d
\n
"
,
db_halflength
);
data_block
=
(
int16_t
*
)
malloc
(
db_halflength
*
sizeof
(
int16_t
));
for
(
symbol_id
=
0
;
symbol_id
<
fp
->
symbols_per_tti
;
symbol_id
++
)
{
...
...
@@ -78,40 +86,45 @@ void send_IF4(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, uint16_t packet_type) {
}
// Update information in generated packet
dl_
packet
->
frame_status
.
sym_num
=
symbol_id
;
dl_
header
->
frame_status
.
sym_num
=
symbol_id
;
printf
(
"
\n
Not even here !!
\n
"
);
// Write the packet(s) to the fronthaul
//
if ((
bytes_sent =
eNB->ifdevice.trx_write_func(&eNB->ifdevice,
//
(proc->timestamp_tx-eNB->ifdevice.openair0_cfg.tx_sample_advance)
,
//
dl_packet
,
//
eNB->frame_parms.samples_per_tti
,
//
eNB->frame_parms.nb_antennas_tx
,
//
0)) < 0) {
//
perror("RCC : ETHERNET write");
//
}
if
((
eNB
->
ifdevice
.
trx_write_func
(
&
eNB
->
ifdevice
,
symbol_id
,
&
data_block
,
1
,
1
,
0
))
<
0
)
{
perror
(
"RCC : ETHERNET write"
);
}
slotoffsetF
+=
fp
->
ofdm_symbol_size
;
blockoffsetF
+=
fp
->
ofdm_symbol_size
;
}
}
else
if
(
packet_type
==
IF4_PULFFT
)
{
IF4_ul_packet_t
*
ul_packet
=
(
IF4_ul_packet_t
*
)
malloc
(
sizeof_IF4_ul_packet_t
);
gen_IF4_ul_packet
(
ul_packet
,
proc
);
ul_header
=
(
IF4_ul_header_t
*
)
malloc
(
sizeof_IF4_ul_header_t
);
gen_IF4_ul_header
(
ul_header
,
proc
);
db_halflength
=
(
12
*
fp
->
N_RB_UL
)
>>
1
;
slotoffsetF
=
(
proc
->
subframe_rx
)
*
(
fp
->
ofdm_symbol_size
)
*
((
fp
->
Ncp
==
1
)
?
12
:
14
)
+
1
;
blockoffsetF
=
slotoffsetF
+
fp
->
ofdm_symbol_size
-
db_halflength
;
ul_packet
->
data_block
=
data_block
;
data_block
=
(
int16_t
*
)
malloc
(
db_halflength
*
sizeof
(
int16_t
))
;
for
(
symbol_id
=
0
;
symbol_id
<
fp
->
symbols_per_tti
;
symbol_id
++
)
{
// Do compression of the two parts and generate data blocks - rxdataF
for
(
element_id
=
0
;
element_id
<
db_halflength
;
element_id
++
)
{
//
data_block[element_id] = lin2alaw[ (rxdataF[0][blockoffsetF+element_id] & 0xffff) + 32768 ];
//
data_block[element_id] |= lin2alaw[ (rxdataF[0][blockoffsetF+element_id]>>16) + 32768 ]<<8;
data_block
[
element_id
]
=
lin2alaw
[
(
rxdataF
[
0
][
blockoffsetF
+
element_id
]
&
0xffff
)
+
32768
];
data_block
[
element_id
]
|=
lin2alaw
[
(
rxdataF
[
0
][
blockoffsetF
+
element_id
]
>>
16
)
+
32768
]
<<
8
;
//
data_block[element_id+db_halflength] = lin2alaw[ (
t
xdataF[0][slotoffsetF+element_id] & 0xffff) + 32768 ];
//
data_block[element_id+db_halflength] |= lin2alaw[ (
t
xdataF[0][slotoffsetF+element_id]>>16) + 32768 ]<<8;
data_block
[
element_id
+
db_halflength
]
=
lin2alaw
[
(
r
xdataF
[
0
][
slotoffsetF
+
element_id
]
&
0xffff
)
+
32768
];
data_block
[
element_id
+
db_halflength
]
|=
lin2alaw
[
(
r
xdataF
[
0
][
slotoffsetF
+
element_id
]
>>
16
)
+
32768
]
<<
8
;
}
// Update information in generated packet
ul_
packet
->
frame_status
.
sym_num
=
symbol_id
;
ul_
header
->
frame_status
.
sym_num
=
symbol_id
;
// Write the packet(s) to the fronthaul
...
...
@@ -131,7 +144,7 @@ void send_IF4(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, uint16_t packet_type) {
void
recv_IF4
(
PHY_VARS_eNB
*
eNB
,
eNB_rxtx_proc_t
*
proc
,
uint16_t
*
packet_type
,
uint32_t
*
symbol_number
)
{
*
packet_type
=
0
;
int16_t
*
data_block
=
NULL
;
//
int16_t *data_block=NULL;
// Read packet(s) from the fronthaul
// for(i=0; i<fp->symbols_per_tti; i++) {
...
...
@@ -166,7 +179,7 @@ void recv_IF4(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, uint16_t *packet_type, u
return
;
}
void
gen_IF4_dl_
packet
(
IF4_dl_
packet
_t
*
dl_packet
,
eNB_rxtx_proc_t
*
proc
)
{
void
gen_IF4_dl_
header
(
IF4_dl_
header
_t
*
dl_packet
,
eNB_rxtx_proc_t
*
proc
)
{
// Set Type and Sub-Type
dl_packet
->
type
=
IF4_PACKET_TYPE
;
dl_packet
->
sub_type
=
IF4_PDLFFT
;
...
...
@@ -183,10 +196,10 @@ void gen_IF4_dl_packet(IF4_dl_packet_t *dl_packet, eNB_rxtx_proc_t *proc) {
dl_packet
->
frame_status
.
rsvd
=
0
;
// Set frame check sequence
dl_packet
->
fcs
=
0
;
}
void
gen_IF4_ul_
packet
(
IF4_ul_
packet
_t
*
ul_packet
,
eNB_rxtx_proc_t
*
proc
)
{
void
gen_IF4_ul_
header
(
IF4_ul_
header
_t
*
ul_packet
,
eNB_rxtx_proc_t
*
proc
)
{
// Set Type and Sub-Type
ul_packet
->
type
=
IF4_PACKET_TYPE
;
ul_packet
->
sub_type
=
IF4_PULFFT
;
...
...
@@ -207,10 +220,10 @@ void gen_IF4_ul_packet(IF4_ul_packet_t *ul_packet, eNB_rxtx_proc_t *proc) {
ul_packet
->
gain0
.
rsvd
=
0
;
// Set frame check sequence
ul_packet
->
fcs
=
0
;
}
void
gen_IF4_prach_
packet
(
IF4_prach_
packet
_t
*
prach_packet
,
eNB_rxtx_proc_t
*
proc
)
{
void
gen_IF4_prach_
header
(
IF4_prach_
header
_t
*
prach_packet
,
eNB_rxtx_proc_t
*
proc
)
{
// Set Type and Sub-Type
prach_packet
->
type
=
IF4_PACKET_TYPE
;
prach_packet
->
sub_type
=
IF4_PRACH
;
...
...
@@ -226,5 +239,5 @@ void gen_IF4_prach_packet(IF4_prach_packet_t *prach_packet, eNB_rxtx_proc_t *pro
prach_packet
->
prach_conf
.
exponent
=
0
;
// Set frame check sequence
prach_packet
->
fcs
=
0
;
}
This diff is collapsed.
Click to expand it.
openair1/PHY/LTE_TRANSPORT/if4_tools.h
+
18
−
18
View file @
fc13e200
...
...
@@ -93,7 +93,7 @@ struct IF4_lte_prach_conf {
typedef
struct
IF4_lte_prach_conf
IF4_lte_prach_conf_t
;
#define sizeof_IF4_lte_prach_conf_t 4
struct
IF4_dl_
packet
{
struct
IF4_dl_
header
{
/// Destination Address
/// Source Address
...
...
@@ -107,15 +107,15 @@ struct IF4_dl_packet {
/// Frame Status
IF4_frame_status_t
frame_status
;
/// Data Blocks
int16_t
*
data_block
;
/// Frame Check Sequence
uint32_t
fcs
;
};
typedef
struct
IF4_dl_
packet
IF4_dl_
packet
_t
;
#define sizeof_IF4_dl_
packet
_t 1
8
typedef
struct
IF4_dl_
header
IF4_dl_
header
_t
;
#define sizeof_IF4_dl_
header
_t 1
2
struct
IF4_ul_
packet
{
struct
IF4_ul_
header
{
/// Destination Address
/// Source Address
...
...
@@ -145,15 +145,15 @@ struct IF4_ul_packet {
/// Gain 7
IF4_gain_t
gain7
;
/// Data Blocks
int16_t
*
data_block
;
/// Frame Check Sequence
uint32_t
fcs
;
};
typedef
struct
IF4_ul_
packet
IF4_ul_
packet
_t
;
#define sizeof_IF4_ul_
packet
_t
34
typedef
struct
IF4_ul_
header
IF4_ul_
header
_t
;
#define sizeof_IF4_ul_
header
_t
28
struct
IF4_prach_
packet
{
struct
IF4_prach_
header
{
/// Destination Address
/// Source Address
...
...
@@ -167,19 +167,19 @@ struct IF4_prach_packet {
/// LTE Prach Configuration
IF4_lte_prach_conf_t
prach_conf
;
/// Prach Data Block (one antenna)
int16_t
*
data_block
;
/// Frame Check Sequence
uint32_t
fcs
;
};
typedef
struct
IF4_prach_
packet
IF4_prach_
packet
_t
;
#define sizeof_IF4_prach_
packet
_t 1
8
typedef
struct
IF4_prach_
header
IF4_prach_
header
_t
;
#define sizeof_IF4_prach_
header
_t 1
2
void
gen_IF4_dl_
packet
(
IF4_dl_
packet
_t
*
,
eNB_rxtx_proc_t
*
);
void
gen_IF4_dl_
header
(
IF4_dl_
header
_t
*
,
eNB_rxtx_proc_t
*
);
void
gen_IF4_ul_
packet
(
IF4_ul_
packet
_t
*
,
eNB_rxtx_proc_t
*
);
void
gen_IF4_ul_
header
(
IF4_ul_
header
_t
*
,
eNB_rxtx_proc_t
*
);
void
gen_IF4_prach_
packet
(
IF4_prach_
packet
_t
*
,
eNB_rxtx_proc_t
*
);
void
gen_IF4_prach_
header
(
IF4_prach_
header
_t
*
,
eNB_rxtx_proc_t
*
);
void
send_IF4
(
PHY_VARS_eNB
*
,
eNB_rxtx_proc_t
*
,
uint16_t
);
...
...
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