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
alex037yang
OpenXG-RAN
Commits
7df2571f
Commit
7df2571f
authored
7 years ago
by
lfarizav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
solving memory allocation for rxdataF at eNB
parent
dc931f87
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
37 deletions
+71
-37
openair1/PHY/INIT/lte_init.c
openair1/PHY/INIT/lte_init.c
+5
-7
openair1/PHY/LTE_TRANSPORT/drs_modulation.c
openair1/PHY/LTE_TRANSPORT/drs_modulation.c
+1
-1
openair1/PHY/LTE_TRANSPORT/if4_tools.c
openair1/PHY/LTE_TRANSPORT/if4_tools.c
+3
-1
openair1/PHY/TOOLS/file_output.c
openair1/PHY/TOOLS/file_output.c
+5
-0
openair1/SCHED/phy_procedures_lte_ue.c
openair1/SCHED/phy_procedures_lte_ue.c
+1
-1
openair1/SIMULATION/RF/adc.c
openair1/SIMULATION/RF/adc.c
+13
-4
targets/SIMU/USER/channel_sim.c
targets/SIMU/USER/channel_sim.c
+43
-23
No files found.
openair1/PHY/INIT/lte_init.c
View file @
7df2571f
...
...
@@ -1165,7 +1165,7 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
printf
(
"[lte_init_f] address of rxdataF[i] in memory: %p, thread %d, antenna %d
\n
"
,
&
common_vars
->
common_vars_rx_data_per_thread
[
0
].
rxdataF
[
i
],
0
,
i
);
}
//rxdata_temp
//rxdata_temp
. Please remove this dummy allocation when all arrays are size fixed. If not, the multichannel does not work.
rxdataF_temp
=
(
int32_t
**
)
malloc16
(
fp
->
nb_antennas_rx
*
sizeof
(
int32_t
*
)
);
for
(
i
=
0
;
i
<
fp
->
nb_antennas_rx
;
i
++
)
{
rxdataF_temp
[
i
]
=
(
int32_t
*
)
malloc16_clear
((
14313
)
*
sizeof
(
int32_t
));
...
...
@@ -1452,8 +1452,8 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
if
(
eNB
->
node_function
!=
NGFI_RCC_IF4p5
)
common_vars
->
txdata
[
eNB_id
]
=
(
int32_t
**
)
malloc16
(
fp
->
nb_antennas_tx
*
sizeof
(
int32_t
*
));
common_vars
->
txdataF
[
eNB_id
]
=
(
int32_t
**
)
malloc16
(
NB_ANTENNA_PORTS_ENB
*
sizeof
(
int32_t
*
));
common_vars
->
txdataF_BF
[
eNB_id
]
=
(
int32_t
**
)
malloc16
(
fp
->
nb_antennas_tx
*
sizeof
(
int32_t
*
));
common_vars
->
txdataF
[
eNB_id
]
=
(
int32_t
**
)
malloc16
(
NB_ANTENNA_PORTS_ENB
*
sizeof
(
int32_t
*
));
common_vars
->
txdataF_BF
[
eNB_id
]
=
(
int32_t
**
)
malloc16
(
fp
->
nb_antennas_tx
*
sizeof
(
int32_t
*
));
if
(
eNB
->
node_function
!=
NGFI_RRU_IF5
)
{
for
(
i
=
0
;
i
<
NB_ANTENNA_PORTS_ENB
;
i
++
)
{
...
...
@@ -1512,11 +1512,12 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
common_vars
->
rxdata
[
eNB_id
]
=
(
int32_t
**
)
malloc16
(
fp
->
nb_antennas_rx
*
sizeof
(
int32_t
*
)
);
common_vars
->
rxdata_7_5kHz
[
eNB_id
]
=
(
int32_t
**
)
malloc16
(
fp
->
nb_antennas_rx
*
sizeof
(
int32_t
*
)
);
}
if
(
eNB
->
node_function
!=
NGFI_RRU_IF5
)
common_vars
->
rxdataF
[
eNB_id
]
=
(
int32_t
**
)
malloc16
(
fp
->
nb_antennas_rx
*
sizeof
(
int32_t
*
)
);
for
(
i
=
0
;
i
<
fp
->
nb_antennas_rx
;
i
++
)
{
if
(
eNB
->
node_function
!=
NGFI_RCC_IF4p5
)
{
// allocate 2 subframes of I/Q signal data (time) if not an RCC (no time-domain signals)
common_vars
->
rxdata
[
eNB_id
][
i
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
samples_per_tti
*
10
*
sizeof
(
int32_t
)
);
...
...
@@ -1525,17 +1526,14 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
// allocate 2 subframes of I/Q signal data (time, 7.5 kHz offset)
common_vars
->
rxdata_7_5kHz
[
eNB_id
][
i
]
=
(
int32_t
*
)
malloc16_clear
(
2
*
fp
->
samples_per_tti
*
2
*
sizeof
(
int32_t
)
);
}
if
(
eNB
->
node_function
!=
NGFI_RRU_IF5
)
// allocate 2 subframes of I/Q signal data (frequency)
common_vars
->
rxdataF
[
eNB_id
][
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
(
2
*
fp
->
ofdm_symbol_size
*
fp
->
symbols_per_tti
)
);
#ifdef DEBUG_PHY
printf
(
"[openair][LTE_PHY][INIT] common_vars->rxdata[%d][%d] = %p (%lu bytes)
\n
"
,
eNB_id
,
i
,
common_vars
->
rxdata
[
eNB_id
][
i
],
fp
->
samples_per_tti
*
10
*
sizeof
(
int32_t
));
if
(
eNB
->
node_function
!=
NGFI_RRU_IF5
)
printf
(
"[openair][LTE_PHY][INIT] common_vars->rxdata_7_5kHz[%d][%d] = %p (%lu bytes)
\n
"
,
eNB_id
,
i
,
common_vars
->
rxdata_7_5kHz
[
eNB_id
][
i
],
fp
->
samples_per_tti
*
2
*
sizeof
(
int32_t
));
#endif
common_vars
->
rxdataF
[
eNB_id
][
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
(
fp
->
ofdm_symbol_size
*
fp
->
symbols_per_tti
)
);
}
...
...
This diff is collapsed.
Click to expand it.
openair1/PHY/LTE_TRANSPORT/drs_modulation.c
View file @
7df2571f
...
...
@@ -141,7 +141,7 @@ int generate_drs_pusch(PHY_VARS_UE *ue,
(
ref_im
*
alpha_re
[
alpha_ind
]))
>>
15
);
((
short
*
)
txdataF
)[
2
*
(
symbol_offset
+
re_offset
)]
=
(
short
)
((((
short
*
)
txdataF
)[
2
*
(
symbol_offset
+
re_offset
)]
*
(
int32_t
)
amp
)
>>
15
);
((
short
*
)
txdataF
)[
2
*
(
symbol_offset
+
re_offset
)
+
1
]
=
(
short
)
((((
short
*
)
txdataF
)[
2
*
(
symbol_offset
+
re_offset
)
+
1
]
*
(
int32_t
)
amp
)
>>
15
);
printf
(
"[drs_modulation]txdataF drs(%d,%d)
\n
"
,((
short
*
)
txdataF
)[
2
*
(
symbol_offset
+
re_offset
)],((
short
*
)
txdataF
)[
2
*
(
symbol_offset
+
re_offset
)
+
1
]);
//printf("[drs_modulation]subframe %d, txdataF[%d] drs(%d,%d)\n",subframe,(symbol_offset + re_offset)
,((short*) txdataF)[2*(symbol_offset + re_offset)],((short*) txdataF)[2*(symbol_offset + re_offset)+1]);
alpha_ind
=
(
alpha_ind
+
cyclic_shift
);
...
...
This diff is collapsed.
Click to expand it.
openair1/PHY/LTE_TRANSPORT/if4_tools.c
View file @
7df2571f
...
...
@@ -51,11 +51,13 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
int16_t **rxsigF = eNB->prach_vars.rxsigF;
void *tx_buffer = eNB->ifbuffer.tx[subframe&1];
void *tx_buffer_prach = eNB->ifbuffer.tx_prach;
uint16_t symbol_id=0, element_id=0;
uint16_t db_fulllength, db_halflength;
int slotoffsetF=0, blockoffsetF=0;
// write_output("sendif405_rxsigF_UL.m","sendif4p5_rxsF_UL", &eNB->common_vars.rxdata[0][0],10*fp->ofdm_symbol_size*fp->symbols_per_tti,1,16);
//write_output("sendif405_txsigF_UL.m","sendif4p5_txsF_UL", &eNB->common_vars.txdata[0][0],10*fp->ofdm_symbol_size*fp->symbols_per_tti,1,16);
uint16_t *data_block=NULL, *i=NULL;
IF4p5_header_t *packet_header=NULL;
...
...
This diff is collapsed.
Click to expand it.
openair1/PHY/TOOLS/file_output.c
View file @
7df2571f
...
...
@@ -79,6 +79,11 @@ int write_output(const char *fname,const char *vname,void *data,int length,int d
fprintf
(
fp
,
"%d
\t
%d
\t
%d
\n
"
,
i
/
2
,((
short
*
)
data
)[
i
],((
short
*
)
data
)[
i
+
1
]);
}
break
;
/*case 17:
for (i=0; i<length; i++)) {
fprintf(fp,"%d\t%d\t\n",i,*data[i]);
}
break;*/
case
2
:
// real 32-bit
for
(
i
=
0
;
i
<
length
;
i
+=
dec
)
{
fprintf
(
fp
,
"%d
\n
"
,((
int
*
)
data
)[
i
]);
...
...
This diff is collapsed.
Click to expand it.
openair1/SCHED/phy_procedures_lte_ue.c
View file @
7df2571f
...
...
@@ -1559,7 +1559,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
frame_tx
,
subframe_tx
);
printf
(
"[phy_procedures_lte_ue] ue->ulsch_Msg3_active [%d] %d
\n
"
,
eNB_id
,
ue
->
ulsch_Msg3_active
[
eNB_id
]);
if
(
ue
->
mac_enabled
==
1
)
{
if
((
ue
->
ulsch_Msg3_active
[
eNB_id
]
==
1
)
&&
(
ue
->
ulsch_Msg3_frame
[
eNB_id
]
==
frame_tx
)
&&
...
...
This diff is collapsed.
Click to expand it.
openair1/SIMULATION/RF/adc.c
View file @
7df2571f
...
...
@@ -18,6 +18,9 @@
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#define DEBUG_ADC
void
adc
(
double
*
r_re
[
2
],
double
*
r_im
[
2
],
...
...
@@ -31,21 +34,27 @@ void adc(double *r_re[2],
int
i
;
int
aa
;
//FILE *file1=NULL;
//FILE *file2=NULL;
//file1 = fopen("adc1","w+");
//file1 = fopen("adc2","w+");
double
gain
=
(
double
)(
1
<<
(
B
-
1
));
//double gain = 1.0;
//for (i=0;i<length;i++){
// fprintf(file1,"%d\t%d\t%d\t%d\t%d\n",i,(short)(r_re[0][i+input_offset]*gain),(short)(r_im[0][i+input_offset]*gain),output_offset/14336,i+output_offset);
// }
for
(
i
=
0
;
i
<
length
;
i
++
)
{
for
(
aa
=
0
;
aa
<
nb_rx_antennas
;
aa
++
)
{
((
short
*
)
output
[
aa
])[((
i
+
output_offset
)
<<
1
)]
=
(
short
)(
r_re
[
aa
][
i
+
input_offset
]
*
gain
);
((
short
*
)
output
[
aa
])[
1
+
((
i
+
output_offset
)
<<
1
)]
=
(
short
)(
r_im
[
aa
][
i
+
input_offset
]
*
gain
);
//if (i>10 && i<20)
//printf("Adc outputs %d (%d,%d)-(%d,%d)\n",i+output_offset,((short *)output[aa])[((i+output_offset)<<1)],((short *)output[aa])[1+((i+output_offset)<<1)],(short)(r_re[aa][i+input_offset]*gain),(short)(r_im[aa][i+input_offset]*gain));
if
((
r_re
[
aa
][
i
+
input_offset
]
*
gain
)
>
30000
)
{
//("Adc outputs %d %e %d \n",i,((short *)output[0])[((i+output_offset)<<1)], ((i+output_offset)<<1) );
}
}
//printf("Adc outputs %d %e %d \n",i,((short *)output[0])[((i+output_offset)<<1)], ((i+output_offset)<<1) );
}
}
}
/*void adc_freq(double *r_re[2],
double *r_im[2],
...
...
This diff is collapsed.
Click to expand it.
targets/SIMU/USER/channel_sim.c
View file @
7df2571f
This diff is collapsed.
Click to expand it.
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