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
e4f9becc
Commit
e4f9becc
authored
Jan 26, 2018
by
lfarizav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementation of adc using SSE intrinsic functions
parent
e8ef1cdb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
49 deletions
+13
-49
openair1/SIMULATION/RF/adc.c
openair1/SIMULATION/RF/adc.c
+6
-44
openair1/SIMULATION/TOOLS/multipath_channel.c
openair1/SIMULATION/TOOLS/multipath_channel.c
+1
-1
targets/SIMU/USER/channel_sim.c
targets/SIMU/USER/channel_sim.c
+6
-4
No files found.
openair1/SIMULATION/RF/adc.c
View file @
e4f9becc
...
...
@@ -93,39 +93,6 @@ void adc_SSE_float(float *r_re[2],
unsigned
int
nb_rx_antennas
,
unsigned
int
length
,
unsigned
char
B
)
{
int
i
;
int
aa
;
//FILE *file1=NULL;
//FILE *file2=NULL;
//file1 = fopen("adc1","w+");
//file1 = fopen("adc2","w+");
float
gain
=
(
float
)(
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_SSE_float_test
(
float
*
r_re
[
2
],
float
*
r_im
[
2
],
unsigned
int
input_offset
,
unsigned
int
output_offset
,
unsigned
int
**
output
,
unsigned
int
nb_rx_antennas
,
unsigned
int
length
,
unsigned
char
B
)
{
int
i
;
int
aa
;
...
...
@@ -140,20 +107,15 @@ void adc_SSE_float_test(float *r_re[2],
r_re128
=
_mm_mul_ps
(
r_re128
,
gain128
);
r_im128
=
_mm_mul_ps
(
r_im128
,
gain128
);
r_re128i
=
_mm_cvtps_epi32
(
r_re128
);
r_im128i
=
_mm_cvtps_epi32
(
r_im128
);
output128
=
_mm_packs_epi32
(
r_im128i
,
r_re128i
);
_mm_store_si128
(
&
output
[
aa
][
4
*
i
+
input_offset
],
output128
);
}
}
for
(
i
=
0
;
i
<
(
length
>>
2
);
i
++
)
{
for
(
aa
=
0
;
aa
<
nb_rx_antennas
;
aa
++
)
{
r_im128i
=
_mm_cvtps_epi32
(
r_im128
);
r_re128i
=
_mm_packs_epi32
(
r_re128i
,
r_re128i
);
r_im128i
=
_mm_packs_epi32
(
r_im128i
,
r_im128i
);
output128
=
_mm_unpacklo_epi16
(
r_re128i
,
r_im128i
);
_mm_storeu_si128
((
__m128i
*
)
&
output
[
aa
][
4
*
i
+
output_offset
],
output128
);
}
}
/*for (i=0; i<length; i++) {
printf("output[%d] %d\n",i,((short *)output[0])[((4*i+output_offset)<<1)]);
}*/
}
void
adc_freq
(
double
*
r_re
[
2
],
double
*
r_im
[
2
],
unsigned
int
input_offset
,
...
...
openair1/SIMULATION/TOOLS/multipath_channel.c
View file @
e4f9becc
...
...
@@ -715,7 +715,7 @@ void multipath_channel_prach(channel_desc_t *desc,
random_channel
(
desc
,
0
);
//Find a(l)
freq_channel_prach
(
desc
,
nb_rb
,
n_samples
,
prach_fmt
,
n_ra_prb
);
//Find desc->chF_prach
}
for
(
f
=
0
;
f
<
leng
ht
;
f
++
)
{
for
(
f
=
0
;
f
<
leng
th
;
f
++
)
{
rx_tmp
.
x
=
0
;
rx_tmp
.
y
=
0
;
for
(
ii
=
0
;
ii
<
desc
->
nb_rx
;
ii
++
)
{
...
...
targets/SIMU/USER/channel_sim.c
View file @
e4f9becc
...
...
@@ -524,8 +524,6 @@ void do_DL_sig_freq(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][
//}
//write_output("chsim_txsigF_DL.m","chsm_txsF_DL", PHY_vars_eNB_g[eNB_id][CC_id]->common_vars.txdataF[0][0],10*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti,1,16);
//for (int idx=0;idx<10;idx++) printf("dumping DL raw tx subframe (input) %d: s_f[%d] = (%f,%f)\n", subframe, idx, s_re_f[0][idx],s_im_f[0][idx]);
#ifdef DEBUG_SIM
LOG_D
(
OCM
,
"[SIM][DL] eNB %d (CCid %d): tx_pwr %.1f dBm/RE (target %d dBm/RE), for subframe %d
\n
"
,
eNB_id
,
CC_id
,
...
...
@@ -544,7 +542,8 @@ void do_DL_sig_freq(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][
frame_parms
->
ofdm_symbol_size
*
frame_parms
->
symbols_per_tti
,
hold_channel
,
eNB_id
,
UE_id
,
CC_id
,
subframe
&
0x1
);
#endif
stop_meas
(
&
eNB2UE
[
eNB_id
][
UE_id
][
CC_id
]
->
DL_multipath_channel_freq
);
//for (int idx=0;idx<10;idx++) printf("dumping DL raw tx subframe (input) %d: s_f[%d] = (%f,%f)\n", subframe, idx, s_re_f[0][idx],s_im_f[0][idx]);
//for (int idx=0;idx<10;idx++) printf("dumping DL raw tx subframe (input) %d: r_f[%d] = (%f,%f)\n", subframe, idx, r_re0_f[0][idx],r_im0_f[0][idx]);
/*clock_t stop=clock();
printf("multipath_channel DL time is %f s, AVERAGE time is %f s, count %d, sum %e\n",(float) (stop-start)/CLOCKS_PER_SEC,(float) (sum+stop-start)/(count*CLOCKS_PER_SEC),count,sum+stop-start);
sum=(sum+stop-start);*/
...
...
@@ -624,6 +623,7 @@ void do_DL_sig_freq(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][
12
.
0
*
frame_parms
->
N_RB_DL
);
#endif
stop_meas
(
&
eNB2UE
[
eNB_id
][
UE_id
][
CC_id
]
->
DL_rf_rx_simple_freq
);
//for (int idx=0;idx<10;idx++) printf("dumping DL raw tx subframe (input) %d: r_f[%d] = (%f,%f)\n", subframe, idx, r_re0_f[0][idx],r_im0_f[0][idx]);
//print_meas (&eNB2UE[eNB_id][UE_id][CC_id]->DL_rf_rx_simple_freq,"[DL][rf_rx_simple_freq]", &eNB2UE[eNB_id][UE_id][CC_id]->DL_rf_rx_simple_freq, &eNB2UE[eNB_id][UE_id][CC_id]->DL_rf_rx_simple_freq);
/*clock_t stop=clock();
...
...
@@ -694,8 +694,10 @@ void do_DL_sig_freq(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][
12
);
#endif
stop_meas
(
&
eNB2UE
[
eNB_id
][
UE_id
][
CC_id
]
->
DL_adc
);
//for (int idx=0;idx<10;idx++) printf("dumping DL raw subframe %d: r_re_p_f[%d] = (%e,%e)\n", subframe, idx, r_re_p_f[0][idx], r_im_p_f[0][idx]);
//for (int idx=0;idx<10;idx++) printf("dumping DL raw subframe %d: rxdataF0[%d] = (%d,%d)\n", subframe, idx, ((short*)&rxdataF[0][sf_offset+idx])[0], ((short*)&rxdataF[0][sf_offset+idx])[1]);
//print_meas (&eNB2UE[eNB_id][UE_id][CC_id]->DL_adc,"[DL][adc]", &eNB2UE[eNB_id][UE_id][CC_id]->DL_adc, &eNB2UE[eNB_id][UE_id][CC_id]->DL_adc);
//for (int idx=0;idx<10;idx++) printf("dumping DL raw rx subframe %d: rxdataF[%d] = (%d,%d)=====>%s
\n", subframe, idx, ((short*)&rxdataF[0][sf_offset+idx])[0], ((short*)&rxdataF[0][sf_offset+idx])[1],(((((r_re_p_f[0][idx]<0)&&(((short*)&rxdataF[0][sf_offset+idx])[0]<0))||((r_re_p_f[0][idx]>=0)&&(((short*)&rxdataF[0][sf_offset+idx])[0]>=0))))&&(((r_im_p_f[0][idx]<0)&&(((short*)&rxdataF[0][sf_offset+idx])[1]<0))||((r_im_p_f[0][idx]>=0)&&(((short*)&rxdataF[0][sf_offset+idx])[1]>=0))))?"OK":"ERROR"
);
//for (int idx=0;idx<10;idx++) printf("dumping DL raw rx subframe %d: rxdataF[%d] = (%d,%d)=====>%s
,txdataF[%d] = (%d,%d), r_re_im_p_f(%e,%e)\n", subframe, idx, ((short*)&rxdataF[0][sf_offset+idx])[0], ((short*)&rxdataF[0][sf_offset+idx])[1],(((((r_re_p_f[0][idx]<0)&&(((short*)&rxdataF[0][sf_offset+idx])[0]<0))||((r_re_p_f[0][idx]>=0)&&(((short*)&rxdataF[0][sf_offset+idx])[0]>=0))))&&(((r_im_p_f[0][idx]<0)&&(((short*)&rxdataF[0][sf_offset+idx])[1]<0))||((r_im_p_f[0][idx]>=0)&&(((short*)&rxdataF[0][sf_offset+idx])[1]>=0))))?"OK":"ERROR",idx,((short*)&txdataF[0][sf_offset+idx])[0],((short*)&txdataF[0][sf_offset+idx])[1],r_re_p_f[0][idx],r_im_p_f[0][idx]
);
//write_output("chsim_rxsigF_subframe0.m","chsm_rxsF0", PHY_vars_UE_g[UE_id][CC_id]->common_vars.common_vars_rx_data_per_thread[0].rxdataF[0],10*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti,1,16);
//write_output("chsim_rxsigF_subframe1.m","chsm_rxsF1", PHY_vars_UE_g[UE_id][CC_id]->common_vars.common_vars_rx_data_per_thread[1].rxdataF[0],10*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti,1,16);
...
...
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