1. fix UCP4008_SL new feature#1412#;
2. add case46; 3. modify case5,21,22,23,45,48; 4. test case:5,21,44,46,48
This commit is contained in:
parent
476ad121fb
commit
b4c5cffb73
@ -218,7 +218,7 @@ static inline void msg_transfer_queue_polling(void)
|
|||||||
|
|
||||||
#define CELL_SETUP_TYPE_SIMULATION (0x5a6b7c8d)
|
#define CELL_SETUP_TYPE_SIMULATION (0x5a6b7c8d)
|
||||||
|
|
||||||
void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core)
|
void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core, uint8_t frame_type)
|
||||||
{
|
{
|
||||||
uint32_t size = 32;
|
uint32_t size = 32;
|
||||||
char* buf;
|
char* buf;
|
||||||
@ -230,6 +230,8 @@ void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core)
|
|||||||
handler.inst_id = 0;
|
handler.inst_id = 0;
|
||||||
handler.type_id = CU_SPLIT;
|
handler.type_id = CU_SPLIT;
|
||||||
|
|
||||||
|
sleep(1);
|
||||||
|
|
||||||
int32_t ret = msg_transfer_send_start(handler.value,cu_flag);
|
int32_t ret = msg_transfer_send_start(handler.value,cu_flag);
|
||||||
|
|
||||||
/************C_PLANE***************/
|
/************C_PLANE***************/
|
||||||
@ -248,6 +250,7 @@ void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core)
|
|||||||
*(uint32_t*)(buf + 16) = scs_id;
|
*(uint32_t*)(buf + 16) = scs_id;
|
||||||
*(uint32_t*)(buf + 20) = cell_id;
|
*(uint32_t*)(buf + 20) = cell_id;
|
||||||
*(uint32_t*)(buf + 24) = run_core;
|
*(uint32_t*)(buf + 24) = run_core;
|
||||||
|
*(uint32_t*)(buf + 28) = frame_type;
|
||||||
|
|
||||||
ret = msg_transfer_send_msg(handler.value, cu_flag, (uint8_t *)buf, offset, size);
|
ret = msg_transfer_send_msg(handler.value, cu_flag, (uint8_t *)buf, offset, size);
|
||||||
ret = msg_transfer_send_end(handler.value,cu_flag);
|
ret = msg_transfer_send_end(handler.value,cu_flag);
|
||||||
@ -283,10 +286,9 @@ int32_t test_case(uint32_t argc, int32_t* argvp)
|
|||||||
uint8_t scs_id = 1; // NR 30K
|
uint8_t scs_id = 1; // NR 30K
|
||||||
uint8_t cell_id = 0;
|
uint8_t cell_id = 0;
|
||||||
uint32_t run_ape = 0xF;
|
uint32_t run_ape = 0xF;
|
||||||
|
uint8_t frame_type = 1; // tdd
|
||||||
|
|
||||||
sleep(1);
|
cell_setup_simulation(scs_id, cell_id, run_ape, frame_type); /* the first cell */
|
||||||
|
|
||||||
cell_setup_simulation(scs_id, cell_id, run_ape); /* the first cell */
|
|
||||||
UCP_PRINT_DEBUG("call cell setup(1)");
|
UCP_PRINT_DEBUG("call cell setup(1)");
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
@ -297,7 +299,8 @@ int32_t test_case(uint32_t argc, int32_t* argvp)
|
|||||||
scs_id = 1; // NR 30K
|
scs_id = 1; // NR 30K
|
||||||
cell_id = 1;
|
cell_id = 1;
|
||||||
run_ape = 0xF0;
|
run_ape = 0xF0;
|
||||||
cell_setup_simulation(scs_id, cell_id, run_ape); /* the second cell */
|
uint8_t frame_type = 1; // tdd
|
||||||
|
cell_setup_simulation(scs_id, cell_id, run_ape, frame_type); /* the second cell */
|
||||||
u8_cell_flag = 1;
|
u8_cell_flag = 1;
|
||||||
UCP_PRINT_DEBUG("call cell setup(2)");
|
UCP_PRINT_DEBUG("call cell setup(2)");
|
||||||
}
|
}
|
||||||
|
@ -217,7 +217,7 @@ static inline void msg_transfer_queue_polling(void)
|
|||||||
|
|
||||||
#define CELL_SETUP_TYPE_SIMULATION (0x5a6b7c8d)
|
#define CELL_SETUP_TYPE_SIMULATION (0x5a6b7c8d)
|
||||||
|
|
||||||
void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core)
|
void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core, uint8_t frame_type)
|
||||||
{
|
{
|
||||||
uint32_t size = 32;
|
uint32_t size = 32;
|
||||||
char* buf;
|
char* buf;
|
||||||
@ -229,6 +229,8 @@ void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core)
|
|||||||
handler.inst_id = 0;
|
handler.inst_id = 0;
|
||||||
handler.type_id = CU_SPLIT;
|
handler.type_id = CU_SPLIT;
|
||||||
|
|
||||||
|
sleep(1);
|
||||||
|
|
||||||
int32_t ret = msg_transfer_send_start(handler.value,cu_flag);
|
int32_t ret = msg_transfer_send_start(handler.value,cu_flag);
|
||||||
|
|
||||||
/************C_PLANE***************/
|
/************C_PLANE***************/
|
||||||
@ -238,6 +240,8 @@ void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core)
|
|||||||
return ;
|
return ;
|
||||||
//continue;
|
//continue;
|
||||||
}
|
}
|
||||||
|
UCP_PRINT_DEBUG("availableSize = 0x%x.", availableSize);
|
||||||
|
UCP_PRINT_DEBUG("offset = 0x%x.", offset);
|
||||||
|
|
||||||
*(uint32_t*)(buf + 0) = CELL_SETUP_TYPE_SIMULATION;
|
*(uint32_t*)(buf + 0) = CELL_SETUP_TYPE_SIMULATION;
|
||||||
*(uint32_t*)(buf + 4) = read_stc_local_timer();
|
*(uint32_t*)(buf + 4) = read_stc_local_timer();
|
||||||
@ -245,6 +249,7 @@ void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core)
|
|||||||
*(uint32_t*)(buf + 16) = scs_id;
|
*(uint32_t*)(buf + 16) = scs_id;
|
||||||
*(uint32_t*)(buf + 20) = cell_id;
|
*(uint32_t*)(buf + 20) = cell_id;
|
||||||
*(uint32_t*)(buf + 24) = run_core;
|
*(uint32_t*)(buf + 24) = run_core;
|
||||||
|
*(uint32_t*)(buf + 28) = frame_type;
|
||||||
|
|
||||||
ret = msg_transfer_send_msg(handler.value, cu_flag, (uint8_t *)buf, offset, size);
|
ret = msg_transfer_send_msg(handler.value, cu_flag, (uint8_t *)buf, offset, size);
|
||||||
ret = msg_transfer_send_end(handler.value,cu_flag);
|
ret = msg_transfer_send_end(handler.value,cu_flag);
|
||||||
@ -280,26 +285,24 @@ int32_t test_case(uint32_t argc, int32_t* argvp)
|
|||||||
uint8_t scs_id = 0; // NR 15K
|
uint8_t scs_id = 0; // NR 15K
|
||||||
uint8_t cell_id = 0;
|
uint8_t cell_id = 0;
|
||||||
uint32_t run_ape = 0xF;
|
uint32_t run_ape = 0xF;
|
||||||
|
uint8_t frame_type = 1; // tdd
|
||||||
|
|
||||||
sleep(1);
|
cell_setup_simulation(scs_id, cell_id, run_ape, frame_type); /* the first cell */
|
||||||
|
|
||||||
cell_setup_simulation(scs_id, cell_id, run_ape); /* the first cell */
|
|
||||||
UCP_PRINT_DEBUG("call cell setup(1)");
|
UCP_PRINT_DEBUG("call cell setup(1)");
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
#if 1
|
|
||||||
if ((100000 == gu32_rx_callback_data_cnt) && (0 == u8_cell_flag))
|
if ((100000 == gu32_rx_callback_data_cnt) && (0 == u8_cell_flag))
|
||||||
{
|
{
|
||||||
/* 1st cell build ok after 10s */
|
/* 1st cell build ok after 10s */
|
||||||
scs_id = 0; // NR 15K
|
scs_id = 0; // NR 15K
|
||||||
cell_id = 1;
|
cell_id = 1;
|
||||||
run_ape = 0xF0;
|
run_ape = 0xF0;
|
||||||
cell_setup_simulation(scs_id, cell_id, run_ape); /* the second cell */
|
uint8_t frame_type = 1; // tdd
|
||||||
|
cell_setup_simulation(scs_id, cell_id, run_ape, frame_type); /* the second cell */
|
||||||
u8_cell_flag = 1;
|
u8_cell_flag = 1;
|
||||||
UCP_PRINT_DEBUG("call cell setup(2)");
|
UCP_PRINT_DEBUG("call cell setup(2)");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
msg_transfer_queue_polling();
|
msg_transfer_queue_polling();
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ static inline void msg_transfer_queue_polling(void)
|
|||||||
|
|
||||||
#define CELL_SETUP_TYPE_SIMULATION (0x5a6b7c8d)
|
#define CELL_SETUP_TYPE_SIMULATION (0x5a6b7c8d)
|
||||||
|
|
||||||
void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core)
|
void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core, uint8_t frame_type)
|
||||||
{
|
{
|
||||||
uint32_t size = 32;
|
uint32_t size = 32;
|
||||||
char* buf;
|
char* buf;
|
||||||
@ -229,6 +229,8 @@ void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core)
|
|||||||
handler.inst_id = 0;
|
handler.inst_id = 0;
|
||||||
handler.type_id = CU_SPLIT;
|
handler.type_id = CU_SPLIT;
|
||||||
|
|
||||||
|
sleep(1);
|
||||||
|
|
||||||
int32_t ret = msg_transfer_send_start(handler.value,cu_flag);
|
int32_t ret = msg_transfer_send_start(handler.value,cu_flag);
|
||||||
|
|
||||||
/************C_PLANE***************/
|
/************C_PLANE***************/
|
||||||
@ -238,6 +240,8 @@ void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core)
|
|||||||
return ;
|
return ;
|
||||||
//continue;
|
//continue;
|
||||||
}
|
}
|
||||||
|
UCP_PRINT_DEBUG("availableSize = 0x%x.", availableSize);
|
||||||
|
UCP_PRINT_DEBUG("offset = 0x%x.", offset);
|
||||||
|
|
||||||
*(uint32_t*)(buf + 0) = CELL_SETUP_TYPE_SIMULATION;
|
*(uint32_t*)(buf + 0) = CELL_SETUP_TYPE_SIMULATION;
|
||||||
*(uint32_t*)(buf + 4) = read_stc_local_timer();
|
*(uint32_t*)(buf + 4) = read_stc_local_timer();
|
||||||
@ -245,6 +249,7 @@ void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core)
|
|||||||
*(uint32_t*)(buf + 16) = scs_id;
|
*(uint32_t*)(buf + 16) = scs_id;
|
||||||
*(uint32_t*)(buf + 20) = cell_id;
|
*(uint32_t*)(buf + 20) = cell_id;
|
||||||
*(uint32_t*)(buf + 24) = run_core;
|
*(uint32_t*)(buf + 24) = run_core;
|
||||||
|
*(uint32_t*)(buf + 28) = frame_type;
|
||||||
|
|
||||||
ret = msg_transfer_send_msg(handler.value, cu_flag, (uint8_t *)buf, offset, size);
|
ret = msg_transfer_send_msg(handler.value, cu_flag, (uint8_t *)buf, offset, size);
|
||||||
ret = msg_transfer_send_end(handler.value,cu_flag);
|
ret = msg_transfer_send_end(handler.value,cu_flag);
|
||||||
@ -254,7 +259,7 @@ void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core)
|
|||||||
|
|
||||||
int32_t test_case(uint32_t argc, int32_t* argvp)
|
int32_t test_case(uint32_t argc, int32_t* argvp)
|
||||||
{
|
{
|
||||||
UCP_PRINT_DEBUG("start running testcase 22 (8 ape 15K case).");
|
UCP_PRINT_DEBUG("start running testcase 23 (dual mode case).");
|
||||||
|
|
||||||
osp_read_spe_cfg_file("/ramfs/cfgDat");
|
osp_read_spe_cfg_file("/ramfs/cfgDat");
|
||||||
|
|
||||||
@ -280,26 +285,24 @@ int32_t test_case(uint32_t argc, int32_t* argvp)
|
|||||||
uint8_t scs_id = 1; // NR 30K
|
uint8_t scs_id = 1; // NR 30K
|
||||||
uint8_t cell_id = 0;
|
uint8_t cell_id = 0;
|
||||||
uint32_t run_ape = 0xF;
|
uint32_t run_ape = 0xF;
|
||||||
|
uint8_t frame_type = 1; // tdd
|
||||||
|
|
||||||
sleep(1);
|
cell_setup_simulation(scs_id, cell_id, run_ape, frame_type); /* the first cell */
|
||||||
|
|
||||||
cell_setup_simulation(scs_id, cell_id, run_ape); /* the first cell */
|
|
||||||
UCP_PRINT_DEBUG("call cell setup(1)");
|
UCP_PRINT_DEBUG("call cell setup(1)");
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
#if 1
|
|
||||||
if ((100000 == gu32_rx_callback_data_cnt) && (0 == u8_cell_flag))
|
if ((100000 == gu32_rx_callback_data_cnt) && (0 == u8_cell_flag))
|
||||||
{
|
{
|
||||||
/* 1st cell build ok after 10s */
|
/* 1st cell build ok after 10s */
|
||||||
scs_id = 0; // NR 15K
|
scs_id = 0; // NR 15K
|
||||||
cell_id = 1;
|
cell_id = 1;
|
||||||
run_ape = 0xF0;
|
run_ape = 0xF0;
|
||||||
cell_setup_simulation(scs_id, cell_id, run_ape); /* the second cell */
|
uint8_t frame_type = 1; // tdd
|
||||||
|
cell_setup_simulation(scs_id, cell_id, run_ape, frame_type); /* the second cell */
|
||||||
u8_cell_flag = 1;
|
u8_cell_flag = 1;
|
||||||
UCP_PRINT_DEBUG("call cell setup(2)");
|
UCP_PRINT_DEBUG("call cell setup(2)");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
msg_transfer_queue_polling();
|
msg_transfer_queue_polling();
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ static inline void msg_transfer_queue_polling(void)
|
|||||||
|
|
||||||
#define CELL_SETUP_TYPE_SIMULATION (0x5a6b7c8d)
|
#define CELL_SETUP_TYPE_SIMULATION (0x5a6b7c8d)
|
||||||
|
|
||||||
void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core)
|
void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core, uint8_t frame_type)
|
||||||
{
|
{
|
||||||
uint32_t size = 32;
|
uint32_t size = 32;
|
||||||
char* buf;
|
char* buf;
|
||||||
@ -225,6 +225,7 @@ void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core)
|
|||||||
*(uint32_t*)(buf + 16) = scs_id;
|
*(uint32_t*)(buf + 16) = scs_id;
|
||||||
*(uint32_t*)(buf + 20) = cell_id;
|
*(uint32_t*)(buf + 20) = cell_id;
|
||||||
*(uint32_t*)(buf + 24) = run_core;
|
*(uint32_t*)(buf + 24) = run_core;
|
||||||
|
*(uint32_t*)(buf + 28) = frame_type;
|
||||||
|
|
||||||
ret = msg_transfer_send_msg(handler.value, cu_flag, (uint8_t *)buf, offset, size);
|
ret = msg_transfer_send_msg(handler.value, cu_flag, (uint8_t *)buf, offset, size);
|
||||||
ret = msg_transfer_send_end(handler.value,cu_flag);
|
ret = msg_transfer_send_end(handler.value,cu_flag);
|
||||||
@ -331,7 +332,8 @@ int32_t test_case(uint32_t argc, int32_t* argvp)
|
|||||||
uint8_t scs_id = 1; // NR 30K
|
uint8_t scs_id = 1; // NR 30K
|
||||||
uint8_t cell_id = 0xFF;
|
uint8_t cell_id = 0xFF;
|
||||||
uint32_t run_ape = 0;
|
uint32_t run_ape = 0;
|
||||||
cell_setup_simulation(scs_id, cell_id, run_ape);
|
uint8_t frame_type = 1; // tdd
|
||||||
|
cell_setup_simulation(scs_id, cell_id, run_ape, frame_type);
|
||||||
|
|
||||||
osp_set_task_orx(6, 95);
|
osp_set_task_orx(6, 95);
|
||||||
|
|
||||||
|
1
test/case46/fh_case.txt
Normal file
1
test/case46/fh_case.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
fdd test case
|
398
test/case46/src/testcase46.c
Normal file
398
test/case46/src/testcase46.c
Normal file
@ -0,0 +1,398 @@
|
|||||||
|
// +FHDR------------------------------------------------------------
|
||||||
|
// Copyright (c) 2022 SmartLogic.
|
||||||
|
// ALL RIGHTS RESERVED
|
||||||
|
// -----------------------------------------------------------------
|
||||||
|
// Filename : test.c
|
||||||
|
// Author : xianfeng.du
|
||||||
|
// Created On : 2022-11-25
|
||||||
|
// Last Modified :
|
||||||
|
// -----------------------------------------------------------------
|
||||||
|
// Description:
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// -FHDR------------------------------------------------------------
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <termios.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#include "typedef.h"
|
||||||
|
#include "ucp_printf.h"
|
||||||
|
#include "msg_transfer_mem.h"
|
||||||
|
#include "pet_sm_mgt.h"
|
||||||
|
#include "ucp_handshake.h"
|
||||||
|
#include "ospShell.h"
|
||||||
|
#include "ospLog.h"
|
||||||
|
#include "ospCfgToBin.h"
|
||||||
|
#include "ospTask.h"
|
||||||
|
#include "drv_init.h"
|
||||||
|
#include "ospSwTimer.h"
|
||||||
|
|
||||||
|
uint32_t slot_ind_flag = 0;
|
||||||
|
uint32_t slot_ind_time_flag = 0;
|
||||||
|
uint32_t g_slot_time = 0;
|
||||||
|
uint32_t gu32_value = 0;
|
||||||
|
uint32_t gu32_tick_receive_ctrl = 0;
|
||||||
|
uint32_t gu32_tick_from_tx_ctrl = 0;
|
||||||
|
|
||||||
|
uint32_t rx_callback_data(const char* buf,uint32_t payloadSize)
|
||||||
|
{
|
||||||
|
uint32_t stc_cnt = read_stc_local_timer();
|
||||||
|
uint32_t value = *(uint32_t *)buf;
|
||||||
|
uint16_t sfn = value >> 16;
|
||||||
|
uint16_t slot = value & 0xffff;
|
||||||
|
|
||||||
|
uint32_t tick_from_tx_ctrl = *(uint32_t *)(buf+4);
|
||||||
|
|
||||||
|
slot_ind_flag = 1;
|
||||||
|
gu32_value = value;
|
||||||
|
gu32_tick_receive_ctrl = stc_cnt;
|
||||||
|
gu32_tick_from_tx_ctrl = tick_from_tx_ctrl;
|
||||||
|
uint32_t diff = stc_cnt - tick_from_tx_ctrl;
|
||||||
|
|
||||||
|
if(0 == slot_ind_time_flag)
|
||||||
|
{
|
||||||
|
slot_ind_time_flag = 1;
|
||||||
|
diff = 1000000;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
diff = stc_cnt - g_slot_time;
|
||||||
|
}
|
||||||
|
g_slot_time = stc_cnt;
|
||||||
|
|
||||||
|
if ((diff > 1020000) || (diff < 980000))
|
||||||
|
{
|
||||||
|
UCP_PRINT_ERROR("qNO[%d],sfn[%d],slot[%d],diff[%d]",UCP4008_TRAFFIC_NR_eMBB_DATA,sfn,slot,diff);
|
||||||
|
}
|
||||||
|
return payloadSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t rx1_callback_data(const char* buf,uint32_t payloadSize)
|
||||||
|
{
|
||||||
|
return payloadSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t rx_callback_ctrl(const char* buf,uint32_t payloadSize)
|
||||||
|
{
|
||||||
|
return payloadSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void get_msg_transfer_info(uint16_t port_index, uint16_t inst_id, uint16_t transfer_type, transfer_type_info_s* transfer_type_info_ptr)
|
||||||
|
{
|
||||||
|
queue_info_s c_plane,u_plane;
|
||||||
|
|
||||||
|
switch (transfer_type) {
|
||||||
|
case CU_SPLIT:
|
||||||
|
c_plane.rx_block_size = 0x25800;
|
||||||
|
c_plane.rx_block_num = 32;
|
||||||
|
c_plane.rx_callback = rx_callback_ctrl;
|
||||||
|
c_plane.tx_block_size = 0x8000;
|
||||||
|
c_plane.tx_block_num = 8;
|
||||||
|
c_plane.tx_callback = NULL;
|
||||||
|
|
||||||
|
u_plane.rx_block_size = 0x28000;
|
||||||
|
u_plane.rx_block_num = 8;
|
||||||
|
//u_plane.rx_callback = rx_callback_data;
|
||||||
|
if (0 == inst_id)
|
||||||
|
{
|
||||||
|
u_plane.rx_callback = rx_callback_data;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
u_plane.rx_callback = rx1_callback_data;
|
||||||
|
}
|
||||||
|
u_plane.tx_block_size = 0x28000;
|
||||||
|
u_plane.tx_block_num = 8;
|
||||||
|
u_plane.tx_callback = NULL;
|
||||||
|
|
||||||
|
transfer_type_info_ptr->queue_cplane_info = c_plane;
|
||||||
|
transfer_type_info_ptr->queue_uplane_info = u_plane;
|
||||||
|
break;
|
||||||
|
case OAM:
|
||||||
|
c_plane.rx_block_size = 0x100000;
|
||||||
|
c_plane.rx_block_num = 32;
|
||||||
|
c_plane.rx_callback = rx_callback_oam;
|
||||||
|
c_plane.tx_block_size = 0x8000;
|
||||||
|
c_plane.tx_block_num = 8;
|
||||||
|
c_plane.tx_callback = NULL;
|
||||||
|
|
||||||
|
transfer_type_info_ptr->queue_cplane_info = c_plane;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
UCP_PRINT_ERROR("get_msg_queue_cfg doesn't support transfer_type[%d] .",transfer_type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void msg_transfer_cfg(void)
|
||||||
|
{
|
||||||
|
uint8_t port_id = 0;
|
||||||
|
uint16_t inst_id = 0;
|
||||||
|
uint16_t transfer_type = 0;
|
||||||
|
int32_t handle_id = 0;
|
||||||
|
transfer_type_info_s transfer_type_info;
|
||||||
|
|
||||||
|
for (inst_id=0; inst_id<MAX_INSTANCE_NUM; inst_id++) {
|
||||||
|
/*********************************transfer_type = CU_SPLIT**********************************/
|
||||||
|
transfer_type = CU_SPLIT;
|
||||||
|
get_msg_transfer_info(port_id,inst_id,transfer_type, &transfer_type_info);
|
||||||
|
handle_id = msg_transfer_init(port_id, transfer_type, inst_id, &transfer_type_info);
|
||||||
|
if (handle_id < 0) {
|
||||||
|
UCP_PRINT_ERROR("phy_cfg_init transfer_type:CU_SPLIT, handle_id[0x%08x] error.",handle_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************transfer_type = OAM**********************************/
|
||||||
|
transfer_type = OAM;
|
||||||
|
get_msg_transfer_info(port_id,inst_id,transfer_type, &transfer_type_info);
|
||||||
|
handle_id = msg_transfer_init(port_id, transfer_type, inst_id, &transfer_type_info);
|
||||||
|
if (handle_id < 0) {
|
||||||
|
UCP_PRINT_ERROR("phy_cfg_init transfer_type:OAM, handle_id[0x%08x] error.",handle_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PetSmLocalMgt_t* pPetSmLocalMgt = get_pet_sm_local_mgt();
|
||||||
|
MsgQueueLocalMgt_t* pMsgQueueLocalMgt = get_msg_queue_local_mgt();
|
||||||
|
pPetSmLocalMgt->pSyncInfo->queueCfgFlag = ++pMsgQueueLocalMgt->localSyncInfo.queueCfgFlag;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void msg_transfer_queue_polling(void)
|
||||||
|
{
|
||||||
|
uint8_t port_id = 0;
|
||||||
|
HandleId_t handler;
|
||||||
|
uint16_t cu_flag;
|
||||||
|
uint32_t offset = 0;
|
||||||
|
uint32_t len = 0;
|
||||||
|
uint8_t* msg_ptr;
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < MAX_INSTANCE_NUM; i++) {
|
||||||
|
handler.port_id = port_id;
|
||||||
|
handler.inst_id = i;
|
||||||
|
handler.type_id = CU_SPLIT;
|
||||||
|
cu_flag = C_PLANE;
|
||||||
|
msg_transfer_receive(handler.value, cu_flag, offset, len, &msg_ptr);
|
||||||
|
|
||||||
|
cu_flag = U_PLANE;
|
||||||
|
msg_transfer_receive(handler.value, cu_flag, offset, len, &msg_ptr);
|
||||||
|
|
||||||
|
handler.type_id = OAM;
|
||||||
|
msg_transfer_receive(handler.value, cu_flag, offset, len, &msg_ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define CELL_SETUP_TYPE_SIMULATION (0x5a6b7c8d)
|
||||||
|
|
||||||
|
void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core, uint8_t frame_type)
|
||||||
|
{
|
||||||
|
uint32_t size = 32;
|
||||||
|
char* buf;
|
||||||
|
uint32_t availableSize,offset;
|
||||||
|
|
||||||
|
uint16_t cu_flag = C_PLANE;
|
||||||
|
HandleId_t handler;
|
||||||
|
handler.port_id = 0;
|
||||||
|
handler.inst_id = 0;
|
||||||
|
handler.type_id = CU_SPLIT;
|
||||||
|
|
||||||
|
//usleep(10000);
|
||||||
|
sleep(1);
|
||||||
|
|
||||||
|
int32_t ret = msg_transfer_send_start(handler.value,cu_flag);
|
||||||
|
|
||||||
|
/************C_PLANE***************/
|
||||||
|
ret = msg_transfer_alloc_msg(handler.value, cu_flag, size, &buf, &availableSize, &offset);
|
||||||
|
if ( SUCCESS != ret) {
|
||||||
|
UCP_PRINT_ERROR("cell_setup_simulation call msg_transfer_alloc_msg err.");
|
||||||
|
return ;
|
||||||
|
//continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
*(uint32_t*)(buf + 0) = CELL_SETUP_TYPE_SIMULATION;
|
||||||
|
*(uint32_t*)(buf + 4) = read_stc_local_timer();
|
||||||
|
*(uint32_t*)(buf + 12) = 0; // build cell
|
||||||
|
*(uint32_t*)(buf + 16) = scs_id;
|
||||||
|
*(uint32_t*)(buf + 20) = cell_id;
|
||||||
|
*(uint32_t*)(buf + 24) = run_core;
|
||||||
|
*(uint32_t*)(buf + 28) = frame_type;
|
||||||
|
|
||||||
|
ret = msg_transfer_send_msg(handler.value, cu_flag, (uint8_t *)buf, offset, size);
|
||||||
|
ret = msg_transfer_send_end(handler.value,cu_flag);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ORX_MSG_TYPE_SIMULATION (0xaabb7788)
|
||||||
|
|
||||||
|
void orx_msg_send(void)
|
||||||
|
{
|
||||||
|
uint32_t size = 16;
|
||||||
|
char* buf = NULL;
|
||||||
|
uint32_t availableSize,offset;
|
||||||
|
|
||||||
|
uint16_t cu_flag = C_PLANE;
|
||||||
|
HandleId_t handler;
|
||||||
|
handler.port_id = 0;
|
||||||
|
handler.inst_id = 0;
|
||||||
|
handler.type_id = CU_SPLIT;
|
||||||
|
|
||||||
|
//usleep(10000);
|
||||||
|
//sleep(1);
|
||||||
|
|
||||||
|
int32_t ret = msg_transfer_send_start(handler.value,cu_flag);
|
||||||
|
|
||||||
|
/************C_PLANE***************/
|
||||||
|
ret = msg_transfer_alloc_msg(handler.value, cu_flag, size, &buf, &availableSize, &offset);
|
||||||
|
if ( SUCCESS != ret) {
|
||||||
|
UCP_PRINT_ERROR("cell_setup_simulation call msg_transfer_alloc_msg err.");
|
||||||
|
return ;
|
||||||
|
//continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
*(uint32_t*)(buf + 0) = ORX_MSG_TYPE_SIMULATION;
|
||||||
|
*(uint32_t*)(buf + 4) = read_stc_local_timer();
|
||||||
|
|
||||||
|
ret = msg_transfer_send_msg(handler.value, cu_flag, (uint8_t *)buf, offset, size);
|
||||||
|
ret = msg_transfer_send_end(handler.value,cu_flag);
|
||||||
|
|
||||||
|
UCP_PRINT_DEBUG("start send orx message.");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64_t osp_orx_msg_proc_task(void)
|
||||||
|
{
|
||||||
|
sleep(1);
|
||||||
|
|
||||||
|
orx_msg_send();
|
||||||
|
|
||||||
|
return OSP_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t osp_set_task_orx(uint8_t cpu, uint8_t pri)
|
||||||
|
{
|
||||||
|
OSP_TASKMSG_REG task_reg_tabl;
|
||||||
|
OSP_STATUS ret = OSP_OK;
|
||||||
|
|
||||||
|
if (cpu > 7)
|
||||||
|
{
|
||||||
|
UCP_PRINT_DEBUG("coreid %d beyond 7\n", cpu);
|
||||||
|
return OSP_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(&task_reg_tabl, 0, sizeof(OSP_TASKMSG_REG));
|
||||||
|
task_reg_tabl.TaskId = OspDbgLog+3;
|
||||||
|
strcpy((void *)&task_reg_tabl.TaskName, "OspDbgOrx");
|
||||||
|
task_reg_tabl.TaskPri = RT_NOMSG_PRI(pri);
|
||||||
|
task_reg_tabl.Init = NULL;
|
||||||
|
task_reg_tabl.MainLoop = (OSP_FUNCPTR)osp_orx_msg_proc_task;
|
||||||
|
task_reg_tabl.Cpu = cpu;
|
||||||
|
task_reg_tabl.MsgType = OSP_PROCESS_MSG;
|
||||||
|
|
||||||
|
ret = osp_regtask(&task_reg_tabl);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t test_case(uint32_t argc, int32_t* argvp)
|
||||||
|
{
|
||||||
|
UCP_PRINT_DEBUG("start running testcase 46.");
|
||||||
|
|
||||||
|
osp_read_spe_cfg_file("/ramfs/cfgDat");
|
||||||
|
|
||||||
|
msg_transfer_mem_init();
|
||||||
|
msg_transfer_cfg();
|
||||||
|
ucp_handshake();
|
||||||
|
|
||||||
|
UCP_PRINT_DEBUG("start transfering message.");
|
||||||
|
|
||||||
|
uint32_t size = 100;
|
||||||
|
char* buf;
|
||||||
|
uint32_t availableSize,offset;
|
||||||
|
uint8_t* ptr;
|
||||||
|
|
||||||
|
uint16_t cu_flag = C_PLANE;
|
||||||
|
HandleId_t handler;
|
||||||
|
handler.port_id = 0;
|
||||||
|
handler.inst_id = 0;
|
||||||
|
handler.type_id = CU_SPLIT;
|
||||||
|
|
||||||
|
int32_t ret;
|
||||||
|
uint8_t scs_id = 0; // NR 15K
|
||||||
|
uint8_t cell_id = 0xFF;
|
||||||
|
uint32_t run_ape = 0;
|
||||||
|
uint8_t frame_type = 0; // fdd
|
||||||
|
cell_setup_simulation(scs_id, cell_id, run_ape, frame_type);
|
||||||
|
|
||||||
|
//osp_set_task_orx(6, 95);
|
||||||
|
|
||||||
|
while(1) {
|
||||||
|
msg_transfer_queue_polling();
|
||||||
|
|
||||||
|
if(1 == slot_ind_flag)
|
||||||
|
{
|
||||||
|
slot_ind_flag = 0;
|
||||||
|
|
||||||
|
handler.inst_id = 0;
|
||||||
|
|
||||||
|
/************C_PLANE***************/
|
||||||
|
cu_flag = C_PLANE;
|
||||||
|
ret = msg_transfer_send_start(handler.value,cu_flag);
|
||||||
|
|
||||||
|
ret = msg_transfer_alloc_msg(handler.value, cu_flag, size, &buf, &availableSize, &offset);
|
||||||
|
if ( SUCCESS != ret) {
|
||||||
|
UCP_PRINT_ERROR("0,c_plane alloc error\r\n");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ptr = (uint8_t *)buf;
|
||||||
|
*(uint32_t*)(ptr + 0) = gu32_value;
|
||||||
|
*(uint32_t*)(ptr + 4) = gu32_tick_from_tx_ctrl;
|
||||||
|
*(uint32_t*)(ptr + 8) = gu32_tick_receive_ctrl;
|
||||||
|
*(uint32_t*)(ptr + 12) = read_stc_local_timer();
|
||||||
|
|
||||||
|
ret = msg_transfer_send_msg(handler.value, cu_flag, (uint8_t *)buf, offset, size);
|
||||||
|
if ( SUCCESS != ret) {
|
||||||
|
UCP_PRINT_ERROR("0,c_plane send error\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = msg_transfer_send_end(handler.value,cu_flag);
|
||||||
|
|
||||||
|
/************U_PLANE***************/
|
||||||
|
cu_flag = U_PLANE;
|
||||||
|
ret = msg_transfer_send_start(handler.value,cu_flag);
|
||||||
|
|
||||||
|
ret = msg_transfer_alloc_msg(handler.value, cu_flag, size, &buf, &availableSize, &offset);
|
||||||
|
if ( SUCCESS != ret) {
|
||||||
|
UCP_PRINT_ERROR("0,u_plane alloc error\r\n");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ptr = (uint8_t *)buf;
|
||||||
|
*(uint32_t*)(ptr + 0) = gu32_value;
|
||||||
|
*(uint32_t*)(ptr + 4) = gu32_tick_from_tx_ctrl;
|
||||||
|
*(uint32_t*)(ptr + 8) = gu32_tick_receive_ctrl;
|
||||||
|
*(uint32_t*)(ptr + 12) = read_stc_local_timer();
|
||||||
|
|
||||||
|
ret = msg_transfer_send_msg(handler.value, cu_flag, (uint8_t *)buf, offset, size);
|
||||||
|
if ( SUCCESS != ret) {
|
||||||
|
UCP_PRINT_ERROR("0,u_plane send error\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = msg_transfer_send_end(handler.value,cu_flag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
@ -235,7 +235,7 @@ void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core, u
|
|||||||
|
|
||||||
int32_t test_case(uint32_t argc, int32_t* argvp)
|
int32_t test_case(uint32_t argc, int32_t* argvp)
|
||||||
{
|
{
|
||||||
UCP_PRINT_DEBUG("start running testcase 45.");
|
UCP_PRINT_DEBUG("start running testcase 48.");
|
||||||
|
|
||||||
osp_read_spe_cfg_file("/ramfs/cfgDat");
|
osp_read_spe_cfg_file("/ramfs/cfgDat");
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ static inline void msg_transfer_queue_polling(void)
|
|||||||
|
|
||||||
#define CELL_SETUP_TYPE_SIMULATION (0x5a6b7c8d)
|
#define CELL_SETUP_TYPE_SIMULATION (0x5a6b7c8d)
|
||||||
|
|
||||||
void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core)
|
void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core, uint8_t frame_type)
|
||||||
{
|
{
|
||||||
uint32_t size = 32;
|
uint32_t size = 32;
|
||||||
char* buf;
|
char* buf;
|
||||||
@ -218,6 +218,7 @@ void cell_setup_simulation(uint8_t scs_id, uint8_t cell_id, uint32_t run_core)
|
|||||||
*(uint32_t*)(buf + 16) = scs_id;
|
*(uint32_t*)(buf + 16) = scs_id;
|
||||||
*(uint32_t*)(buf + 20) = cell_id;
|
*(uint32_t*)(buf + 20) = cell_id;
|
||||||
*(uint32_t*)(buf + 24) = run_core;
|
*(uint32_t*)(buf + 24) = run_core;
|
||||||
|
*(uint32_t*)(buf + 28) = frame_type;
|
||||||
|
|
||||||
ret = msg_transfer_send_msg(handler.value, cu_flag, (uint8_t *)buf, offset, size);
|
ret = msg_transfer_send_msg(handler.value, cu_flag, (uint8_t *)buf, offset, size);
|
||||||
ret = msg_transfer_send_end(handler.value,cu_flag);
|
ret = msg_transfer_send_end(handler.value,cu_flag);
|
||||||
@ -252,7 +253,8 @@ int32_t test_case(uint32_t argc, int32_t* argvp)
|
|||||||
uint8_t scs_id = 1; // NR 30K
|
uint8_t scs_id = 1; // NR 30K
|
||||||
uint8_t cell_id = 0xFF;
|
uint8_t cell_id = 0xFF;
|
||||||
uint32_t run_ape = 0;
|
uint32_t run_ape = 0;
|
||||||
cell_setup_simulation(scs_id, cell_id, run_ape);
|
uint8_t frame_type = 1; // tdd
|
||||||
|
cell_setup_simulation(scs_id, cell_id, run_ape, frame_type);
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
msg_transfer_queue_polling();
|
msg_transfer_queue_polling();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user