* Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef TS_TASK_STRUCT_H
#define TS_TASK_STRUCT_H
#include "tsch_defines.h"
#include "aicpu_msg.h"
#ifdef __cplusplus
extern "C" {
#endif
* @ingroup tsch
* @brief the type defination of task
*/
typedef enum tag_ts_task_type {
TS_TASK_TYPE_KERNEL_AICORE = 0,
TS_TASK_TYPE_KERNEL_AICPU = 1,
TS_TASK_TYPE_EVENT_RECORD = 2,
TS_TASK_TYPE_STREAM_WAIT_EVENT = 3,
TS_TASK_TYPE_FUSION_ISSUE = 4,
TS_TASK_TYPE_MEMCPY = 5,
TS_TASK_TYPE_MAINTENANCE = 6,
TS_TASK_TYPE_CREATE_STREAM = 7,
TS_TASK_TYPE_DATA_DUMP = 8,
TS_TASK_TYPE_REMOTE_EVENT_WAIT = 9,
TS_TASK_TYPE_PCTRACE_ENABLE = 10,
TS_TASK_TYPE_CREATE_L2_ADDR = 11,
TS_TASK_TYPE_MODEL_MAINTAINCE = 12,
TS_TASK_TYPE_MODEL_EXECUTE = 13,
TS_TASK_TYPE_NOTIFY_WAIT = 14,
TS_TASK_TYPE_NOTIFY_RECORD = 15,
TS_TASK_TYPE_RDMA_SEND = 16,
TS_TASK_TYPE_L2_SDMA_TASK_MEMCPY = 17,
TS_TASK_TYPE_STREAM_SWITCH = 18,
TS_TASK_TYPE_STREAM_ACTIVE = 19,
TS_TASK_TYPE_LABEL_SET = 20,
TS_TASK_TYPE_LABEL_SWITCH = 21,
TS_TASK_TYPE_LABEL_GOTO = 22,
TS_TASK_TYPE_PROFILER_TRACE = 23,
TS_TASK_TYPE_EVENT_RESET = 24,
TS_TASK_TYPE_RDMA_DB_SEND = 25,
TS_TASK_TYPE_PROFILER_TRACE_EX = 26,
TS_TASK_TYPE_PROFILER_DYNAMIC_ENABLE = 27,
TS_TASK_TYPE_PROFILER_DYNAMIC_DISABLE = 28,
TS_TASK_TYPE_ALLOC_DSA_ADDR = 29,
TS_TASK_TYPE_CCU_LAUNCH = 30,
TS_TASK_TYPE_PROFILING_ENABLE = 64,
TS_TASK_TYPE_PROFILING_DISABLE = 65,
TS_TASK_TYPE_KERNEL_AIVEC = 66,
TS_TASK_TYPE_MODEL_END_GRAPH = 67,
TS_TASK_TYPE_MODEL_TO_AICPU = 68,
TS_TASK_TYPE_ACTIVE_AICPU_STREAM = 69,
TS_TASK_TYPE_DATADUMP_LOADINFO = 70,
TS_TASK_TYPE_STREAM_SWITCH_N = 71,
TS_TASK_TYPE_HOSTFUNC_CALLBACK = 72,
TS_TASK_TYPE_ONLINEPROF_START = 73,
TS_TASK_TYPE_ONLINEPROF_STOP = 74,
TS_TASK_TYPE_STREAM_LABEL_SWITCH_BY_INDEX = 75,
TS_TASK_TYPE_STREAM_LABEL_GOTO = 77,
TS_TASK_TYPE_DEBUG_REGISTER = 78,
TS_TASK_TYPE_DEBUG_UNREGISTER = 79,
TS_TASK_TYPE_MODEL_EXIT = 81,
TS_TASK_TYPE_MDCPROF = 82,
TS_TASK_TYPE_DEVICE_RINGBUFFER_CONTROL = 83,
TS_TASK_TYPE_DEBUG_REGISTER_WITH_STREAM = 84,
TS_TASK_TYPE_DEBUG_UNREGISTER_WITH_STREAM = 85,
TS_TASK_TYPE_TASK_TIMEOUT_SET = 86,
TS_TASK_TYPE_GET_DEVICE_MSG = 87,
TS_TASK_TYPE_GET_FLOAT_STATUS = 88,
TS_TASK_TYPE_CLEAR_FLOAT_STATUS = 89,
TS_TASK_TYPE_MEMCPY_ASYNC_WITHOUT_SDMA = 90,
TS_TASK_TYPE_SET_OVERFLOW_SWITCH = 91,
TS_TASK_TYPE_REDUCE_ASYNC_V2 = 92,
TS_TASK_TYPE_SET_STREAM_GE_OP_TAG = 93,
TS_TASK_TYPE_SET_STREAM_MODE = 94,
TS_TASK_TYPE_IPCINT_NOTICE = 95,
TS_TASK_TYPE_MODEL_LOAD = 96,
TS_TASK_TYPE_GET_STARS_VERSION = 97,
TS_TASK_TYPE_TASK_FLIP = 98,
TS_TASK_TYPE_MODEL_TASK_UPDATE = 101,
TS_TASK_TYPE_AICPU_INFO_LOAD = 102,
TS_TASK_TYPE_NOP = 103,
TS_TASK_TYPE_COMMON_CMD = 104,
TS_TASK_TYPE_UB_DB_SEND = 105,
TS_TASK_TYPE_DIRECT_SEND = 106,
TS_TASK_TYPE_KERNEL_FUSION = 107,
TS_TASK_TYPE_RESERVED,
} ts_task_type_t;
typedef enum tag_ts_task_state {
TASK_STATE_INIT = 0,
TASK_STATE_WAIT = 1,
TASK_STATE_RUN = 2,
TASK_STATE_COMPLETE = 3,
TASK_STATE_PENDING = 4,
TASK_STATE_SDMA_PROCESS_FAILED = 5,
TASK_STATE_SDMA_PROCESS_SUCCESS = 6,
TASK_STATE_AICORE_PROCESS_START = 7,
TASK_STATE_AICORE_DONE = 8,
TASK_STATE_RUN_PHASE2 = 9,
} ts_task_state_t;
typedef enum tag_ts_report_type {
TS_REPORT_TYPE_TASK = 0,
TS_REPORT_TYPE_ERROR_REPORT = 1,
TS_REPORT_TYPE_RECYCLE_SQ_FINISHED = 3,
TS_REPORT_TYPE_RECYCLE_STREAM_FINISHED = 4,
TS_REPORT_TYPE_RECYCLE_NOTIFY_FINISHED = 5,
TS_REPORT_TYPE_RECYCLE_EVENT_FINISHED = 6,
TS_REPORT_TYPE_RECYCLE_CQ_FINISHED = 7,
TS_REPORT_TYPE_UPDATE_SQ_HEAD = 8,
} ts_report_type_t;
typedef enum tag_ts_conds_sub_type {
CONDS_SUB_TYPE_MODEL_EXEC = 1,
CONDS_SUB_TYPE_RDMA_1 = 2,
CONDS_SUB_TYPE_RDMA_2 = 3,
CONDS_SUB_TYPE_STREAM_SWITCH = 4,
CONDS_SUB_TYPE_STREAM_SWITCH_EX = 5,
CONDS_SUB_TYPE_STREAM_ACTIVE = 6,
CONDS_SUB_TYPE_LABEL_SWITCH_BY_INDEX = 7,
CONDS_SUB_TYPE_GET_FLOAT_STATUS = 8,
CONDS_SUB_TYPE_MAX = 9,
} ts_conds_sub_type_t;
typedef enum tag_ts_common_cmd {
CMD_STREAM_CLEAR = 0,
CMD_NOTIFY_RESET = 1,
} ts_ph_common_cmd_t;
* @ingroup tsch
* @brief the struct define of report msg when task is completed
*/
typedef struct tag_ts_task_report_msg {
volatile uint16_t SOP : 1;
volatile uint16_t MOP : 1;
payload */
volatile uint16_t EOP : 1;
SOP & EOP can appear in the same packet, MOP & EOP can also appear on the same packet. */
volatile uint16_t report_type : 3;
volatile uint16_t streamID : 10;
volatile uint16_t taskID;
volatile uint32_t pay_load;
volatile uint16_t SQ_id : 9;
volatile uint16_t reserved : 6;
volatile uint16_t phase : 1;
volatile uint16_t SQ_head : 14;
volatile uint16_t stream_id_ex : 1;
volatile uint16_t fault_stream_id_ex : 1;
} ts_task_report_msg_t;
typedef struct tag_ts_driver_msg {
volatile uint16_t phase : 1;
volatile uint16_t report_type : 15;
volatile uint16_t sq_id;
volatile uint16_t sq_head;
volatile uint16_t recycle_id;
volatile uint64_t reserved;
} ts_driver_msg_t;
typedef struct tag_ts_logic_cq_report_msg {
volatile uint16_t phase : 1;
volatile uint16_t SOP : 1;
volatile uint16_t MOP : 1;
return payload */
volatile uint16_t EOP : 1;
can appear in the same packet, MOP & EOP can also appear on the same packet. */
volatile uint16_t logic_cq_id : 12;
volatile uint16_t stream_id ;
volatile uint16_t task_id;
volatile uint8_t error_type;
volatile uint8_t need_sorting;
volatile uint32_t error_code;
volatile uint32_t pay_load;
} ts_logic_cq_report_msg_t;
* @ingroup tsch
* @brief the struct define of callback report msg
*/
typedef struct tag_ts_host_func_cq_report_msg {
volatile uint16_t phase : 1;
volatile uint16_t SOP : 1;
volatile uint16_t MOP : 1;
return payload */
volatile uint16_t EOP : 1;
can appear in the same packet, MOP & EOP can also appear on the same packet. */
volatile uint16_t cq_id : 12;
volatile uint16_t stream_id ;
volatile uint16_t task_id;
volatile uint16_t sq_id;
volatile uint16_t sq_head;
volatile uint16_t sequence_id;
volatile uint8_t is_block;
volatile uint8_t reserved1[2];
volatile uint8_t cqe_type;
volatile uint64_t host_func_cb_ptr;
volatile uint64_t fn_data_ptr;
} ts_host_func_cq_report_msg_t;
#define IPCINT_MSGLEN_MAX (0x8U)
#pragma pack(1)
struct ts_cb_task {
uint16_t cq_id;
uint8_t is_block;
uint8_t reserved1[3];
uint64_t host_func_cb_ptr;
uint64_t fn_data_ptr;
};
struct ts_ipcint_notice_task {
uint32_t ntc_pid;
uint16_t ntc_grpId;
uint16_t ntc_tid;
uint16_t ntc_subEventId;
uint8_t ntc_eventId;
uint8_t msg_len;
uint8_t msg[IPCINT_MSGLEN_MAX];
uint16_t phy_devId;
};
typedef struct tag_ts_callback_report_msg {
uint8_t phase : 1;
uint8_t reserved0 : 7;
uint8_t task_type;
uint16_t sq_id;
uint16_t sq_head;
uint16_t stream_id;
uint16_t task_id;
union {
struct ts_cb_task cb_task;
struct ts_ipcint_notice_task ipcint_notice_task;
} u;
} ts_callback_report_msg_t;
#pragma pack()
typedef struct tag_ts_host_func_sq_send_msg {
uint16_t phase : 1;
uint16_t SOP : 1;
uint16_t MOP : 1;
uint16_t EOP : 1;
SOP & EOP can appear in the same packet, MOP & EOP can also appear on the same packet. */
uint16_t reserved : 12;
uint16_t stream_id ;
uint16_t task_id;
uint16_t cq_id;
uint16_t cq_tail;
uint16_t sequence_id;
uint32_t reserved1[13];
}ts_host_func_sq_send_msg_t;
* @ingroup tsch
* @brief the struct define of kernel type task
*/
typedef struct tag_ts_kernel_task {
uint64_t PC_start;
uint64_t param_base;
uint64_t l2_preload_ctrl;
uint64_t literal_src_addr;
uint32_t literal_dst_base;
uint32_t literal_size;
uint16_t block_dim;
uint8_t L2_size;
uint8_t l2_in_main;
uint32_t priority : 3;
uint32_t l2PreloadVirAddr : 26;
uint32_t flag : 3;
} ts_kernel_task_t;
* @ingroup tsch
* @brief the struct define of event record type task
*/
typedef struct tag_ts_event_record_task {
uint16_t eventID;
uint8_t reserved0[6];
uint64_t timeline_base;
uint32_t offset;
uint32_t thread_id;
uint32_t vir_addr;
uint8_t flag;
uint8_t wait_cq_flag;
uint16_t wait_cq_id;
uint8_t reserved[16];
} ts_event_record_task_t;
* @ingroup tsch
* @brief the struct define of event reset type task
*/
typedef struct tag_ts_event_reset_task {
uint16_t eventID;
uint16_t isNotify;
uint8_t reserved[44];
} ts_event_reset_task_t;
* @ingroup tsch
* @brief the struct define of stream wait event type task
*/
typedef struct tag_ts_stream_wait_event_task {
uint16_t eventID;
uint16_t nextStreamIdx;
uint16_t isNotify;
uint16_t ret_code;
uint16_t fault_task_id;
uint16_t fault_stream_id;
uint32_t wait_timeout;
uint8_t reserved[28];
uint16_t task_id;
int16_t timewheel_slot;
} ts_stream_wait_event_task_t;
* @ingroup tsch
* @brief the struct define of notify record type task
*/
typedef struct tag_ts_notify_record_task {
uint16_t soc_id;
uint16_t notify_id;
uint8_t reserved[44];
} ts_notify_record_task_t;
* @ingroup tsch
* @brief the struct define of ipc interrupt notice type task
*/
typedef struct tag_ts_ipc_int_notice_task {
uint32_t ntc_pid;
uint16_t ntc_grpId;
uint16_t ntc_tid;
uint16_t ntc_subEventId;
uint8_t ntc_eventId;
uint8_t msg_len;
uint8_t msg[IPCINT_MSGLEN_MAX];
uint16_t phy_devId;
uint8_t reserved[26];
} ts_ipc_int_notice_task_t;
* @ingroup tsch
* @brief the struct define of notify wait type task
*/
typedef struct tag_ts_notify_wait_task {
uint16_t notify_id;
uint16_t reserved_field;
uint32_t time_out;
uint16_t task_id;
uint8_t reserved[38];
} ts_notify_wait_task_t;
* @ingroup tsch
* @brief the struct define of fusion type task
*/
typedef struct tag_ts_fusion_task {
uint16_t flag;
uint8_t reserved[46];
} ts_fusion_task_t;
enum tag_ts_fusion_flag {
TS_FUSION_BEGIN = 0,
TS_FUSION_END = 1,
};
#define TS_KERNEL_CONVERT (0x01U)
#define TS_KERNEL_DUMPFLAG (0x02U)
#define TS_ENDGRAPH_DUMPFLAG (0x02U)
#define TS_ENDGRAPH_INFOFLAG (0x04U)
#define TS_TASK_UNSINKFLAG (0x08U)
#define TS_TASK_OVERFLOW_DUMP_FLAG_OFFSET 0x04U
#define TS_TASK_INVALID_FLAG 0x20U
#define TS_TASK_FAST_CQ_FLAG 0x40U
* @ingroup tsch
* @brief the struct define of memory copy type task
*/
enum rtMemcpyAddrConvertType {
TS_NOT_NEED_CONVERT,
TS_DMA_ADDR_CONVERT,
TS_NO_DMA_ADDR_CONVERT
};
struct TS_DMA_OFFSET_ADDR {
uint64_t offset;
uint32_t devid;
};
struct TS_NO_DMA_OFFSET_ADDR {
uint32_t srcVirAddr;
uint32_t dstVirAddr;
uint32_t dstOffsetLow;
};
struct TS_D2D_ADDR_OFFSET {
uint32_t srcOffsetLow;
uint32_t dstOffsetLow;
uint16_t srcOffsetHigh;
uint16_t dstOffsetHigh;
};
typedef struct tag_ts_memcpy_task {
uint64_t src_base_addr;
uint64_t dst_base_addr;
uint64_t length;
uint16_t memcpy_type;
uint8_t dir;
uint8_t isAddrConvert;
uint8_t copy_data_type;
uint8_t d2d_offset_flag : 1;
uint8_t reserved2 : 7;
int16_t timewheel_slot;
union {
struct TS_DMA_OFFSET_ADDR dmaOffsetAddr;
struct TS_NO_DMA_OFFSET_ADDR noDmaOffsetAddr;
struct TS_D2D_ADDR_OFFSET d2dAddrOffset;
};
} ts_memcpy_task_t;
typedef struct tag_ts_reduce_async_v2_task {
uint64_t src_base_addr;
uint64_t dst_base_addr;
uint64_t overflow_addr;
uint32_t length;
uint16_t memcpy_type;
uint8_t dir;
uint8_t is_addr_convert;
uint32_t vir_overflow_addr;
uint8_t copy_data_type;
uint8_t reserved[8];
uint8_t isOverFlowReport : 1;
uint8_t reserved1 : 7;
int16_t timewheel_slot;
} ts_reduce_async_v2_task_t;
* @ingroup tsch
* @brief the struct define of maintenance type task
*/
typedef struct tag_ts_maintenance_task {
uint16_t goal;
uint16_t targetID;
uint8_t terminal;
uint8_t reserved0;
uint16_t wait_cq_id;
uint32_t thread_id;
uint8_t force_recycle;
uint8_t reserved[33];
uint16_t v_target_id;
} ts_maintenance_task_t;
#define MAINTENANCE_GOAL_STREAM (0U)
#define MAINTENANCE_GOAL_EVENT (1U)
#define MAINTENANCE_GOAL_STREAM_TASK_RECYCLE (2U)
#define MAINTENANCE_FORCE_RECYCLE_STREAM (0x67)
typedef struct tag_ts_create_stream {
uint64_t pid;
uint64_t l2_base_vaddr;
uint64_t asid_baddr;
uint16_t vf_id;
uint16_t v_stream_id;
uint16_t runtime_version;
uint16_t reserved0;
uint32_t thread;
uint16_t asid;
uint16_t SMMU_sub_streamID;
uint16_t SQ_id;
uint8_t priority;
uint8_t stream_attr;
uint8_t group_id;
uint8_t device_id;
uint8_t support_log_to_host;
uint8_t reserved;
} ts_create_stream_t;
typedef struct tag_ts_create_l2_addr {
uint64_t l2_base_vaddr_for_sdma;
uint64_t pte_pa;
uint64_t pid;
uint32_t virAddr;
uint8_t reserved[20];
} ts_create_l2_addr_t;
typedef struct tag_ts_profile_enable {
uint64_t pid;
uint8_t pmu_event_id[8];
uint64_t global_start_count_cycle;
uint64_t global_stop_count_cycle;
uint8_t user_defined_profiling_enable;
uint8_t is_timeline_prof_en;
uint8_t is_taskbased_prof_en;
uint8_t is_prof_log_en;
uint8_t is_hwts_log_en;
uint8_t reserved[11];
} ts_profile_enable_t;
typedef struct tag_ts_profile_disable {
uint64_t pid;
uint8_t is_timeline_prof_dis;
uint8_t is_taskbased_prof_dis;
uint8_t is_prof_log_dis;
uint8_t is_hwts_log_dis;
uint8_t reserved[36];
} ts_profile_disable_t;
typedef struct tag_ts_onlineprof_start {
uint64_t online_prof_addr;
uint32_t virAddr;
uint8_t reserved[36];
} ts_onlineprof_start_t;
typedef struct tag_ts_onlinerof_stop {
uint64_t online_prof_addr;
uint8_t reserved[40];
} ts_onlineprof_stop_t;
typedef struct tag_ts_mdcprof {
uint64_t mdc_prof_addr;
uint32_t length;
uint8_t reserved[36];
} ts_mdcprof_t;
typedef struct tag_ts_remote_event_wait_task {
uint64_t src_mailbox_pa;
uint64_t src_doorbell_pa;
uint64_t dst_doorbell_pa;
uint16_t src_event_id;
uint16_t src_device_id;
uint16_t dst_device_id;
uint8_t channel_type;
uint8_t reserved[17];
} ts_remote_event_wait_t;
typedef struct tag_tsPCTrace_task {
uint64_t trace_buf_addr;
uint16_t taskID;
uint16_t coreDim;
uint32_t virAddr;
uint8_t reserved[32];
} tsPCTrace_task_t;
typedef struct tag_ts_data_dump_task {
uint64_t dumpBaseAddr;
uint32_t dumpKind;
uint32_t dumpBlockSize;
uint32_t dumpBlockDim;
uint16_t dumptaskID;
uint8_t reserved[22];
uint32_t virAddr;
} ts_data_dump_task_t;
typedef struct tag_ts_model_maintaince_task {
uint16_t model_id;
uint16_t stream_id;
uint16_t operation_type;
uint16_t stream_type;
uint16_t first_task_id;
uint16_t endgraph_id;
uint32_t executor_flag;
uint64_t exec_times_offset;
uint8_t reserved[22];
uint16_t v_model_id;
} ts_model_maintaince_task_t;
typedef struct tag_ts_maintaince_task {
uint8_t sub_type;
uint8_t rsv;
uint16_t target_id;
uint8_t reserved[44];
} ts_maintaince_task_t;
typedef struct tag_ts_dynamic_profile_enable {
uint32_t pid;
uint8_t eventMuxConfig[8];
uint64_t startCycle;
uint64_t stopCycle;
uint8_t userDefinedEnable;
uint8_t isTimelineProfEn;
uint8_t isTaskBasedProfEn;
uint8_t isProfLogEn;
uint8_t isSocLogEn;
uint8_t reserved[15];
} ts_dynamic_profile_enable;
typedef struct tag_ts_alloc_dsa_addr_task {
uint16_t dsa_sq_id;
uint8_t reserved[46];
} ts_alloc_dsa_addr_task_t;
typedef struct tag_ts_debug_status_t {
uint8_t debug_flag;
uint8_t reserved[3];
} ts_debug_status_t;
enum tag_ts_mmt_operation_type {
TS_MMT_STREAM_BIND = 0,
TS_MMT_STREAM_UNBIND = 1,
TS_MMT_MODEL_CREATE = 2,
TS_MMT_MODEL_DESTROY = 3,
TS_MMT_MODEL_PRE_PROC = 4,
TS_MMT_STREAM_LOAD_COMPLETE = 5,
TS_MMT_MODEL_ABORT = 6,
TS_MMT_RESERVED
};
enum tag_ts_mmt_stream_type {
TS_MMT_HEAD_STREAM = 0,
TS_MMT_WAIT_ACTIVE_STREAM = 1,
};
typedef struct tag_ts_model_execute_task {
uint16_t model_id;
uint16_t first_task_id;
int16_t sch_group_id;
uint8_t reserved0[2];
uint64_t asid_baddr;
uint64_t tcr;
uint16_t asid;
uint16_t SMMU_subStreamID;
uint8_t reserved[20];
} ts_model_execute_task_t;
typedef struct tag_ts_rdma_send_task {
uint32_t sq_index;
uint32_t wqe_index;
uint8_t reserved[40];
} ts_rdma_send_task_t;
typedef struct tag_ts_rdma_db_send_task {
uint64_t dbInfo;
uint32_t dbIndex;
uint8_t reserved[36];
} ts_rdma_db_send_task_t;
typedef struct tag_ts_stream_switch_task {
int64_t value;
uint64_t pptr;
uint64_t pValuePtr;
uint32_t condition;
uint16_t trueStreamId;
uint8_t isCondEx;
uint8_t dataType;
uint32_t pptrVirAddr;
uint32_t pValuePtrVirAddr;
uint8_t reserved[8];
} ts_stream_switch_task_t;
typedef struct tag_ts_stream_switchN_task {
uint64_t pptr;
uint64_t pValuePtr;
uint64_t pTrueStreamIdPtr;
uint32_t size;
uint32_t elementSize;
uint32_t pptrVirAddr;
uint32_t pValuePtrVirAddr;
uint32_t pTrueVirAddr;
uint8_t dataType;
uint8_t isTransAddr;
uint8_t reserved[2];
} ts_stream_switchN_task_t;
typedef struct tag_ts_stream_active_task {
uint16_t activeStreamId;
uint8_t reserved[46];
} ts_stream_active_task_t;
typedef struct tag_ts_profiler_notify_task {
uint64_t profilerTraceId;
uint8_t notify;
uint8_t reserved[39];
} ts_profiler_notify_task_t;
typedef struct tag_ts_keypoint_task {
uint64_t profilerTraceId;
uint64_t modelId;
uint16_t tagId;
uint8_t reserved[30];
} ts_keypoint_task_t;
typedef struct tag_ts_label_set_task {
uint16_t label_id;
uint16_t reserved[3];
uint64_t label_ptr;
uint8_t reserved1[28];
uint32_t vir_addr;
} ts_label_set_task_t;
typedef struct tag_ts_label_switch_task {
uint64_t pptr;
uint32_t condition;
uint32_t value;
uint16_t true_label_id;
uint16_t true_label_id_to_node_idx;
uint16_t next_task_idx_bak;
uint16_t true_label_id_to_stream_id;
uint8_t reserved[20];
uint32_t virAddr;
} ts_label_switch_task_t;
typedef struct tag_ts_label_goto_task {
uint16_t label_id;
uint16_t label_id_to_node_idx;
uint16_t next_task_idx_bak;
uint16_t label_id_to_stream_id;
uint8_t reserved[40];
} ts_label_goto_task_t;
typedef struct tag_ts_datadump_load_info_task {
uint64_t dumpInfoPtr;
uint32_t length;
uint8_t reserved[36];
} ts_datadump_load_info_task_t;
typedef struct tag_ts_aicpu_load_info_task {
uint64_t aicpuInfoPtr;
uint32_t length;
uint8_t reserved[36];
} ts_aicpu_load_info_task_t;
* @ingroup ts
* @brief the struct define of debug register task
*/
typedef struct tag_ts_debug_register_task {
uint64_t addr;
uint32_t model_id;
uint32_t flag;
uint32_t virAddr;
uint8_t reserved[20];
} ts_debug_register_task_t;
* @ingroup ts
* @brief the struct define of debug unregister task
*/
typedef struct tag_ts_debug_unregister_task {
uint32_t model_id;
uint8_t reserved[44];
} ts_debug_unregister_task_t;
* @ingroup ts
* @brief the struct define of debug register with stream task
*/
typedef struct tag_ts_debug_register_with_stream_task {
uint64_t addr;
uint32_t stream_id;
uint32_t flag;
uint32_t virAddr;
uint8_t reserved[28];
} ts_debug_register_with_stream_task_t;
* @ingroup ts
* @brief the struct define of debug unregister with stream task
*/
typedef struct tag_ts_debug_unregister_with_stream_task {
uint32_t stream_id;
uint8_t reserved[44];
} ts_debug_unregister_with_stream_task_t;
typedef struct tag_ts_end_graph {
uint64_t end_graph_name_ptr;
uint64_t arg_ptr;
uint32_t model_id;
uint32_t executor_flag;
uint8_t priority;
uint8_t flag;
uint8_t reserved[22];
} ts_end_graph_t;
typedef struct tag_ts_model_exit {
uint32_t model_id;
uint32_t stream_id;
uint8_t reserved[40];
} ts_model_exit_t;
typedef struct tag_ts_aicpu_task {
uint64_t arg_ptr;
uint32_t model_id;
uint32_t cmd_type;
uint32_t executor_flag;
int16_t timewheel_slot;
uint8_t reserved[26];
} ts_aicpu_task_t;
typedef struct tag_ts_host_func_cb_task {
uint64_t host_func_cb_ptr;
uint64_t fn_data_ptr;
uint32_t cb_rpt_cqid;
uint8_t is_block;
uint8_t reserved[27];
}ts_host_func_cb_task_t;
typedef struct tag_node_info {
uint32_t node_idx;
uint32_t reserved[1];
} rt_node_info_t;
typedef struct tag_hwts_info {
uint16_t sq_exe_head;
uint16_t stream_exe_head;
uint16_t reserved1;
uint16_t task_id;
uint16_t reserved2;
} rt_hwts_info_t;
typedef struct tag_ts_label_dev_info_v2 {
uint16_t label_id;
uint16_t stream_id;
uint16_t model_id;
union {
rt_node_info_t node_info;
rt_hwts_info_t hwts_info;
uint16_t reserved[5];
} u;
}ts_label_dev_info_v2_t;
typedef struct tag_ts_label_dev_info {
uint16_t model_id;
uint16_t stream_id;
uint16_t label_id;
}ts_label_dev_info_t;
typedef struct tag_ts_stream_label_switch_by_index_task_t {
uint64_t index_ptr;
uint64_t label_info_ptr;
uint32_t max;
uint16_t next_task_idx_bak;
uint8_t reserved[18];
uint32_t indexPtrVirAddr;
uint32_t labelInfoPtrVirAddr;
} ts_stream_label_switch_by_index_task_t;
typedef struct tag_ts_stream_label_goto_task_t {
uint16_t label_id;
uint16_t model_id;
uint16_t next_task_idx_bak;
uint8_t reserved[42];
} ts_stream_label_goto_task_t;
typedef struct tag_ts_device_ringbuffer_control_task_t {
uint64_t ringbuffer_offset;
uint64_t ringbuffer_phy_addr;
uint64_t pid;
uint32_t total_len;
uint8_t ringbuffer_del_flag;
uint8_t reserved[19];
} ts_ringbuffer_control_t;
typedef struct tag_ts_timeout_set_task_t {
uint32_t op_wait_timeout_en : 1;
uint32_t op_execute_timeout_en : 1;
uint32_t rsv : 30;
uint32_t op_wait_timeout;
uint32_t op_execute_timeout;
int16_t timewheel_slot;
uint8_t reserved[34];
} ts_timeout_set_task_t;
typedef struct tag_ts_get_dev_msg_task_t {
uint64_t dev_addr;
uint64_t offset;
uint32_t len;
uint16_t type;
uint8_t reserved[26];
} ts_get_dev_msg_task_t;
typedef struct tag_ts_stream_overflow_switch_t {
uint16_t stream_id;
uint16_t is_switch_on : 1;
uint16_t rsv : 15;
uint32_t reserved[11];
} ts_stream_overflow_switch_t;
typedef struct tag_ts_stream_set_tag_t {
uint16_t stream_id;
uint16_t rsv;
uint32_t geOpTag;
uint32_t reserved[10];
}ts_stream_set_tag_t;
typedef struct tag_ts_set_stream_mode_t {
uint64_t mode;
uint8_t reserved[40];
} ts_set_stream_mode_t;
typedef struct tag_ts_flip_task_t {
uint16_t flip_num;
uint8_t reserved[46];
} ts_flip_task_t;
#ifndef STARS_CTRL_CPU
typedef struct tag_ts_model_update_task_t {
uint64_t desc_buff_offset;
uint64_t tiling_key_offset;
uint64_t block_dim_offset;
uint64_t tiling_tab_offset;
uint16_t tiling_tab_len;
uint16_t des_stream_id;
uint16_t des_task_id;
uint16_t exe_stream_id;
uint8_t reserved[8];
} ts_model_update_task_t;
#else
typedef struct tag_ts_model_update_task_t {
uint64_t tiling_key_offset;
uint64_t block_dim_offset;
uint64_t tiling_tab_offset;
uint16_t tiling_tab_len;
uint16_t des_stream_id;
uint32_t des_task_id;
uint16_t exe_stream_id;
uint16_t rsv;
} ts_model_update_task_t;
#endif
typedef struct tag_ts_common_cmd_task {
uint16_t cmd_type;
uint16_t stream_id;
uint32_t notify_id;
uint16_t step;
uint8_t reserved[38];
} ts_common_cmd_task_t;
typedef struct tag_ts_get_stars_version {
uint32_t runtime_version;
uint8_t reserved[44];
} ts_get_stars_version_t;
* @ingroup tsch
* @brief the struct define of task
*/
typedef struct tag_ts_task {
uint16_t streamID;
uint16_t taskID;
uint16_t next_task_idx;
uint16_t type;
uint16_t next_stream_idx;
uint16_t task_state;
uint8_t task_prof_en : 7;
uint8_t isctrl : 1;
uint8_t task_info_flag;
* bit 2: endgraph dump, bit 3: unsink flag
* bit 4: overflow dump, bit 5: invalid flag
bit 6: fast cq flag */
uint16_t task_info;
union {
ts_kernel_task_t kernel_task;
ts_event_record_task_t event_task;
ts_stream_wait_event_task_t stream_wait_event_task;
ts_fusion_task_t fusion_task;
ts_memcpy_task_t memcpy_task;
ts_maintenance_task_t maintenance_task;
ts_create_stream_t creat_stream;
ts_create_l2_addr_t create_l2_addr;
ts_profile_enable_t profile_enable;
ts_profile_disable_t profile_disable;
ts_remote_event_wait_t remote_event_wait_task;
tsPCTrace_task_t pc_trace_task;
ts_data_dump_task_t data_dump_task;
ts_notify_wait_task_t notify_wait_task;
ts_notify_record_task_t notify_record_task;
ts_ipc_int_notice_task_t ipc_int_notice_task;
ts_model_maintaince_task_t model_maintaince_task;
ts_model_execute_task_t model_execute_task;
ts_rdma_send_task_t rdma_send_task;
ts_stream_switch_task_t stream_switch_task;
ts_stream_active_task_t stream_active_task;
ts_profiler_notify_task_t profiler_notify_task;
ts_keypoint_task_t keypoint_task;
ts_label_set_task_t label_set_task;
ts_label_switch_task_t label_switch_task;
ts_label_goto_task_t label_goto_task;
ts_event_reset_task_t event_reset_task;
ts_end_graph_t end_graph_task;
ts_model_exit_t model_exit_task;
ts_aicpu_task_t aicpu_task;
ts_datadump_load_info_task_t datadump_load_info_task;
ts_debug_register_task_t debug_register_task;
ts_debug_unregister_task_t debug_unregister_task;
ts_stream_switchN_task_t stream_switchN_task;
ts_host_func_cb_task_t host_func_cb_task;
ts_onlineprof_start_t onlineprof_start_task;
ts_onlineprof_stop_t onlineprof_stop_task;
ts_rdma_db_send_task_t rdma_db_send_task;
ts_stream_label_switch_by_index_task_t stream_label_switch_index_task;
ts_stream_label_goto_task_t stream_label_goto_task;
ts_mdcprof_t mdcprof;
ts_ringbuffer_control_t ringbuffer_control_task;
ts_debug_register_with_stream_task_t debug_register_with_stream_task;
ts_debug_unregister_with_stream_task_t debug_unregister_with_stream_task;
ts_timeout_set_task_t timeout_set_task;
ts_get_dev_msg_task_t get_dev_msg_task;
ts_reduce_async_v2_task_t reduce_async_v2_task;
ts_set_stream_mode_t set_stream_mode_task;
ts_flip_task_t flip_task;
ts_model_update_task_t model_update_task;
ts_aicpu_load_info_task_t aicpu_load_info;
ts_common_cmd_task_t common_cmd_task;
ts_get_stars_version_t get_version_task;
} u;
} ts_task_t;
typedef struct tag_stream_snapshot {
uint16_t stream_id;
uint16_t task_id;
uint16_t sq_id : 12;
uint16_t sq_fsm : 4;
uint16_t acsq_id : 8;
uint16_t acsq_fsm : 6;
uint16_t is_swap_in : 1;
uint16_t rsv : 1;
} ts_stream_snapshot_t;
#define TASK_REPORT_RESULT_CODE_FAIL (1U)
typedef enum tag_ts_aicpu_record_type {
AICPU_MSG_EVENT_RECORD = 1,
AICPU_MSG_NOTIFY_RECORD
} ts_aicpu_record_type_t;
typedef enum tag_ts_sq_alloc_type {
SQ_ALLOC_TYPE_RT_DEFAULT = 0,
SQ_ALLOC_TYPE_TS_FFTS_DSA = 1,
} ts_sq_alloc_type_t;
typedef struct {
uint32_t stream_id;
uint32_t priority;
uint32_t overflow_en : 1;
uint32_t sat_mode : 1;
uint32_t sq_type : 1;
uint32_t swsq_flag : 1;
uint32_t rsv : 28;
uint32_t thread_disable_flag;
uint32_t share_sq_id;
} ts_stream_alloc_info_t;
typedef struct tag_stars_cond_op_store {
uint32_t op_code : 7;
uint32_t immd_low : 5;
uint32_t func3 : 3;
uint32_t rs1 : 3;
uint32_t reserved1 : 2;
uint32_t rs2 : 3;
uint32_t reserved2 : 2;
uint32_t immd_high : 7;
} ts_stars_cond_op_store_t;
typedef struct tag_stars_cond_op_imm {
uint32_t op_code : 7;
uint32_t rd : 3;
uint32_t reserved0 : 2;
uint32_t func3 : 3;
uint32_t rs1 : 3;
uint32_t reserved1 : 2;
uint32_t immd : 12;
} ts_stars_cond_op_imm_t;
typedef ts_stars_cond_op_imm_t ts_stars_cond_op_nop_t;
typedef struct tag_stars_cond_op_loadimm {
uint32_t op_code : 7;
uint32_t rd : 3;
uint32_t reserved : 2;
uint32_t func3 : 3;
uint32_t immd_addr_high : 17;
uint32_t immd_addr_low;
} ts_stars_cond_op_loadimm_t;
typedef struct tag_stars_cond_op_LHWI {
uint32_t op_code : 7;
uint32_t rd : 3;
uint32_t reserved0 : 2;
uint32_t func3 : 3;
uint32_t reserved1 : 2;
uint32_t immd : 15;
} ts_stars_cond_op_LHWI_t;
typedef struct tag_stars_cond_op_LLWI {
uint32_t op_code : 7;
uint32_t rd : 3;
uint32_t reserved0 : 2;
uint32_t func3 : 3;
uint32_t immd_high : 17;
uint32_t immd_low;
} ts_stars_cond_op_LLWI_t;
typedef struct tag_stars_cond_op_function_call {
uint32_t opCode : 7;
uint32_t reserved0 : 3;
uint32_t reserved1 : 2;
uint32_t func3 : 3;
uint32_t rs1 : 3;
uint32_t reserved2 : 2;
uint32_t rs2 : 3;
uint32_t reserved3 : 2;
uint32_t reserved4 : 7;
} ts_stars_cond_op_function_call_t;
#define STARS_SQE_UNIT_LEN 64
#define STARS_CQE_UNIT_LEN 16
#define TS_STARS_SQE_TYPE_INVALID 63
#ifndef STARS_CTRL_CPU
typedef enum ts_stars_sqe_type {
TS_STARS_SQE_TYPE_FFTS = 0,
TS_STARS_SQE_TYPE_AICPU = 1,
TS_STARS_SQE_TYPE_PLACE_HOLDER = 3,
TS_STARS_SQE_TYPE_EVENT_RECORD = 4,
TS_STARS_SQE_TYPE_EVENT_WAIT = 5,
TS_STARS_SQE_TYPE_NOTIFY_RECORD = 6,
TS_STARS_SQE_TYPE_NOTIFY_WAIT = 7,
TS_STARS_SQE_TYPE_WRITE_VALUE = 8,
TS_STARS_SQE_TYPE_SDMA = 11,
TS_STARS_SQE_TYPE_VPC = 12,
TS_STARS_SQE_TYPE_JPEGE = 13,
TS_STARS_SQE_TYPE_JPEGD = 14,
TS_STARS_SQE_TYPE_DSA = 15,
TS_STARS_SQE_TYPE_ROCCE = 16,
TS_STARS_SQE_TYPE_PCIE_DMA = 17,
TS_STARS_SQE_TYPE_RESERVE = 18,
TS_STARS_SQE_TYPE_CDQM = 19,
TS_STARS_SQE_TYPE_COND = 20,
TS_STARS_SQE_TYPE_END
} ts_stars_sqe_type_t;
#else
typedef enum ts_stars_sqe_type {
TS_STARS_SQE_TYPE_AIC = 0,
TS_STARS_SQE_TYPE_AIV = 1,
TS_STARS_SQE_TYPE_FUSION = 2,
TS_STARS_SQE_TYPE_PLACE_HOLDER = 3,
TS_STARS_SQE_TYPE_AICPU_H = 4,
TS_STARS_SQE_TYPE_AICPU_D = 5,
TS_STARS_SQE_TYPE_NOTIFY_RECORD = 6,
TS_STARS_SQE_TYPE_NOTIFY_WAIT = 7,
TS_STARS_SQE_TYPE_WRITE_VALUE = 8,
TS_STARS_SQE_TYPE_UBDMA = 9,
TS_STARS_SQE_TYPE_ASYNCDMA = 10,
TS_STARS_SQE_TYPE_SDMA = 11,
TS_STARS_SQE_TYPE_VPC = 12,
TS_STARS_SQE_TYPE_JPEGE = 13,
TS_STARS_SQE_TYPE_JPEGD = 14,
TS_STARS_SQE_TYPE_CMO = 15,
TS_STARS_SQE_TYPE_CCU = 16,
TS_STARS_SQE_TYPE_NSC = 18,
TS_STARS_SQE_TYPE_DSS = 19,
TS_STARS_SQE_TYPE_COND = 20,
TS_STARS_SQE_TYPE_END = 63,
} ts_stars_sqe_type_t;
#endif
enum rtTopicType_t {
TOPIC_TYPE_DEVICE_AICPU_ONLY = 0,
TOPIC_TYPE_DEVICE_AICPU_FIRST = 1,
TOPIC_TYPE_HOST_AICPU_ONLY = 2,
TOPIC_TYPE_HOST_AICPU_FIRST = 3,
TOPIC_TYPE_HOST_CTRL_CPU = 4,
TOPIC_TYPE_DATA_CPU = 5,
TOPIC_TYPE_DEVICE_CTRL_CPU = 6,
TOPIC_TYPE_TS_CPU = 7,
TOPIC_TYPE_DVPP_CPU = 8,
TOPIC_TYPE_DEVICE_HOST_CTRL_CPU = 9,
};
enum ts_ffts_type {
TS_FFTS_TYPE_AIC_ONLY = 0U,
TS_FFTS_TYPE_AIV_ONLY = 1U,
TS_FFTS_TYPE_AUTO_THREAD = 2U,
TS_FFTS_TYPE_MANUAL_THREAD = 3U,
TS_FFTS_TYPE_FFTS_PLUS = 4U,
TS_FFTS_TYPE_AIC_AIV_MIX = 5U
};
enum ts_aic_type {
TS_TYPE_AIC_ONLY = 0U,
TS_TYPE_AIV_ONLY = 1U,
TS_TYPE_AIX_MAX = 2U
};
enum ts_stars_write_value_sub_type {
TS_STARS_WRITE_VALUE_SUB_TYPE_DEFAULT = 0,
TS_STARS_WRITE_VALUE_SUB_TYPE_EVENT_RESET = 1,
TS_STARS_WRITE_VALUE_SUB_TYPE_RDMA_DB_SEND = 2,
TS_STARS_WRITE_VALUE_SUB_TYPE_NOTIFY_RECORD_IPC_NO_PCIE = 3,
TS_STARS_WRITE_VALUE_SUB_TYPE_NOTIFY_RECORD_IPC_PCIE = 4,
TS_STARS_WRITE_VALUE_SUB_TYPE_MAX,
};
#pragma pack(push)
#pragma pack (1)
#ifndef STARS_CTRL_CPU
typedef struct ts_stars_sqe_header {
uint8_t type : 6;
uint8_t l1_lock : 1;
uint8_t l1_unlock : 1;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t reserved : 1;
uint16_t block_dim;
uint16_t rt_stream_id;
uint16_t task_id;
} ts_stars_sqe_header_t;
typedef struct ts_stars_sqe_word0 {
uint8_t type : 6;
uint8_t l1_lock : 1;
uint8_t l1_unlock : 1;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t reserved : 1;
uint16_t block_dim;
} ts_stars_sqe_word0_t;
typedef struct ts_stars_ph_sqe_word0 {
uint8_t type : 6;
uint8_t l2_lock : 1;
uint8_t l2_unlock : 1;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t res0 : 1;
uint16_t task_type;
} ts_stars_ph_sqe_word0_t;
typedef struct ts_stars_sqe_normal {
uint8_t type : 6;
uint8_t l2_lock : 1;
uint8_t l2_unlock : 1;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t res0 : 1;
uint16_t res1;
uint16_t stream_id;
uint16_t task_id;
uint32_t res2;
uint16_t res3;
uint8_t kernel_credit;
uint8_t res4;
uint32_t res[12];
} ts_stars_sqe_t;
typedef struct ts_stars_ph_sqe {
uint8_t type : 6;
uint8_t l2_lock : 1;
uint8_t l2_unlock : 1;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t res0 : 1;
uint16_t task_type;
uint16_t stream_id;
uint16_t task_id;
uint32_t res1;
uint16_t res2;
uint8_t kernel_credit;
uint8_t res3;
union {
ts_maintaince_task_t maintaince_info;
ts_datadumploadinfo_t datadumploadinfo;
ts_keypoint_task_t keypoint_task;
ts_dynamic_profile_enable dynamic_profiling_info;
ts_debug_register_task_t model_debug_register_task;
ts_debug_register_with_stream_task_t stream_debug_register_task;
ts_model_maintaince_task_t model_maintaince_task;
ts_ringbuffer_control_t ringbuffer_control_task;
ts_stream_overflow_switch_t stream_overflow_swith_task;
ts_get_dev_msg_task_t get_dev_msg_task;
ts_stream_set_tag_t stream_set_tag_task;
ts_alloc_dsa_addr_task_t alloc_dsa_addr_task;
ts_debug_status_t debug_status_info;
ts_flip_task_t flip_task;
ts_model_update_task_t model_task_updata_info;
ts_to_aicpu_loadinfo_t aicpuloadinfo;
ts_common_cmd_task_t common_cmd_task;
ts_get_stars_version_t get_version_task;
uint32_t resv[12];
} u;
} ts_stars_ph_sqe_t;
typedef struct ts_stars_notify_sqe {
ts_stars_sqe_header_t header;
uint32_t notify_id : 13;
uint32_t res2 : 19;
uint16_t res3;
uint8_t kernel_credit;
uint8_t res4;
uint32_t timeout;
uint32_t res5[11];
} ts_stars_notify_sqe_t;
typedef struct ts_stars_event_sqe {
ts_stars_sqe_header_t header;
uint16_t event_id;
uint16_t res2;
uint16_t res3;
uint8_t kernel_credit;
uint8_t res4;
uint32_t exe_result;
uint32_t timeout;
uint32_t res5[10];
} ts_stars_event_sqe_t;
typedef struct stars_aicpu_sqe {
uint8_t type : 6;
uint8_t l1_lock : 1;
uint8_t l1_unlock : 1;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t reserved : 1;
uint16_t block_dim;
uint16_t rt_stream_id;
uint16_t task_id;
uint16_t res0;
uint16_t kernel_type : 7;
uint16_t batch_mode : 1;
uint16_t topic_type : 4;
uint16_t qos : 3;
uint16_t res7 : 1;
uint16_t sqe_index;
uint16_t kernel_credit : 8;
uint16_t post_p_bak : 2;
uint16_t type_bak : 6;
uint32_t task_so_addr_low;
uint32_t task_so_addr_high : 16;
uint32_t res3 : 16;
uint32_t param_addr_low;
uint32_t param_addr_high : 16;
uint32_t res4 : 16;
uint32_t task_name_str_ptr_low;
uint32_t task_name_str_ptr_high : 16;
uint32_t res5 : 16;
uint32_t p_l2ctrl_low;
uint32_t p_l2ctrl_high : 16;
uint32_t overflow_en : 1;
uint32_t res6 : 15;
uint32_t extra_field_low;
uint32_t extra_field_high;
uint32_t sub_topic_id : 12;
uint32_t topic_id : 6;
uint32_t group_id : 6;
uint32_t usr_data_len : 8;
uint32_t dest_pid;
} ts_stars_aicpu_sqe_t;
typedef struct ts_stars_vpc_sqe {
uint8_t type : 6;
uint8_t l2_lock : 1;
uint8_t l2_unlock : 1;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t res0 : 1;
uint16_t res1;
uint16_t stream_id;
uint16_t task_id;
uint32_t res2;
uint16_t res3;
uint8_t kernel_credit;
uint8_t ptr_mode : 1;
uint8_t error_times : 2;
uint8_t post_p_bak : 2;
uint8_t res4 : 3;
uint32_t res[12];
} ts_stars_vpc_sqe_t;
typedef struct ts_stars_jpegd_sqe {
uint8_t type : 6;
uint8_t l2_lock : 1;
uint8_t l2_unlock : 1;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t res0 : 1;
uint16_t res1;
uint16_t stream_id;
uint16_t task_id;
uint32_t res2;
uint16_t res3;
uint8_t kernel_credit;
uint8_t ptr_mode : 1;
uint8_t aicpu_task_pos : 7;
uint32_t res[12];
} ts_stars_jpegd_sqe_t;
typedef struct stars_function_call_sqe {
ts_stars_sqe_header_t header;
uint8_t conds_sub_type;
uint8_t reserved0[3];
uint16_t reserved1;
uint8_t kernel_credit;
uint8_t reserved2 : 7;
uint8_t csc : 1;
ts_stars_cond_op_LHWI_t lhwi1;
ts_stars_cond_op_LLWI_t llwi1;
ts_stars_cond_op_LHWI_t lhwi2;
ts_stars_cond_op_LLWI_t llwi2;
ts_stars_cond_op_function_call_t func_call;
ts_stars_cond_op_nop_t nop[5];
} ts_stars_function_call_sqe_t;
typedef struct stars_get_float_status_sqe {
uint8_t type : 6;
uint8_t sq_lock : 1;
uint8_t sq_unlock : 1;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t res0 : 1;
uint16_t task_type;
uint16_t stream_id;
uint16_t task_id;
uint32_t reserved0;
uint16_t reserved1;
uint8_t kernel_credit;
uint8_t reserved2 : 6;
uint8_t debug_flag : 1;
uint8_t csc : 1;
ts_stars_cond_op_loadimm_t ldi;
ts_stars_cond_op_LLWI_t llwi;
ts_stars_cond_op_store_t sd_overflow_cnt;
ts_stars_cond_op_store_t sd_zero[7];
} ts_stars_get_float_status_sqe_t;
#else
typedef enum tag_david_notify_sub_type {
NOTIFY_SUB_TYPE_SINGLE_NOTIFY_RECORD = 0U,
NOTIFY_SUB_TYPE_SINGLE_NOTIFY_WAIT = 1U,
NOTIFY_SUB_TYPE_COUNT_NOTIFY_RECORD = 2U,
NOTIFY_SUB_TYPE_COUNT_NOTIFY_WAIT = 3U,
NOTIFY_SUB_TYPE_EVENT_USE_SINGLE_NOTIFY_RECORD = 4U,
NOTIFY_SUB_TYPE_EVENT_USE_SINGLE_NOTIFY_WAIT = 5U,
NOTIFY_SUB_TYPE_EVENT_USE_COUNT_NOTIFY_RECORD = 6U,
NOTIFY_SUB_TYPE_EVENT_USE_COUNT_NOTIFY_WAIT = 7U,
NOTIFY_SUB_TYPE_MAX
} david_notify_sub_type_t;
typedef struct ts_stars_sqe_normal {
uint8_t type : 6;
uint8_t l1_lock : 1;
uint8_t l1_unlock : 1;
uint8_t ie : 1;
uint8_t pre_p : 1;
uint8_t post_p : 1;
uint8_t wr_cqe : 1;
uint8_t ptr_mode : 1;
uint8_t rtt_mode : 1;
uint8_t head_update : 1;
uint8_t res0 : 1;
uint16_t res1;
uint16_t stream_id;
uint16_t task_id;
uint32_t res2 : 11;
uint32_t sub_type : 5;
uint32_t resv : 16;
uint16_t res3;
uint8_t kernel_credit;
uint8_t res4 : 5;
uint8_t sqe_length : 3;
uint32_t res[12];
} ts_stars_sqe_t;
typedef struct ts_stars_sqe_header {
uint8_t type : 6;
uint8_t l1_lock : 1;
uint8_t l1_unlock : 1;
uint8_t ie : 1;
uint8_t pre_p : 1;
uint8_t post_p : 1;
uint8_t wr_cqe : 1;
uint8_t ptr_mode : 1;
uint8_t rtt_mode : 1;
uint8_t head_update : 1;
uint8_t reserved : 1;
uint16_t block_dim;
uint16_t rt_stream_id;
uint16_t task_id;
} ts_stars_sqe_header_t;
typedef struct tag_ts_call_back_info {
uint16_t cb_cq_id;
uint16_t cb_group_id;
uint16_t dev_id;
uint16_t stream_id;
uint32_t notify_id;
uint16_t task_id;
uint8_t is_block : 1;
uint8_t is_online : 1;
uint8_t res0 : 6;
uint8_t res1;
uint32_t hostfunc_addr_low;
uint32_t hostfunc_addr_high;
uint32_t fndata_low;
uint32_t fndata_high;
uint32_t res2;
uint32_t res3;
uint32_t sub_topic_id : 12;
uint32_t topic_id : 6;
uint32_t group_id : 6;
uint32_t usr_data_len : 8;
uint32_t dest_pid;
} ts_call_back_info_t;
typedef struct ts_stars_ph_sqe {
uint8_t type : 6;
uint8_t l1_lock : 1;
uint8_t l1_unlock : 1;
uint8_t ie : 1;
uint8_t pre_p : 1;
uint8_t post_p : 1;
uint8_t wr_cqe : 1;
uint8_t ptr_mode : 1;
uint8_t ptt_mode : 1;
uint8_t head_update : 1;
uint8_t res0 : 1;
uint16_t block_dim;
uint16_t stream_id;
uint16_t task_id;
uint32_t res1;
uint16_t task_type;
uint8_t kernel_credit;
uint8_t timeout_type;
union {
ts_maintaince_task_t maintaince_info;
ts_datadumploadinfo_t datadumploadinfo;
ts_keypoint_task_t keypoint_task;
ts_dynamic_profile_enable dynamic_profiling_info;
ts_debug_register_task_t model_debug_register_task;
ts_debug_register_with_stream_task_t stream_debug_register_task;
ts_model_maintaince_task_t model_maintaince_task;
ts_ringbuffer_control_t ringbuffer_control_task;
ts_stream_overflow_switch_t stream_overflow_swith_task;
ts_get_dev_msg_task_t get_dev_msg_task;
ts_stream_set_tag_t stream_set_tag_task;
ts_alloc_dsa_addr_task_t alloc_dsa_addr_task;
ts_debug_status_t debug_status_info;
ts_flip_task_t flip_task;
ts_model_update_task_t model_task_update_info;
ts_to_aicpu_loadinfo_t aicpuloadinfo;
ts_call_back_info_t call_back_info;
uint32_t resv[12];
} u;
} ts_stars_ph_sqe_t;
typedef struct stars_function_call_sqe {
ts_stars_sqe_header_t header;
uint8_t conds_sub_type;
uint16_t reserved0;
uint8_t reserved1 : 7;
uint8_t csc : 1;
uint16_t reserved2;
uint8_t kernel_credit;
uint8_t reserved3 : 4;
uint8_t debug_flag : 1;
uint8_t sqe_length : 3;
ts_stars_cond_op_LHWI_t lhwi1;
ts_stars_cond_op_LLWI_t llwi1;
ts_stars_cond_op_LHWI_t lhwi2;
ts_stars_cond_op_LLWI_t llwi2;
ts_stars_cond_op_function_call_t func_call;
ts_stars_cond_op_nop_t nop[5];
} ts_stars_function_call_sqe_t;
typedef struct ts_stars_aic_aiv_sqe {
ts_stars_sqe_header_t header;
uint16_t group_dim;
uint16_t group_block_dim;
uint8_t feature_flag;
uint8_t res1;
uint8_t kernel_credit;
uint8_t die_friendly : 1;
uint8_t mix : 1;
uint8_t loose : 1;
uint8_t res2 : 2;
uint8_t sqe_length : 3;
uint32_t stack_phy_base_low;
uint32_t stack_phy_base_high;
uint16_t aic_pmg : 2;
uint16_t aic_ns : 1;
uint16_t aic_part_id : 8;
uint16_t pi_mix : 1;
uint16_t aic_qos : 4;
uint16_t aic_wrr_rd : 3;
uint16_t aic_wrr_wr : 3;
uint16_t aic_icache_prefetch_cnt : 5;
uint16_t aiv_icache_prefetch_cnt : 5;
uint16_t aiv_pmg : 2;
uint16_t aiv_ns : 1;
uint16_t aiv_part_id : 8;
uint16_t res4 : 1;
uint16_t aiv_qos : 4;
uint16_t aiv_wrr_rd : 3;
uint16_t aiv_wrr_wr : 3;
uint16_t schem : 2;
uint16_t ratio : 8;
uint32_t aic_start_pc_low;
uint32_t aiv_start_pc_low;
uint16_t aic_start_pc_high;
uint16_t aiv_start_pc_high;
uint32_t aiv_simt_dcu_sm_size;
uint32_t aic_task_param_ptr_l;
uint32_t aic_task_param_ptr_h;
uint32_t aiv_task_param_ptr_l;
uint32_t aiv_task_param_ptr_h;
} ts_stars_aic_aiv_sqe_t;
typedef struct ts_memcpy_stride00 {
uint16_t dst_stream_id;
uint16_t dst_sub_stream_id;
uint32_t src_addr_low;
uint32_t src_addr_high;
uint32_t dst_addr_low;
uint32_t dst_addr_high;
uint32_t length_move;
uint32_t src_offset_low;
uint32_t dst_offset_low;
uint16_t src_offset_high;
uint16_t dst_offset_high;
} ts_memcpy_stride00_t;
typedef struct ts_memcpy_stride01 {
uint16_t dst_stream_id;
uint16_t dst_sub_stream_id;
uint32_t src_addr_low;
uint32_t src_addr_high;
uint32_t dst_addr_low;
uint32_t dst_addr_high;
uint32_t length_move;
uint32_t src_stride_length;
uint32_t dst_stride_length;
uint32_t stride_num;
} ts_memcpy_stride01_t;
typedef struct ts_memcpy_stride10 {
uint16_t num_outer;
uint16_t num_inner;
uint32_t src_addr_low;
uint32_t src_addr_high;
uint32_t stride_outer;
uint32_t stride_inner;
uint32_t length_inner;
uint32_t reserved[3];
} ts_memcpy_stride10_t;
typedef struct ts_david_stars_memcpy_sqe {
ts_stars_sqe_header_t header;
uint32_t res1;
uint16_t res2;
uint8_t kernel_credit;
uint8_t res3;
uint32_t opcode : 8;
uint32_t sssv : 1;
uint32_t dssv : 1;
uint32_t sns : 1;
uint32_t dns : 1;
uint32_t sro : 1;
uint32_t dro : 1;
uint32_t stride : 2;
uint32_t ie2 : 1;
uint32_t comp_en : 1;
uint32_t va_valid : 1;
uint32_t res4 : 13;
uint16_t sqe_id;
uint8_t mapam_part_id;
uint8_t mpamns : 1;
uint8_t pmg : 2;
uint8_t qos : 4;
uint8_t d2d_offset_flag : 1;
uint16_t src_stream_id;
uint16_t src_sub_stream_id;
union {
ts_memcpy_stride00_t stride_mode0;
ts_memcpy_stride01_t stride_mode1;
ts_memcpy_stride10_t stride_mode2;
} u;
} ts_david_stars_memcpy_sqe_t;
typedef struct ts_stars_notify_sqe {
ts_stars_sqe_header_t header;
uint32_t notify_id : 17;
uint32_t res2 : 13;
uint32_t cnt_flag : 1;
uint32_t clr_flag : 1;
uint16_t sub_type;
uint8_t kernel_credit;
uint8_t res4 : 5;
uint8_t sqe_length : 3;
uint32_t cnt_value;
uint32_t wait_mode_bit : 2;
uint32_t record_mode_bit : 3;
uint32_t bitmap : 1;
uint32_t res5 : 26;
uint32_t timeout;
uint32_t exe_result;
uint32_t res7[8];
} ts_stars_notify_sqe_t;
typedef struct ts_stars_ubdma_db_sqe {
ts_stars_sqe_header_t header;
uint16_t mode : 1;
uint16_t doorbell_num : 2;
uint16_t res0 : 13;
uint16_t res1;
uint16_t res2;
uint8_t kernel_credit;
uint8_t res3 : 5;
uint8_t sqe_length : 3;
uint32_t jetty_id1 : 16;
uint32_t res4 : 9;
uint32_t func_id1 : 7;
uint16_t pi_value1;
uint16_t res5 : 15;
uint16_t die_id1 : 1;
uint32_t jetty_id2 : 16;
uint32_t res6 : 9;
uint32_t func_id2 : 7;
uint16_t pi_value2;
uint16_t res7 : 15;
uint16_t die_id2 : 1;
uint32_t res8[8];
} ts_stars_ubdma_db_sqe_t;
typedef struct tag_ts_host_func_call_back_info {
uint16_t cb_cq_id;
uint16_t cb_group_id;
uint16_t dev_id;
uint16_t stream_id;
uint16_t event_id;
uint16_t is_block;
uint16_t task_id;
uint16_t res1;
uint32_t hostfunc_addr_low;
uint32_t hostfunc_addr_high;
uint32_t fndata_low;
uint32_t fndata_high;
} ts_host_func_call_back_info_t;
typedef struct ts_stars_ubdma_direct_wqe_sqe {
ts_stars_sqe_header_t header;
uint16_t mode : 1;
uint16_t die_id : 1;
uint16_t res1 : 13;
uint16_t wqe_size : 1;
uint16_t res2;
uint16_t res3;
uint8_t kernel_credit;
uint8_t res4 : 5;
uint8_t sqe_length : 3;
uint32_t jetty_id : 16;
uint32_t res5 : 9;
uint32_t func_id : 7;
uint32_t res6[11];
} ts_stars_ubdma_direct_wqe_sqe_t;
typedef struct ts_stars_jpegd_sqe {
ts_stars_sqe_header_t header;
uint32_t cmdBufSize;
uint16_t res1;
uint8_t kernel_credit;
uint8_t res2 : 1;
uint8_t aicpu_task_pos : 7;
uint32_t res[12];
} ts_stars_jpegd_sqe_t;
typedef struct ts_stars_vpc_sqe {
ts_stars_sqe_header_t header;
uint32_t cmdBufSize;
uint16_t res1;
uint8_t kernel_credit;
uint8_t res2 : 1;
uint8_t error_times : 2;
uint8_t post_p_bak : 2;
uint8_t res3 : 3;
uint32_t res[12];
} ts_stars_vpc_sqe_t;
typedef struct stars_aicpu_sqe {
ts_stars_sqe_header_t header;
uint16_t res0;
uint16_t kernel_type : 7;
uint16_t batch_mode : 1;
uint16_t topic_type : 4;
uint16_t qos : 3;
uint16_t res1 : 1;
uint16_t sqe_index;
uint16_t kernel_credit : 8;
uint16_t res2 : 4;
uint16_t sqe_length : 3;
uint32_t task_so_addr_low;
uint32_t task_so_addr_high : 16;
uint32_t post_p_bak : 2;
uint32_t type_bak : 6;
uint32_t res3 : 8;
uint32_t param_addr_low;
uint32_t param_addr_high : 16;
uint32_t res4 : 16;
uint32_t task_name_str_ptr_low;
uint32_t task_name_str_ptr_high : 16;
uint32_t res5 : 16;
uint32_t p_l2ctrl_low;
uint32_t p_l2ctrl_high : 16;
uint32_t overflow_en : 1;
uint32_t res6 : 15;
uint32_t extra_field_low;
uint32_t extra_field_high;
uint32_t sub_topic_id : 12;
uint32_t topic_id : 6;
uint32_t group_id : 6;
uint32_t usr_data_len : 8;
uint32_t dest_pid;
} ts_stars_aicpu_sqe_t;
typedef struct stars_get_float_status_sqe {
ts_stars_sqe_header_t header;
uint8_t conds_sub_type;
uint16_t reserved0;
uint8_t reserved1 : 7;
uint8_t csc : 1;
uint16_t reserved2;
uint8_t kernel_credit;
uint8_t reserved3 : 4;
uint8_t debug_flag : 1;
uint8_t sqe_length : 3;
ts_stars_cond_op_loadimm_t ldi;
ts_stars_cond_op_LLWI_t llwi;
ts_stars_cond_op_store_t sd_overflow_cnt;
ts_stars_cond_op_store_t sd_zero[7];
} ts_stars_get_float_status_sqe_t;
#endif
typedef struct ts_stars_memcpy_async_sqe {
uint8_t type : 6;
uint8_t res0 : 2;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t res1 : 1;
uint16_t res2;
uint16_t rt_stream_id;
uint16_t task_id;
uint32_t res3;
uint16_t res4;
uint8_t kernel_credit;
uint8_t ptr_mode : 1;
uint8_t res5 : 7;
uint32_t opcode : 8;
uint32_t ie2 : 1;
uint32_t sssv : 1;
uint32_t dssv : 1;
uint32_t sns : 1;
uint32_t dns : 1;
uint32_t qos : 4;
uint32_t sro : 1;
uint32_t dro : 1;
uint32_t partid : 8;
uint32_t mpam : 1;
uint32_t d2d_offset_flag : 1;
uint32_t res6 : 3;
uint16_t src_streamid;
uint16_t src_sub_streamid;
uint16_t dst_streamid;
uint16_t dst_sub_streamid;
uint32_t length;
uint32_t src_addr_low;
uint32_t src_addr_high;
uint32_t dst_addr_low;
uint32_t dst_addr_high;
uint32_t src_offset_low;
uint32_t dst_offset_low;
uint16_t src_offset_high;
uint16_t dst_offset_high;
uint32_t res_last[1];
} ts_stars_memcpy_async_sqe_t;
typedef struct ts_stars_memcpy_ptr_async_sqe {
uint8_t type : 6;
uint8_t res0 : 2;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t res1 : 1;
uint16_t res2;
uint16_t rt_stream_id;
uint16_t task_id;
uint32_t res3;
uint16_t res4;
uint8_t kernel_credit;
uint8_t ptr_mode : 1;
uint8_t res5 : 7;
uint32_t sdma_sqe_base_addr_low;
uint32_t sdma_sqe_base_addr_high : 17;
uint32_t res6 : 14;
uint32_t va : 1;
uint32_t res_last[10];
} ts_stars_memcpy_ptr_async_sqe_t;
typedef struct ts_stars_pciedma_sqe {
ts_stars_sqe_header_t header;
uint32_t res0;
uint16_t res1;
uint16_t kernel_credit : 8;
uint16_t res2 : 8;
uint32_t sq_addr_low;
uint32_t sq_addr_high;
uint16_t sq_tail_ptr;
uint16_t res3;
uint32_t is_converted : 1;
uint32_t is_dsa_update : 1;
uint32_t is_sqe_update : 1;
uint32_t offset : 8;
uint32_t res4 : 21;
uint64_t src;
uint64_t dst;
uint64_t length;
uint32_t passid;
uint32_t res5;
}ts_stars_pciedma_sqe_t;
typedef struct ffts_sqe {
uint8_t type : 6;
uint8_t l2_lock : 1;
uint8_t l2_unlock : 1;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t reserved : 1;
uint16_t reserved1;
uint16_t stream_id;
uint16_t task_id;
uint16_t ffts_type : 3;
uint16_t reserved2 : 9;
uint16_t wrr_ratio : 4;
uint16_t reserved3;
uint16_t sqe_index;
uint16_t kernel_credit : 8;
uint16_t reserved4 : 8;
uint32_t reserved5[4];
uint32_t task_start_pc_l;
uint16_t task_start_pc_h;
uint16_t reserved6;
uint32_t task_param_ptr_l;
uint32_t task_param_ptr_h;
uint32_t reserved7[4];
} ts_ffts_sqe_t;
typedef struct ts_stars_callback_sqe {
uint8_t type : 6;
uint8_t l1_lock : 1;
uint8_t l1_unlock : 1;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t reserved : 1;
uint16_t block_dim;
uint16_t rt_stream_id;
uint16_t header_task_id;
uint16_t res0;
uint16_t kernel_type : 7;
uint16_t batch_mode : 1;
uint16_t topic_type : 4;
uint16_t qos : 3;
uint16_t res1 : 1;
uint16_t sqe_index;
uint16_t kernel_credit : 8;
uint16_t res2 : 8;
uint16_t cb_cq_id;
uint16_t cb_group_id;
uint16_t dev_id;
uint16_t stream_id;
uint16_t event_id;
uint16_t is_block;
uint16_t task_id;
uint16_t res4;
uint32_t hostfunc_addr_low;
uint32_t hostfunc_addr_high;
uint32_t fndata_low;
uint32_t fndata_high;
uint32_t res5;
uint32_t res6;
uint32_t sub_topic_id : 12;
uint32_t topic_id : 6;
uint32_t group_id : 6;
uint32_t usr_data_len : 8;
uint32_t dest_pid;
} ts_stars_callback_sqe_t;
#define TOPIC_SCHED_USER_DATA_LEN (40U)
typedef struct ts_stars_topic_sched_sqe {
uint8_t type : 6;
uint8_t l1_lock : 1;
uint8_t l1_unlock : 1;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t reserved : 1;
uint16_t block_dim;
uint16_t rt_stream_id;
uint16_t header_task_id;
uint16_t res0;
uint16_t kernel_type : 7;
uint16_t batch_mode : 1;
uint16_t topic_type : 4;
uint16_t qos : 3;
uint16_t dest_pid_flag : 1;
uint16_t sqe_index;
uint16_t kernel_credit : 8;
uint16_t res1 : 8;
"user msg" + 2Byte devid(if devid_flag == 1) + 2Byte tid(if tid_flag == 1) + 4Byte pid(if dest_pid_flag == 1) */
uint8_t user_data[TOPIC_SCHED_USER_DATA_LEN];
uint32_t sub_topic_id : 12;
uint32_t topic_id : 6;
uint32_t group_id : 6;
uint32_t usr_data_len : 6;
uint32_t devid_flag : 1;
uint32_t tid_flag : 1;
uint32_t dest_pid;
} ts_stars_topic_sched_sqe_t;
typedef struct ts_stars_write_value_sqe {
uint8_t type : 6;
uint8_t res0 : 2;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t res1 : 1;
uint16_t res2;
uint16_t rt_stream_id;
uint16_t task_id;
uint32_t res3;
uint32_t res4 : 16;
uint32_t kernel_credit : 8;
uint8_t ptr_mode : 1;
uint32_t res5 : 7;
uint32_t write_addr_low;
uint32_t write_addr_high : 17;
uint32_t res6 : 3;
uint32_t awsize : 3;
uint32_t snoop : 1;
uint32_t awcache : 4;
uint32_t awprot : 3;
uint32_t va : 1;
uint32_t res7;
uint32_t sub_type;
uint32_t write_value_part0;
uint32_t write_value_part1;
uint32_t write_value_part2;
uint32_t write_value_part3;
uint32_t write_value_part4;
uint32_t write_value_part5;
uint32_t write_value_part6;
uint32_t write_value_part7;
} ts_stars_write_value_sqe_t;
typedef struct ts_stars_ffts_plus_sqe_header {
uint8_t type : 6;
uint8_t l1_lock : 1;
uint8_t l1_unlock : 1;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t overflow_en : 1;
uint16_t block_dim;
uint16_t rt_stream_id;
uint16_t task_id;
} ts_stars_ffts_plus_sqe_header_t;
typedef struct ts_ffts_plus_sqe {
ts_stars_ffts_plus_sqe_header_t header;
uint16_t ffts_type : 3;
uint16_t cmo : 1;
uint16_t schedule_dfx_flag : 1;
uint16_t res3 : 7;
uint16_t wrr_ratio : 4;
uint16_t dsa_sq_id : 11;
uint16_t res4 : 5;
uint16_t sqe_index;
uint8_t kernel_credit;
uint8_t sub_type;
uint32_t stack_phy_base_l;
uint32_t stack_phy_base_h;
uint16_t total_context_num;
uint16_t ready_context_num;
uint16_t preload_context_num;
uint16_t timeout;
uint16_t res7;
uint16_t prefetch_ost_num : 5;
uint16_t res8 : 3;
uint16_t cmaint_ost_num : 5;
uint16_t res9 : 3;
uint16_t aic_prefetch_lower : 5;
uint16_t res10 : 3;
uint16_t aic_prefetch_upper : 5;
uint16_t res11 : 3;
uint16_t aiv_prefetch_lower : 5;
uint16_t res12 : 3;
uint16_t aiv_prefetch_upper : 5;
uint16_t res13 : 3;
uint32_t context_address_base_l;
uint32_t context_address_base_h : 17;
uint32_t res14 : 15;
uint32_t pid;
uint32_t res15[3];
} ts_ffts_plus_sqe_t;
typedef struct ts_stars_cmo_sqe {
ts_stars_sqe_header_t header;
uint16_t ffts_type : 3;
uint16_t cmo : 1;
uint16_t res1 : 8;
uint16_t wrr_ratio : 4;
uint16_t res2;
uint16_t res3;
uint16_t kernel_credit : 8;
uint16_t schem : 2;
uint16_t res4 : 1;
uint16_t icache_prefetch_cnt : 5;
uint16_t cmo_type;
uint16_t cmo_id;
uint32_t res5;
uint32_t res6;
uint32_t res7;
uint32_t opcode : 8;
uint32_t ie2 : 1;
uint32_t sssv : 1;
uint32_t dssv : 1;
uint32_t sns : 1;
uint32_t dns : 1;
uint32_t qos : 4;
uint32_t sro : 1;
uint32_t dro : 1;
uint32_t part_id : 8;
uint32_t mpam : 1;
uint32_t pmg : 2;
uint32_t format : 1;
uint32_t res8 : 1;
uint16_t src_streamid;
uint16_t src_sub_streamid;
uint16_t num_outer;
uint16_t num_inner;
uint32_t length;
uint32_t src_addr_low;
uint32_t src_addr_high;
uint32_t stride_outer;
uint32_t stride_inner;
} ts_stars_cmo_sqe_t;
typedef struct ts_stars_cdqm_sqe {
ts_stars_sqe_header_t header;
uint32_t sqe_index : 16;
uint32_t res0 : 16;
uint32_t res1 : 16;
uint32_t kernel_credit : 8;
uint32_t ptr_mode : 1;
uint32_t res3 : 7;
uint32_t cdqe_addr_low;
uint32_t cdqe_addr_high : 17;
uint32_t res4 : 14;
uint32_t va : 1;
uint32_t cdqe_index : 16;
uint32_t cdq_id : 16;
uint32_t die_id : 16;
uint32_t res5 : 16;
uint8_t cdqe[15];
uint8_t res6 : 7;
uint8_t ready : 1;
uint32_t res7[4];
} ts_stars_cdqm_sqe_t;
typedef struct ts_stars_dsa_sqe {
ts_stars_sqe_header_t header;
uint32_t start : 1;
uint32_t function_type : 3;
uint32_t data_type : 3;
uint32_t algo_type : 3;
uint32_t param_vld_bitmap : 5;
uint32_t param_addr_val_bitmap : 7;
uint32_t res0 : 10;
uint16_t sqe_index;
uint8_t kernel_credit;
uint8_t res1;
uint32_t cfg_result_addr_low;
uint32_t cfg_result_addr_high;
uint32_t cfg_state_addr_low;
uint32_t cfg_state_addr_high;
uint32_t cfg_param_addr_low;
uint32_t cfg_param_addr_high;
uint32_t cfg_seed_low;
uint32_t cfg_seed_high;
uint32_t cfg_number_low;
uint32_t cfg_number_high;
uint16_t ctx_id;
uint16_t slot_id : 4;
uint16_t err_bit : 1;
uint16_t res2 : 11;
uint16_t thread_id;
uint16_t res3;
} ts_stars_dsa_sqe_t;
typedef struct ts_stars_cqe {
uint16_t phase : 1;
uint16_t warn : 1;
uint16_t evt : 1;
uint16_t place_hold : 1;
uint16_t sq_id : 11;
uint16_t error_bit : 1;
uint16_t sq_head;
uint16_t stream_id;
uint16_t task_id;
uint16_t err_type : 8;
uint16_t drop_flag : 1;
uint16_t rsv : 1;
uint16_t sqe_type : 6;
uint16_t sq_index;
uint32_t status;
} ts_stars_cqe_t;
#define MAX_CMO_INFO_NUM (6U)
typedef struct ts_stars_cmo_info {
uint16_t cmo_type;
uint16_t cmo_id;
} ts_stars_cmo_info_t;
typedef struct ts_stars_barrier_sqe {
ts_stars_sqe_header_t header;
uint16_t ffts_type : 3;
uint16_t cmo : 1;
uint16_t res1 : 8;
uint16_t wrr_ratio : 4;
uint16_t res2;
uint16_t sqe_index;
uint16_t kernel_credit : 8;
uint16_t schem : 2;
uint16_t res3 : 1;
uint16_t icache_prefetch_cnt : 5;
uint16_t cmo_type;
uint16_t cmo_bitmap : 6;
uint16_t res4 : 10;
ts_stars_cmo_info_t cmo_info[MAX_CMO_INFO_NUM];
uint32_t res5[5];
} ts_stars_barrier_sqe_t;
#if defined(CFG_SOC_PLATFORM_KPSTARS)
typedef struct ts_stars_rdma_sqe {
uint8_t type : 6;
uint8_t res0 : 2;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t res1 : 1;
uint16_t res2;
uint16_t rt_stream_id;
uint16_t task_id;
uint32_t res3;
uint16_t res4;
uint8_t kernel_credit;
uint8_t reserved0 : 7;
uint8_t clr : 1;
uint32_t rdma_qp_addr_low;
uint32_t rdma_qp_addr_high;
uint32_t tag : 24;
uint32_t cmd : 4;
uint32_t reserved1 : 3;
uint32_t flag : 1;
uint32_t param;
uint32_t wait_cqe_num : 16;
uint32_t hac_func_id : 8;
uint32_t qp_va : 1;
uint32_t ssv : 1;
uint32_t reserved2 : 6;
uint32_t rdma_smmu_stream_id : 16;
uint32_t rdma_smmu_substream_id : 16;
uint32_t res_last[6];
} ts_stars_rdma_sqe_t;
typedef struct ts_stars_sdma_sqe {
uint8_t type : 6;
uint8_t res0 : 2;
uint8_t ie : 2;
uint8_t pre_p : 2;
uint8_t post_p : 2;
uint8_t wr_cqe : 1;
uint8_t res1 : 1;
uint16_t res2;
uint16_t rt_stream_id;
uint16_t task_id;
uint32_t res3;
uint16_t res4;
uint8_t kernel_credit;
uint8_t reserved0 : 7;
uint8_t clr : 1;
uint32_t opcode : 8;
uint32_t sssv : 1;
uint32_t dssv : 1;
uint32_t sns : 1;
uint32_t dns : 1;
uint32_t sro : 1;
uint32_t dro : 1;
uint32_t stride : 2;
uint32_t ie1 : 1;
uint32_t comp_en : 1;
uint32_t reserved1 : 14;
uint32_t sqe_id : 16;
uint32_t mpam_partid : 8;
uint32_t mpamns : 1;
uint32_t pmg : 2;
uint32_t qos : 4;
uint32_t reserved2 : 1;
uint32_t src_streamid : 16;
uint32_t src_substreamid : 16;
uint32_t dst_streamid : 16;
uint32_t dst_substreamid : 16;
uint32_t src_addr_l;
uint32_t src_addr_h;
uint32_t dst_addr_l;
uint32_t dst_addr_h;
uint32_t length_move : 32;
uint32_t src_stride_len : 32;
uint32_t dst_stride_len : 32;
uint32_t stride_num : 32;
} ts_stars_sdma_sqe_t;
#endif
typedef struct ts_stars_aic_sqe_t {
ts_stars_sqe_header_t header;
uint16_t ffts_type : 3;
uint16_t res1 : 9;
uint16_t wrr_ratio : 4;
uint16_t res2;
uint16_t sqe_index;
uint16_t kernel_credit : 8;
uint16_t schem : 2;
uint16_t res3 : 1;
uint16_t icache_prefetch_cnt : 5;
uint32_t stack_phy_base_low;
uint32_t stack_phy_base_high;
uint32_t res4;
uint32_t pmg : 2;
uint32_t ns : 1;
uint32_t part_id : 8;
uint32_t res5 : 1;
uint32_t qos : 4;
uint32_t res6 : 16;
uint32_t pc_addr_low;
uint32_t pc_addr_high : 16;
uint32_t res7 : 16;
uint32_t param_addr_low;
uint32_t param_addr_high;
uint32_t res8[4];
} ts_stars_aic_sqe_t;
#pragma pack(pop)
#ifdef __cplusplus
}
#endif
#endif