[Feature][Modem]Update MTK MODEM V1.6 baseline version: MOLY.NR15.R3.MD700.IVT.MP1MR3.MP.V1.6

MTK modem version: MT2735_IVT_MOLY.NR15.R3.MD700.IVT.MP1MR3.MP.V1.6.tar.gz
RF  modem version: NA

Change-Id: I45a4c2752fa9d1a618beacd5d40737fb39ab64fb
diff --git a/mcu/interface/service/dhl/v1/GV.h b/mcu/interface/service/dhl/v1/GV.h
new file mode 100644
index 0000000..4c4a14f
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/GV.h
@@ -0,0 +1,89 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   GV.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   Global variable read/write type definition
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 05 07 2014 eason.lai
+ * [MOLY00064969] [DHL]expand tab to 4 spaces to have better typesettings
+ * .
+ *
+ * 11 07 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * dhl module check-in.
+ ****************************************************************************/
+#ifndef _GV1_H
+#define _GV1_H
+
+#include "kal_general_types.h"
+
+typedef struct
+{
+    kal_uint32  ID;
+    kal_uint16  Type;
+    kal_uint16  offset;
+    kal_uint16  size;
+    kal_uint16  NbrOFPtr;
+    kal_uint16  Ptrs[1];
+} GV_Struct;
+
+typedef struct
+{
+    kal_uint16  size;
+    kal_uint8   *data;
+} GVReturn;
+
+void GV_ReadVar(kal_uint8 *_GVCmd, GVReturn *Var);
+void GV_WriteVar(kal_uint8 *_GVCmd, kal_uint8 *var);
+
+#endif
+
diff --git a/mcu/interface/service/dhl/v1/L1Trc.h b/mcu/interface/service/dhl/v1/L1Trc.h
new file mode 100644
index 0000000..94912b0
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/L1Trc.h
@@ -0,0 +1,892 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   L1Trc.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   Layer 1 trace interface
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 04 21 2019 yh.sung
+ * [MOLY00392990] [VMOLY][UTF] Phase 2 Landing
+ * [UTF][DHL] UTF Trace API - trace interface
+ *
+ * 06 22 2018 yancy.chien
+ * [MOLY00331449] [Gen97] DHL logging development
+ * 	Migration on UMOLYE.
+ *
+ * 05 24 2018 yancy.chien
+ * [MOLY00258174] [Gen95][DHL] logging development.
+ *
+ * 01 31 2018 yancy.chien
+ * [MOLY00304870] [DHL] L1 Trace array support
+ * 1. ULSP version macro & function
+ * 2. SW version macro & function, for L1: VPE0~5 & L2: ert/hif/el2
+ * 3. COND&HW_COND version macro & function
+ * 4. Mechanism for check max argument size
+ *
+ * 12 20 2017 kenneth.lin
+ * [MOLY00253909] [DHL] Gen 95 development
+ * 	
+ * 	[DHL] API change on xl1sim
+ * 	- for cgen update
+ *
+ * 12 20 2017 kenneth.lin
+ * [MOLY00253909] [DHL] Gen 95 development
+ * [DHL] API change on xl1sim
+ * 	- for cgen update
+ *
+ * 11 30 2017 yu-hsiang.peng
+ * [MOLY00292252] [6293] Print L2 timestamp when current is non-4G
+ * [UMOLYA.TRUNK] L2 23G time
+ *
+ * 11 03 2017 yancy.chien
+ * [MOLY00258174] [Gen95][DHL] logging development
+ * Merge from DEV branch.
+ *
+ * 09 07 2017 yu-hsiang.peng
+ * [MOLY00275876] [Gen93] L1 trace code size silm
+ * [UMOLYA.TRUNK] L1 trace redefine
+ *
+ * 08 16 2017 yu-hsiang.peng
+ * [MOLY00266204] [Gen93] Common feature development before control
+ * [UMOLYA.TRUNK] Two features 
+ * 	1. OTA message filter 
+ * 	2. Non-smp use function check
+ *
+ * 06 20 2017 kenneth.lin
+ * [MOLY00257978] conditional trace development
+ * 	
+ * 	add typedef cgen_use_L1ULSP_NOT_PREPROCESS in 92 gen flow
+ *
+ * 06 19 2017 yancy.chien
+ * [MOLY00257978] conditional trace development
+ * Fix build error.
+ *
+ * 06 19 2017 yancy.chien
+ * [MOLY00257978] conditional trace development
+ * 1st phase-in.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ * 	     Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ * 04 20 2017 yu-hsiang.peng
+ * [MOLY00243236] [6293] L1trace LISR check use macro
+ * [UMOLYA.TRUNK] ulsp lisr check use macro to enhance debug flow
+ *
+ * 03 20 2017 kenneth.lin
+ * [MOLY00235284] [xL1SIM][DHL] support ulsp logging feature in xl1sim
+ * [xl1sim][DHL] ulsp code refactoring
+ *
+ * 03 14 2017 kenneth.lin
+ * [MOLY00235284] [xL1SIM][DHL] support ulsp logging feature in xl1sim
+ * fixed build failed on UESIM
+ *
+ * 03 14 2017 kenneth.lin
+ * [MOLY00235284] [xL1SIM][DHL] support ulsp logging feature in xl1sim
+ *
+ *  DHL support ulsp logging feature in xl1sim
+ *
+ *  1. enable __USE_ULSP__
+ *  2. implement ulsp macro to send ELT directly
+ *
+ * 03 10 2017 yu-hsiang.peng
+ * [MOLY00224307] [MT6293] General feature change before MP branch create
+ * [UMOLYA.TRUNK] add L1 time trace new format
+ *
+ * 03 10 2017 yu-hsiang.peng
+ * [MOLY00224307] [MT6293] General feature change before MP branch create
+ * [UMOLYA.TRUNK] Fix target build warning
+ *
+ * 03 07 2017 yu-hsiang.peng
+ * [MOLY00224307] [MT6293] General feature change before MP branch create
+ * [UMOLYA.TRUNK] move filter to L2 cached lock
+ *
+ * 03 01 2017 yu-hsiang.peng
+ * [MOLY00231055] [Bianco Bring-up] [6293] L1L2 trace new verison (CGen & DHL)
+ * [UMOLYA.TRUNK] Fix non-smp trace api build warning
+ *
+ * 02 22 2017 yu-hsiang.peng
+ * [MOLY00231055] [Bianco Bring-up] [6293] L1L2 trace new verison (CGen & DHL)
+ * [UMOLYA.TRUNK] change L1/L2 trace macro.
+ *
+ * 02 08 2017 willie.pan
+ * [MOLY00163869] [6293][ULS+] Support 9~16 words for L2 logging in MoDIS
+ *
+ *  .
+ *
+ * 12 15 2016 willie.pan
+ * [MOLY00163869] Support 8 word API for MODIS L2 Logging
+ *
+ * 11 29 2016 yu-hsiang.peng
+ * [MOLY00210769] [MT6293] MT6292 CCB service migrate to MT6293 and MT6293 ULSP logging on CCB development
+ * [UMOLYA] Add bound sync in L1L2 redump info.
+ *
+ * 11 28 2016 yu-hsiang.peng
+ * [MOLY00210769] [MT6293] MT6292 CCB service migrate to MT6293 and MT6293 ULSP logging on CCB development
+ * .UMOLYA] Add idle sync in L1L2 redump info.
+ *
+ * 11 14 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In]
+ *
+ *  . Suooprt L2 logging @ xL1SIM
+ *
+ * 11 11 2016 yancy.chien
+ * [MOLY00212754] [MT6293][NWSIM][3G][R6][All case][BLOCK] UESIM power on always error at l2trc_send_4_word_int
+ *  Fix build error.
+ *
+ * 11 11 2016 yancy.chien
+ * [MOLY00212754] [MT6293][NWSIM][3G][R6][All case][BLOCK] UESIM power on always error at l2trc_send_4_word_int
+ *
+ * 11 08 2016 yancy.chien
+ * [MOLY00211534] [DHL] [L1/L2] Workaround for pass funtion in macro parameter issue
+ *
+ * 11 02 2016 yu-hsiang.peng
+ * [MOLY00210965] [MT6293] Patch MT6290, MT6291, MT6292 change into UMOLYA
+ * [UMOLYA.TRUNK] merge Yancy's CL3048791 & CL#3049395
+ *
+ * 11 01 2016 yancy.chien
+ * [MOLY00200296] [DHL] C2K Time Trace API.
+ *  1. Enlarge ping/pong buffer size to 128KB on UT env
+ *  2. Wrap time trace API by C2K_RAT option
+ *
+ * 11 01 2016 yu-hsiang.peng
+ * [MOLY00210769] [MT6293] MT6292 CCB service migrate to MT6293 and MT6293 ULSP logging on CCB development
+ * [UMOLYA.TRUNK] ULSP on CCB full load logging, normal logging(stage 1)
+ *
+ * 10 27 2016 yancy.chien
+ * [MOLY00181823] [DHL] UMOLY Migrate to UMOLYA - W16.44 Migration.
+ *
+ * 10 14 2016 yancy.chien
+ * [MOLY00181823] [DHL] UMOLY Migrate to UMOLYA
+ * [93Only] Add C2K time API for trigger flush event in MoDIS / UESIM
+ *
+ * 10 03 2016 yancy.chien
+ * [MOLY00181823] [DHL] UMOLY Migrate to UMOLYA
+ *  W16.41 Migration
+ *    Merge L1Trc related function to fix MoDIS logging issue.
+ *
+ * 09 22 2016 jean.tsao
+ * [MOLY00185213] [UMOLYA] DHL 92 SW logging migrate to 93
+ * [ULSP] MCU side driver API
+ *
+ * 09 21 2016 yu-hsiang.peng
+ * [MOLY00201169] [MT6293] DHL EBS support
+ * [UMOLYA.TRUNK]  ULSP buffer put in non-cached
+ * (Required by Cynthia.Sun & Willie Pan)
+ *
+ * 09 20 2016 yu-hsiang.peng
+ * [MOLY00190921] [MT6293] Fix DHL Build Warning
+ * [UMOLYA.TRUNK]. Fix XL1SIM build warning
+ *
+ * 09 20 2016 yu-hsiang.peng
+ * [MOLY00185213] [MT6293] DHL MT6292 SW logging migrate to MT6293 & MT6293 ULSP logging development
+ * [UMOLYA.TRUNK]  EX flow L1/L2 redump trace
+ *
+ * 09 14 2016 yu-hsiang.peng
+ * [MOLY00185213] [MT6293] DHL MT6292 SW logging migrate to MT6293 & MT6293 ULSP logging development
+ * [UMOLYA.TRUNK] Exception TMD & Macross templete
+ *
+ * 09 13 2016 yu-hsiang.peng
+ * [MOLY00190921] [MT6293] Fix DHL Build Warning
+ * [UMOLYA.TRUNK] Fix mask interrupt build warning
+ *
+ * 08 11 2016 yu-hsiang.peng
+ * [MOLY00185213] [MT6293] DHL MT6292 SW logging migrate to MT6293 & MT6293 ULSP logging development
+ * [UMOLYA.TRUNK] Merge back 93 ULSP 1st connect ELT code - increase LS buffer size (stage 4)
+ *
+ * 08 03 2016 yu-hsiang.peng
+ * [MOLY00185213] [MT6293] DHL MT6292 SW logging migrate to MT6293 & MT6293 ULSP logging development
+ * [UMOLYA.TRUNK] Merge back 93 ULSP 1st connect ELT code (stage 4)
+ *
+ * 07 22 2016 yancy.chien
+ * [MOLY00192766] [DHL] L1/L2 Trace optimization
+ *  Remove redundant "filter[0]==1" checking
+ *
+ * 07 14 2016 yu-hsiang.peng
+ * [MOLY00190921] [MT6293] Fix DHL Build Warning
+ * Kuo-Wei Hung requirement : Fix xL1SIM warning
+ *
+ * 06 24 2016 yu-hsiang.peng
+ * [MOLY00185213] [UMOLYA] DHL 92 SW logging migrate to 93
+ * [UMOLYA.TRUNK] 93 ULSP trace macro  & LS 1st integrate (stage 2)
+ *
+ * 06 21 2016 yu-hsiang.peng
+ * [MOLY00185213] [UMOLYA] DHL 92 SW logging migrate to 93
+ * [UMOLYA.TRUNK] 92 SW logging migration & 93 L1 L2 trace macro (stage 1)
+ *
+ * 05 26 2016 yancy.chien
+ * [MOLY00181823] [DHL] UMOLY Migrate to UMOLYA
+ * .
+ *
+ * 05 16 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In] Fix warning of ULSP macro
+ *
+ *  .
+ *
+ * 04 26 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In] ULS+ PAE Log Parsing Feature Phase In
+ *
+ *  .
+ *
+ * 04 25 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In] Fix ULS+ offset for PAE
+ *
+ *  .
+ *
+ * 04 15 2016 eason.lai
+ * [MOLY00173976] [6292][DHL] L1/L2 trace integrated with log DMA
+ *  logDMA is not enabled yet due to logDMA sperious IRQ is not fixed
+ *
+ * 04 14 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In]
+ *
+ *  .Optimize interrupt disable in ULS+ solution
+ *
+ * 04 13 2016 eason.lai
+ * [MOLY00173976] [6292][DHL] L1/L2 trace integrated with log DMA
+ *  This change haven't enable the log DMA due to log DMA IRQ has
+ *                       spurious interrupt.
+ *
+ * 04 13 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In] Modification for L1/L2 Logging Profiling
+ *
+ *  .
+ *
+ * 04 07 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In]
+ *
+ *  .
+ *
+ * 04 06 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In]
+ *
+ *  . Update for new L1/L2 logging API
+ *
+ * 04 06 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In]
+ *
+ *  .
+ *
+ * 04 05 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In]
+ *
+ *  .
+ *
+ * 03 31 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In] Temporary use old inerrupt disable API on ULS+
+ *
+ *  .
+ *
+ * 03 30 2016 eason.lai
+ * [MOLY00171573] [DHL] apply CIRQ EI/DI marco (without 40Qbit check)
+ *  fixed xl1sim L1D cosim regression fail issue
+ *
+ * 03 29 2016 eason.lai
+ * [MOLY00171573] [DHL] apply CIRQ EI/DI marco (without 40Qbit check)
+ *  1. apply CIRQ EI/DI marco on L1 trace
+ *  2. fixed l1trace potential bug
+ *  3. support L1_CATCHER = FALSE
+ *
+ * 03 21 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In] Add ULSP L1&L2 Logging Macro
+ *
+ *  .
+ *
+ * 03 21 2016 eason.lai
+ * [MOLY00170160] [6292/Elbrus][DHL] L1trace HRT enhancement
+ *  reduce caller codesize overhead
+ *
+ * 03 14 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In] Fix auto-TCM issue
+ *
+ *  .
+ *
+ * 03 14 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In]
+ *
+ *  .
+ *
+ * 02 26 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In]
+ *
+ *  .
+ *
+ * 02 26 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In]
+ *
+ *  .ULS+ for L1 PAE
+ *
+ * 02 26 2016 eason.lai
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In]
+ *  disabled  L2 timesatmp hardcode
+ *
+ * 02 01 2016 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *  l1/l2 log redump
+ *
+ * 01 28 2016 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *
+ *  replace SaveAndSetIRQMask with kal_hrt_SaveAndSetIRQMask
+ *
+ * 01 26 2016 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *  1. load filter from nvram at task init
+ *  2. exception log dump
+ *
+ * 11 25 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ * refine the xl1sim option in DHL and restore the patch of CL#1796032.
+ *
+ * 11 23 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ * xl1sim introduce SMP DHL
+ *
+ * 10 30 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *
+ *  remove __PCORE__ and __L1CORE__ option
+ *
+ * 10 26 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *  enable L1/L2 trace bit decoding
+ *
+ * 10 23 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *
+ *  SMP DHL logging migration
+ *
+ * 09 21 2015 yu-hsiang.peng
+ * [MOLY00142553] [DHL] fix build warning for LR11 MP/Trunk
+ * [UMOLY.Trunk] Fix build warning(0921)
+ *
+ * 08 27 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *  fixed link error
+ *
+ * 07 22 2015 eason.lai
+ * [MOLY00130157] [TK6291][DHL] smart logging migration
+ *  fixed dhl_trace.c assert @ 1340
+ *
+ * 07 22 2015 eason.lai
+ * [MOLY00130157] [TK6291][DHL] smart logging migration
+ *  .
+ *
+ * 07 10 2015 eason.lai
+ * merge code
+ *
+ * 05 15 2015 eason.lai
+ * [MOLY00113901] [TK6291][DHL] change pcore/l1core l1trace buffer size
+ *  base on PAE result, pcore 8KB, l1core 64KB
+ *
+ * 04 26 2015 eason.lai
+ * [MOLY00109038] [TK6291E1][pre 1st Call][UMOLY][4G][FDD] There's no assert/fatal error message on "System Trace(L1CORE)" window
+ *  1. fixed l1core assert log missing by the potential problem.
+ *  2. start to support l1core l1 filer store in NVRAM
+ *
+ * 04 15 2015 eason.lai
+ * [MOLY00107803] [TK6291][DHL] PAE simulation code and option patch back.
+ *  as CR title.
+ *
+ * 04 09 2015 eason.lai
+ * [MOLY00105513] [TK6291][DHL] introduce GPD/SPD wrapper
+ *       GPD/SPD wrapper and L2copro log dma
+ *
+ * 03 17 2015 eason.lai
+ * [MOLY00084440] [MT6291][DHL] Patch back UMOLY trunk from MT6291_DEV
+ * move L1 trace buffer to L2SRAM, and change tst ring buffer as cacheable
+ *
+ * 02 10 2015 eason.lai
+ * [MOLY00095350] [TK6291][DHL] enable 64us timestamp in modis/uesim
+ *  move l2 trace timestamp marco to be function call
+ *
+ * 11 24 2014 eason.lai
+ * [MOLY00084440] [MT6291][DHL] Patch back UMOLY trunk from MT6291_DEV
+ * FMA global timer
+ *
+ * 11 14 2014 eason.lai
+ * [MOLY00084440] [MT6291][DHL] Patch back UMOLY trunk from MT6291_DEV
+ *  first time patch back
+ *
+ * 06 09 2014 ken.liu
+ * [MOLY00062708] [DHL] enable L1Boxster support.
+ * re-enable l1 boxster.
+ *
+ * 05 07 2014 eason.lai
+ * [MOLY00064969] [DHL]expand tab to 4 spaces to have better typesettings
+ * .
+ *
+ * 04 29 2014 ken.liu
+ * [MOLY00062708] [DHL] enable L1Boxster support.
+ * rollback L1boxster to align ELT support.
+ *
+ * 04 16 2014 ken.liu
+ * [MOLY00062708] [DHL] enable L1Boxster support.
+ * disable l1boxster on modis.
+ *
+ * 04 16 2014 ken.liu
+ * [MOLY00062708] [DHL] enable L1Boxster support.
+ * enable l1boxster by default.
+ *
+ * 04 15 2014 ken.liu
+ * [MOLY00062708] [DHL] enable L1Boxster support.
+ * Disable l1boxster by default due to incorrect usage of L1 trace API in AST L1 module.
+ *
+ * 04 15 2014 ken.liu
+ * [MOLY00062708] [DHL] enable L1Boxster support.
+ * fix modis build error.
+ *
+ * 04 15 2014 ken.liu
+ * [MOLY00062708] [DHL] enable L1Boxster support.
+ * fix modis build error.
+ *
+ * 04 15 2014 ken.liu
+ * [MOLY00062708] [DHL] enable L1Boxster support.
+ * enable L1Boxster support and optimization.
+ *
+ * 04 07 2014 eason.lai
+ * [MOLY00061900] [DHL][K95 MD2] merge code from DEV branch
+ *  .
+ *
+ * 03 24 2014 ken.liu
+ * [MOLY00060207] [DHL] support L2 log buffer in TCM
+ * support l2 buffer from tcm sections.
+ *
+ * 03 13 2014 ken.liu
+ * [MOLY00059075] [xL1SIM] Patch back to MOLY
+ * add TRC_L2_PAD define.
+ *
+ * 03 10 2014 willie.pan
+ * [MOLY00059007] [MT6290E2][EL1] Sync DSP log and L1 trace by A time
+ *  .
+ *
+ * 03 07 2014 ken.liu
+ * [MOLY00058420] [DHL] Fast interrupt mask/unmask via inline assembly for L2 trace
+ * enable __L2_LOGGING_IRQ_LOC__.
+ *
+ * 03 06 2014 ken.liu
+ * [MOLY00058420] [DHL] Fast interrupt mask/unmask via inline assembly for L2 trace
+ * fix modis build error.
+ *
+ * 03 06 2014 ken.liu
+ * [MOLY00058420] [DHL] Fast interrupt mask/unmask via inline assembly for L2 trace
+ * replace l2 trace interrupt mask/unmask with inline assembly.
+ *
+ * 02 26 2014 eason.lai
+ * [MOLY00057680] [L2][HMU][DHL] L2 trace and L2 timestamp support
+ * Provide L2 trace timestamp API and change L2 trace type number
+ *
+ * 08 26 2013 mojo.lai
+ * [MOLY00035110] Fix DHL L1 trace decode fail issue
+ *
+ * 05 15 2013 ken.liu
+ * [MOLY00020676] [MT6290 Bring-up] Layer 2 trace enum arg and filter support
+ * enable l2 trace enum support.
+ *
+ * 04 30 2013 ken.liu
+ * [MOLY00021076] [MT6290 Bring-up] DHL flush log uses too much CPU time before entering idle task
+ * sync from MT6290E1_FirstCall.
+ *
+ * 03 08 2013 ken.liu
+ * [MOLY00009212] LTE Multimode merge back to MOLY
+ * 1. add dhl_EM_logger api.
+ * 2. resend exception log on first tool connection.
+ *
+ * 01 24 2013 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * enable flush log on assert
+ *
+ * 12 26 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * sync TST new api trc_UpdateTimeStamp.
+ *
+ * 11 29 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * sync section attribute for layer 1 trace and l1 sim task/hisr config for DHL.
+ *
+ * 11 07 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * dhl module check-in.
+ ****************************************************************************/
+/* Normal L1 traces exmaple
+
+1. default
+#define UMTS_3G_GEMINI_TIME(v1, v2, v3, v4, v5) do {\
+    {\
+        TRC_START_FILTER_CHECK_L1(DHL_L1Trace_Filter, 1, 0x01);\
+        TRC_PREPROCESS_DATA_SECTION1_L1(cgen_local_v1,v1);\
+        TRC_PREPROCESS_DATA_SECTION1_L1(cgen_local_v2,v2);\
+        TRC_PREPROCESS_DATA_SECTION1_L1(cgen_local_v3,v3);\
+        TRC_PREPROCESS_DATA_SECTION1_L1(cgen_local_v4,v4);\
+        TRC_PREPROCESS_DATA_SECTION1_L1(cgen_local_v5,v5);\
+        TRC_START_FILL_L1();\
+        TRC_PREPROCESS_DATA_SECTION2_L1(cgen_local_v1,v1);\
+        TRC_PREPROCESS_DATA_SECTION2_L1(cgen_local_v2,v2);\
+        TRC_PREPROCESS_DATA_SECTION2_L1(cgen_local_v3,v3);\
+        TRC_PREPROCESS_DATA_SECTION2_L1(cgen_local_v4,v4);\
+        TRC_PREPROCESS_DATA_SECTION2_L1(cgen_local_v5,v5);\
+        TRC_OUTPUT_16_FIRST_WRAPPER_L1(0x0000,0x0000);\
+        TRC_OUTPUT_8_MID_WRAPPER_L1(cgen_local_v1,v1);\
+        TRC_OUTPUT_16_MID_WRAPPER_L1(cgen_local_v2,v2);\
+        TRC_OUTPUT_32_MID_WRAPPER_L1(cgen_local_v3,v3);\
+        TRC_OUTPUT_16_MID_WRAPPER_L1(cgen_local_v4,v4);\
+        TRC_OUTPUT_32_LAST_WRAPPER_L1(cgen_local_v5,v5);\
+        TRC_END_FILL_L1();\
+        TRC_END_FILTER_CHECK_L1(DHL_L1Trace_Filter, 1, 0x01);\
+    }\	
+} while(0)
+
+2. non_smp
+#define UMTS_3G_GEMINI_TIME(v1, v2, v3, v4, v5) do {\
+    {\
+        TRC_START_FILTER_CHECK_L1_NON_SMP(DHL_L1_Trace_Filter, 1, 0x01);\
+        TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP(cgen_local_v1,v1);\
+        TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP(cgen_local_v2,v2);\
+        TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP(cgen_local_v3,v3);\
+        TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP(cgen_local_v4,v4);\
+        TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP(cgen_local_v5,v5);\
+        TRC_START_FILL_L1_NON_SMP();\
+        TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP(cgen_local_v1,v1);\
+        TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP(cgen_local_v2,v2);\
+        TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP(cgen_local_v3,v3);\
+        TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP(cgen_local_v4,v4);\
+        TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP(cgen_local_v5,v5);\
+        TRC_OUTPUT_16_FIRST_WRAPPER_L1_NON_SMP(0x0000,0x0000);\
+        TRC_OUTPUT_8_MID_WRAPPER_L1_NON_SMP(cgen_local_v1,v1);\
+        TRC_OUTPUT_16_MID_WRAPPER_L1_NON_SMP(cgen_local_v2,v2);\
+        TRC_OUTPUT_32_MID_WRAPPER_L1_NON_SMP(cgen_local_v3,v3);\
+        TRC_OUTPUT_16_MID_WRAPPER_L1_NON_SMP(cgen_local_v4,v4);\
+        TRC_OUTPUT_32_LAST_WRAPPER_L1_NON_SMP(cgen_local_v5,v5);\
+        TRC_END_FILL_L1_NON_SMP();\
+        TRC_END_FILTER_CHECK_L1_NON_SMP(DHL_L1_Trace_Filter, 1, 0x01);\
+    }\	
+} while(0)
+
+
+*/
+// __USE_ULSP__               : Use ULSP HW logger
+// __USE_ULSP_SW_SIMULATOR__  : Use ULSP SW Simulator, this option shouldn't co-exist with __USE_USLP__
+
+/**********************/
+/* CGen gen format    */
+/**********************/
+
+#if defined(__USE_ULSP__) || defined(__USE_ULSP_SW_SIMULATOR__)
+
+typedef int cgen_use_L1ULSP;
+typedef int cgen_use_L1BitField;
+typedef int cgen_use_L1CondTrace;
+
+#if defined(__USE_ULSP_SW_SIMULATOR__)
+typedef int cgen_use_L1ULSP_Func_Impl;
+#endif
+
+#else
+
+typedef int cgen_use_L1Boxster;
+typedef int cgen_use_L2Boxster;
+typedef int cgen_use_L1BitField;
+typedef int cgen_use_L1ULSP_NOT_PREPROCESS; //workaround for cgen
+
+#endif
+
+#if defined (L1_CATCHER)
+#ifndef _L1TRC_H
+#define _L1TRC_H
+
+// legacy SW logging format, but still need for conditional trace
+#define TRC_L2_PAD (0xFA)
+#define TRC_BOXSTER_PAD (0xFA)
+//Use MACRO
+#define TRC_MERGE_2S_MACRO(v1, v2) ( (kal_uint32)(v1&0xFFFF) + ( ((kal_uint32)v2)<<16 ))
+#define TRC_MERGE_1S2C_MACRO(v1, v2, v3) ( (kal_uint32)(v1&0xFFFF) + ( ( (kal_uint32)(v2&0xFF) )<<16) + ( ((kal_uint32)v3)<<24) )
+#define TRC_MERGE_4C_MACRO(v1, v2, v3, v4) ( (kal_uint32)(v1&0xFF) + ( ((kal_uint32)(v2&0xFF))<<8) + ( ((kal_uint32)(v3&0xFF))<<16) + ( ((kal_uint32)v4)<<24))
+
+#define TRC_MERGE_2S(v1, v2) TRC_MERGE_2S_MACRO((v1), (v2))
+#define TRC_MERGE_1S2C(v1, v2, v3) TRC_MERGE_1S2C_MACRO((v1), (v2), (v3))
+#define TRC_MERGE_4C(v1, v2, v3, v4) TRC_MERGE_4C_MACRO((v1), (v2), (v3), (v4))
+
+
+
+/* for Cgen 92 SW logging, need Cgen help to remove, otherwise build error */
+typedef enum
+{
+    L1CSPM_DEFAULT,
+    SPIN_LOCK,
+    HW_ITC
+} E_DHL_TMD_CRIT_PROT;
+typedef enum
+{
+    L2_BUFFER_DEFAULT = 0,
+    L2_BUFFER_EL2 = L2_BUFFER_DEFAULT,
+    L2_BUFFER_HIF = 1,
+    L2_BUFFER_ERT = 2,
+    L2_BUFFER_END = 3
+} E_DHL_L2_BUFFER_MAPPING_TABLE;
+
+/*must some with MAX_UNIFIED_TRACE_CLASS_BYTE */
+typedef enum
+{
+    MAX_L1_TRACE_CLASS_BYTE = 8
+} E_NUM_L1_TRACE_CLASS;
+
+//#define __DHL_LEGACY_TRACE_API_ENABLE__
+
+/***************************/
+/* Include                 */
+/***************************/
+
+#include "kal_general_types.h"
+#include "kal_public_api.h"
+#if defined(__USE_ULSP__)
+#include "ulsp_mcu_logging.h"
+#endif//#if defined(__USE_ULSP__)
+
+
+/************************/
+/* Definition - IRQ     */
+/************************/
+#if defined(__MTK_TARGET__)
+#if !defined(__L2_LOGGING_IRQ_LOC__)
+#define __L2_LOGGING_IRQ_LOC__
+#endif
+#endif
+
+#if defined(__L2_LOGGING_IRQ_LOC__)
+extern kal_uint32 dhl_SaveAndSetIRQMask_cirq_wrap(void);
+extern void dhl_RestoreIRQMask_cirq_wrap(kal_uint32 status);
+#define DHL_LOCK_CPU_INTERRUPT(oldmask) \
+    do{ \
+        oldmask = dhl_SaveAndSetIRQMask_cirq_wrap(); \
+    }while(0)
+
+#define DHL_UNLOCK_CPU_INTERRUPT(oldmask) \
+    do{ \
+        dhl_RestoreIRQMask_cirq_wrap(oldmask); \
+    }while(0)
+#elif defined(__MTK_TARGET__)
+
+extern kal_uint32 kal_hrt_SaveAndSetIRQMask(void);
+extern void kal_hrt_RestoreIRQMask(kal_uint32 irq);
+extern kal_uint32 dhl_SaveAndSetIRQMask_cirq_wrap(void);
+extern void dhl_RestoreIRQMask_cirq_wrap(kal_uint32 status);
+
+
+
+#define DHL_LOCK_CPU_INTERRUPT(oldmask) \
+    do{ \
+        oldmask = kal_hrt_SaveAndSetIRQMask(); \
+    }while(0)
+
+#define DHL_UNLOCK_CPU_INTERRUPT(oldmask) \
+    do{ \
+        kal_hrt_RestoreIRQMask(oldmask); \
+    }while(0)
+#else
+#define DHL_LOCK_CPU_INTERRUPT(oldmask) \
+    do{ \
+        oldmask = 0; \
+    }while(0)
+
+#define DHL_UNLOCK_CPU_INTERRUPT(oldmask) \
+    do{ \
+        oldmask = 0; \
+    }while(0)
+#endif /* __L2_LOGGING_IRQ_LOC__ */
+
+/**************************/
+/* Definition -           */
+/* code setting           */
+/**************************/
+#if !defined(GEN_FOR_PC)
+
+#if defined(__MTK_TARGET__)
+#define __DHL_L2CACHE_LOCK_DATA __attribute__ ((section("L2CACHE_LOCK_RW")))
+#else
+#define __DHL_L2CACHE_LOCK_DATA 
+#endif
+#define __DHL_Core0IspRAM
+#define __DHL_Core1IspRAM
+#define __DHL_Core2IspRAM
+
+#if defined(__MD97__) || !defined(__MTK_TARGET__)
+#define __DHL_L2SRAM_ROCODE
+#else
+#define __DHL_L2SRAM_ROCODE __attribute__((section ("L2SRAM_L2C_ROCODE")))
+#endif
+
+#define __DHL_Core0DspRAM
+#define __DHL_Core1DspRAM
+#define __DHL_Core2DspRAM
+
+#if defined(__MD97__) || !defined(__MTK_TARGET__)
+#define __DHL_L2SRAM_DATA
+#define __DHL_L2SRAM_RW
+#else
+#define __DHL_L2SRAM_DATA __attribute__((section ("L2SRAM_L2C_ZI")))
+#define __DHL_L2SRAM_RW   __attribute__((section ("L2SRAM_L2C_RW")))
+#endif
+
+
+typedef void (*trc_setfilterfunc)(unsigned char *);
+#define TRC_FILTER_FUNC_ARRAY       trc_filterfuncarray
+#define TRC_NBR_MODULE              trc_filterfuncnbr
+#define TRC_SET_FILTER_FUNC         trc_setfilterfunc
+
+/*********************************************/
+/*    Macro for declaring filter in codegen  */
+/*********************************************/
+//force all to l2 cache in 93 to reduce mips, the conclusion after W16 PAE
+#define DECLARE_TMD_FILTER(VAR_TYPE, VAR_NAME, VAR_SIZE, P0, P1, P2, P3, P4, P5, P6, P7) \
+    VAR_TYPE  VAR_NAME[VAR_SIZE] = {P0, P1, P2, P3, P4, P5, P6, P7};
+
+#define DECLARE_TMD_FILTER_L2SRAM(VAR_TYPE, VAR_NAME, VAR_SIZE, P0, P1, P2, P3, P4, P5, P6, P7) \
+    VAR_TYPE   VAR_NAME[VAR_SIZE] = {P0, P1, P2, P3, P4, P5, P6, P7};
+
+#define DECLARE_TMD_FILTER_TCM(VAR_TYPE, VAR_NAME, VAR_SIZE, P0, P1, P2, P3, P4, P5, P6, P7) \
+    VAR_TYPE   VAR_NAME[VAR_SIZE] = {P0, P1, P2, P3, P4, P5, P6, P7};
+
+/*********************************************/
+/*    Macro for extern filter in codegen     */
+/*********************************************/
+#define EXTERN_TMD_FILTER(VAR_TYPE, VAR_NAME, VAR_SIZE) \
+    extern VAR_TYPE    VAR_NAME[VAR_SIZE];
+
+#define SET_TMD_FILTER(VAR_NAME, VAR_ARRAY_PTR, VAR_ARRAY_SIZE) \
+    do{ \
+        kal_uint32 i; \
+        for(i=0; i<VAR_ARRAY_SIZE; i++) VAR_NAME[i] = VAR_ARRAY_PTR[i]; \
+    }while(0)
+
+#define FILTER_COPY(DES_BUFFER, FILTER_NAME, FILTER_SIZE) \
+    do{ \
+        memcpy(DES_BUFFER, FILTER_NAME, FILTER_SIZE); \
+    }while(0);
+
+#define FILTER_CHECK(FILTER_NAME, FILTER_ARRAY_INDEX, FILTER_CLASS) ((FILTER_NAME[FILTER_ARRAY_INDEX] & FILTER_CLASS) != 0)
+
+
+#endif // #if !defined(GEN_FOR_PC)
+
+/***********************/
+/* Definition - ULSP   */
+/***********************/
+
+#if defined(__LTE_L1SIM__)
+extern kal_bool l1_trc_assure_lisr(const char *func, const char *file, int line);
+#else
+extern kal_bool l1_trc_assure_lisr();
+#endif
+
+#include "L1Trc_array.h"
+
+#if defined(__USE_ULSP_SW_SIMULATOR__)
+    #include "dhl_ulsp_swsim_interface.h"
+    #include "dhl_cond_l1_trace.h"
+    #include "L1Trc_ulsp_func_interface.h"
+#elif defined(__USE_ULSP__)
+    #if defined(__MTK_TARGET__)
+        #include "dhl_ulsp_hw_interface.h"    
+        
+    #elif defined(L1_SIM)
+        #include "dhl_ulsp_xl1sim_interface.h"
+
+    #endif // #if defined(__MTK_TARGET__)
+    
+    #include "dhl_cond_l1_trace.h"
+    
+#else
+    #include "dhl_l1_legacy_sw_interface.h"
+
+#endif
+
+
+
+
+/************/
+/*Functions */
+/************/
+void trc_fillFrameNumber_multiple(kal_uint32 framenumber, kal_uint32 ebit, kal_uint32 time, kal_uint32 sim_index);
+void trc_UFillFrameNumber_multiple(kal_uint16 framenumber, kal_uint32 ebit, kal_int16 bsfn, kal_uint32 time, kal_uint32 sim_index);
+void trc_fill_4g_time(kal_uint32 phytimer, kal_uint16 sample, kal_uint32 time, kal_uint16 sfn, kal_uint8 subframe);
+void trc_fill_4g_time_2(kal_uint32 phytimer, kal_uint16 sample, kal_uint32 time, kal_uint16 sfn, kal_uint8 subframe, kal_uint32 _4g_time);
+void trc_fill_4g_time_gfrc2(kal_uint32 phytimer, kal_uint32 time, kal_uint16 sfn, kal_uint8 subframe, kal_uint32 absH, kal_uint32 absL);
+void trc_UpdateTimeStamp(kal_uint32 time);
+// Export for HIF GPT use
+void l2trc_fill_4G_time();
+void l2trc_update_4G_time(kal_uint32 celltime, kal_uint32 abstick);
+void l2trc_fill_23G_time();
+#if defined(__C2K_RAT__)
+extern void trc_fill_c2k_do_time(kal_uint8 fn_up, kal_uint32 fn_low, kal_uint8 slot, kal_uint32 echip, kal_uint32 frc);
+extern void trc_fill_c2k_1x_time(kal_uint8 fn_up, kal_uint32 fn_low, kal_uint8 slot, kal_uint32 echip, kal_uint32 frc);
+#endif  // defined(__C2K_RAT__)
+//if remove , will build error in el1
+void Trc_Init(void);
+void trc_4g_trigger();
+void trc_UTrigger();
+void trc_handover(kal_uint32 handovertime, kal_uint32 framenumber);
+void trc_Uhandover(kal_uint32 handovertime, kal_uint32 framenumber);
+
+// legacy wrapper, to avoid build error on MoDIS
+void trc_l2_flush();
+
+void trc_setfilter(kal_uint8 *setting, kal_uint32 len);
+void trc_set_l1_filter(kal_uint8 *setting, kal_uint32 len);
+void trc_set_l2_filter(kal_uint8 *setting, kal_uint32 len);
+kal_int32 trc_getfilter(kal_uint8 *buffer, kal_int32 len);
+
+
+#endif //_L1TRC_H
+#endif /* #if defined(L1_CATCHER) */
diff --git a/mcu/interface/service/dhl/v1/L1Trc_array.h b/mcu/interface/service/dhl/v1/L1Trc_array.h
new file mode 100644
index 0000000..c5905fd
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/L1Trc_array.h
@@ -0,0 +1,153 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   L1Trc_array.h
+ *
+ * Project:
+ * --------
+ *   UMOLYA
+ *
+ * Description:
+ * ------------
+ *   L1 trace array support interface
+ *   NOTE: This header is included in L1Trc.h, please do not include this header alone!!
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 06 22 2018 yancy.chien
+ * [MOLY00331449] [Gen97] DHL logging development
+ * 	Migration on UMOLYE.
+ *
+ * 03 19 2018 yancy.chien
+ * [MOLY00258174] [Gen95][DHL] logging development
+ * Remove ASSERT check in l1 array trace.
+ *
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_L1TRC_ARRAY_H
+#define _DHL_L1TRC_ARRAY_H
+/* Array Trace Examples, Macro & Function version are the same
+
+1. normal
+#define DHL_ARRAY_TEST_L1(array_ptr, count) do {\
+    {\          
+        TRC_START_FILTER_CHECK_L1(DHL_L1_Trace_Filter, 1, 0x01);\
+        TRC_START_FILL_L1();\
+        TRC_OUTPUT_ARRAY_L1(0x2F00, array_ptr, 4, count, 31);\
+        TRC_END_FILL_L1();\
+        TRC_END_FILTER_CHECK_L1(DHL_L1_Trace_Filter, 1, 0x01);\
+    }\
+} while(0)
+
+2. force_l2
+#define DHL_ARRAY_TEST_L2(array_ptr, count) do {\
+    {\
+        TRC_START_FILTER_CHECK_L1_FORCE_L2(DHL_L1_Trace_Filter, 1, 0x01);\
+        TRC_START_FILL_L1_FORCE_L2();\
+        TRC_OUTPUT_ARRAY_L1_FORCE_L2(0x4E00, array_ptr, 4, count, 31);\
+        TRC_END_FILL_L1_FORCE_L2();\
+        TRC_END_FILTER_CHECK_L1_FORCE_L2(DHL_L1_Trace_Filter, 1, 0x01);\
+    }\  
+} while(0)
+
+*/
+
+/********************************************
+* L1/L2 Array Type support
+********************************************/
+
+#if defined(__USE_ULSP__) || defined(__USE_ULSP_SW_SIMULATOR__)
+
+// shrink the arg_count to max count to avoid whole L1 Trace frame decode fail
+
+#define TRC_OUTPUT_ARRAY_IMPL(func_name, begin_trace_id, array_ptr, align, count, max_count) \
+do { \
+    func_name(begin_trace_id, array_ptr, align, count < max_count ? count : max_count); \
+} while(0)
+
+
+#define TRC_OUTPUT_ARRAY_L1(begin_trace_id, array_ptr, align, count, max_count) TRC_OUTPUT_ARRAY_IMPL(trc_output_array_l1, begin_trace_id, array_ptr, align, count, max_count)
+#define TRC_OUTPUT_ARRAY_L2(begin_trace_id, array_ptr, align, count, max_count) TRC_OUTPUT_ARRAY_IMPL(trc_output_array_l2, begin_trace_id, array_ptr, align, count, max_count)
+
+#define TRC_OUTPUT_ARRAY_L1_FORCE_L2 TRC_OUTPUT_ARRAY_L2
+
+// NON_SMP
+#define TRC_OUTPUT_ARRAY_L1_NON_SMP TRC_OUTPUT_ARRAY_L1
+#define TRC_OUTPUT_ARRAY_L2_NON_SMP TRC_OUTPUT_ARRAY_L2
+
+extern void trc_output_array_l1(kal_uint16 begin_trace_id, void* array_ptr, kal_uint8 align, kal_uint8 count);
+extern void trc_output_array_l2(kal_uint16 begin_trace_id, void* array_ptr, kal_uint8 align, kal_uint8 count);
+
+#else	// legacy SW logging
+
+#define TRC_OUTPUT_ARRAY_L1(BEGIN_TRC_ID, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS, ARRAY_PTR, ALIGN, COUNT, MAX_COUNT) \
+do { \
+    if(FILTER_CHECK(FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)) { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        EXT_ASSERT(0 < COUNT && COUNT <= MAX_COUNT, COUNT, MAX_COUNT, 0); /* suppose SW solution is for internal use only, the assert should be accepted */ \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        vpe_id = kal_get_current_vpe_id(); \
+        TRC_SEND_ARRAY_DATA_cb[vpe_id](BEGIN_TRC_ID, ARRAY_PTR, ALIGN, COUNT); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } \
+} while(0)
+
+#define TRC_OUTPUT_ARRAY_L2(L2_BUFFER_SETTING, BEGIN_TRC_ID, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS, ARRAY_PTR, ALIGN, COUNT, MAX_COUNT) \
+do { \
+    if(FILTER_CHECK(FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)) { \
+        EXT_ASSERT(0 < COUNT && COUNT <= MAX_COUNT, COUNT, MAX_COUNT, 0); /* suppose SW solution is for internal use only, the assert should be accepted */ \
+        l2trc_send_array_cb[L2_BUFFER_SETTING](BEGIN_TRC_ID, ARRAY_PTR, ALIGN, COUNT); \
+    } \
+} while(0)
+
+
+typedef void (*TRC_SEND_ARRAY_DATA_cb_t)(kal_uint16 begin_trace_id, void* array_ptr, kal_uint8 align, kal_uint8 count);
+
+extern TRC_SEND_ARRAY_DATA_cb_t TRC_SEND_ARRAY_DATA_cb[6];
+extern TRC_SEND_ARRAY_DATA_cb_t l2trc_send_array_cb[3];
+
+#endif	// defined(__USE_ULSP__) || defined(__USE_ULSP_SW_SIMULATOR__)
+
+#endif  // _DHL_L1TRC_ARRAY_H
diff --git a/mcu/interface/service/dhl/v1/L1Trc_ulsp_func_interface.h b/mcu/interface/service/dhl/v1/L1Trc_ulsp_func_interface.h
new file mode 100644
index 0000000..f0c1ee6
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/L1Trc_ulsp_func_interface.h
@@ -0,0 +1,617 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   L1Trc_ulsp_func_interface.h
+ *
+ * Project:
+ * --------
+ *   UMOLYE
+ *
+ * Description:
+ * ------------
+ *   ULSP function implementation
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 08 14 2018 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * .
+ *
+ * 05 21 2018 yancy.chien
+ * [DHL] L1 trace function implement v2.
+ *
+ *
+ ****************************************************************************/
+/* Function Trace Examples
+
+1. default
+#define UMTS_3G_GEMINI_TIME(v1, v2, v3, v4, v5) do {\
+    {\
+        TRC_START_FILTER_CHECK_L1(DHL_L1_Trace_Filter, 1, 0x01);\
+        TRC_SEND_4_DATA_ULSP_L1(TRC_MERGE_2S(0x0000, (short)(v2)), TRC_MERGE_1S2C((short)(v4), (char)(v1), TRC_BOXSTER_PAD), (long)(v3), (long)(v5));\
+        TRC_END_FILTER_CHECK_L1(DHL_L1_Trace_Filter, 1, 0x01);\     
+    }\  
+} while(0)
+
+2. non_smp
+#define EL1D_TRC_AGC_CONTEXT_ENTRY_H(v1) do {\
+    {\
+        TRC_START_FILTER_CHECK_L1_NON_SMP(EL1D_AGC0_Trace_Filter, 1, 0x02);\
+        TRC_SEND_1_DATA_ULSP_L1_NON_SMP(TRC_MERGE_1S2C(0x0133, (unsigned char)(v1), TRC_BOXSTER_PAD));\
+        TRC_END_FILTER_CHECK_L1_NON_SMP(EL1D_AGC0_Trace_Filter, 1, 0x02);\
+    }\
+} while(0)
+
+3. force_l2
+#define L2_DHL_DEBUG_TRC2(v1, v2) do {\
+    {\
+        TRC_START_FILTER_CHECK_L1_FORCE_L2(DHL_L1_Trace_Filter, 1, 0x01);\
+        TRC_SEND_3_DATA_ULSP_L1_FORCE_L2(TRC_MERGE_1S2C(0x1E00, TRC_BOXSTER_PAD, TRC_BOXSTER_PAD), (long)(v1), (long)(v2));\
+        TRC_END_FILTER_CHECK_L1_FORCE_L2(DHL_L1_Trace_Filter, 1, 0x01);\
+    }\  
+} while(0)
+
+4. ex_force_l1
+#define DUMP_COND_L1_TRC_END() do {\
+    {\
+        TRC_START_FILTER_CHECK_L1_EX_FORCE_L1(DHL_L1_Trace_Filter, 1, 0x02);\
+        TRC_SEND_1_DATA_ULSP_L1_EX_FORCE_L1(TRC_MERGE_1S2C(0x2A00, TRC_BOXSTER_PAD, TRC_BOXSTER_PAD));\
+        TRC_END_FILTER_CHECK_L1_EX_FORCE_L1(DHL_L1_Trace_Filter, 1, 0x02);\
+    }\	
+} while(0)
+
+*/
+ 
+#ifndef _L1TRC_ULSP_FUNC_INTERFACE_H
+#define _L1TRC_ULSP_FUNC_INTERFACE_H
+#if __clang_analyzer__
+#pragma clang system_header
+#endif
+
+#define TRC_SEND_1_DATA_ULSP_L1(...) ulsp_l1_send_1_word(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L1(...) ulsp_l1_send_2_word(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L1(...) ulsp_l1_send_3_word(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L1(...) ulsp_l1_send_4_word(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L1(...) ulsp_l1_send_5_word(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L1(...) ulsp_l1_send_6_word(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L1(...) ulsp_l1_send_7_word(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L1(...) ulsp_l1_send_8_word(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L1(...) ulsp_l1_send_9_word(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L1(...) ulsp_l1_send_10_word(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L1(...) ulsp_l1_send_11_word(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L1(...) ulsp_l1_send_12_word(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L1(...) ulsp_l1_send_13_word(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L1(...) ulsp_l1_send_14_word(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L1(...) ulsp_l1_send_15_word(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L1(...) ulsp_l1_send_16_word(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L1(...) ulsp_l1_send_17_word(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L1(...) ulsp_l1_send_18_word(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L1(...) ulsp_l1_send_19_word(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L1(...) ulsp_l1_send_20_word(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L1(...) ulsp_l1_send_21_word(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L1(...) ulsp_l1_send_22_word(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L1(...) ulsp_l1_send_23_word(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L1(...) ulsp_l1_send_24_word(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L1(...) ulsp_l1_send_25_word(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L1(...) ulsp_l1_send_26_word(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L1(...) ulsp_l1_send_27_word(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L1(...) ulsp_l1_send_28_word(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L1(...) ulsp_l1_send_29_word(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L1(...) ulsp_l1_send_30_word(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L1(...) ulsp_l1_send_31_word(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L1(...) ulsp_l1_send_32_word(__VA_ARGS__)
+
+#define TRC_SEND_1_DATA_ULSP_L2(...) ulsp_l2_send_1_word(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L2(...) ulsp_l2_send_2_word(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L2(...) ulsp_l2_send_3_word(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L2(...) ulsp_l2_send_4_word(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L2(...) ulsp_l2_send_5_word(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L2(...) ulsp_l2_send_6_word(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L2(...) ulsp_l2_send_7_word(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L2(...) ulsp_l2_send_8_word(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L2(...) ulsp_l2_send_9_word(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L2(...) ulsp_l2_send_10_word(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L2(...) ulsp_l2_send_11_word(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L2(...) ulsp_l2_send_12_word(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L2(...) ulsp_l2_send_13_word(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L2(...) ulsp_l2_send_14_word(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L2(...) ulsp_l2_send_15_word(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L2(...) ulsp_l2_send_16_word(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L2(...) ulsp_l2_send_17_word(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L2(...) ulsp_l2_send_18_word(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L2(...) ulsp_l2_send_19_word(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L2(...) ulsp_l2_send_20_word(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L2(...) ulsp_l2_send_21_word(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L2(...) ulsp_l2_send_22_word(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L2(...) ulsp_l2_send_23_word(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L2(...) ulsp_l2_send_24_word(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L2(...) ulsp_l2_send_25_word(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L2(...) ulsp_l2_send_26_word(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L2(...) ulsp_l2_send_27_word(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L2(...) ulsp_l2_send_28_word(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L2(...) ulsp_l2_send_29_word(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L2(...) ulsp_l2_send_30_word(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L2(...) ulsp_l2_send_31_word(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L2(...) ulsp_l2_send_32_word(__VA_ARGS__)
+
+#define TRC_SEND_1_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_1_word(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_2_word(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_3_word(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_4_word(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_5_word(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_6_word(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_7_word(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_8_word(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_9_word(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_10_word(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_11_word(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_12_word(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_13_word(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_14_word(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_15_word(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_16_word(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_17_word(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_18_word(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_19_word(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_20_word(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_21_word(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_22_word(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_23_word(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_24_word(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_25_word(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_26_word(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_27_word(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_28_word(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_29_word(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_30_word(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_31_word(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_32_word(__VA_ARGS__)
+
+#define TRC_SEND_1_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_1_word(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_2_word(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_3_word(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_4_word(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_5_word(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_6_word(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_7_word(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_8_word(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_9_word(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_10_word(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_11_word(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_12_word(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_13_word(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_14_word(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_15_word(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_16_word(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_17_word(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_18_word(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_19_word(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_20_word(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_21_word(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_22_word(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_23_word(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_24_word(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_25_word(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_26_word(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_27_word(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_28_word(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_29_word(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_30_word(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_31_word(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_32_word(__VA_ARGS__)
+
+#define TRC_SEND_1_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_1_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_2_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_3_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_4_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_5_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_6_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_7_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_8_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_9_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_10_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_11_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_12_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_13_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_14_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_15_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_16_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_17_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_18_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_19_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_20_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_21_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_22_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_23_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_24_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_25_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_26_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_27_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_28_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_29_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_30_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_31_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_32_word_non_smp(__VA_ARGS__)
+
+#define TRC_SEND_1_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_1_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_2_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_3_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_4_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_5_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_6_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_7_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_8_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_9_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_10_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_11_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_12_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_13_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_14_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_15_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_16_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_17_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_18_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_19_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_20_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_21_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_22_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_23_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_24_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_25_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_26_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_27_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_28_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_29_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_30_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_31_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_32_word_non_smp(__VA_ARGS__)
+
+#define TRC_SEND_1_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_1_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_2_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_3_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_4_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_5_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_6_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_7_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_8_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_9_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_10_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_11_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_12_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_13_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_14_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_15_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_16_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_17_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_18_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_19_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_20_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_21_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_22_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_23_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_24_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_25_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_26_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_27_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_28_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_29_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_30_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_31_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_32_word_non_smp(__VA_ARGS__)
+
+#define TRC_SEND_1_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_1_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_2_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_3_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_4_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_5_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_6_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_7_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_8_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_9_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_10_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_11_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_12_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_13_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_14_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_15_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_16_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_17_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_18_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_19_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_20_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_21_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_22_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_23_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_24_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_25_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_26_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_27_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_28_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_29_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_30_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_31_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_32_word_non_smp(__VA_ARGS__)
+
+#define TRC_SEND_1_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_1_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_2_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_3_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_4_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_5_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_6_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_7_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_8_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_9_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_10_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_11_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_12_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_13_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_14_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_15_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_16_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_17_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_18_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_19_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_20_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_21_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_22_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_23_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_24_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_25_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_26_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_27_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_28_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_29_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_30_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_31_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_32_word_hw_cond(__VA_ARGS__)
+
+
+
+#define TRC_SEND_1_DATA_ULSP_L1_FORCE_L2 TRC_SEND_1_DATA_ULSP_L2
+#define TRC_SEND_2_DATA_ULSP_L1_FORCE_L2 TRC_SEND_2_DATA_ULSP_L2
+#define TRC_SEND_3_DATA_ULSP_L1_FORCE_L2 TRC_SEND_3_DATA_ULSP_L2
+#define TRC_SEND_4_DATA_ULSP_L1_FORCE_L2 TRC_SEND_4_DATA_ULSP_L2
+#define TRC_SEND_5_DATA_ULSP_L1_FORCE_L2 TRC_SEND_5_DATA_ULSP_L2
+#define TRC_SEND_6_DATA_ULSP_L1_FORCE_L2 TRC_SEND_6_DATA_ULSP_L2
+#define TRC_SEND_7_DATA_ULSP_L1_FORCE_L2 TRC_SEND_7_DATA_ULSP_L2
+#define TRC_SEND_8_DATA_ULSP_L1_FORCE_L2 TRC_SEND_8_DATA_ULSP_L2
+#define TRC_SEND_9_DATA_ULSP_L1_FORCE_L2 TRC_SEND_9_DATA_ULSP_L2
+#define TRC_SEND_10_DATA_ULSP_L1_FORCE_L2 TRC_SEND_10_DATA_ULSP_L2
+#define TRC_SEND_11_DATA_ULSP_L1_FORCE_L2 TRC_SEND_11_DATA_ULSP_L2
+#define TRC_SEND_12_DATA_ULSP_L1_FORCE_L2 TRC_SEND_12_DATA_ULSP_L2
+#define TRC_SEND_13_DATA_ULSP_L1_FORCE_L2 TRC_SEND_13_DATA_ULSP_L2
+#define TRC_SEND_14_DATA_ULSP_L1_FORCE_L2 TRC_SEND_14_DATA_ULSP_L2
+#define TRC_SEND_15_DATA_ULSP_L1_FORCE_L2 TRC_SEND_15_DATA_ULSP_L2
+#define TRC_SEND_16_DATA_ULSP_L1_FORCE_L2 TRC_SEND_16_DATA_ULSP_L2
+#define TRC_SEND_17_DATA_ULSP_L1_FORCE_L2 TRC_SEND_17_DATA_ULSP_L2
+#define TRC_SEND_18_DATA_ULSP_L1_FORCE_L2 TRC_SEND_18_DATA_ULSP_L2
+#define TRC_SEND_19_DATA_ULSP_L1_FORCE_L2 TRC_SEND_19_DATA_ULSP_L2
+#define TRC_SEND_20_DATA_ULSP_L1_FORCE_L2 TRC_SEND_20_DATA_ULSP_L2
+#define TRC_SEND_21_DATA_ULSP_L1_FORCE_L2 TRC_SEND_21_DATA_ULSP_L2
+#define TRC_SEND_22_DATA_ULSP_L1_FORCE_L2 TRC_SEND_22_DATA_ULSP_L2
+#define TRC_SEND_23_DATA_ULSP_L1_FORCE_L2 TRC_SEND_23_DATA_ULSP_L2
+#define TRC_SEND_24_DATA_ULSP_L1_FORCE_L2 TRC_SEND_24_DATA_ULSP_L2
+#define TRC_SEND_25_DATA_ULSP_L1_FORCE_L2 TRC_SEND_25_DATA_ULSP_L2
+#define TRC_SEND_26_DATA_ULSP_L1_FORCE_L2 TRC_SEND_26_DATA_ULSP_L2
+#define TRC_SEND_27_DATA_ULSP_L1_FORCE_L2 TRC_SEND_27_DATA_ULSP_L2
+#define TRC_SEND_28_DATA_ULSP_L1_FORCE_L2 TRC_SEND_28_DATA_ULSP_L2
+#define TRC_SEND_29_DATA_ULSP_L1_FORCE_L2 TRC_SEND_29_DATA_ULSP_L2
+#define TRC_SEND_30_DATA_ULSP_L1_FORCE_L2 TRC_SEND_30_DATA_ULSP_L2
+#define TRC_SEND_31_DATA_ULSP_L1_FORCE_L2 TRC_SEND_31_DATA_ULSP_L2
+#define TRC_SEND_32_DATA_ULSP_L1_FORCE_L2 TRC_SEND_32_DATA_ULSP_L2
+
+
+// only provides 1 data macro since we only use for "Redump" raw string message for now
+#define TRC_SEND_1_DATA_ULSP_L1_EX_FORCE_L1(v1) TRC_OUTPUT_32_SINGLE_WRAPPER_L1_EX_FORCE_L1(v1, v1)
+#define TRC_SEND_1_DATA_ULSP_L1_EX_FORCE_L2(v1) TRC_OUTPUT_32_SINGLE_WRAPPER_L1_EX_FORCE_L2(v1, v1)
+
+
+
+
+extern void ulsp_l1_send_1_word(kal_uint32 v1);
+extern void ulsp_l1_send_2_word(kal_uint32 v1, kal_uint32 v2);
+extern void ulsp_l1_send_3_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+extern void ulsp_l1_send_4_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+extern void ulsp_l1_send_5_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+extern void ulsp_l1_send_6_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+extern void ulsp_l1_send_7_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7);
+extern void ulsp_l1_send_8_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8);
+extern void ulsp_l1_send_9_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+extern void ulsp_l1_send_10_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+extern void ulsp_l1_send_11_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+extern void ulsp_l1_send_12_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+extern void ulsp_l1_send_13_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13);
+extern void ulsp_l1_send_14_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14);
+extern void ulsp_l1_send_15_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+extern void ulsp_l1_send_16_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+extern void ulsp_l1_send_17_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17);
+extern void ulsp_l1_send_18_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18);
+extern void ulsp_l1_send_19_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19);
+extern void ulsp_l1_send_20_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20);
+extern void ulsp_l1_send_21_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21);
+extern void ulsp_l1_send_22_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22);
+extern void ulsp_l1_send_23_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23);
+extern void ulsp_l1_send_24_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24);
+extern void ulsp_l1_send_25_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25);
+extern void ulsp_l1_send_26_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26);
+extern void ulsp_l1_send_27_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27);
+extern void ulsp_l1_send_28_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28);
+extern void ulsp_l1_send_29_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29);
+extern void ulsp_l1_send_30_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30);
+extern void ulsp_l1_send_31_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31);
+extern void ulsp_l1_send_32_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31, kal_uint32 v32);
+
+extern void ulsp_l2_send_1_word(kal_uint32 v1);
+extern void ulsp_l2_send_2_word(kal_uint32 v1, kal_uint32 v2);
+extern void ulsp_l2_send_3_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+extern void ulsp_l2_send_4_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+extern void ulsp_l2_send_5_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+extern void ulsp_l2_send_6_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+extern void ulsp_l2_send_7_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7);
+extern void ulsp_l2_send_8_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8);
+extern void ulsp_l2_send_9_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+extern void ulsp_l2_send_10_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+extern void ulsp_l2_send_11_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+extern void ulsp_l2_send_12_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+extern void ulsp_l2_send_13_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13);
+extern void ulsp_l2_send_14_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14);
+extern void ulsp_l2_send_15_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+extern void ulsp_l2_send_16_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+extern void ulsp_l2_send_17_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17);
+extern void ulsp_l2_send_18_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18);
+extern void ulsp_l2_send_19_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19);
+extern void ulsp_l2_send_20_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20);
+extern void ulsp_l2_send_21_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21);
+extern void ulsp_l2_send_22_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22);
+extern void ulsp_l2_send_23_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23);
+extern void ulsp_l2_send_24_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24);
+extern void ulsp_l2_send_25_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25);
+extern void ulsp_l2_send_26_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26);
+extern void ulsp_l2_send_27_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27);
+extern void ulsp_l2_send_28_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28);
+extern void ulsp_l2_send_29_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29);
+extern void ulsp_l2_send_30_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30);
+extern void ulsp_l2_send_31_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31);
+extern void ulsp_l2_send_32_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31, kal_uint32 v32);
+
+extern void ulsp_l1_send_1_word_non_smp(kal_uint32 v1);
+extern void ulsp_l1_send_2_word_non_smp(kal_uint32 v1, kal_uint32 v2);
+extern void ulsp_l1_send_3_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+extern void ulsp_l1_send_4_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+extern void ulsp_l1_send_5_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+extern void ulsp_l1_send_6_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+extern void ulsp_l1_send_7_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7);
+extern void ulsp_l1_send_8_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8);
+extern void ulsp_l1_send_9_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+extern void ulsp_l1_send_10_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+extern void ulsp_l1_send_11_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+extern void ulsp_l1_send_12_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+extern void ulsp_l1_send_13_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13);
+extern void ulsp_l1_send_14_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14);
+extern void ulsp_l1_send_15_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+extern void ulsp_l1_send_16_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+extern void ulsp_l1_send_17_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17);
+extern void ulsp_l1_send_18_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18);
+extern void ulsp_l1_send_19_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19);
+extern void ulsp_l1_send_20_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20);
+extern void ulsp_l1_send_21_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21);
+extern void ulsp_l1_send_22_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22);
+extern void ulsp_l1_send_23_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23);
+extern void ulsp_l1_send_24_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24);
+extern void ulsp_l1_send_25_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25);
+extern void ulsp_l1_send_26_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26);
+extern void ulsp_l1_send_27_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27);
+extern void ulsp_l1_send_28_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28);
+extern void ulsp_l1_send_29_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29);
+extern void ulsp_l1_send_30_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30);
+extern void ulsp_l1_send_31_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31);
+extern void ulsp_l1_send_32_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31, kal_uint32 v32);
+
+extern void ulsp_l2_send_1_word_non_smp(kal_uint32 v1);
+extern void ulsp_l2_send_2_word_non_smp(kal_uint32 v1, kal_uint32 v2);
+extern void ulsp_l2_send_3_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+extern void ulsp_l2_send_4_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+extern void ulsp_l2_send_5_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+extern void ulsp_l2_send_6_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+extern void ulsp_l2_send_7_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7);
+extern void ulsp_l2_send_8_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8);
+extern void ulsp_l2_send_9_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+extern void ulsp_l2_send_10_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+extern void ulsp_l2_send_11_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+extern void ulsp_l2_send_12_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+extern void ulsp_l2_send_13_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13);
+extern void ulsp_l2_send_14_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14);
+extern void ulsp_l2_send_15_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+extern void ulsp_l2_send_16_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+extern void ulsp_l2_send_17_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17);
+extern void ulsp_l2_send_18_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18);
+extern void ulsp_l2_send_19_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19);
+extern void ulsp_l2_send_20_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20);
+extern void ulsp_l2_send_21_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21);
+extern void ulsp_l2_send_22_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22);
+extern void ulsp_l2_send_23_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23);
+extern void ulsp_l2_send_24_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24);
+extern void ulsp_l2_send_25_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25);
+extern void ulsp_l2_send_26_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26);
+extern void ulsp_l2_send_27_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27);
+extern void ulsp_l2_send_28_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28);
+extern void ulsp_l2_send_29_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29);
+extern void ulsp_l2_send_30_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30);
+extern void ulsp_l2_send_31_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31);
+extern void ulsp_l2_send_32_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31, kal_uint32 v32);
+
+extern void ulsp_l1_send_1_word_hw_cond(kal_uint32 v1);
+extern void ulsp_l1_send_2_word_hw_cond(kal_uint32 v1, kal_uint32 v2);
+extern void ulsp_l1_send_3_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+extern void ulsp_l1_send_4_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+extern void ulsp_l1_send_5_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+extern void ulsp_l1_send_6_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+extern void ulsp_l1_send_7_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7);
+extern void ulsp_l1_send_8_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8);
+extern void ulsp_l1_send_9_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+extern void ulsp_l1_send_10_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+extern void ulsp_l1_send_11_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+extern void ulsp_l1_send_12_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+extern void ulsp_l1_send_13_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13);
+extern void ulsp_l1_send_14_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14);
+extern void ulsp_l1_send_15_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+extern void ulsp_l1_send_16_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+extern void ulsp_l1_send_17_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17);
+extern void ulsp_l1_send_18_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18);
+extern void ulsp_l1_send_19_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19);
+extern void ulsp_l1_send_20_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20);
+extern void ulsp_l1_send_21_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21);
+extern void ulsp_l1_send_22_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22);
+extern void ulsp_l1_send_23_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23);
+extern void ulsp_l1_send_24_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24);
+extern void ulsp_l1_send_25_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25);
+extern void ulsp_l1_send_26_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26);
+extern void ulsp_l1_send_27_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27);
+extern void ulsp_l1_send_28_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28);
+extern void ulsp_l1_send_29_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29);
+extern void ulsp_l1_send_30_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30);
+extern void ulsp_l1_send_31_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31);
+extern void ulsp_l1_send_32_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31, kal_uint32 v32);
+
+
+#endif
diff --git a/mcu/interface/service/dhl/v1/adt.h b/mcu/interface/service/dhl/v1/adt.h
new file mode 100644
index 0000000..dd256ec
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/adt.h
@@ -0,0 +1,109 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   adt.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   ADT structure and interface
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ * 	     Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ * 05 07 2014 eason.lai
+ * [MOLY00064969] [DHL]expand tab to 4 spaces to have better typesettings
+ * .
+ *
+ * 11 07 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * dhl module check-in.
+ ****************************************************************************/
+
+#ifndef _ADT_H
+#define _ADT_H
+
+#include "kal_public_defs.h"
+
+typedef struct adt_node
+{
+    kal_int32 data_len;
+    void *data;
+    struct adt_node *first_child;
+    struct adt_node *next_sibling;
+} adt_node_t;
+
+/**
+ * @brief       pack adt tree into bytes
+ * @param root  root node of adt tree
+ * @param buf   pointer to byte buffer (caller-free)
+ * @return      number of packed bytes
+ */
+int adt_pack(adt_node_t *root, unsigned char **buf);
+
+/**
+ * @brief           unpack adt tree from bytes
+ * @param root      root node of adt tree (caller-free)
+ * @param buf       byte buffer
+ * @param buf_len   length of byte buffer
+ * @return          number of bytes processed
+ */
+int adt_unpack(adt_node_t **root, unsigned char *buf, int buf_len);
+
+/**
+ * @brief       free adt tree
+ * @param root  root node of adt tree
+ */
+void adt_free(adt_node_t *root);
+
+#endif
diff --git a/mcu/interface/service/dhl/v1/dhl_asm_interface.h b/mcu/interface/service/dhl/v1/dhl_asm_interface.h
new file mode 100644
index 0000000..d429867
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/dhl_asm_interface.h
@@ -0,0 +1,74 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   dhl_asm_interface.h
+ *
+ * Project:
+ * --------
+ *   UMOLYA
+ *
+ * Description:
+ * ------------
+ *   ASM config/interfaces for SS team
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ * 	     Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_ASM_INTERFACE_H_
+#define _DHL_ASM_INTERFACE_H_
+
+kal_uint32 dhl_asm_init_buffer(kal_uint32 **buffer_address, kal_uint32 request_size);
+
+#endif //_DHL_ASM_INTERFACE_H_
+
+
diff --git a/mcu/interface/service/dhl/v1/dhl_cc_public.h b/mcu/interface/service/dhl/v1/dhl_cc_public.h
new file mode 100644
index 0000000..4927422
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/dhl_cc_public.h
@@ -0,0 +1,96 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   dhl_cc_public.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   DHL Cross-core public include header
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 06 17 2019 sunwhy.kuo
+ * [MOLY00413664] patch DHL mon flush API in DHL v1 VMOLY
+ * 	
+ * 	patch DHL mon flush API in DHL v1 VMOLY
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ * 	     Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ * 12 28 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *  92 ASM SWTR/SWLA data path
+ *
+ * 07 22 2015 eason.lai
+ * [MOLY00130157] [TK6291][DHL] smart logging migration
+ *  .
+ *
+ *
+ ****************************************************************************/
+#ifndef __DHL_CC_PUBLIC__
+#define __DHL_CC_PUBLIC__
+
+#include "kal_public_defs.h"
+#include "kal_public_api.h"
+#include "kal_general_types.h"
+
+#if !defined(GEN_FOR_PC)
+// meta mode flag
+extern kal_uint8 tst_meta_mode_trace_nvram_enable_flag;
+#endif  /* !GEN_FOR_PC */
+
+//for SIM Authentication APDU flush mdm buffer use
+void dhl_mon_trigger_flush_log(void);
+
+#endif /* __DHL_CC_PUBLIC__ */
+
+
diff --git a/mcu/interface/service/dhl/v1/dhl_cond_l1_trace.h b/mcu/interface/service/dhl/v1/dhl_cond_l1_trace.h
new file mode 100644
index 0000000..6353835
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/dhl_cond_l1_trace.h
@@ -0,0 +1,377 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   dhl_cond_l1_trace.h
+ *
+ * Project:
+ * --------
+ *   UMOLYA
+ *
+ * Description:
+ * ------------
+ *   Conditional L1 trace interface,
+*    NOTE: This header is included in L1Trc.h, please do not include this header alone!!
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 06 26 2018 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * 	
+ * 	Fix build warrning on xL1SIM.
+ *
+ * 06 22 2018 yancy.chien
+ * [MOLY00331449] [Gen97] DHL logging development
+ * 	Migration on UMOLYE.
+ *
+ * 03 14 2018 yancy.chien
+ * [MOLY00258174] [Gen95][DHL] logging development
+ * Fix string-aliasing warning.
+ *
+ * 01 31 2018 yancy.chien
+ * [MOLY00304870] [DHL] L1 Trace array support
+ * 1. ULSP version macro & function
+ * 2. SW version macro & function, for L1: VPE0~5 & L2: ert/hif/el2
+ * 3. COND&HW_COND version macro & function
+ * 4. Mechanism for check max argument size
+ *
+ * 12 20 2017 kenneth.lin
+ * [MOLY00253909] [DHL] Gen 95 development
+ * 	
+ * 	[DHL] API change on xl1sim
+ * 	- for cgen update
+ *
+ * 12 20 2017 kenneth.lin
+ * [MOLY00253909] [DHL] Gen 95 development
+ * [DHL] API change on xl1sim
+ * 	- for cgen update
+ *
+ * 09 19 2017 yancy.chien
+ * [MOLY00257978] conditional trace development
+ * Fix build error on XL1SIM.
+ *
+ * 09 14 2017 kenneth.lin
+ * [MOLY00257978] conditional trace development
+ * 	
+ * 	[DHL] fixed conditional trace build error in xl1sim
+ *
+ * 09 12 2017 yancy.chien
+ * [MOLY00257978] conditional trace development
+ * Fix build error on xL1SIM.
+ *
+ * 09 07 2017 yu-hsiang.peng
+ * [MOLY00275876] [Gen93] L1 trace code size silm
+ * [UMOLYA.TRUNK] L1 trace redefine
+ *
+ * 08 02 2017 yancy.chien
+ * [MOLY00257978] conditional trace development
+ * Add cond only macros.
+ *
+ * 07 14 2017 yancy.chien
+ * [MOLY00257978] conditional trace development
+ * 1. Move Conditional buffer to SHM
+ * 2. Refine dump flow & avoid infinite loop
+ * 3. Print debug log
+ *
+ * 06 30 2017 yancy.chien
+ * [MOLY00257978] conditional trace development
+ * Rename HW_COND MACROs & add seperate L1/L2 type for SW_COND.
+ *
+ * 06 19 2017 yancy.chien
+ * [MOLY00257978] conditional trace development
+ * 1st phase-in.
+ *
+ *
+ *
+ ****************************************************************************/
+/* Cond Trace Examples
+
+1. normal (Macro & Function version are same)
+#define PHS_LOG_I_SET_PHICH_CMD(v1, v2, v3) do {\
+    {\
+        TRC_START_FILTER_CHECK_L1_COND(EL1_PHS_1_Trace_Filter, 1, 0x01);\
+        TRC_PREPROCESS_DATA_SECTION1_L1_COND(cgen_local_v1,v1);\
+        TRC_PREPROCESS_DATA_SECTION1_L1_COND(cgen_local_v2,v2);\
+        TRC_PREPROCESS_DATA_SECTION1_L1_COND(cgen_local_v3,v3);\
+        TRC_START_FILL_L1_COND();\
+        TRC_PREPROCESS_DATA_SECTION2_L1_COND(cgen_local_v1,v1);\
+        TRC_PREPROCESS_DATA_SECTION2_L1_COND(cgen_local_v2,v2);\
+        TRC_PREPROCESS_DATA_SECTION2_L1_COND(cgen_local_v3,v3);\
+        TRC_SEND_N_DATA_L1_COND(2, TRC_MERGE_1S2C(0x6E02, (unsigned char)(cgen_local_v1), (unsigned char)(cgen_local_v2)), TRC_MERGE_4C((unsigned char)(cgen_local_v3), TRC_BOXSTER_PAD, TRC_BOXSTER_PAD, TRC_BOXSTER_PAD));\
+        TRC_END_FILL_L1_COND();\
+        TRC_END_FILTER_CHECK_L1_COND(EL1_PHS_1_Trace_Filter, 1, 0x01);\
+    }\	
+} while(0)
+
+2 non_smp (Macro & Function version are same)
+#define EL1SM_DBG_Power_Clock(v1) do {\
+    {\
+        TRC_START_FILTER_CHECK_L1_NON_SMP_COND(EL1SM_1_Trace_Filter, 1, 0x01);\
+        TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP_COND(cgen_local_v1,v1);\
+        TRC_START_FILL_L1_NON_SMP_COND();\
+        TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP_COND(cgen_local_v1,v1);\
+        TRC_SEND_N_DATA_L1_COND(2, TRC_MERGE_1S2C(0x0D90, TRC_BOXSTER_PAD, TRC_BOXSTER_PAD), (unsigned long)(cgen_local_v1));\
+        TRC_END_FILL_L1_NON_SMP_COND();\
+        TRC_END_FILTER_CHECK_L1_NON_SMP_COND(EL1SM_1_Trace_Filter, 1, 0x01);\
+    }\
+} while(0)
+
+3.a hw_cond (function version)
+#define UMTS_3G_GEMINI_TIME_HW_COND(v1, v2, v3, v4, v5) do {\
+    {\
+        TRC_START_FILTER_CHECK_L1_HW_COND(DHL_L1_Trace_Filter, 1, 0x01);\
+        TRC_SEND_4_DATA_ULSP_L1_HW_COND(TRC_MERGE_2S(0x0000, (short)(v2)), TRC_MERGE_1S2C((short)(v4), (char)(v1), TRC_BOXSTER_PAD), (long)(v3), (long)(v5));\
+        TRC_END_FILTER_CHECK_L1_HW_COND(DHL_L1_Trace_Filter, 1, 0x01);\
+    }\
+} while(0)
+
+3.b hw_cond (macro version)
+#define UMTS_3G_GEMINI_TIME_HW_COND(v1, v2, v3, v4, v5) do {\
+    {\
+        TRC_START_FILTER_CHECK_L1_HW_COND(DHL_L1_Trace_Filter, 1, 0x01);\
+        TRC_PREPROCESS_DATA_SECTION1_L1_HW_COND(cgen_local_v1,v1);\
+        TRC_PREPROCESS_DATA_SECTION1_L1_HW_COND(cgen_local_v2,v2);\
+        TRC_PREPROCESS_DATA_SECTION1_L1_HW_COND(cgen_local_v3,v3);\
+        TRC_PREPROCESS_DATA_SECTION1_L1_HW_COND(cgen_local_v4,v4);\
+        TRC_PREPROCESS_DATA_SECTION1_L1_HW_COND(cgen_local_v5,v5);\
+        TRC_START_FILL_L1_HW_COND();\
+        TRC_PREPROCESS_DATA_SECTION2_L1_HW_COND(cgen_local_v1,v1);\
+        TRC_PREPROCESS_DATA_SECTION2_L1_HW_COND(cgen_local_v2,v2);\
+        TRC_PREPROCESS_DATA_SECTION2_L1_HW_COND(cgen_local_v3,v3);\
+        TRC_PREPROCESS_DATA_SECTION2_L1_HW_COND(cgen_local_v4,v4);\
+        TRC_PREPROCESS_DATA_SECTION2_L1_HW_COND(cgen_local_v5,v5);\
+        TRC_OUTPUT_16_FIRST_WRAPPER_L1_HW_COND(0x0000,0x0000);\
+        TRC_OUTPUT_8_MID_WRAPPER_L1_HW_COND(cgen_local_v1,v1);\
+        TRC_OUTPUT_16_MID_WRAPPER_L1_HW_COND(cgen_local_v2,v2);\
+        TRC_OUTPUT_32_MID_WRAPPER_L1_HW_COND(cgen_local_v3,v3);\
+        TRC_OUTPUT_16_MID_WRAPPER_L1_HW_COND(cgen_local_v4,v4);\
+        TRC_OUTPUT_32_LAST_WRAPPER_L1_HW_COND(cgen_local_v5,v5);\
+        TRC_END_FILL_L1_HW_COND();\
+        TRC_END_FILTER_CHECK_L1_HW_COND(DHL_L1_Trace_Filter, 1, 0x01);\
+    }\	
+} while(0)
+
+
+*/
+#ifndef _DHL_COND_L1_TRACE_H
+#define _DHL_COND_L1_TRACE_H
+
+// Conversion for normal COND traces
+#define TRC_PREPROCESS_DATA_SECTION1_L1_COND(cgen_local_var, var)   
+#define TRC_PREPROCESS_DATA_SECTION2_L1_COND(cgen_local_var, var)   kal_uint32 cgen_local_var = (kal_uint32)(var)
+#if defined(L1_SIM)
+#else
+#define TRC_START_FILTER_CHECK_L1_COND         TRC_START_FILTER_CHECK_L1
+#define TRC_END_FILTER_CHECK_L1_COND           TRC_END_FILTER_CHECK_L1
+#endif
+
+#if defined(__MTK_TARGET__)
+#define TRC_START_FILL_L1_COND()
+#define TRC_END_FILL_L1_COND()
+#else
+#define TRC_START_FILL_L1_COND()               {volatile kal_uint8 unused=0    /* to avoid build error on MoDIS*/
+#define TRC_END_FILL_L1_COND()                 (void)(unused);}    /*avoid build error on MoDIS*/
+#endif
+
+// Conversion for NON_SMP COND trace, should be removed
+#define TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP_COND    TRC_PREPROCESS_DATA_SECTION1_L1
+#define TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP_COND    TRC_PREPROCESS_DATA_SECTION2_L1
+#define TRC_START_FILTER_CHECK_L1_NON_SMP_COND          TRC_START_FILTER_CHECK_L1_COND
+#define TRC_END_FILTER_CHECK_L1_NON_SMP_COND            TRC_END_FILTER_CHECK_L1_COND
+#define TRC_START_FILL_L1_NON_SMP_COND                  TRC_START_FILL_L1_COND
+#define TRC_END_FILL_L1_NON_SMP_COND                    TRC_END_FILL_L1_COND
+
+#define TRC_SEND_N_DATA_L1_COND(word_cnt, ...) do \
+{   \
+    dhl_l1_cond_send_n_word(word_cnt, __VA_ARGS__); \
+} while(0)
+
+#define TRC_SEND_N_DATA_L2_COND(word_cnt, ...) do \
+{   \
+    dhl_l1_cond_send_n_word(word_cnt, __VA_ARGS__); \
+} while(0)
+
+
+// Conversion for HW_COND traces
+#define TRC_PREPROCESS_DATA_SECTION1_L1_HW_COND     TRC_PREPROCESS_DATA_SECTION1_L1
+#define TRC_PREPROCESS_DATA_SECTION2_L1_HW_COND     TRC_PREPROCESS_DATA_SECTION2_L1
+#define TRC_START_FILTER_CHECK_L1_HW_COND           TRC_START_FILTER_CHECK_L1_COND
+#define TRC_END_FILTER_CHECK_L1_HW_COND             TRC_END_FILTER_CHECK_L1_COND
+
+// Note: create local buffer may increase stack size!!
+#define TRC_START_FILL_L1_HW_COND() kal_uint8 hw_cond_tmp_buf[128]; \
+                                    kal_uint8 tmp_idx = 0
+
+#define TRC_END_FILL_L1_HW_COND() do { \
+    dhl_l1_cond_send_array(&hw_cond_tmp_buf[0], tmp_idx); \
+} while(0)
+
+// implemenation for HW_COND trace macro
+
+#define DHL_HW_COND_L1_FILL_TMP_BUF_8(val) do{ \
+    hw_cond_tmp_buf[tmp_idx++] = (val); \
+} while(0)
+
+
+#define DHL_HW_COND_L1_FILL_TMP_BUF_16(val) do{ \
+    hw_cond_tmp_buf[tmp_idx++] = (kal_uint8) (val); \
+    hw_cond_tmp_buf[tmp_idx++] = (kal_uint8) ((val) >> 8); \
+} while(0)
+
+#define DHL_HW_COND_L1_FILL_TMP_BUF_24(val) do{ \
+    hw_cond_tmp_buf[tmp_idx++]   = (kal_uint8) (val); \
+    hw_cond_tmp_buf[tmp_idx++]   = (kal_uint8) ((val) >> 8); \
+    hw_cond_tmp_buf[tmp_idx++]   = (kal_uint8) ((val) >> 16); \
+} while(0)
+
+#define DHL_HW_COND_L1_FILL_TMP_BUF_32(val) do{ \
+    hw_cond_tmp_buf[tmp_idx++]   = (kal_uint8) (val); \
+    hw_cond_tmp_buf[tmp_idx++]   = (kal_uint8) ((val) >> 8); \
+    hw_cond_tmp_buf[tmp_idx++]   = (kal_uint8) ((val) >> 16); \
+    hw_cond_tmp_buf[tmp_idx++]   = (kal_uint8) ((val) >> 24); \
+} while(0)
+
+// Conversion for HW_COND fill data macros
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_HW_COND(value,dummy)     DHL_HW_COND_L1_FILL_TMP_BUF_16(value);
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_HW_COND(value,dummy)       DHL_HW_COND_L1_FILL_TMP_BUF_32(value);
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_HW_COND(value,dummy)       DHL_HW_COND_L1_FILL_TMP_BUF_24(value);
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_HW_COND(value,dummy)       DHL_HW_COND_L1_FILL_TMP_BUF_16(value);
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_HW_COND(value,dummy)        DHL_HW_COND_L1_FILL_TMP_BUF_8(value);
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_HW_COND(value,dummy)      DHL_HW_COND_L1_FILL_TMP_BUF_32(value);
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_HW_COND(value,dummy)      DHL_HW_COND_L1_FILL_TMP_BUF_24(value);
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_HW_COND(value,dummy)      DHL_HW_COND_L1_FILL_TMP_BUF_16(value);
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_HW_COND(value,dummy)       DHL_HW_COND_L1_FILL_TMP_BUF_8(value);
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_HW_COND(value,dummy)    DHL_HW_COND_L1_FILL_TMP_BUF_32(value);
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_HW_COND(value,dummy)    DHL_HW_COND_L1_FILL_TMP_BUF_24(value);
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_HW_COND(value,dummy)    DHL_HW_COND_L1_FILL_TMP_BUF_16(value);
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_HW_COND(value,dummy)     DHL_HW_COND_L1_FILL_TMP_BUF_8(value);
+
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2_HW_COND(value,dummy)     DHL_HW_COND_L1_FILL_TMP_BUF_16(value);
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2_HW_COND(value,dummy)       DHL_HW_COND_L1_FILL_TMP_BUF_32(value);
+#define TRC_OUTPUT_24_MID_WRAPPER_L2_HW_COND(value,dummy)       DHL_HW_COND_L1_FILL_TMP_BUF_24(value);
+#define TRC_OUTPUT_16_MID_WRAPPER_L2_HW_COND(value,dummy)       DHL_HW_COND_L1_FILL_TMP_BUF_16(value);
+#define TRC_OUTPUT_8_MID_WRAPPER_L2_HW_COND(value,dummy)        DHL_HW_COND_L1_FILL_TMP_BUF_8(value);
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2_HW_COND(value,dummy)      DHL_HW_COND_L1_FILL_TMP_BUF_32(value);
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2_HW_COND(value,dummy)      DHL_HW_COND_L1_FILL_TMP_BUF_24(value);
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2_HW_COND(value,dummy)      DHL_HW_COND_L1_FILL_TMP_BUF_16(value);
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2_HW_COND(value,dummy)       DHL_HW_COND_L1_FILL_TMP_BUF_8(value);
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2_HW_COND(value,dummy)    DHL_HW_COND_L1_FILL_TMP_BUF_32(value);
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2_HW_COND(value,dummy)    DHL_HW_COND_L1_FILL_TMP_BUF_24(value);
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2_HW_COND(value,dummy)    DHL_HW_COND_L1_FILL_TMP_BUF_16(value);
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2_HW_COND(value,dummy)     DHL_HW_COND_L1_FILL_TMP_BUF_8(value);
+
+
+//========================================================================
+//============================ Array Support =============================
+//========================================================================
+#define TRC_OUTPUT_ARRAY_L1_COND(begin_trace_id, array_ptr, align, count, max_count) TRC_OUTPUT_ARRAY_IMPL(trc_output_array_l1_cond, begin_trace_id, array_ptr, align, count, max_count)
+
+#define TRC_OUTPUT_ARRAY_L2_COND(begin_trace_id, array_ptr, align, count, max_count) TRC_OUTPUT_ARRAY_IMPL(trc_output_array_l1_cond, begin_trace_id, array_ptr, align, count, max_count) // redirect to l1, since there is no conditional l2 buffer
+
+#define TRC_OUTPUT_ARRAY_L1_HW_COND(begin_trace_id, array_ptr, align, count, max_count) \
+do { \
+    kal_uint32 *pWrite = &hw_cond_tmp_buf[0]; \
+    kal_uint32 array_data_bytes = count * align; \
+    EXT_ASSERT(0 < count && count <= max_count, count, max_count, 0); /* since it's used by DHL only, we can make sure not misuse happend */ \
+    *(pWrite) = begin_trace_id + ((count - 1) << 8); \
+    pWrite = (kal_uint32*) ((kal_uint32) pWrite + 2); \
+    memcpy(pWrite, array_ptr, array_data_bytes); \
+    if(align != 4) { \
+        pWrite = (kal_uint32*) ((kal_uint32) pWrite + array_data_bytes); \
+    } \
+    tmp_buf_idx = 2 /* TraceID */ + array_data_bytes; \
+} while(0)
+
+#define TRC_OUTPUT_ARRAY_L2_HW_COND(BEGIN_TRC_ID, ARRAY_PTR, ALIGN, COUNT) TRC_OUTPUT_ARRAY_L1_HW_COND(BEGIN_TRC_ID, ARRAY_PTR, ALIGN, COUNT) // redirect to l1, since there is no conditional l2 buffer
+
+#define TRC_OUTPUT_ARRAY_L1_NON_SMP_COND TRC_OUTPUT_ARRAY_L1_COND
+#define TRC_OUTPUT_ARRAY_L2_NON_SMP_COND TRC_OUTPUT_ARRAY_L2_COND
+
+
+//========================================================================
+//========================== Function Declarion ==========================
+//========================================================================
+
+#if defined(__MTK_TARGET__)
+ 
+void dhl_l1_cond_send_array(kal_uint8* src, kal_uint32 byte_cnt);
+void dhl_l1_cond_send_n_word(kal_uint32 word_cnt, ...);
+void dhl_dump_l1_cond_trace();
+extern void trc_output_array_l1_cond(kal_uint16 begin_trace_id, void* array_ptr, kal_uint8 align, kal_uint8 count);
+extern void trc_output_array_l1_hw_cond(kal_uint16 begin_trace_id, void* array_ptr, kal_uint8 align, kal_uint8 count);
+
+#else //Wrapper for xL1sim 
+
+#ifdef TRC_C
+// Workaround for XL1sim, TRC_C is defined in L1Trc.c, and since XL1SIM only build L1Trc.c rather than dhl_cond_l1_trace.c, we declare empty body here 
+void dhl_l1_cond_send_array(kal_uint8* src, kal_uint32 length) {};
+void dhl_l1_cond_send_n_word(kal_uint32 word_cnt, ...) {};
+void dhl_dump_l1_cond_trace() {};
+extern void trc_output_array_l1_cond(kal_uint16 begin_trace_id, void* array_ptr, kal_uint8 align, kal_uint8 count){}
+extern void trc_output_array_l1_hw_cond(kal_uint16 begin_trace_id, void* array_ptr, kal_uint8 align, kal_uint8 count){}
+
+#else // other source file, only get prototype
+
+extern void dhl_l1_cond_send_array(kal_uint8* src, kal_uint32 length);
+extern void dhl_l1_cond_send_n_word(kal_uint32 word_cnt, ...);
+extern void dhl_dump_l1_cond_trace();
+
+extern void trc_output_array_l1_cond(kal_uint16 begin_trace_id, void* array_ptr, kal_uint8 align, kal_uint8 count);
+extern void trc_output_array_l1_hw_cond(kal_uint16 begin_trace_id, void* array_ptr, kal_uint8 align, kal_uint8 count);
+
+
+#endif // #ifdef TRC_C
+
+#endif // defined(__MTK_TARGET__)
+
+
+
+#endif
+
diff --git a/mcu/interface/service/dhl/v1/dhl_debugl1_trace.tmd b/mcu/interface/service/dhl/v1/dhl_debugl1_trace.tmd
new file mode 100644
index 0000000..720c708
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/dhl_debugl1_trace.tmd
@@ -0,0 +1,18 @@
+[Default]
+DHL_DEBUGL1
+On
+Buffer
+
+[Modem_Type]
+dhl
+
+[Class]
+L1_CHANNEL_DEBUG ON
+
+[String]
+
+[Message]
+info                    DHL_DEBUGL1_ULSP_SEND                  L1_CHANNEL_DEBUG           "[DHL][ULSP][SEND] Type= %l, Address= %xl, Len= %xl"
+info                    DHL_DEBUGL1_ULSP_ACK                   L1_CHANNEL_DEBUG           "[DHL][ULSP][ACK] Type= %l, Address= %xl, Len= %xl"
+info                    DHL_DEBUGL1_PS_SEND                  L1_CHANNEL_DEBUG           "[DHL][PS][SEND] Output buffer number %xl"
+info                    DHL_DEBUGL1_PS_ACK                   L1_CHANNEL_DEBUG           "[DHL][PS][ACK] Release buffer number %xl"
\ No newline at end of file
diff --git a/mcu/interface/service/dhl/v1/dhl_def.h b/mcu/interface/service/dhl/v1/dhl_def.h
new file mode 100644
index 0000000..f110afc
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/dhl_def.h
@@ -0,0 +1,2431 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   dhl_def.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   DHL function and struct definition
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 04 21 2019 yh.sung
+ * [MOLY00392990] [VMOLY][UTF] Phase 2 Landing
+ * [UTF][DHL] UTF Trace API - trace interface
+ *
+ * 08 14 2018 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * .
+ *
+ * 06 22 2018 yancy.chien
+ * [MOLY00331449] [Gen97] DHL logging development
+ * 	Migration on UMOLYE.
+ *
+ * 06 14 2018 mojo.lai
+ * [MOLY00333176] [ICD] stage1+stage2 ICD UMOLYE CBr patch back to LR13.R0
+ * 	
+ * 	ICD 1.26 phase-in LR13.R0
+ *
+ * 05 25 2018 yancy.chien
+ * [MOLY00258174] [Gen95][DHL] logging development
+ * 1. Move force_rls_buf & set_mode LS API to HD task.
+ * 2. add lock / unlock DSP power API.
+ * 3. Recycle LS buffer when logging stopped.
+ * 4. Skip DSP dormant when CCB buffer setting = 0.
+ *
+ * 04 18 2018 yancy.chien
+ * [MOLY00321239] [Gen95] tst_log_primitive migration for MSG_ID_FDD_CPHY_MSG_CONTAINER_REQ/ MSG_ID_TDD_CPHY_MSG_CONTAINER_REQ
+ * 	1. Add dhl_log_primitive_custom API.
+ * 	2. Remove special handling for TDD/FDD in tst_log_primitive.
+ *
+ * 03 15 2018 yancy.chien
+ * [MOLY00313685] [ICD] Interface Control Document
+ * 	V1.25 phase-in.
+ *
+ * 02 23 2018 yancy.chien
+ * [MOLY00258174] [Gen95][DHL] logging development
+ * Add TMC_HANDSHAKE command & comment.
+ *
+ * 02 07 2018 yancy.chien
+ * [MOLY00306384] Gen95 SWLA & Addon Modification
+ * 1. ASM 3 Core migration.
+ * 2. Dump Core2 SWLA .
+ *
+ * 12 28 2017 sunwhy.kuo
+ * [MOLY00294414] [gen95][xL1sim meta] merge xL1sim meta from LR12A.MP2.MT6295M.DEV to TRUNK
+ * revert and add uint16 boundry case
+ *
+ * 12 28 2017 sunwhy.kuo
+ * [MOLY00294414] [gen95][xL1sim meta] merge xL1sim meta from LR12A.MP2.MT6295M.DEV to TRUNK
+ * fix build warning in dhl_frame_parser.c
+ *
+ * 11 30 2017 yu-hsiang.peng
+ * [MOLY00292576] [Coverity Scanned Code Defect]CID:4077159 code defect happened in /mcu/common/service/dhl/src/dhl_trace.c
+ * [UMOLYA.TRUNK] fix coverity, CID: 4077159 & 4077183 & 4077409 & 4077481
+ *
+ * 11 28 2017 yu-hsiang.peng
+ * [MOLY00292225] [Gen93][Gen95] dsp dump naming change
+ * [UMOLYA.TRUNK] DSP memory dump change (requested by SS5)
+ *
+ * 11 03 2017 yancy.chien
+ * [MOLY00258174] [Gen95][DHL] logging development
+ * Merge from DEV branch.
+ *
+ * 08 01 2017 yu-hsiang.peng
+ * [MOLY00266204] [Gen93] Common feature development before control
+ * [UMOLYA.TRUNK] Recycle LS buffer when mdlogger not connect after 60 seconde (FRC version)
+ *
+ * 06 05 2017 yu-hsiang.peng
+ * [MOLY00254166] [Gen93] dsp swla dump feature
+ * [UMOLYA.TRUNK] memory dump feature
+ * 	1. DSP SWLA support
+ * 	2. mini com logger support
+ *
+ * 05 04 2017 yancy.chien
+ * [MOLY00246779] [BIANCO] Enable ASM addon,SWTR and stream mode
+ *  1. ASM over CCB, based on EBS interface
+ *  2. Remove Core2 & Core3 & INFRA & SYSTEM asm type
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *       Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ * 04 17 2017 kenneth.lin
+ * [MOLY00242340] [ULSP] DSP filter enhancement
+ *
+ *  [Gen93][DHL][ULSP] enable ELT dsp filter
+ *
+ * 04 07 2017 yu-hsiang.peng
+ * [MOLY00224307] [MT6293] General feature change before MP branch create
+ * [UMOLYA.TRUNK] add HRT  PS code
+ *
+ * 01 23 2017 yancy.chien
+ * [MOLY00200106] [DHL] Code Refactoring
+ *  1. Remove HRT trace entry function
+ *  2. Add memcpy marco for buf_des structure
+ *
+ * 01 06 2017 willie.pan
+ * [MOLY00163869] [6293][ULS+] ULSP Source ID to Core/TC ID mapping
+ *
+ * 01 06 2017 yu-hsiang.peng
+ * [MOLY00222943] [MT6293] DHL Seamless Meta Support
+ * [UMOLYA.TRUNK] Merge Seamless Meta mode from IT CBr  -DHL
+ *
+ * 01 03 2017 yu-hsiang.peng
+ * [MOLY00210769] [MT6293] MT6292 CCB service migrate to MT6293 and MT6293 ULSP logging on CCB development
+ * [UMOLYA.TRUNK] increase inject CMD to 256 bytes
+ *
+ * 12 20 2016 cynthia.sun
+ * [MOLY00173325] [MDL] 93 Integration
+ * . VRF memory dump
+ *
+ * 12 06 2016 cynthia.sun
+ * [MOLY00173325] [MDL] 93 Integration
+ * . Design new DSP filter struct
+ *
+ * 12 02 2016 yu-hsiang.peng
+ * [MOLY00210769] [MT6293] MT6292 CCB service migrate to MT6293 and MT6293 ULSP logging on CCB development
+ * [UMOLYA] Remove Core 2/3 SWLA
+ *
+ * 11 09 2016 yancy.chien
+ * [MOLY00212377] [DHL] Remove stack_timer_struct for SS team request
+ *
+ * 11 04 2016 cynthia.sun
+ * [MOLY00173325] [MDL] 93 Integration
+ * . DSP DM/PM memory dump
+ *
+ * 11 01 2016 yu-hsiang.peng
+ * [MOLY00210769] [MT6293] MT6292 CCB service migrate to MT6293 and MT6293 ULSP logging on CCB development
+ * [UMOLYA.TRUNK] ULSP on CCB full load logging, normal logging(stage 1)
+ *
+ * 10 27 2016 jean.tsao
+ * [MOLY00171985] [LR11][LR11.MP3][UMOLY] GPS logging location information
+ * [UMOLYA] GPS logging location information
+ *
+ * 10 27 2016 yancy.chien
+ * [MOLY00181823] [DHL] UMOLY Migrate to UMOLYA - W16.44 Migration.
+ *
+ * 09 21 2016 yancy.chien
+ * [MOLY00181823] [DHL] UMOLY Migrate to UMOLYA
+ *
+ * 08 03 2016 yu-hsiang.peng
+ * [MOLY00185213] [MT6293] DHL MT6292 SW logging migrate to MT6293 & MT6293 ULSP logging development
+ * [UMOLYA.TRUNK] Merge back 93 ULSP 1st connect ELT code (stage 4)
+ *
+ * 06 24 2016 yu-hsiang.peng
+ * [MOLY00185213] [UMOLYA] DHL 92 SW logging migrate to 93
+ * [UMOLYA.TRUNK] 93 ULSP trace macro  & LS 1st integrate (stage 2)
+ *
+ * 06 21 2016 yu-hsiang.peng
+ * [MOLY00185213] [UMOLYA] DHL 92 SW logging migrate to 93
+ * [UMOLYA.TRUNK] 92 SW logging migration & 93 L1 L2 trace macro (stage 1)
+ *
+ * 05 26 2016 yancy.chien
+ * [MOLY00181823] [DHL] UMOLY Migrate to UMOLYA
+ * .
+ *
+ * 05 20 2016 cynthia.sun
+ * [MOLY00147391] [MDL] 92 Integration
+ * . fix DFE1 mux_id
+ *
+ * 05 12 2016 yancy.chien
+ * [MOLY00179274] [DHL][ASM] Config PMC
+ * [DHL][ASM] Config PMC
+ *
+ * 04 15 2016 eason.lai
+ * [MOLY00173976] [6292][DHL] L1/L2 trace integrated with log DMA
+ *  logDMA is not enabled yet due to logDMA sperious IRQ is not fixed
+ *
+ * 04 13 2016 eason.lai
+ * [MOLY00173976] [6292][DHL] L1/L2 trace integrated with log DMA
+ *  This change haven't enable the log DMA due to log DMA IRQ has
+ *                       spurious interrupt.
+ *
+ * 03 23 2016 hk.yang
+ * [MOLY00170465] [UMOLY][DHL] MDM service porting
+ * [92] porting MDM.
+ *
+ * 03 21 2016 eason.lai
+ * [MOLY00170160] [6292/Elbrus][DHL] L1trace HRT enhancement
+ *  reduce caller codesize overhead
+ *
+ * 03 14 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In]
+ *
+ *  .
+ *
+ * 02 26 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In]
+ *
+ *  .ULS+ for L1 PAE
+ *
+ * 02 22 2016 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *  add mcu/infra SWTR dump
+ *
+ * 02 17 2016 eason.lai
+ * [MOLY00165104] [MT6292][FPGA][Phone Call][4G TDD][Critical] ELT failed to do memory dump
+ *
+ *  change the exception RX gpd buffer to 4KB to prevent CLDMA hang
+ *
+ * 01 12 2016 cynthia.sun
+ * [MOLY00147391] [MDL] 92 Integration
+ * . merge with SS1 on UMOLY
+ *
+ * 12 28 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *  92 ASM SWTR/SWLA data path
+ *
+ * 12 09 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *  update timestamp once 64us tick different with previous time in ps trace
+ *
+ * 11 30 2015 willie.pan
+ * [MOLY00151097] [MDL] MDL for 92 check in
+ *
+ *  Change for 92 MDL
+ *
+ * 11 25 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ * refine the xl1sim option in DHL and restore the patch of CL#1796032.
+ *
+ * 11 23 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ * xl1sim introduce SMP DHL
+ *
+ * 10 30 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *
+ *  remove __PCORE__ and __L1CORE__ option
+ *
+ * 10 23 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *
+ *  SMP DHL logging migration
+ *
+ * 09 22 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *  single-core modis support based on 91 DHL
+ *
+ * 09 21 2015 yu-hsiang.peng
+ * [MOLY00142553] [DHL] fix build warning for LR11 MP/Trunk
+ * [UMOLY.Trunk] Fix build warning(0921)
+ *
+ * 09 15 2015 eason.lai
+ * [MOLY00141933] [DHL] change the bb register memory dump order
+ *  move bb reigster to the last region to dump
+ *
+ * 07 31 2015 eason.lai
+ * [MOLY00130157] [TK6291][DHL] smart logging migration
+ *  fixed dicard info decoding fail issue
+ *
+ * 07 28 2015 hk.yang
+ * [MOLY00132867] [UMOLY][LR11] dhl monitor service
+ *  [UMOLY] dhl frame parser.
+ *
+ * 07 22 2015 eason.lai
+ * [MOLY00130157] [TK6291][DHL] smart logging migration
+ *  .
+ *
+ * 07 20 2015 yu-hsiang.peng
+ * [CBR] L1D/NV 2 eason CBR.
+ *
+ * 07 10 2015 eason.lai
+ * merge code
+ *
+ * 04 26 2015 eason.lai
+ * [MOLY00109038] [TK6291E1][pre 1st Call][UMOLY][4G][FDD] There's no assert/fatal error message on "System Trace(L1CORE)" window
+ *  1. fixed l1core assert log missing by the potential problem.
+ *  2. start to support l1core l1 filer store in NVRAM
+ *
+ * 04 09 2015 eason.lai
+ * [MOLY00105513] [TK6291][DHL] introduce GPD/SPD wrapper
+ *       GPD/SPD wrapper and L2copro log dma
+ *
+ * 04 01 2015 cynthia.sun
+ * [MOLY00105635] [TK6291][DHL] L1CORE ASM
+ * .
+ *
+ * 03 23 2015 eason.lai
+ * [MOLY00099926] [DHL] inject msg to l1core
+ * [DHL] Enable inject ilm / string / ADT handler in L1core
+ *
+ * 02 03 2015 eason.lai
+ * [MOLY00084440] [MT6291][DHL] Patch back UMOLY trunk from MT6291_DEV
+ *  Ubin TDD/FDD DBME patch back
+ *
+ * 12 16 2014 eason.lai
+ * [MOLY00084440] [MT6291][DHL] Patch back UMOLY trunk from MT6291_DEV
+ *  fixed build error
+ *
+ * 11 24 2014 eason.lai
+ * [MOLY00084440] [MT6291][DHL] Patch back UMOLY trunk from MT6291_DEV
+ * FMA global timer
+ *
+ * 11 14 2014 eason.lai
+ * [MOLY00084440] [MT6291][DHL] Patch back UMOLY trunk from MT6291_DEV
+ *  first time patch back
+ *
+ * 09 25 2014 eason.lai
+ * [MOLY00073290] [MT6291][DHL] basic logging support for V7FPGA L1S_L1DISABLE
+ * checksum support
+ *
+ * 09 11 2014 eason.lai
+ * [MOLY00073290] [TK6291][DHL] basic logging support for V7FPGA L1S_L1DISABLE
+ * TK6291 DHL exception handling and memory dump
+ *
+ * 09 03 2014 eason.lai
+ * [MOLY00063896] [TK6291][DHL] UMOLY Check-in
+ * fixed LWG l1core build error due to em strcut.
+ *
+ * 08 28 2014 eason.lai
+ * [MOLY00073290] [TK6291][DHL] basic logging support for V7FPGA L1S_L1DISABLE
+ *  exception flow handling
+ *
+ * 08 20 2014 eason.lai
+ * [MOLY00073290] [TK6291][DHL] basic logging support for V7FPGA L1S_L1DISABLE
+ * Revised comiple option
+ *
+ * 08 14 2014 ken.liu
+ * [MOLY00075310] [UMOLY] L2copro ip header log DMA integration
+ * update l2copro log msg id and struct name.
+ *
+ * 08 13 2014 ken.liu
+ * [MOLY00075310] [UMOLY] L2copro ip header log DMA integration
+ * DHL header for l2copro log dma.
+ *
+ * 08 01 2014 eason.lai
+ * [MOLY00073290] [TK6291][DHL] basic logging support for V7FPGA L1S_L1DISABLE
+ * Fixed modis build error
+ *
+ * 07 31 2014 eason.lai
+ * [MOLY00073290] [TK6291][DHL] basic logging support for V7FPGA L1S_L1DISABLE
+ *  should set USB HIF SUPPROT to true
+ *
+ * 07 15 2014 victor.chan
+ * [MOLY00063930] [Cgen] UMOLY DEV Check-in
+ *  Add dhl_multiple_db_type, dhl_multiple_db_desc, dhl_multiple_db_major_views and dhl_multiple_db_minor_views enum for Pcore and L1core.
+ *
+ * 04 28 2014 willie.pan
+ * [MOLY00063896] [TK6291][DHL] UMOLY Check-in
+ *  .
+ *
+ * 04 28 2014 willie.pan
+ * [MOLY00063896] [TK6291][DHL] UMOLY Check-in
+ *  .
+ *
+ * 01 21 2014 wcpuser_integrator
+ * [MOLY00054475] SGLTE option rename
+ * .
+ *
+ * 01 14 2014 ken.liu
+ * [MOLY00049431] [MT6290E1][DHL] Reserve MOD_NIL (0) to support trace decoding without database
+ * enable new sys trace and dhl header format
+ *
+ * 01 08 2014 ken.liu
+ * [MOLY00052051] [DHL] add support for internal trace access level
+ * update access level define names.
+ *
+ * 01 08 2014 ken.liu
+ * [MOLY00052051] [DHL] add support for internal trace access level
+ * add access level defines.
+ *
+ * 12 31 2013 ken.liu
+ * [MOLY00052051] [DHL] add support for internal trace access level
+ * enable dhl_internal_trace support.
+ *
+ * 11 26 2013 mojo.lai
+ * [MOLY00047331] Support new error detect mechanism BEE
+ *  .
+ *
+ * 11 22 2013 mojo.lai
+ * [MOLY00047548] Keep sending l1/l2 log to ring buffer when disconnected
+ *  .
+ *
+ * 11 21 2013 mojo.lai
+ * [MOLY00045854] [PS1267 HG+WG] Check-in Gemini HG+WG modification
+ *  .
+ *
+ * 11 15 2013 ken.liu
+ * [MOLY00046623] [MT6290E1][DHL] Add filter on/off control for META tool
+ * add filter on/off control for META tool.
+ *
+ * 11 08 2013 ken.liu
+ * [MOLY00045664] [MT6290E2][DHL] Add memory type to support register access from tool
+ * add default_type mem type for tool access.
+ *
+ * 10 18 2013 mojo.lai
+ * [MOLY00041595] [MT6290E1][MMDS_DC] MMDC feature patch back to MOLY trunk
+ *  .
+ *
+ * 10 18 2013 mojo.lai
+ * [MOLY00041595] [MT6290E1][MMDS_DC] MMDC feature patch back to MOLY trunk
+ *  .
+ *
+ * 10 18 2013 mojo.lai
+ * [MOLY00041595] [MT6290E1][MMDS_DC] MMDC feature patch back to MOLY trunk
+ *  .
+ *
+ * 09 11 2013 willie.pan
+ * [MOLY00037476] [DHL] SP Logging Phase In
+ *  .
+ *
+ * 08 28 2013 mojo.lai
+ * [MOLY00031404] Implement DHL connect / disconnect command
+ *  .
+ *
+ * 08 21 2013 mojo.lai
+ * [MOLY00034481] Enable DSP mux filter
+ *  .
+ *
+ * 08 15 2013 ken.liu
+ * [MOLY00033915] [MT6290E1][DHL] TTY channel wrapper for smart phone logging
+ * add read/write API for smart phone logging
+ *
+ * 08 13 2013 willie.pan
+ * [MOLY00032932] [DHL] DHL Port Setting Feature Phase In
+ * .
+ *
+ * 07 26 2013 mojo.lai
+ * [MOLY00031404] Implement DHL connect / disconnect command
+ * .
+ *
+ * 07 25 2013 ken.liu
+ * [MOLY00031306] [MT6290E1] DHL mux filter
+ * check-in dhl mux filter support (disabled by default until next ELT release)
+ *
+ * 07 05 2013 ken.liu
+ * [MOLY00028661] 2/3G handover time support
+ * 2/3g handover time support
+ *
+ * 07 04 2013 willie.pan
+ * [MOLY00028571] [DHL] CoreSonic memory dump integration
+ * .
+ *
+ * 07 03 2013 mojo.lai
+ * [MOLY00027397] IRDBG 2g dsp logging
+ *
+ * 06 20 2013 mojo.lai
+ * [MOLY00026719] Support read memory in word access and half word access
+ * .
+ *
+ * 06 05 2013 ken.liu
+ * [MOLY00024820] [MT6290E1][NAS RTD][LTE/MM][FDD/TDD] Assert at cdcacm_usbhdr.c
+ * assign rx gpd after port is opened
+ *
+ * 06 03 2013 ken.liu
+ * [MOLY00024730] DHL multimode engineering mode and air message logging support
+ * add DHL partial filter command.
+ *
+ * 06 03 2013 ken.liu
+ * [MOLY00021786] [MT6290 Bring-up]4G coresonic DSP assert memory dump integration
+ * sync from MT6290E1_FirstCall.
+ *
+ * 05 23 2013 mojo.lai
+ * [MOLY00009210] DHL
+ * rework l2 copro logger
+ *
+ * 05 22 2013 mojo.lai
+ * [MOLY00009210] DHL
+ * L2 copro support
+ *
+ * 05 07 2013 ken.liu
+ * [MOLY00021794] [MT6290 Bring-up] DHL support for MT6290M project
+ * reduce log ring buffer size to fit memory budget.
+ *
+ * 04 30 2013 ken.liu
+ * [MOLY00012607] MOLY multimode build tst API migration
+ * sync dhl_peer_trace and dhl_EM_logger() from stanleyHY's CBr.
+ *
+ * 04 30 2013 ken.liu
+ * [MOLY00021076] [MT6290 Bring-up] DHL flush log uses too much CPU time before entering idle task
+ * sync from MT6290E1_FirstCall.
+ *
+ * 04 12 2013 mojo.lai
+ * [MOLY00009210] DHL
+ * Fix compile error
+ *
+ * 04 03 2013 mojo.lai
+ * [MOLY00009210] TATAKA merge to MOLY
+ * SWTR merge
+ *
+ * 03 22 2013 ken.liu
+ * [MOLY00009212] LTE Multimode merge back to MOLY
+ * 1. remove tst_dump_to_file_for_crash dummy wrapper
+ * 2. sync FDI L1DMA
+ * 3. enable per-byte processing for exception rx
+ *
+ * 03 20 2013 ken.liu
+ * [MOLY00011772] [MT7208][NW-UE SIM][TC 6.2.2.8] ASSERT at m11301.c, 2027
+ * Back out changelist 107910
+ *
+ * 12 20 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * enable uart channel with software flow control.
+ *
+ * 11 07 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * dhl module check-in.
+ ****************************************************************************/
+
+#ifndef _DHL_DEF_H
+#define _DHL_DEF_H
+
+#include "dhl_trace.h"
+#include "kal_public_defs.h"
+#include "kal_public_api.h"
+#include "svc_sap.h"
+#include "cpu_info.h" // SYS_MCU_NUM_CORE
+
+#if defined(__EM_MODE__)
+#ifndef _EM_STRUCT_H
+#include "em_struct.h"
+#endif  //#ifndef _EM_STRUCT_H
+#endif  //#ifdef __EM_MODE__
+
+#include "dcl.h"
+
+#include "sysconf_statistics.h"
+
+#if !defined (L1_SIM) || defined (__UE_SIMULATOR__)
+#include "nvram_interface.h"
+//#include "nvram_data_items.h"
+#include "nvram_enums.h"
+#include "nvram_struct.h"
+#endif //#if !defined (L1_SIM) || defined (__UE_SIMULATOR__)
+
+#include "tst.h"
+
+//Willie:
+#define __DHL_TEST_USB_PORT__ uart_port_usb5
+
+//#define DHL_FRAME_LEN_WORD_ALIGN
+
+#define DHL_NVRAM_ACCESS_EXCEPTION 1
+#define DHL_NVRAM_ACCESS_STATISTIC 2
+#define DHL_NVRAM_ACCESS_OTHERS 3
+
+#define MAX_PS_TRACE_CLASS_BYTE  8 /*must some with MAX_UNIFIED_TRACE_CLASS_BYTE */
+#define DHL_TIMER_ID_SYNC 0
+#define TST_MODULE_FILTER_LEN       ((END_OF_MOD_ID+8)/8)
+#define TST_SAP_FILTER_LEN          (LAST_SAP_CODE+1)
+#define TST_TRACE_FILTER_LEN        (MAX_PS_TRACE_CLASS_BYTE * (END_OF_MOD_ID+1))
+#define TST_TOTAL_FILTER_LEN    (TST_MODULE_FILTER_LEN+ TST_SAP_FILTER_LEN+ TST_TRACE_FILTER_LEN)
+
+
+extern kal_eventgrpid dhl_event_group;
+#define DHL_EVENT_DATA_READY              (0x1)
+#define DHL_EVENT_PORT_NOT_USING          (0x2)
+#define DHL_EVENT_TX_IOR_READY            (0x4)
+#define DHL_EVENT_TX_RESUME               (0x8)
+#define DHL_EVENT_RESUME_READER           (0x10)
+#define DHL_EVENT_TOOL_CONNECT            (0x20)
+#define DHL_EVENT_READY_TO_WRITE          (0x40)
+#define DHL_EVENT_TX_BUF_RELEASED         (0x200)
+#define DHL_EVENT_MON_TX_BUF_RELEASED     (0x400)
+#define DHL_EVENT_MON_DATA_READY          (0x800)
+#define DHL_EVENT_MON_TX_IOR_READY        (0x1000)
+#define DHL_EVENT_MON_TOOL_CONNECT        (0x2000)
+#define DHL_EVENT_TX_ALL_DONE             (0x4000)
+#define DHL_EVENT_CCB_PAGE_RELEASE        (0x8000)
+
+extern kal_eventgrpid dhl_hd_event_group;
+#define DHL_HD_EVENT_L1DMA_BUFFER_READY     (0x1)
+#define DHL_HD_EVENT_ASM_MCU_BUFFER_READY   (0x2)
+#define DHL_HD_EVENT_IRDBG_BUFFER_READY     (0x4)
+#define DHL_HD_EVENT_TOOL_CONNECT           (0x8)
+#define DHL_HD_EVENT_ASM_INFRA_BUFFER_READY (0x10)
+#if defined(__MD95__) || defined(__MD93__) || defined(__USE_ULSP_SW_SIMULATOR__)
+#define DHL_HD_EVENT_ULSP_MCU_BUFFER_READY  (0x20)
+#define DHL_HD_EVENT_ULSP_DSP_BUFFER_READY  (0x40)
+#endif
+#define DHL_HD_EVENT_SEQUENCE_TRACE_TEST    (0x200)
+#define DHL_HD_EVENT_HRT_PS_FLUSH           (0x400)
+#define DHL_HD_EVENT_STOP_LOG2BUFFER        (0x800)
+#define DHL_HD_EVENT_ULSP_SWITCH_MODE       (0x1000)
+#define DHL_HD_EVENT_ULSP_FORCE_RELEASE     (0x2000)
+#define DHL_HD_EVENT_ULSP_MCU_NORMAL_BUFFER_READY      (0x4000)
+#define DHL_HD_EVENT_ULSP_MCU_ONDEMAND_BUFFER_READY    (0x8000)
+#define DHL_HD_EVENT_ULSP_4G_DSP_NORMAL_BUFFER_READY   (0x10000)
+#define DHL_HD_EVENT_ULSP_4G_DSP_ONDEMAND_BUFFER_READY (0x20000)
+#define DHL_HD_EVENT_ULSP_5G_DSP_NORMAL_BUFFER_READY   (0x40000)
+#define DHL_HD_EVENT_ULSP_5G_DSP_ONDEMAND_BUFFER_READY (0x80000)
+//Seamless META
+#define META_EVENT_TOOL_CONNECT             (0x1)
+#define META_EVENT_DATA_READY               (0x2)
+
+// L2 Coprocessor data ready event
+#define DHL_HD_EVENT_L2COPRO_DATA_READY     (0x20)
+
+#define ASSERT_COMMAND_BUFFER_LENGTH (4096 * 2)
+
+#ifdef IN_MEMORY_EXCEPTION_BUFFER
+#define DHL_EXCEPTION_BUFFER_SIZE (TST_RING_BUFFER_SIZE * 2)
+#endif
+
+#define  INJECT_STRING_TO_MODULE_MAX_LENGTH  (256)
+#define  INJECT_AT_COMMAND_MAX_LENGTH        (256)
+
+#define DHL_RTOS_TIME_RESOLUTION_TICK (0)
+
+#ifdef __MTK_TARGET__
+#define  MAX_TST_RECEIVE_BUFFER_LENGTH       256
+#else
+#define  MAX_TST_RECEIVE_BUFFER_LENGTH       (64*1024-1)
+#endif  /* UNIT_TEST */
+
+
+extern kal_bool  tst_is_L1Trc_open;
+extern kal_bool  tst_is_PsTrc_open;
+extern kal_bool  tst_is_l1_writing_uart;/*protect UART Port from closing while writing*/
+extern kal_bool  tst_is_ps_writing_uart;/*protect UART Port from closing while writing*/
+
+/*for close/open UART port in run time*/
+extern kal_bool tst_is_uart_open;
+extern kal_bool tst_is_writing_uart;
+
+#if defined (UNIT_TEST) || defined (__UE_SIMULATOR__)
+#define LEGACY_TX
+#endif
+
+//extern kal_uint8  tst_ring_buffer[];
+//extern kal_uint32 tst_ptr_buffer_start;
+//extern kal_uint32 tst_ptr_buffer_end;
+#if !defined(LEGACY_TX) && !defined(__DHL_ON_WR8_PLATFORM__)
+extern kal_uint32 tst_ptr_buffer_sent;
+#endif
+
+#ifdef IN_MEMORY_EXCEPTION_BUFFER
+extern kal_uint8 dhl_exception_buffer[];
+extern kal_uint32 dhl_exception_buffer_pos;
+#endif
+
+//the following is dummy tst enums/structs to bypass cgen database check
+typedef enum
+{
+    TST_NULL_COMMAND
+} tst_command_type;
+
+typedef kal_uint8 tst_null_command_struct;
+
+typedef struct
+{
+    tst_command_type  command_type;
+    kal_uint16        cmd_len;
+} tst_command_header_struct;
+
+typedef struct
+{
+    kal_uint32     dummy;
+} tst_log_prim_header_struct;
+
+typedef struct
+{
+    kal_uint32     dummy;
+} tst_index_trace_header_struct;
+
+typedef struct
+{
+    kal_uint32     dummy;
+} tst_prompt_trace_header_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint8   index;
+    kal_uint8   string[INJECT_STRING_TO_MODULE_MAX_LENGTH];
+} tst_inject_string_struct;
+
+typedef tst_inject_string_struct dhl_inject_string_struct;
+
+#define TST_MSG_LOG_SAP_ENABLE 0x7
+
+// Remove stack_timer requirement from SS, contact: HW Jheng
+//typedef stack_timer_struct timer_expiry_struct;
+
+
+#define MAX_RAW_TRACE_SIZE (128)
+#define MAX_TRACE_SIZE (128)
+#define EX_MAX_TRACE_SIZE (128)
+
+#define MAX_HEADER_LEN (8)
+#define DHL_CHECKSUM_FRAME_SIZE  (4)
+
+#if defined(DHL_V_0_5_1) || defined(DHL_V_0_7_1)
+#define DHL_TYPE_CHECKSUM_FLAG      (0x10)
+#define DHL_TYPE_USER_FLAG          (0x20)
+#define DHL_TYPE_EXT_FLAG           (0x08)
+#define DHL_TYPE_MASK               (0x07)
+#else
+#define DHL_FLAG_EXTRA              (0x1)
+#define DHL_TX_FLAG_CHECKSUM              (0x20)
+#define DHL_RX_FLAG_CHECKSUM           (0x40)
+#endif
+
+#define DHL_UNKNOWN_TYPE            (0xFF)
+
+#define __TST_META_MODE_TRACE_ENABLE__ // for MOD_FT
+
+typedef enum
+{
+#if defined (DHL_V_0_5_1)
+    V0_5_1_W1118
+#elif defined(DHL_V_0_7_1)
+    V0_7_1_W1232
+#else
+    V0_7_2_W1346
+#endif
+} dhl_protocol_version;
+
+
+#define DHL_FLAG_CORE_ID_MASK (0x7)
+#define DHL_FLAG_GET_CORE_ID(_f) (((_f) >> 2) & DHL_FLAG_CORE_ID_MASK)
+#define DHL_FLAG_SET_CORE_ID(_des, _f) (_des) = ((_des) | (((_f) & DHL_FLAG_CORE_ID_MASK) << 2))
+
+typedef enum
+{
+    DHL_CORE_ID_MCU_MASTER = 0,
+    DHL_CORE_ID_MCU_SLAVE_1,
+    DHL_CORE_ID_MCU_SLAVE_2,
+    DHL_CORE_ID_MCU_SLAVE_3,
+    DHL_CORE_ID_MCU_SLAVE_4,
+    DHL_CORE_ID_MCU_SLAVE_5,
+    DHL_CORE_ID_MCU_SLAVE_6,
+    DHL_CORE_ID_MCU_SLAVE_7,
+} dhl_core_id_enum;
+
+/**
+ *   Enable checksum
+ *   define here for feeding into codegen when customer release / subsidiary
+ **/
+
+#define __DHL_RX_CHECKSUM__
+#define __DHL_HEADER_CHECKSUM__
+typedef enum
+{
+#if !defined(__DHL_RX_CHECKSUM__) && !defined(__DHL_HEADER_CHECKSUM__)
+    NO_CHECKSUM,
+#else
+#if defined(__DHL_HEADER_CHECKSUM__)
+    DHL_HEADER_CHECKSUM,
+#endif // __DHL_HEADER_CHECKSUM__
+#if defined(__DHL_RX_CHECKSUM__)
+    DHL_RX_CHECKSUM,
+#endif // __DHL_RX_CHECKSUM__
+#endif
+    NO_HEADER_COMPRESSION,
+
+#if defined(L1_CATCHER)
+    MULTI_CORE_SMP_SUPPORT,
+#endif
+
+    DHL_MUX_ENABLE,
+
+    SYSTEM_MONITOR_UMOLYA,
+    USB_MEMORY_DUMP_MODE_AUTO,
+    /* VPE info in check sum field */
+    DISPLAY_EXTENSION_INFO,
+#ifdef __ICD_LOGGING_SUPPORT__
+    ICD_LOGGING,
+#endif    
+} dhl_protocol_info;
+
+typedef enum
+{
+    DHL_PRIMITIVE = 0,
+    DHL_INDEX_TRACE = 1,
+    DHL_RAW_BYTE_TRACE = 2,
+    DHL_RAW_STRING_TRACE = 3,
+    DHL_DISCARD_INFO = 4,
+    DHL_TIME_INFO = 5,
+    DHL_RLE_PRIMITIVE = 6,
+    DHL_PRIMITIVE_ADT = 7,
+    DHL_L1_TRACE = 8,
+    DHL_META_CNF_PRIMITIVE = 9,
+    DHL_L2_TRACE = 10,
+    
+    DHL_ICD_TUNNELING = 0xE0,    // Command & log share same ID, so we need to avoid it collides with command_type
+    //cannot use 0xFF, since it means unknown type
+} dhl_type;
+#define DHL_TYPE_NUM 11
+
+#if defined (DHL_V_0_5_1)
+typedef struct
+{
+    kal_uint16 type;
+    kal_uint16 len;
+} dhl_header_struct;
+#else
+typedef struct
+{
+    kal_uint8 flag;
+    kal_uint8 type;
+    kal_uint16 len;
+} dhl_header_struct;
+#endif
+
+typedef struct
+{
+    kal_uint8 type;
+    kal_uint8 len;
+} dhl_compact_header_struct;
+
+typedef struct
+{
+    kal_uint8 type;
+} dhl_ultra_compact_header_struct;
+
+typedef struct
+{
+    kal_uint32          msg_index;
+    trace_class_enum    trace_class;
+    kal_uint8           access_level;
+    module_type module_id;
+
+} dhl_index_trace_header_struct;
+
+typedef struct
+{
+    kal_uint16 key_len;
+    kal_uint16 data_len;
+} dhl_index_trace_ext_header_struct;
+
+typedef struct
+{
+    kal_uint32          msg_index;
+    trace_class_enum    trace_class;
+    module_type module_id;
+} dhl_raw_byte_trace_header_struct;
+
+typedef struct
+{
+    module_type         module_id;
+    trace_class_enum    trace_class;
+} dhl_raw_string_trace_header_struct;
+
+typedef struct
+{
+    module_type src_mod_id;
+    module_type dest_mod_id;
+    sap_type    sap_id;
+    msg_type    msg_id;
+    kal_uint16  local_len;
+    kal_uint16  peer_len;
+    kal_uint32  local_addr;
+    kal_uint32  peer_addr;
+} dhl_primitive_header_struct;
+
+typedef dhl_primitive_header_struct dhl_rle_primitive_header_struct;
+
+typedef struct
+{
+    module_type src_mod_id;
+    module_type dest_mod_id;
+    sap_type    sap_id;
+    msg_type    msg_id;
+    kal_uint16  local_len;
+    kal_uint16  peer_len;
+    kal_uint32  local_addr;
+    kal_uint32  peer_addr;
+    kal_uint8   local_access_type;
+    kal_uint8   peer_access_type;
+} dhl_ex_primitive_header_struct;
+
+typedef struct
+{
+    kal_uint32 src_mod_id;
+    kal_uint32 dest_mod_id;
+    kal_uint32 sap_id;
+    kal_uint32 msg_id;
+    kal_uint16 local_len;
+    kal_uint16 peer_len;
+} dhl_meta_cnf_primitive_header_struct;
+
+typedef struct
+{
+#if defined (DHL_V_0_5_1)
+    kal_uint16 count;
+#else
+    kal_uint8 count;
+#endif
+} dhl_discard_info_header_struct;
+
+#define DISCARD_INFO_TYPE_UNKNOWN       (0x0)
+#define DISCARD_INFO_TYPE_PS_TRACE      (0x1)
+#define DISCARD_INFO_TYPE_PRIMITIVE     (0x2)
+#define DISCARD_INFO_TYPE_TIMESTAMP     (0x3)
+#define DISCARD_INFO_TYPE_L1_TRACE      (0x4)
+#define DISCARD_INFO_TYPE_L1_BUFFER     (0x5)
+#define DISCARD_INFO_TYPE_L2_TRACE      (0x6)
+#define DISCARD_INFO_TYPE_L2_BUFFER     (0x7)
+
+typedef enum
+{
+    PS_TRACE = 1,
+    PRIMITIVE = 2,
+    TIMESTAMP = 3,
+    L1_TRACE = 4,
+    L1_BUFFER = 5,
+    L2_TRACE = 6,
+    L2_BUFFER = 7,
+} dhl_discard_info_type;
+
+typedef struct
+{
+    kal_uint32 count;
+} dhl_discard_info_type_ps_trace;
+
+typedef struct
+{
+    kal_uint32 count;
+} dhl_discard_info_type_primitive;
+
+typedef struct
+{
+    kal_uint16 count;
+} dhl_discard_info_type_timestamp;
+
+typedef struct
+{
+    kal_uint8 count;
+} dhl_discard_info_type_l1_trace;
+
+typedef struct
+{
+    kal_uint16 count;
+} dhl_discard_info_type_l1_buffer;
+
+typedef struct
+{
+    kal_uint8 count;
+} dhl_discard_info_type_l2_trace;
+
+typedef struct
+{
+    kal_uint16 count;
+} dhl_discard_info_type_l2_buffer;
+
+typedef struct
+{
+#if defined (DHL_V_0_5_1)
+    kal_uint16 count;
+#else
+    kal_uint8 count;
+#endif
+} dhl_time_info_header_struct;
+
+#define TIME_INFO_TYPE_RTOS_TIMESTAMP   (0x1)
+#define TIME_INFO_TYPE_3G_FRAME         (0x2)
+#define TIME_INFO_TYPE_3G_SFN           (0x3)
+
+typedef enum
+{
+    RTOS_TIME = 1,
+} dhl_time_info_type;
+
+typedef struct
+{
+    kal_uint32 timestamp;
+} dhl_time_info_type_rtos_time;
+
+typedef struct
+{
+    kal_uint16 count;
+} dhl_l1_trace_header_struct;
+
+#if defined(DHL_FRAME_LEN_WORD_ALIGN)
+#define RUP(_v) ((_v + 3) / 4 * 4)
+#else
+#define RUP(_v) (_v)
+#endif
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+#define dhl_ex_trace_impl(_t, _u, _msg, _mod, _argv, _arg_info) \
+    dhl_ex_internal_trace_impl(_t, _u, DHL_ACCESS_LEVEL_1_ALL_USER, _msg, _mod, _argv, _arg_info)
+extern void dhl_ex_internal_trace_impl(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint8 access_level, kal_uint32 msg_index, kal_uint32 module_id, const char *arg_type, va_list argument_info);
+
+extern void dhl_ex_print_impl(trace_class_enum trc_class, kal_uint32 user_flag, module_type mod_id, const char *fmt, va_list argument_info);
+
+
+//extern void dhl_convert_ilm_header(ilm_struct *ilm, dhl_primitive_header_struct *hdr);
+#define dhl_convert_ilm_header(_ilm, _hdr) \
+    do { \
+        (_hdr)->local_len = 0; \
+        (_hdr)->peer_len  = 0; \
+        if (!msg_is_inline((_ilm))) { \
+            if ((_ilm)->local_para_ptr != NULL) { \
+                (_hdr)->local_len = (_ilm)->local_para_ptr->msg_len; \
+            } \
+            if ((_ilm)->peer_buff_ptr != NULL) { \
+                (_hdr)->peer_len = sizeof(peer_buff_struct) + \
+                                   (_ilm)->peer_buff_ptr->pdu_len + \
+                                   (_ilm)->peer_buff_ptr->free_header_space + \
+                                   (_ilm)->peer_buff_ptr->free_tail_space; \
+            } \
+        } \
+        (_hdr)->src_mod_id  = (_ilm)->src_mod_id; \
+        (_hdr)->dest_mod_id = (_ilm)->dest_mod_id; \
+        (_hdr)->sap_id      = (_ilm)->sap_id; \
+        (_hdr)->msg_id      = (_ilm)->msg_id; \
+        (_hdr)->local_addr  = (kal_uint32)(_ilm)->local_para_ptr; \
+        (_hdr)->peer_addr   = (kal_uint32)(_ilm)->peer_buff_ptr; \
+    } while(0)
+
+
+typedef struct
+{
+    kal_uint8 access_type;
+    kal_int32 len;
+    kal_uint8 *data;
+} buf_des;
+
+/*
+ * Macro: DHL_COPY_BY_BUF_DES
+ * ----------------------------
+ *   Memcpy to dest by buf_des struct, then increase the write pointer
+ *
+ *   PARAMETERS
+ *      buf_write_ptr   : kal_uint8*
+ *      body            : buf_des[]
+ *      body_count      : kal_uint32
+ *   RETURN: NONE
+ */
+
+#define DHL_COPY_BY_BUF_DES(buf_write_ptr, body, body_count) \
+    do { \
+        kal_uint32 i; \
+        for (i = 0; i < body_count; i++) { \
+            memcpy(buf_write_ptr, body[i].data, body[i].len); \
+            buf_write_ptr += body[i].len; \
+        } \
+    } while(0)
+
+extern void dhl_log_primitive_impl(kal_uint32 user_flag, dhl_primitive_header_struct *hdr, buf_des *des, kal_int32 count, kal_bool compressed);
+extern void dhl_print_primitive(kal_uint32 user_flag, dhl_primitive_header_struct *hdr);
+extern void dhl_print_primitive_impl(
+    kal_uint32 user_flag,
+    dhl_primitive_header_struct *hdr,
+    kal_uint8 *local_data,
+    kal_int32 local_len,
+    kal_uint8 *peer_data,
+    kal_int32 peer_len);
+extern void dhl_ex_print_primitive(kal_uint32 user_flag, dhl_ex_primitive_header_struct *hdr);
+
+/* layer-1 trace group */
+typedef enum
+{
+    UMTS_3G_GEMINI_TIME = 0,
+    UMTS_3G_TIME,
+    UMTS_2G_GEMINI_TIME,
+    UMTS_2G_TIME,
+    UMTS_2G_HANDOVER_TIME,
+    UMTS_3G_HANDOVER_TIME,
+    LTE_4G_TIME = 6,
+    LTE_4G_TIME_2 = 7,
+    LTE_4G_L2_TIME = 8,
+} dhl_l1_time_trace_type;
+
+typedef enum
+{
+    L1_TRACE_LOST_COUNT,
+    L1_BUFFER_LOST_COUNT,
+    L2_TRACE_LOST_COUNT,
+    L2_BUFFER_LOST_COUNT,
+} dhl_l1_lost_count_type;
+
+
+
+extern void dhl_ex_log_l1_trace_group(kal_uint32 user_flag, kal_uint16 count, kal_uint8 *buf, kal_uint32 buf_len);
+extern void dhl_ex_log_l2_trace_group(kal_uint32 user_flag, kal_uint16 count, kal_uint8 *buf, kal_uint32 buf_len);
+extern void dhl_ex_log_l1_lost_count(dhl_l1_lost_count_type type, kal_uint8 count);
+
+#include "adt.h"
+
+/* ADT logging */
+extern void dhl_log_primitive_with_adt(ilm_struct *ilm_ptr, translator_adt_enc_callback_t translator_cb, kal_bool filter);
+
+/* ADT inject for UT */
+typedef void (*translator_adt_dec_callback_t)(const ilm_struct *ilm_adt_ptr, ilm_struct **ilm_ptr);
+kal_bool register_translator_adt_decoder(msg_type msg_id, translator_adt_dec_callback_t cb);
+translator_adt_dec_callback_t get_adt_decoder(msg_type msg_id);
+kal_bool register_translator_adt_encoder(msg_type msg_id, translator_adt_enc_callback_t translator_cb);
+translator_adt_enc_callback_t get_adt_encoder(msg_type msg_id);
+
+/* control */
+extern void dhl_sync();
+extern void dhl_time();
+
+#ifdef UNIT_TEST
+void dhl_write_file(kal_bool outgoing, kal_uint8 *data, kal_int32 len);
+#endif
+
+#define SYNC_PATTERN_SIZE (4)
+
+typedef enum
+{
+    DHL_CMD_NULL = 0,
+    DHL_CMD_META_REQ_PRIMITIVE = 1,
+    DHL_CMD_CHECK_DATABASE_SIGNATURE = 2,
+    DHL_CMD_MD_MONITOR_CMD = 3,
+    DHL_CMD_3RD_PARTY_TOOL_CMD = 4,
+
+    /* Do NOT change the order of the above command(s) */
+    DHL_CMD_SET_PRIM_MOD_FILTER,
+    DHL_CMD_SET_PRIM_SAP_FILTER,
+    DHL_CMD_SET_TRAP_FILTER,
+    DHL_CMD_SET_PS_TRC_FILTER,
+    DHL_CMD_SET_L1_TRC_FILTER,
+    DHL_CMD_READ_GLOBAL_VARIABLE,
+    DHL_CMD_WRITE_GLOBAL_VARIABLE,
+    DHL_CMD_REBOOT_TARGET,
+    DHL_CMD_INJECT_ILM,
+    DHL_CMD_REDIRECT,
+    DHL_CMD_FT_MODE_CONFIG,
+    DHL_CMD_NVRAM,
+    DHL_CMD_READ_STACK_STATISTICS,
+    DHL_CMD_FILE_TRANSFER,
+    DHL_CMD_FILE_SAVE,
+    DHL_CMD_READ_MEMORY_ADDR,
+    DHL_CMD_QUERY_MEMORY_RANGE,
+    DHL_CMD_USB_MEMORY_DUMP_START,
+    DHL_CMD_WRITE_MEMORY,
+    DHL_CMD_QUERY_CTRL_BUF_MONITOR_DATA,
+    DHL_CMD_QUERY_FLC_BUF_MONITOR_DATA,
+    DHL_CMD_FORCE_ASSERT,
+    DHL_CMD_INJECT_ILM_ADT,
+    DHL_CMD_MSG_BKPT,
+    DHL_CMD_INJECT_STRING_TO_MODULE,
+    DHL_CMD_INJECT_AT_CMD,
+    DHL_CMD_SIM_FILE_INFO_REQ,
+    DHL_CMD_SIM_READ_REQ,
+    DHL_CMD_SIM_WRITE_REQ,
+    DHL_CMD_SWLA_EMI_MONITOR_MASTER_SELECT,
+    DHL_CMD_VIRTUAL_CHANNEL,
+    DHL_CMD_EM_MODE_CONFIG,
+    DHL_CMD_SET_TRAP_MSG,
+    DHL_CMD_UBDB,
+    DHL_CMD_REBOOT_FOR_MMI_AUTO_TEST,
+    DHL_CMD_SET_PARTIAL_PRIM_MOD_FILTER,
+    DHL_CMD_SET_PARTIAL_PRIM_SAP_FILTER,
+    DHL_CMD_SET_PARTIAL_PS_TRC_FILTER,
+    DHL_CMD_SET_PARTIAL_L1_TRC_FILTER,
+    DHL_CMD_SET_2G_DSP_FILTER,
+    DHL_CMD_ELT_CONNECT,
+    DHL_CMD_ELT_DISCONNECT,
+    DHL_CMD_LOOP_BACK,
+    DHL_CMD_CUSTOM_READ_MEMORY,
+    DHL_CMD_CUSTOM_WRITE_MEMORY,
+    DHL_CMD_MON_MODE_START,
+    /* SWLA/SWTR MESSAGE ID -Start- */
+    DHL_CMD_SWLA_QUERY_HEADER,
+    DHL_CMD_ASM_QUERY_HEADER,
+    /* SWLA/SWTR MESSAGE ID -End- */
+    DHL_CMD_ICD_TUNNELING = DHL_ICD_TUNNELING,
+    // ELT will send this command for entering TMC, but if MDLogger doesn't enter TMC yet, this will be regarded as general command and will send to DHL, and we just drop it.
+    // NOTE: NEVER change this value, it's magic pattern.
+    DHL_CMD_TMC_HANDSHAKE_DUMMY = 0xFE,  
+} dhl_command_type;
+
+typedef dhl_header_struct dhl_cmd_header_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    dhl_cmd_header_struct hdr;
+    kal_uint32 cksum;
+    kal_uint8 extra_len;
+    kal_uint8 *extra;
+    kal_uint16 recv_len;
+    kal_uint8 *value;
+} dhl_cmd_frame_buffer_struct;
+
+typedef kal_uint8 dhl_cmd_null_struct;
+
+typedef struct
+{
+    kal_uint8   mod_filter[TST_MODULE_FILTER_LEN];
+} dhl_cmd_set_prim_mod_filter_struct;
+
+typedef struct
+{
+    kal_uint8   sap_filter[TST_SAP_FILTER_LEN];
+} dhl_cmd_set_prim_sap_filter_struct;
+
+typedef struct
+{
+    kal_uint16  sap_id;
+    kal_uint8   is_trap;
+} dhl_cmd_set_trap_filter_struct;
+
+typedef struct
+{
+    kal_uint8  sap_filter[TST_TRACE_FILTER_LEN];
+} dhl_cmd_set_ps_trc_filter_struct;
+
+typedef dhl_cmd_set_ps_trc_filter_struct dhl_test_struct;
+
+typedef kal_uint8 dhl_cmd_set_l1_trc_filter_struct;
+
+typedef struct
+{
+    kal_uint32  gv_name_len;
+    kal_char    data[1];
+} dhl_cmd_read_global_variable_struct;
+
+typedef kal_uint8 dhl_ind_read_variable_return_struct;
+
+typedef struct
+{
+    kal_uint16      size1;
+    kal_uint16      size2;
+} dhl_cmd_write_global_variable_struct;
+
+typedef kal_uint8 dhl_cmd_reboot_target_struct;
+
+typedef kal_uint8 dhl_cmd_reboot_for_mmi_auto_test_struct;
+
+typedef struct
+{
+    kal_uint16      no_peer_buff_ptr;
+    kal_uint16      peer_buff_ptr_size;
+    kal_uint8       *peer_buff_ptr;
+    kal_uint8       ref_count;
+    kal_uint8       header_len;
+    kal_uint8       tail_len;
+    kal_uint8       unused1;
+} asn_peer_buff_struct;
+
+typedef struct
+{
+    kal_uint8       ref_count;
+    kal_uint16      no_local_params_ptr;
+    kal_uint16      local_params_ptr_size;
+    kal_uint8       *local_params_ptr;
+} asn_local_para_struct;
+
+typedef struct
+{
+    module_type     src_mod_id;
+    module_type     dest_mod_id;
+    sap_type        sap_id;
+    msg_type        msg_id;
+    asn_local_para_struct   local_params;
+    asn_peer_buff_struct    peer_buff;
+} ilmessage;
+
+typedef kal_uint8 dhl_cmd_inject_ilm_struct;
+
+typedef struct
+{
+    kal_uint32 src_mod_id;
+    kal_uint32 dest_mod_id;
+    kal_uint32 sap_id;
+    kal_uint32 msg_id;
+    kal_uint16 local_len;
+    kal_uint16 peer_len;
+} dhl_cmd_meta_req_primitive_struct;
+
+typedef struct
+{
+    kal_uint8   virtual_channel_id;
+    kal_uint8   pData[1];
+} dhl_cmd_redirect_struct;
+
+typedef struct
+{
+    kal_uint8   enable;
+} dhl_cmd_ft_mode_config_struct;
+
+typedef enum
+{
+    NVRAM_READ,
+    NVRAM_RESET,
+    NVRAM_WRITE,
+    NVRAM_RESET_FLAG
+    // reset stack stats status in NVRAM_EF_SYS_STATISTICS_LID
+} nvram_actions;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    nvram_actions act;
+    kal_uint32  file_id;
+} dhl_cmd_nvram_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+} dhl_cmd_read_stack_statistics_struct;
+
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+} dhl_cmd_read_stack_statistics_slave_struct ;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    module_type     src_mod_id;
+    module_type     dest_mod_id;
+    sap_type          sap_id;
+} dhl_slave2master_print_primitive_struct ;
+
+typedef stack_statistics_struct dhl_ind_stack_statistics_struct;
+typedef stack_statistics_struct dhl_ind_stack_statistics_slave_struct;
+
+#ifdef L1_SIM
+typedef kal_uint8 dhl_ind_nvram_read_cnf_struct;
+typedef kal_uint8 dhl_ind_nvram_reset_cnf_struct;
+#else
+typedef nvram_read_cnf_struct dhl_ind_nvram_read_cnf_struct;
+typedef nvram_reset_cnf_struct dhl_ind_nvram_reset_cnf_struct;
+#endif
+
+typedef struct
+{
+    kal_uint32 HISR_pair_num;
+    kal_char HISR_Name[KAL_MAX_NUM_HISRS * STACK_STATS_HISR_MAX_NAME];
+} dhl_HISR_name_struct;
+
+typedef struct
+{
+    stack_statistics_struct statistic;
+    dhl_HISR_name_struct hisr_name_struct;
+} dhl_nvram_statistics_struct;
+
+typedef dhl_nvram_statistics_struct tst_stack_statistics_struct;
+
+typedef struct
+{
+    kal_uint32  token;
+    kal_uint32  start_address; //if 0xFFFFFFFF => to delete the file
+    kal_uint32  buf_length;
+    kal_uint8   buf[1]; // full path
+} dhl_cmd_file_transfer_struct;
+
+typedef struct
+{
+    kal_uint32  time_stamp;
+    kal_uint32  token;
+    kal_uint32  start_address;//0xFFFFFFFF , to delete the file
+    kal_uint32  path_length;
+    kal_uint32  data_length; //0: end-of-file or file deleted
+} dhl_ind_file_transfer_report_struct;
+
+typedef enum
+{
+    DHL_FS_DELETE_FILE = -1,
+    DHL_FS_ALWAYS_CREATE,
+    DHL_FS_APPEND_END,
+    DHL_FS_SEEK_AND_APPEND
+} dhl_file_save_action_t;
+
+typedef struct
+{
+    kal_uint32 token;
+    dhl_file_save_action_t action;  //0: create, 1: append to the end, 2. open and append the seek pos, 0xFFFFFFFF: delete
+    kal_int32 seek_pos;
+    kal_uint32 data_len;  //the total length of data[1] array
+    kal_uint32 content_offset;  //the offset of file content start in the data[1] array
+    kal_uint8 data[1];  //file path name and file content segment
+} dhl_cmd_file_save_struct;
+
+typedef struct
+{
+    kal_uint32 token;
+    kal_uint32 action;  //0: create, 1: append to the end, 2. open and append the seek pos, 0xFFFFFFFF: delete
+    kal_uint32 fill_data_len;
+} dhl_ind_file_save_report_struct;
+
+typedef enum
+{
+    DHL_READ_MEMORY_ACCESS_TYPE_NOT_SPECIFIED = 0,
+    DHL_READ_MEMORY_ACCESS_TYPE_BYTE = 1,
+    DHL_READ_MEMORY_ACCESS_TYPE_HALF_WORD = 2,
+    DHL_READ_MEMORY_ACCESS_TYPE_WORD = 4
+} dhl_read_memory_access_type;
+
+typedef struct
+{
+    kal_uint8   token;
+    kal_uint8   reserved;
+    kal_uint16  chunk_size;
+    void        *address;
+    kal_uint32  length;
+    kal_uint32  mem_type;
+    dhl_read_memory_access_type  access_type;
+} dhl_cmd_read_memory_addr_struct;
+
+typedef struct
+{
+    kal_uint32 mem_type;
+} dhl_cmd_usb_memory_dump_start_struct;
+
+typedef struct
+{
+    kal_uint8   token;
+    kal_uint8   encoded; //0 for not encoded, 1 for encoded with RLE
+    const void  *address;
+    kal_uint32  length;
+    kal_uint32 mem_type;
+    dhl_read_memory_access_type access_type;
+} dhl_ind_read_memory_report_struct;
+
+// redefine structure for ELT decode MSG_ID_DHL_AUTO_MEMORY_DUMP_IN_ILM.
+typedef dhl_ind_read_memory_report_struct dhl_auto_memory_dump_in_ilm_struct;
+
+typedef kal_uint8 dhl_cmd_query_memory_range_struct;
+
+typedef struct
+{
+    kal_uint32 mem_type;
+} dhl_start_dump_memory_type_struct;
+
+typedef struct
+{
+    kal_uint32 mem_type;
+} dhl_end_dump_memory_type_struct;
+
+typedef struct
+{
+    kal_uint32 mem_type_num;
+    kal_uint8 token;
+    kal_bool last;
+} dhl_ind_query_memory_range_struct;
+
+typedef struct
+{
+    void        *address;
+    kal_uint32  length;
+    kal_uint8   data[1];
+} dhl_cmd_write_memory_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint32  token;
+} dhl_cmd_query_ctrl_buf_monitor_data_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint32  token;
+} dhl_cmd_query_flc_buf_monitor_data_struct;
+
+typedef struct
+{
+    kal_uint32  token;
+    kal_uint32  ack_type; //0: ctrl buffer, 1: flc buffer
+} dhl_ind_query_buf_monitor_report_struct;
+
+typedef enum
+{
+    MSG_BKPT_SET = 0,
+    MSG_BKPT_CLR,
+    MSG_BKPT_RESUME,
+    MSG_BKPT_CLR_ALL,
+    MSG_BKPT_CONFIG_MODE,
+} dhl_msg_bkpt_action;
+
+typedef enum
+{
+    MSG_BKPT_CONFIG_SENDER_HOLD = 0,
+    MSG_BKPT_CONFIG_RECEIVER_HOLD,
+    MSG_BKPT_CONFIG_SENDER_BREAK,
+    MSG_BKPT_CONFIG_RECEIVER_BREAK,
+    MSG_BKPT_CONFIG_BUFFER,
+    MSG_BKPT_CONFIG_SINGLE,
+} dhl_msg_bkpt_config;
+
+typedef struct _dhl_cmd_msg_bkpt
+{
+    dhl_msg_bkpt_config config;
+    module_type     src_mod_id;
+    module_type     dest_mod_id;
+    msg_type        msg_id;
+    struct _dhl_cmd_msg_bkpt *next;
+} dhl_cmd_msg_bkpt;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    dhl_msg_bkpt_action action;
+    dhl_msg_bkpt_config config;
+    module_type     src_mod_id;
+    module_type     dest_mod_id;
+    msg_type        msg_id;
+} dhl_cmd_msg_bkpt_struct;
+
+typedef enum
+{
+    MSG_BREAK_SENDER_HOLD = 0,
+    MSG_BREAK_RECEIVER_HOLD,
+    MSG_BREAK_SENDER_BREAK,
+    MSG_BREAK_RECEIVER_BREAK,
+    MSG_BREAK_SINGLE_STEP,
+} dhl_msg_break_type;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    dhl_msg_break_type type;
+    module_type src_mod_id;
+    module_type dest_mod_id;
+    msg_type msg_id;
+} dhl_dbg_msg_break_struct;
+
+typedef dhl_dbg_msg_break_struct dhldbg_msg_break_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    module_type dest_mod;
+    kal_uint8 index;
+    kal_uint8 string[INJECT_STRING_TO_MODULE_MAX_LENGTH];
+} dhl_cmd_inject_string_to_module_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint8 atcmd[INJECT_AT_COMMAND_MAX_LENGTH];
+} dhl_cmd_inject_at_cmd_struct;
+
+typedef struct
+{
+    kal_uint32 sim_num;
+    kal_uint16 file_idx;
+    kal_uint8 file_path[6];
+} dhl_cmd_sim_file_info_req_struct;
+
+typedef struct
+{
+    kal_uint32 sim_num;
+    kal_uint16 file_idx;
+    kal_uint16 para;
+    kal_uint16 length;
+    kal_uint8 file_path[6];
+} dhl_cmd_sim_read_req_struct;
+
+typedef struct
+{
+    kal_uint32 sim_num;
+    kal_uint16 file_idx;
+    kal_uint16 para;
+    kal_uint8 data[260];
+    kal_uint16 length;
+    kal_uint8 file_path[6];
+} dhl_cmd_sim_write_req_struct;
+
+typedef struct
+{
+    kal_uint32 token;
+    dhl_command_type ack_cmd_type;
+    kal_uint32 return_code;
+    kal_uint32 is_cmd_msg;
+    msg_type ack_cmd_msg_id;
+} dhl_ind_general_query_cmd_ack_struct;
+
+typedef kal_uint8 dhl_cmd_swla_legacy_query_header_struct;
+
+/**
+ * @brief: SWLA memory dump mode, header query command
+ * @parameters:
+ *      dhl_memory_type : please reference E_DHL_SWLA_DUMP_FOR_ELT
+ **/
+typedef struct
+{
+    kal_uint32 dhl_memory_type;
+} dhl_cmd_swla_query_header_struct;
+
+/**
+ * @brief: SWLA memory dump mode, header query command response
+ * @parameters:
+ *      dhl_memory_type : response the same vaule with ELT command to be the token
+ *      swla_header_len : the length of swla header in the peer buffer
+ **/
+typedef struct
+{
+    kal_uint32 dhl_memory_type;
+    kal_uint32 swla_header_len;
+} dhl_ind_swla_query_header_report_struct;
+
+/**
+ * @brief: ASM SWLA/SWTR streaming mode, header query command
+ * @parameters:
+ *      dhl_mux_id : please reference dhl_mux_id enum type
+ **/
+typedef struct
+{
+    kal_uint32 dhl_mux_id;
+} dhl_cmd_asm_query_header_struct;
+
+/**
+ * @brief: ASM SWLA/SWTR streaming mode, header query command response
+ * @parameters:
+ *      dhl_mux_id : response the same vaule with ELT command to be the token
+ *      swla_header_len : the length of ASM swla/swtr header in the peer buffer
+ **/
+typedef struct
+{
+    kal_uint32  dhl_mux_id;
+    kal_uint32  asm_header_len;
+} dhl_ind_asm_query_header_report_struct;
+
+/**
+ * @brief: SWLA/SWTR maximum header length.
+ *         DHL truncates the header, if header length larger than this definition.
+ *         SS has to restore the header manually.
+ **/
+#define DHL_SWLA_MAX_HEADER_LEN_DEF (512)
+#define DHL_SWTR_MAX_HEADER_LEN_DEF (512)
+typedef enum
+{
+    DHL_SWLA_MAX_HEADER_LEN = DHL_SWLA_MAX_HEADER_LEN_DEF,
+    DHL_SWTR_MAX_HEADER_LEN = DHL_SWTR_MAX_HEADER_LEN_DEF
+} dhl_software_monitor;
+
+
+
+
+
+#define DHL_SWLA_EMI_MONITOR_MASTER_NUM (3)
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint16 master_select[DHL_SWLA_EMI_MONITOR_MASTER_NUM];
+} dhl_cmd_swla_emi_monitor_master_select_cmd_struct;
+
+typedef struct
+{
+    kal_uint8 channel_id;
+    kal_uint8 pData[1];
+} dhl_cmd_virtual_channel_struct;
+
+typedef struct
+{
+    kal_uint8 channel_id;
+} dhl_ind_virtual_channel_struct;
+
+typedef struct
+{
+#ifdef __EM_MODE__
+    em_info_status_enum  info_request[NUM_OF_EM_INFO];
+    kal_uint32 sim_selection;   //Accompanied with one option in Catcher_Version_Info_Enum (CATCHER_EM_MULTIPLE_SIM_ENABLE)
+#else   //#ifdef __EM_MODE__
+    //The reason we keep the old declaration here is that we don't want to change the order of tst_command_type
+    //MLT uses the flake database
+    kal_uint8 enable;
+#endif  //#ifdef __EM_MODE__
+} dhl_cmd_em_mode_config_struct;
+
+typedef struct
+{
+    kal_uint16 nCount;
+    kal_uint16 MsgIDs[1];
+} dhl_cmd_set_trap_msg_struct;
+
+typedef struct
+{
+    kal_uint8 token;
+    kal_uint8 command; //0: db_reset, 1:db_write, 2:db_read, 3:db_delete
+    //4: db_snap, 5:db_exist
+    kal_uint16 length;
+    kal_uint8 sim_num;
+    kal_uint8 rat_mode;
+    kal_uint8 buf[1]; // for write commmand address, this must be put in the last var.
+} dhl_cmd_ubdb_struct;
+
+typedef struct
+{
+    kal_uint8 token;
+    kal_uint8 command;
+    kal_uint16 length;
+} dhl_ind_ubdb_struct;
+
+//MSG_ID_TST_R8_DL_PKT_SINGLE_GPD_IND
+typedef struct
+{
+    kal_uint8 ref_count;
+    kal_uint16 msg_len;
+    kal_uint32 trace_id;
+    sap_type raw_data_sap;
+    kal_uint16 offset;
+} tst_r8_dl_pkt_single_gpd_ind_struct;
+
+typedef struct
+{
+    void  *m_Addr;
+    kal_uint16  m_Value;
+} dhl_2g_dsp_filter_setting;
+
+typedef struct
+{
+    kal_uint32  count;
+    dhl_2g_dsp_filter_setting *filter;
+} dhl_cmd_set_2g_dsp_filter_struct;
+
+typedef enum
+{
+    TST_GPD_LOG_GPD_TYPE = 0,
+    TST_GPD_LOG_BD_TYPE,
+    TST_GPD_LOG_RAW_TYPE,
+    TST_GPD_LOG_LAST_TYPE,
+} tst_gpd_log_type_t;
+
+typedef enum
+{
+    DHL_DRV_DETACH,
+    DHL_DRV_ATTACH,
+    DHL_DRV_INIT,
+} dhl_drv_state;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    DCL_HANDLE handle;
+    dhl_drv_state state;
+} dhl_driver_state_change_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    DCL_HANDLE handle;
+    tty_io_request_t *ior;
+} dhl_tty_rx_done_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+}
+tst_l2copro_filter_retrieval_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+}
+tst_l2copro_filter_save_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_bool location_state;
+} dhl_lbs_pos_ntf_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_int64 lat;
+    kal_int64 lng;
+    kal_int32 acc;
+} dhl_lbs_pos_ind_struct;
+
+typedef struct
+{
+    kal_uint32 count;
+} dhl_cmd_set_partial_prim_mod_filter_struct;
+
+typedef struct
+{
+    kal_uint32 count;
+} dhl_cmd_set_partial_prim_sap_filter_struct;
+
+typedef struct
+{
+    kal_uint32 count;
+} dhl_cmd_set_partial_ps_trc_filter_struct;
+
+typedef struct
+{
+    kal_uint32 count;
+} dhl_cmd_set_partial_l1_trc_filter_struct;
+
+typedef enum
+{
+    DHL_MUX_ID_MCU_CODE_BEGIN = 0, DHL_MUX_ID_MCU_CODE_TAIL = 2,
+    DHL_MUX_ID_DSP_CODE_BEGIN = 3, DHL_MUX_ID_DSP_CODE_TAIL = 127,
+    DHL_MUX_ID_HW_CODE_BEGIN = 128, DHL_MUX_ID_HW_CODE_TAIL = 255,
+    DHL_MUX_ID_END = 256,
+} dhl_mux_id_range;
+
+#define DHL_MUX_FILTER_LEN 32
+
+typedef enum
+{
+    DHL_MUX_ID_MCU = 0,
+    DHL_MUX_ID_ASM_SWTR = 1,
+    DHL_MUX_ID_MCU_MON = 2,
+    DHL_MUX_ID_DSP_INNER_1 = DHL_MUX_ID_DSP_CODE_BEGIN,
+    DHL_MUX_ID_DSP_INNER_2,
+    DHL_MUX_ID_DSP_BRP_1,
+    DHL_MUX_ID_DSP_BRP_2,
+    DHL_MUX_ID_DSP_FEC_1,
+    DHL_MUX_ID_DSP_FEC_2,
+    DHL_MUX_ID_DSP_SPEECH_1,
+    DHL_MUX_ID_DSP_SPEECH_2,
+    DHL_MUX_ID_DSP_SCQ0_1,
+    DHL_MUX_ID_DSP_SCQ0_2,
+    DHL_MUX_ID_DSP_SCQ1_1,
+    DHL_MUX_ID_DSP_SCQ1_2,
+    DHL_MUX_ID_DSP_RAKE_1,
+    DHL_MUX_ID_DSP_RAKE_2,
+
+    DHL_MUX_ID_DSP_CODE_END,
+    /*
+        // 91 DSP channel
+        DHL_MUX_ID_DSP_DFE_1 = DHL_MUX_ID_DSP_CODE_BEGIN,
+        DHL_MUX_ID_DSP_DFE_2,
+        DHL_MUX_ID_DSP_RAKE_1,
+        DHL_MUX_ID_DSP_RAKE_2,
+        DHL_MUX_ID_DSP_BRP_1,
+        DHL_MUX_ID_DSP_BRP_2,
+        DHL_MUX_ID_DSP_IMC_1,
+        DHL_MUX_ID_DSP_IMC_2,
+        DHL_MUX_ID_DSP_ICC_1,
+        DHL_MUX_ID_DSP_ICC_2,
+        DHL_MUX_ID_DSP_MPC_1,
+        DHL_MUX_ID_DSP_MPC_2,
+        DHL_MUX_ID_DSP_DFE1_1,
+        DHL_MUX_ID_DSP_DFE1_2,
+
+        DHL_MUX_ID_RESERVED_MD32_1, //Align MT6290 for backward compatible
+        DHL_MUX_ID_RESERVED_MD32_2,
+        DHL_MUX_ID_DSP_MDP_MPC,
+        DHL_MUX_ID_DSP_MDP_IMC,
+        DHL_MUX_ID_DSP_MDP_ICC,
+        DHL_MUX_ID_DSP_MDP_DFE1,
+        DHL_MUX_ID_DSP_CODE_END,
+    */
+
+    /* use DHL_MUX_ID_DSP_CODE_END as trace stats mux num, please also update DHL_MUXID_NUM if add new ID */
+
+    DHL_MUX_ID_HW_IRDBG = DHL_MUX_ID_HW_CODE_BEGIN,
+    DHL_MUX_ID_MCU_1 = 129, /* 130~135: Reserved for others MCU use in the feature */
+    DHL_MUX_ID_MCU_2,
+    DHL_MUX_ID_MCU_3,
+    DHL_MUX_ID_MCU_4,
+    DHL_MUX_ID_MCU_5,
+    DHL_MUX_ID_MCU_6,
+    DHL_MUX_ID_ASM_INFRA_SWTR = 136,/* 136~146: Reserved for others MCU ASM use in the feature */
+    DHL_MUX_ID_ASM_CORE_BEGIN = 137,
+    DHL_MUX_ID_ASM0_SWLA = DHL_MUX_ID_ASM_CORE_BEGIN,
+    DHL_MUX_ID_ASM1_SWLA = 138,
+    DHL_MUX_ID_ASM2_SWLA = 139,
+    DHL_MUX_ID_ASM3_SWLA = 140,
+    DHL_MUX_ID_LINUX_LOG = 147, // VOLTE log
+
+    DHL_MUX_MCU_ULSP = 150,
+    DHL_MUX_MCU_ULSP_ONDEMAND = 151,
+    DHL_MUX_DSP_ULSP = 152,
+    DHL_MUX_NR_DSP_ULSP = 154,
+    DHL_MUX_NR_DSP_ULSP_ONDEMAND = 155,
+    DHL_MUX_LTE_DSP_ULSP = 156,
+    DHL_MUX_LTE_DSP_ULSP_ONDEMAND = 157,
+    DHL_TRACE_STAT_MUX_SIZE,
+    DHL_MUX_ID_NO_MUX = 255
+} dhl_mux_id;
+
+/* last index for L1core : DHL_MUX_ID_MCU_SLAVE */
+//#define DHL_MUXID_NUM (DHL_MUX_ID_NO_MUX + 1)
+//#define DHL_STATS_MUX_SLAVE_ID (DHL_MUXID_NUM - 1)
+
+//ULSP Source ID to Core/TC ID mapping
+//Format: MUX_(MUX_ID)_SOURCEID_(SOURCE_ID)__CORE_(CORE_ID)_TC_(TCID)
+#if defined(__MD97__) && defined(__USE_ULSP__)
+typedef enum
+{
+    MUX_150_SOURCEID_1__CORE_0_TC_0,
+    MUX_150_SOURCEID_2__CORE_0_TC_1,
+    MUX_150_SOURCEID_3__CORE_0_TC_2,
+    MUX_150_SOURCEID_4__CORE_0_TC_3,
+    MUX_150_SOURCEID_5__CORE_0_TC_4,
+    MUX_150_SOURCEID_6__CORE_0_TC_5,
+    MUX_150_SOURCEID_7__CORE_0_TC_6,
+    MUX_150_SOURCEID_8__CORE_0_TC_7,
+    MUX_150_SOURCEID_9__CORE_1_TC_0,
+    MUX_150_SOURCEID_10__CORE_1_TC_1,
+    MUX_150_SOURCEID_11__CORE_1_TC_2,
+    MUX_150_SOURCEID_12__CORE_1_TC_3,
+    MUX_150_SOURCEID_13__CORE_1_TC_4,
+    MUX_150_SOURCEID_14__CORE_1_TC_5,
+    MUX_150_SOURCEID_15__CORE_1_TC_6,
+    MUX_150_SOURCEID_16__CORE_1_TC_7,
+    MUX_150_SOURCEID_17__CORE_2_TC_0,
+    MUX_150_SOURCEID_18__CORE_2_TC_1,
+    MUX_150_SOURCEID_19__CORE_2_TC_2,
+    MUX_150_SOURCEID_20__CORE_2_TC_3,
+    MUX_150_SOURCEID_21__CORE_2_TC_4,
+    MUX_150_SOURCEID_22__CORE_2_TC_5,
+    MUX_150_SOURCEID_23__CORE_2_TC_6,
+    MUX_150_SOURCEID_24__CORE_2_TC_7,
+    MUX_150_SOURCEID_25__CORE_3_TC_0,
+    MUX_150_SOURCEID_26__CORE_3_TC_1,
+    MUX_150_SOURCEID_27__CORE_3_TC_2,
+    MUX_150_SOURCEID_28__CORE_3_TC_3,
+    MUX_150_SOURCEID_29__CORE_3_TC_4,
+    MUX_150_SOURCEID_30__CORE_3_TC_5,
+    MUX_150_SOURCEID_31__CORE_3_TC_6,
+    MUX_150_SOURCEID_32__CORE_3_TC_7,
+    MUX_150_SOURCEID_33__CORE_0_TC_0,
+    MUX_150_SOURCEID_34__CORE_0_TC_1,
+    MUX_150_SOURCEID_35__CORE_0_TC_2,
+    MUX_150_SOURCEID_36__CORE_0_TC_3,
+    MUX_150_SOURCEID_37__CORE_0_TC_4,
+    MUX_150_SOURCEID_38__CORE_0_TC_5,
+    MUX_150_SOURCEID_39__CORE_0_TC_6,
+    MUX_150_SOURCEID_40__CORE_0_TC_7,
+    MUX_150_SOURCEID_41__CORE_1_TC_0,
+    MUX_150_SOURCEID_42__CORE_1_TC_1,
+    MUX_150_SOURCEID_43__CORE_1_TC_2,
+    MUX_150_SOURCEID_44__CORE_1_TC_3,
+    MUX_150_SOURCEID_45__CORE_1_TC_4,
+    MUX_150_SOURCEID_46__CORE_1_TC_5,
+    MUX_150_SOURCEID_47__CORE_1_TC_6,
+    MUX_150_SOURCEID_48__CORE_1_TC_7,
+    MUX_150_SOURCEID_49__CORE_2_TC_0,
+    MUX_150_SOURCEID_50__CORE_2_TC_1,
+    MUX_150_SOURCEID_51__CORE_2_TC_2,
+    MUX_150_SOURCEID_52__CORE_2_TC_3,
+    MUX_150_SOURCEID_53__CORE_2_TC_4,
+    MUX_150_SOURCEID_54__CORE_2_TC_5,
+    MUX_150_SOURCEID_55__CORE_2_TC_6,
+    MUX_150_SOURCEID_56__CORE_2_TC_7,
+    MUX_150_SOURCEID_57__CORE_3_TC_0,
+    MUX_150_SOURCEID_58__CORE_3_TC_1,
+    MUX_150_SOURCEID_59__CORE_3_TC_2,
+    MUX_150_SOURCEID_60__CORE_3_TC_3,
+    MUX_150_SOURCEID_61__CORE_3_TC_4,
+    MUX_150_SOURCEID_62__CORE_3_TC_5,
+    MUX_150_SOURCEID_63__CORE_3_TC_6,
+    MUX_151_SOURCEID_1__CORE_0_TC_0,
+    MUX_151_SOURCEID_2__CORE_0_TC_1,
+    MUX_151_SOURCEID_3__CORE_0_TC_2,
+    MUX_151_SOURCEID_4__CORE_0_TC_3,
+    MUX_151_SOURCEID_5__CORE_0_TC_4,
+    MUX_151_SOURCEID_6__CORE_0_TC_5,
+    MUX_151_SOURCEID_7__CORE_0_TC_6,
+    MUX_151_SOURCEID_8__CORE_0_TC_7,
+    MUX_151_SOURCEID_9__CORE_1_TC_0,
+    MUX_151_SOURCEID_10__CORE_1_TC_1,
+    MUX_151_SOURCEID_11__CORE_1_TC_2,
+    MUX_151_SOURCEID_12__CORE_1_TC_3,
+    MUX_151_SOURCEID_13__CORE_1_TC_4,
+    MUX_151_SOURCEID_14__CORE_1_TC_5,
+    MUX_151_SOURCEID_15__CORE_1_TC_6,
+    MUX_151_SOURCEID_16__CORE_1_TC_7,
+    MUX_151_SOURCEID_17__CORE_2_TC_0,
+    MUX_151_SOURCEID_18__CORE_2_TC_1,
+    MUX_151_SOURCEID_19__CORE_2_TC_2,
+    MUX_151_SOURCEID_20__CORE_2_TC_3,
+    MUX_151_SOURCEID_21__CORE_2_TC_4,
+    MUX_151_SOURCEID_22__CORE_2_TC_5,
+    MUX_151_SOURCEID_23__CORE_2_TC_6,
+    MUX_151_SOURCEID_24__CORE_2_TC_7,
+    MUX_151_SOURCEID_25__CORE_3_TC_0,
+    MUX_151_SOURCEID_26__CORE_3_TC_1,
+    MUX_151_SOURCEID_27__CORE_3_TC_2,
+    MUX_151_SOURCEID_28__CORE_3_TC_3,
+    MUX_151_SOURCEID_29__CORE_3_TC_4,
+    MUX_151_SOURCEID_30__CORE_3_TC_5,
+    MUX_151_SOURCEID_31__CORE_3_TC_6,
+    MUX_151_SOURCEID_32__CORE_3_TC_7,
+    MUX_151_SOURCEID_33__CORE_0_TC_0,
+    MUX_151_SOURCEID_34__CORE_0_TC_1,
+    MUX_151_SOURCEID_35__CORE_0_TC_2,
+    MUX_151_SOURCEID_36__CORE_0_TC_3,
+    MUX_151_SOURCEID_37__CORE_0_TC_4,
+    MUX_151_SOURCEID_38__CORE_0_TC_5,
+    MUX_151_SOURCEID_39__CORE_0_TC_6,
+    MUX_151_SOURCEID_40__CORE_0_TC_7,
+    MUX_151_SOURCEID_41__CORE_1_TC_0,
+    MUX_151_SOURCEID_42__CORE_1_TC_1,
+    MUX_151_SOURCEID_43__CORE_1_TC_2,
+    MUX_151_SOURCEID_44__CORE_1_TC_3,
+    MUX_151_SOURCEID_45__CORE_1_TC_4,
+    MUX_151_SOURCEID_46__CORE_1_TC_5,
+    MUX_151_SOURCEID_47__CORE_1_TC_6,
+    MUX_151_SOURCEID_48__CORE_1_TC_7,
+    MUX_151_SOURCEID_49__CORE_2_TC_0,
+    MUX_151_SOURCEID_50__CORE_2_TC_1,
+    MUX_151_SOURCEID_51__CORE_2_TC_2,
+    MUX_151_SOURCEID_52__CORE_2_TC_3,
+    MUX_151_SOURCEID_53__CORE_2_TC_4,
+    MUX_151_SOURCEID_54__CORE_2_TC_5,
+    MUX_151_SOURCEID_55__CORE_2_TC_6,
+    MUX_151_SOURCEID_56__CORE_2_TC_7,
+    MUX_151_SOURCEID_57__CORE_3_TC_0,
+    MUX_151_SOURCEID_58__CORE_3_TC_1,
+    MUX_151_SOURCEID_59__CORE_3_TC_2,
+    MUX_151_SOURCEID_60__CORE_3_TC_3,
+    MUX_151_SOURCEID_61__CORE_3_TC_4,
+    MUX_151_SOURCEID_62__CORE_3_TC_5,
+    MUX_151_SOURCEID_63__CORE_3_TC_6
+} dhl_source_id_mapping_table;
+#else //defined(__MD97__)
+typedef enum
+{
+    MUX_150_SOURCEID_1__CORE_0_TC_0,
+    MUX_150_SOURCEID_2__CORE_0_TC_1,
+    MUX_150_SOURCEID_3__CORE_0_TC_2,
+    MUX_150_SOURCEID_4__CORE_0_TC_3,
+    MUX_150_SOURCEID_5__CORE_1_TC_0,
+    MUX_150_SOURCEID_6__CORE_1_TC_1,
+    MUX_150_SOURCEID_7__CORE_1_TC_2,
+    MUX_150_SOURCEID_8__CORE_1_TC_3,
+    MUX_150_SOURCEID_9__CORE_2_TC_0,
+    MUX_150_SOURCEID_10__CORE_2_TC_1,
+    MUX_150_SOURCEID_11__CORE_2_TC_2,
+    MUX_150_SOURCEID_12__CORE_2_TC_3,
+    MUX_150_SOURCEID_17__CORE_0_TC_0,
+    MUX_150_SOURCEID_18__CORE_0_TC_1,
+    MUX_150_SOURCEID_19__CORE_0_TC_2,
+    MUX_150_SOURCEID_20__CORE_0_TC_3,
+    MUX_150_SOURCEID_21__CORE_1_TC_0,
+    MUX_150_SOURCEID_22__CORE_1_TC_1,
+    MUX_150_SOURCEID_23__CORE_1_TC_2,
+    MUX_150_SOURCEID_24__CORE_1_TC_3,
+    MUX_150_SOURCEID_25__CORE_2_TC_0,
+    MUX_150_SOURCEID_26__CORE_2_TC_1,
+    MUX_150_SOURCEID_27__CORE_2_TC_2,
+    MUX_150_SOURCEID_28__CORE_2_TC_3
+} dhl_source_id_mapping_table;
+#endif //defined(__MD97__)
+#if defined(__MD97__) && defined(__USE_ULSP__)
+//Format: MUX_(MUX_ID)_(L1/L2)_(START/END)_SOURCE_ID_(SOURCE_ID)
+typedef enum
+{
+    MUX_150_L1_START_SOURCE_ID_1,
+    MUX_150_L1_END_SOURCE_ID_32,
+    MUX_150_L2_START_SOURCE_ID_33,
+    MUX_150_L2_END_SOURCE_ID_63,
+    MUX_151_L1_START_SOURCE_ID_1,
+    MUX_151_L1_END_SOURCE_ID_32,
+    MUX_151_L2_START_SOURCE_ID_33,
+    MUX_151_L2_END_SOURCE_ID_63
+} dhl_ulsp_mcu_l1l2_source_id_range;
+#endif
+typedef struct
+{
+    kal_uint32 bytes_sent;
+    kal_uint32 last_update;
+} dhl_trace_stats;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint8 select[DHL_MUX_FILTER_LEN];
+    kal_uint8 value[DHL_MUX_FILTER_LEN];
+} dhl_cmd_set_dhl_mux_filter_struct;
+
+typedef enum
+{
+    DHL_PORT_NULL,
+    DHL_PORT_UART,
+    DHL_PORT_USB,
+    DHL_PORT_SP,
+    DHL_PORT_OTHER
+} DHL_PORT_SETTING;
+
+/*
+typedef struct
+{
+    kal_uint8 mod_id;
+    kal_uint32 filter_bmp_low;
+}mdl_log_filter_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint8 DFE_mod_num;  //In 91, it's DFE
+    kal_uint8 DFE_HW_cswitch_enbl;
+    mdl_log_filter_struct DFE_cfg[64];
+    kal_uint8 RAKE_mod_num;  //In 91, it's RAKE
+    kal_uint8 RAKE_HW_cswitch_enbl;
+    mdl_log_filter_struct RAKE_cfg[64];
+    kal_uint8 BRP_mod_num;   //In 91, it's BRP
+    kal_uint8 BRP_HW_cswitch_enbl;
+    mdl_log_filter_struct BRP_cfg[64];
+    kal_uint8 IMC_mod_num;   //In 91, it's IMC
+    kal_uint8 IMC_HW_cswitch_enbl;
+    mdl_log_filter_struct IMC_cfg[64];
+    kal_uint8 ICC_mod_num;  //In 91, it's ICC
+    kal_uint8 ICC_HW_cswitch_enbl;
+    mdl_log_filter_struct ICC_cfg[64];
+    kal_uint8 MPC_mod_num;  //IN 91, it's MPC
+    kal_uint8 MPC_HW_cswitch_enbl;
+    mdl_log_filter_struct MPC_cfg[64];
+    kal_uint8 DFE1_mod_num;  //In DFE1
+    kal_uint8 DFE1_HW_cswitch_enbl;
+    mdl_log_filter_struct DFE1_cfg[64];
+}dhl_cmd_set_mdl_filter_struct;
+*/
+
+typedef struct
+{
+    kal_uint8 mod_id;
+    kal_uint32 filter_bmp_low;
+} dsp_log_filter_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint8 INNER_mod_num;
+    kal_uint8 INNER_HW_cswitch_enbl;
+    dsp_log_filter_struct INNER_cfg[64];
+    kal_uint8 BRP_mod_num;
+    kal_uint8 BRP_HW_cswitch_enbl;
+    dsp_log_filter_struct BRP_cfg[64];
+    kal_uint8 FEC_mod_num;
+    kal_uint8 FEC_HW_cswitch_enbl;
+    dsp_log_filter_struct FEC_cfg[64];
+    kal_uint8 SPEECH_mod_num;
+    kal_uint8 SPEECH_HW_cswitch_enbl;
+    dsp_log_filter_struct SPEECH_cfg[64];
+    kal_uint8 SCQ0_mod_num;
+    kal_uint8 SCQ0_HW_cswitch_enbl;
+    dsp_log_filter_struct SCQ0_cfg[64];
+    kal_uint8 SCQ1_mod_num;
+    kal_uint8 SCQ1_HW_cswitch_enbl;
+    dsp_log_filter_struct SCQ1_cfg[64];
+    kal_uint8 RAKE_mod_num;
+    kal_uint8 RAKE_HW_cswitch_enbl;
+    dsp_log_filter_struct RAKE_cfg[64];
+} dhl_cmd_set_dsp_filter_struct;
+
+typedef enum
+{
+    cgen_msg__MSG_ID_DHL_CMD_SET_DSP_FILTER,
+    cgen_src__MOD_DHL_READER,
+    cgen_dst__MOD_DHL_READER,
+} dhl_dsp_filter_struct_desc;
+
+//Generic memory dump definitions
+#if defined(GEN_FOR_PC)
+#define Define_TST_Mem_Dump_Type_Start() typedef enum {
+#define Define_TST_Mem_Dump_Type_Item(type, string, length) string##__size__##length,
+#define Define_TST_Mem_Dump_Type_End()   tst_mem_type_string_end} tst_mem_type_string_enum;
+#else
+#define Define_TST_Mem_Dump_Type_Start() typedef enum {
+#define Define_TST_Mem_Dump_Type_Item(type, string, length) type,
+#define Define_TST_Mem_Dump_Type_End()   tst_mem_type_end} tst_mem_type_enum;
+#endif
+
+typedef struct
+{
+    //do not change this structure, mini com is hard code to set
+    kal_uint32 cmd_flags;
+} dhl_cmd_3rd_party_tool_struct;
+
+typedef enum
+{
+    INIT_CMDS_RESEND_EXCEPTION_INFO = 0,
+    INIT_CMDS_MEMORY_DUMP_SWITCH,
+    INIT_CMDS_QUERY_SWLA_HEADER,
+    INIT_CMDS_QUERY_TARGET_VERSION,
+    INIT_CMDS_ECHO_SIM_MAPPING,
+    INIT_CMDS_QUERY_LOAD_VERSION,
+    INIT_CMDS_QUERY_CALIBRATION,
+    INIT_CMDS_QUERY_SWLA_INFO,
+    INIT_CMDS_QUERY_SWTR_HEADER,
+    INIT_CMDS_MAX = 31,
+} dhl_init_cmd_set_enum_type;
+
+typedef enum
+{
+    DISCONNECT_CMDS_MEMORY_DUMP_SWITCH = 0,
+    DISCONNECT_CMDS_MAX = 31,
+} dhl_disconnect_cmd_set_enum_type;
+
+typedef struct
+{
+    kal_uint32 init_cmds;
+} dhl_cmd_elt_connect_struct;
+
+typedef struct
+{
+    kal_uint32 disconnect_cmds;
+} dhl_cmd_elt_disconnect_struct;
+
+typedef struct
+{
+    kal_uint32 token;
+    kal_uint32 data_len;
+    kal_uint8  data[1];
+} dhl_cmd_loop_back_struct;
+
+typedef struct
+{
+    kal_uint32 token;
+} dhl_cmd_loop_back_response_struct;
+
+#define DATABASE_SIGNATURE_MAGIC (0x24541605)
+#define DATABASE_SIGNATURE_MAX_LENGTH (64)
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_bool enable;
+    kal_uint8 poll_period_level;
+    kal_uint8 block_size_level;
+} dhl_l2copro_log_dma_config_struct;
+typedef struct
+{
+    kal_uint32 magic;
+    kal_uint32 length;
+    kal_uint8 data[DATABASE_SIGNATURE_MAX_LENGTH];
+} dhl_cmd_check_database_signature_struct;
+
+typedef enum
+{
+    QUERY_FAIL,
+    QUERY_CONTINUE,
+    QUERY_END
+} query_mem_range_result;
+
+typedef enum
+{
+    MEM_SYS,
+    MEM_SYS_SLAVE,
+    MEM_DSP,
+    MEM_SLA_CORE0,
+    MEM_SLA_CORE1,
+#if SYS_MCU_NUM_CORE >= 3
+    MEM_SLA_CORE2,
+#endif
+    MEM_STR_MCU,
+    MEM_STR_INFRA,
+    MEM_SLA_BRP,
+    MEM_SLA_INNER,
+    MEM_SLA_FEC,
+    MEM_SLA_SPEECH,
+    MEM_CSDSP,
+    MEM_MD32,
+    /*MEM_USIP_SCQ16,*/
+    MEM_USIP0,
+    MEM_USIP1,
+    MEM_SCQ16_0,
+    MEM_SCQ16_1,
+    MEM_RAKE,
+    MEM_VRF,
+    MEM_BB,
+#if defined(__AST_TL1_TDD__)
+    MEM_AST,
+#endif
+    MEM_TYPE_END,
+} DHL_MEM_TYPE;
+
+typedef enum
+{
+    MEMORY_DUMP_TYPE_ALL,
+    MEMORY_DUMP_TYPE_SWLA,
+} DHL_DUMP_MEM_CHOICE;
+
+typedef enum
+{
+    DEFAULT_AUTO_TYPE,
+    USB_DUMP_TYPE,
+    SD_DUMP_TYPE,
+    META_DUMP_TYPE,
+} DHL_AUTO_MEMORY_DUMP_TYPE;
+
+Define_TST_Mem_Dump_Type_Start()
+Define_TST_Mem_Dump_Type_Item(default_type, default, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_system_mem_type, sys_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_dsp_mem_type, dsp_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_bb_mem_type, bb_reg, 0xFFFFFFFF)
+// SWLA part, remember to add/remove core number for each generation!
+Define_TST_Mem_Dump_Type_Item(tst_core0_swla_mem_type, core0_swla, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_core1_swla_mem_type, core1_swla, 0xFFFFFFFF)
+#if SYS_MCU_NUM_CORE >= 3
+Define_TST_Mem_Dump_Type_Item(tst_core2_swla_mem_type, core2_swla, 0xFFFFFFFF)
+#endif
+Define_TST_Mem_Dump_Type_Item(tst_mcu_swtr_mem_type,   mcu_swtr, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_infra_swtr_mem_type, infra_swtr, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_brp_swla_mem_type, core0_swla, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_inner_swla_mem_type, core1_swla, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_fec_swla_mem_type, core0_swla, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_speech_swla_mem_type, core1_swla, 0xFFFFFFFF)
+// For uSIP_SCQ16 and RAKE
+#if defined(__MTK_TARGET__) && !defined(__NO_DSP__)
+Define_TST_Mem_Dump_Type_Item(dhl_usip0_mem_type, usip0_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(dhl_usip1_mem_type, usip1_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(dhl_scq16_0_mem_type, scq16_0_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(dhl_scq16_1_mem_type, scq16_1_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(dhl_rake_mem_type, rake_mem, 0xFFFFFFFF)
+#endif
+
+Define_TST_Mem_Dump_Type_Item(tst_vrf_mem_type, vrf_mem, 0xFFFFFFFF)
+
+#if defined(__AST_TL1_TDD__) && !defined(UNIT_TEST)
+Define_TST_Mem_Dump_Type_Item(tst_ast_mem_type, ast_mem, 0x400)
+#endif
+
+Define_TST_Mem_Dump_Type_End()
+
+/**
+ *  @brief:
+ *      E_DHL_SWLA_DUMP_FOR_ELT is used for telling ELT which memory dump type is SWLA.
+ *      the enum naming is 1 on 1 mapping with memory type:
+ *      for example:
+ *          Define_TST_Mem_Dump_Type_Item(tst_swla_mem_type, ""swla"", 0xFFFFFFFF)
+ *          Define_TST_Mem_Dump_Type_Item(dhl_slave_swla_mem_type, ""slave_swla"", 0xFFFFFFFF)
+ */
+#if defined(GEN_FOR_PC)
+typedef enum
+{
+    core0_swla,
+    core1_swla,
+#if SYS_MCU_NUM_CORE >= 3
+    core2_swla,
+#endif
+    mcu_swtr,
+    infra_swtr
+} E_DHL_SWLA_DUMP_FOR_ELT;
+#endif /* GEN_FOR_PC */
+
+#if defined(__DHL_MODULE__)
+typedef struct
+{
+    kal_uint8   token;
+    kal_uint8   reserved;
+    kal_uint16  chunk_size;
+    void        *address;
+    kal_uint32  length;
+    DHL_CUSTOM_MEM_TYPE     custom_mem_type;
+    kal_uint32  custom_option;
+} dhl_cmd_custom_read_memory_struct;
+
+typedef struct
+{
+    kal_uint8   token;
+    void  *address;
+    kal_uint32  length;
+    DHL_CUSTOM_MEM_TYPE     custom_mem_type;
+    kal_uint32  custom_option;
+} dhl_ind_custom_read_memory_report_struct;
+
+typedef struct
+{
+    void        *address;
+    kal_uint32  length;
+    DHL_CUSTOM_MEM_TYPE     custom_mem_type;
+    kal_uint32  custom_option;
+    kal_uint8   data[1];
+} dhl_cmd_custom_write_memory_struct;
+
+typedef enum
+{
+    data_channel,
+    monitor_channel,
+    ccb_meta_channel
+} dhl_channel_type;
+
+#endif
+
+#if defined(__TST_META_MODE_TRACE_ENABLE__)
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint8 enable;
+} dhl_meta_mode_log_enable_struct;
+#endif // __TST_META_MODE_TRACE_ENABLE__
+
+#endif
diff --git a/mcu/interface/service/dhl/v1/dhl_ebs_logging.h b/mcu/interface/service/dhl/v1/dhl_ebs_logging.h
new file mode 100644
index 0000000..5be3432
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/dhl_ebs_logging.h
@@ -0,0 +1,169 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   dhl_ebs_logging.h
+ *
+ * Project:
+ * --------
+ *   UMOLYA
+ *
+ * Description:
+ * ------------
+ *   DHL external buffer serivce (EBS) , only support under CCB logging
+ *   Provide CCB buffer(AP resource) for user (HW / SW both)
+ *   User put their own log on CCB buffer and maintain their owne read write ptr
+ *   DHL packet thier log as primitive log and move out
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 06 15 2018 yancy.chien
+ * [MOLY00332776] [Gen95] MD Low Power Montior Development
+ * Migrate from LR13.R0
+ *
+ * 06 12 2018 yancy.chien
+ * [MOLY00332776] [Gen95] MD Low Power Montior Development.
+ * DHL part phase-in.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ * 	     Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ * 04 14 2017 yancy.chien
+ * [MOLY00241423] [93][SWLA] SWLA using CCB as default buffer, as required by ASM stream mode.
+ *  1. Add dhl_asm_init_buffer API for SS
+ *  2. Allocate ASM buffer in raw share memory
+ *  3. Add dhl_ccb_fill_guard_pattern function to fill guard pattern
+ *
+ * 01 16 2017 yu-hsiang.peng
+ * [MOLY00201169] [MT6293] DHL EBS support
+ * [UMOKYA.TRUNK] EBS bug fix
+ *
+ * 01 13 2017 yu-hsiang.peng
+ * [MOLY00201169] [MT6293] DHL EBS support
+ * [UMOKYA.TRUNK] EBS bug fix
+ *
+ * 01 04 2017 yu-hsiang.peng
+ * [MOLY00201169] [MT6293] DHL EBS support
+ * [UMOLYA.TRUNK] Porting EBS back - stage 1 (non-UT version)
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_EBS_LOGGING_H_
+#define _DHL_EBS_LOGGING_H_
+
+#include "kal_general_types.h"
+#include "dhl_def.h"
+
+
+//define
+#define DHL_EBS_MAX_BUFFER_SIZE 512*1024
+
+// enum
+typedef enum
+{
+    DHL_EBS_START       = 0,
+    DHL_EBS_LHIF_LOG    = DHL_EBS_START,
+    DHL_EBS_ASM_LOG,
+    DHL_EBS_LOWPOWER_MON_LOG,    
+    DHL_EBS_MAX_SUPPRT  = 7
+} dhl_EBS_channel_type;
+
+typedef enum
+{
+    DHL_EBS_NOERROR              = 0,
+    //API errror code
+    DHL_EBS_NO_SUPPORT           = 1,
+    DHL_EBS_CALL_TOO_EARLY       = 2,
+    DHL_EBS_NO_INI_SERVERICE     = 3,
+    DHL_EBS_NO_REG_CB            = 5,
+    DHL_EBS_REG_CB_TWICE         = 6,
+
+    DHL_EBS_FILTER_NOT_OPEN      = 7,
+    DHL_EBS_CCB_BUFFER_NOT_READY = 8,
+    DHL_EBS_TOOL_NOT_CONNECT     = 9,
+    DHL_EBS_SEND_LEN_OVER_LIMIT  = 10,
+    //TX errror code
+    DHL_EBS_PARTIAL_TX           = 20,
+
+} DHL_EBS_ERROR_CODE;
+
+
+// structure
+typedef struct
+{
+    DHL_EBS_ERROR_CODE        error_code;
+    kal_uint32                          send_length;
+    // only work in DHL_EBS_PARTIAL_TX
+    // how many data put into TX channel
+    // it most  0 <=  and <= buf_len
+} dhl_EBS_send_result;
+
+typedef struct
+{
+    kal_uint8 dhl_sync_pattern_buf[SYNC_PATTERN_SIZE];
+    kal_uint8 dhl_header[4];
+    dhl_primitive_header_struct msg_header;
+} S_DHL_EBS_ILM_HEADER;
+
+
+// templete
+typedef void (*EBS_tx_done_cb)(dhl_EBS_channel_type type, kal_uint8 *sent_end);
+
+
+// data
+#if defined(__DHL_EBS_LOGGING_MD_TEST__)
+kal_uint32   dhl_ebs_buffer[DHL_EBS_MAX_SUPPRT][DHL_EBS_MAX_BUFFER_SIZE];
+#endif //#if defined(__DHL_EBS_LOGGING_MD_TEST__)
+
+// function
+DHL_EBS_ERROR_CODE DHL_EBS_init(dhl_EBS_channel_type type, kal_uint32 **buf_addr, kal_uint32 *buff_size);
+DHL_EBS_ERROR_CODE DHL_EBS_register_tx_done_callback(dhl_EBS_channel_type type, EBS_tx_done_cb cb);
+dhl_EBS_send_result DHL_EBS_send_log_as_ilm(dhl_EBS_channel_type type, module_type src_mod, module_type dest_mod, msg_type msg_id, sap_type sap_id, kal_uint8 *local_para, kal_int32 local_para_len, kal_uint8 *buf_ptr, kal_int32 buf_len);
+
+#endif //_DHL_EBS_LOGGING_H_
+
+
diff --git a/mcu/interface/service/dhl/v1/dhl_l1_legacy_sw_interface.h b/mcu/interface/service/dhl/v1/dhl_l1_legacy_sw_interface.h
new file mode 100644
index 0000000..2951c83
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/dhl_l1_legacy_sw_interface.h
@@ -0,0 +1,2013 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   dhl_l1_legacy_sw_interface.h
+ *
+ * Project:
+ * --------
+ *   UMOLYE
+ *
+ * Description:
+ * ------------
+ *   This file will be include bu l1trc.h
+ *   The interface for legacy l1 sw logging
+ *   Cannot include this file directly
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_L1_LEGACY_SW_INTERFACE_H
+#define _DHL_L1_LEGACY_SW_INTERFACE_H
+
+#define __DHL_EMI_ROCODE
+#define __DHL_EMI_DATA
+
+#define __L1Vpe0Func __DHL_EMI_ROCODE
+#define __L1Vpe1Func __DHL_EMI_ROCODE
+#define __L1Vpe2Func __DHL_EMI_ROCODE
+#define __L1Vpe3Func __DHL_EMI_ROCODE
+#define __L1Vpe4Func __DHL_EMI_ROCODE
+#define __L1Vpe5Func __DHL_EMI_ROCODE
+
+#define __L2Core0Func __DHL_EMI_ROCODE
+#define __L2Core1Func __DHL_EMI_ROCODE
+#define __L2Core2Func __DHL_EMI_ROCODE
+
+#ifdef TRC_C
+#define __L1_TRC_Vpe0_EXT __DHL_EMI_DATA
+#define __L1_TRC_Vpe1_EXT __DHL_EMI_DATA
+#define __L1_TRC_Vpe2_EXT __DHL_EMI_DATA
+#define __L1_TRC_Vpe3_EXT __DHL_EMI_DATA
+#define __L1_TRC_Vpe4_EXT __DHL_EMI_DATA
+#define __L1_TRC_Vpe5_EXT __DHL_EMI_DATA
+
+#define __L2_TRC_EXT
+#define __L2_ERT_TRC_EXT
+
+#define TRC_EMI_EXT
+#define TRC_SMP_L2DATA_EXT __DHL_L2SRAM_DATA
+#else
+#define __L1_TRC_Vpe0_EXT extern
+#define __L1_TRC_Vpe1_EXT extern
+#define __L1_TRC_Vpe2_EXT extern
+#define __L1_TRC_Vpe3_EXT extern
+#define __L1_TRC_Vpe4_EXT extern
+#define __L1_TRC_Vpe5_EXT extern
+#define __L2_TRC_EXT extern
+#define __L2_ERT_TRC_EXT extern
+#define TRC_EMI_EXT extern
+#define TRC_SMP_L2DATA_EXT extern
+#endif
+
+#define CONVERT_WORD_ALIGNMENT(val) (((val) + 4) / 4 * 4)
+
+/* L1 trace ping/pong buffer size for each core */
+#if defined(UNIT_TEST) || defined(__UE_SIMULATOR__)
+// C2K team need to enlarge buffer size to avoid discard
+#define TRC_vpe0_BUFFER_SIZE CONVERT_WORD_ALIGNMENT((128 * 1024) / 2)
+#define TRC_vpe1_BUFFER_SIZE CONVERT_WORD_ALIGNMENT((128 * 1024) / 2)
+#define TRC_vpe2_BUFFER_SIZE CONVERT_WORD_ALIGNMENT((128 * 1024) / 2)
+#define TRC_vpe3_BUFFER_SIZE CONVERT_WORD_ALIGNMENT((128 * 1024) / 2)
+#define TRC_vpe4_BUFFER_SIZE CONVERT_WORD_ALIGNMENT((128 * 1024) / 2)
+#define TRC_vpe5_BUFFER_SIZE CONVERT_WORD_ALIGNMENT((128 * 1024) / 2)
+
+#else // defined(UNIT_TEST) || defined(__UE_SIMULATOR__) 
+// For target, should remove
+#define TRC_vpe0_BUFFER_SIZE CONVERT_WORD_ALIGNMENT((19 * 1024) / 2)
+#define TRC_vpe1_BUFFER_SIZE CONVERT_WORD_ALIGNMENT((19 * 1024) / 2)
+#define TRC_vpe2_BUFFER_SIZE CONVERT_WORD_ALIGNMENT((19 * 1024) / 2)
+#define TRC_vpe3_BUFFER_SIZE CONVERT_WORD_ALIGNMENT((19 * 1024) / 2)
+#define TRC_vpe4_BUFFER_SIZE CONVERT_WORD_ALIGNMENT((512) / 2)
+#define TRC_vpe5_BUFFER_SIZE CONVERT_WORD_ALIGNMENT((512) / 2)
+
+#endif  // defined(UNIT_TEST) || defined(__UE_SIMULATOR__) 
+
+/* L2 trace ping/pong buffer size for each greup */
+#define L2TRC_el2_BUFFER_SIZE CONVERT_WORD_ALIGNMENT((31 * 1024) / 2)
+#define L2TRC_hif_BUFFER_SIZE CONVERT_WORD_ALIGNMENT((31 * 1024) / 2)
+#define TRC_ert_BUFFER_SIZE CONVERT_WORD_ALIGNMENT((13 * 1024 + 614) / 2)
+
+
+
+
+
+/* L1 ping/pong buffer pool*/
+// core 0 VPE0 (VPE0)
+__L1_TRC_Vpe0_EXT kal_uint8   trc_vpe0_buffers[2][TRC_vpe0_BUFFER_SIZE];
+__L1_TRC_Vpe0_EXT kal_uint8   *trc_vpe0_buf;
+__L1_TRC_Vpe0_EXT kal_uint8   *trc_vpe0_buf_in_process;
+TRC_SMP_L2DATA_EXT  kal_uint32  trc_vpe0_buf_len_in_process;
+__L1_TRC_Vpe0_EXT kal_uint32  trc_vpe0_bufptr;
+__L1_TRC_Vpe0_EXT kal_uint8   *trc_vpe0_buf_write_ptr;
+
+__L1_TRC_Vpe0_EXT kal_uint8   trc_vpe0_lostTraces;
+TRC_EMI_EXT       kal_uint8   prev_trc_vpe0_lostTraces;
+TRC_EMI_EXT       kal_uint8   trc_vpe0_lostBuffers;
+__L1_TRC_Vpe0_EXT kal_uint16  trc_vpe0_count[2];
+__L1_TRC_Vpe0_EXT kal_uint16  *trc_vpe0_cur_count;
+__L1_TRC_Vpe0_EXT kal_uint16  trc_vpe0_count_in_process;
+__L1_TRC_Vpe0_EXT kal_bool    trc_vpe0_flush_flag;
+
+// core 0 VPE1 (VPE1)
+__L1_TRC_Vpe1_EXT kal_uint8   trc_vpe1_buffers[2][TRC_vpe1_BUFFER_SIZE];
+__L1_TRC_Vpe1_EXT kal_uint8   *trc_vpe1_buf;
+__L1_TRC_Vpe1_EXT kal_uint8   *trc_vpe1_buf_in_process;
+TRC_SMP_L2DATA_EXT  kal_uint32  trc_vpe1_buf_len_in_process;
+__L1_TRC_Vpe1_EXT kal_uint32  trc_vpe1_bufptr;
+__L1_TRC_Vpe1_EXT kal_uint8   *trc_vpe1_buf_write_ptr;
+
+__L1_TRC_Vpe1_EXT kal_uint8   trc_vpe1_lostTraces;
+TRC_EMI_EXT       kal_uint8   prev_trc_vpe1_lostTraces;
+TRC_EMI_EXT       kal_uint8   trc_vpe1_lostBuffers;
+__L1_TRC_Vpe1_EXT kal_uint16  trc_vpe1_count[2];
+__L1_TRC_Vpe1_EXT kal_uint16  *trc_vpe1_cur_count;
+__L1_TRC_Vpe1_EXT kal_uint16  trc_vpe1_count_in_process;
+__L1_TRC_Vpe1_EXT kal_bool    trc_vpe1_flush_flag;
+
+// core 1 VPE0 (VPE2)
+__L1_TRC_Vpe2_EXT kal_uint8   trc_vpe2_buffers[2][TRC_vpe2_BUFFER_SIZE];
+__L1_TRC_Vpe2_EXT kal_uint8   *trc_vpe2_buf;
+__L1_TRC_Vpe2_EXT kal_uint8   *trc_vpe2_buf_in_process;
+TRC_SMP_L2DATA_EXT  kal_uint32  trc_vpe2_buf_len_in_process;
+__L1_TRC_Vpe2_EXT kal_uint32  trc_vpe2_bufptr;
+__L1_TRC_Vpe2_EXT kal_uint8   *trc_vpe2_buf_write_ptr;
+
+__L1_TRC_Vpe2_EXT kal_uint8   trc_vpe2_lostTraces;
+TRC_EMI_EXT       kal_uint8   prev_trc_vpe2_lostTraces;
+TRC_EMI_EXT       kal_uint8   trc_vpe2_lostBuffers;
+__L1_TRC_Vpe2_EXT kal_uint16  trc_vpe2_count[2];
+__L1_TRC_Vpe2_EXT kal_uint16  *trc_vpe2_cur_count;
+__L1_TRC_Vpe2_EXT kal_uint16  trc_vpe2_count_in_process;
+__L1_TRC_Vpe2_EXT kal_bool    trc_vpe2_flush_flag;
+
+// core 1 VPE1 (VPE3)
+__L1_TRC_Vpe3_EXT kal_uint8   trc_vpe3_buffers[2][TRC_vpe3_BUFFER_SIZE];
+__L1_TRC_Vpe3_EXT kal_uint8   *trc_vpe3_buf;
+__L1_TRC_Vpe3_EXT kal_uint8   *trc_vpe3_buf_in_process;
+TRC_SMP_L2DATA_EXT  kal_uint32  trc_vpe3_buf_len_in_process;
+__L1_TRC_Vpe3_EXT kal_uint32  trc_vpe3_bufptr;
+__L1_TRC_Vpe3_EXT kal_uint8   *trc_vpe3_buf_write_ptr;
+
+__L1_TRC_Vpe3_EXT kal_uint8   trc_vpe3_lostTraces;
+TRC_EMI_EXT       kal_uint8   prev_trc_vpe3_lostTraces;
+TRC_EMI_EXT       kal_uint8   trc_vpe3_lostBuffers;
+__L1_TRC_Vpe3_EXT kal_uint16  trc_vpe3_count[2];
+__L1_TRC_Vpe3_EXT kal_uint16  *trc_vpe3_cur_count;
+__L1_TRC_Vpe3_EXT kal_uint16  trc_vpe3_count_in_process;
+__L1_TRC_Vpe3_EXT kal_bool    trc_vpe3_flush_flag;
+
+// core 2 VPE0 (VPE4)
+__L1_TRC_Vpe4_EXT kal_uint8   trc_vpe4_buffers[2][TRC_vpe4_BUFFER_SIZE];
+__L1_TRC_Vpe4_EXT kal_uint8   *trc_vpe4_buf;
+__L1_TRC_Vpe4_EXT kal_uint8   *trc_vpe4_buf_in_process;
+TRC_SMP_L2DATA_EXT  kal_uint32  trc_vpe4_buf_len_in_process;
+__L1_TRC_Vpe4_EXT kal_uint32  trc_vpe4_bufptr;
+__L1_TRC_Vpe4_EXT kal_uint8   *trc_vpe4_buf_write_ptr;
+
+__L1_TRC_Vpe4_EXT kal_uint8   trc_vpe4_lostTraces;
+TRC_EMI_EXT       kal_uint8   prev_trc_vpe4_lostTraces;
+TRC_EMI_EXT       kal_uint8   trc_vpe4_lostBuffers;
+__L1_TRC_Vpe4_EXT kal_uint16  trc_vpe4_count[2];
+__L1_TRC_Vpe4_EXT kal_uint16  *trc_vpe4_cur_count;
+__L1_TRC_Vpe4_EXT kal_uint16  trc_vpe4_count_in_process;
+__L1_TRC_Vpe4_EXT kal_bool    trc_vpe4_flush_flag;
+
+// core 2 VPE1 (VPE5)
+__L1_TRC_Vpe5_EXT kal_uint8   trc_vpe5_buffers[2][TRC_vpe5_BUFFER_SIZE];
+__L1_TRC_Vpe5_EXT kal_uint8   *trc_vpe5_buf;
+__L1_TRC_Vpe5_EXT kal_uint8   *trc_vpe5_buf_in_process;
+TRC_SMP_L2DATA_EXT  kal_uint32  trc_vpe5_buf_len_in_process;
+__L1_TRC_Vpe5_EXT kal_uint32  trc_vpe5_bufptr;
+__L1_TRC_Vpe5_EXT kal_uint8   *trc_vpe5_buf_write_ptr;
+
+__L1_TRC_Vpe5_EXT kal_uint8   trc_vpe5_lostTraces;
+TRC_EMI_EXT       kal_uint8   prev_trc_vpe5_lostTraces;
+TRC_EMI_EXT       kal_uint8   trc_vpe5_lostBuffers;
+__L1_TRC_Vpe5_EXT kal_uint16  trc_vpe5_count[2];
+__L1_TRC_Vpe5_EXT kal_uint16  *trc_vpe5_cur_count;
+__L1_TRC_Vpe5_EXT kal_uint16  trc_vpe5_count_in_process;
+__L1_TRC_Vpe5_EXT kal_bool    trc_vpe5_flush_flag;
+
+/* L2 buffer pool*/
+#define L2TRC_MAX_BUF_CNT (2)
+
+// ERT L2 trace group
+__L2_ERT_TRC_EXT kal_uint8   trc_ert_buffers[L2TRC_MAX_BUF_CNT][TRC_ert_BUFFER_SIZE];
+__L2_ERT_TRC_EXT kal_uint8   *trc_ert_buf;
+__L2_ERT_TRC_EXT kal_uint8   *trc_ert_buf_in_process;
+__L2_ERT_TRC_EXT kal_uint32  trc_ert_buf_len_in_process;
+__L2_ERT_TRC_EXT kal_uint32  trc_ert_bufptr;
+__L2_ERT_TRC_EXT kal_uint8   *trc_ert_buf_write_ptr;
+
+__L2_ERT_TRC_EXT kal_uint8   trc_ert_lostTraces;
+TRC_EMI_EXT      kal_uint8   prev_trc_ert_lostTraces;
+TRC_EMI_EXT      kal_uint8   trc_ert_lostBuffers;
+__L2_ERT_TRC_EXT kal_uint16   trc_ert_count[2];
+__L2_ERT_TRC_EXT kal_uint16   *trc_ert_cur_count;
+__L2_ERT_TRC_EXT kal_uint16   trc_ert_count_in_process;
+__L1_TRC_Vpe5_EXT kal_bool    trc_ert_flush_flag;
+
+
+
+
+// EL2 L2 trace group
+__L2_TRC_EXT kal_uint8   trc_el2_buffers[L2TRC_MAX_BUF_CNT][L2TRC_el2_BUFFER_SIZE];
+__L2_TRC_EXT kal_uint8   *trc_el2_buf;
+__L2_TRC_EXT kal_uint8   *trc_el2_buf_in_process;
+__L2_TRC_EXT kal_uint32  trc_el2_buf_len_in_process;
+__L2_TRC_EXT kal_uint32  trc_el2_bufptr;
+__L2_TRC_EXT kal_uint8   *trc_el2_buf_write_ptr;
+
+__L2_TRC_EXT kal_uint8   trc_el2_lostTraces;
+TRC_EMI_EXT  kal_uint8   prev_trc_el2_lostTraces;
+TRC_EMI_EXT  kal_uint8   trc_el2_lostBuffers;
+__L2_TRC_EXT kal_uint16   trc_el2_count[2];
+__L2_TRC_EXT kal_uint16   *trc_el2_cur_count;
+__L2_TRC_EXT kal_uint16   trc_el2_count_in_process;
+
+// HIF L2 trace group
+__L2_TRC_EXT kal_uint8   trc_hif_buffers[L2TRC_MAX_BUF_CNT][L2TRC_hif_BUFFER_SIZE];
+__L2_TRC_EXT kal_uint8   *trc_hif_buf;
+__L2_TRC_EXT kal_uint8   *trc_hif_buf_in_process;
+__L2_TRC_EXT kal_uint32  trc_hif_buf_len_in_process;
+__L2_TRC_EXT kal_uint32  trc_hif_bufptr;
+__L2_TRC_EXT kal_uint8   *trc_hif_buf_write_ptr;
+
+__L2_TRC_EXT kal_uint8   trc_hif_lostTraces;
+TRC_EMI_EXT  kal_uint8   prev_trc_hif_lostTraces;
+TRC_EMI_EXT  kal_uint8   trc_hif_lostBuffers;
+__L2_TRC_EXT kal_uint16   trc_hif_count[2];
+__L2_TRC_EXT kal_uint16   *trc_hif_cur_count;
+__L2_TRC_EXT kal_uint16   trc_hif_count_in_process;
+/*
+void dhlcore0_l1l2_flush(void);
+void dhlcore1_l1l2_flush(void);
+
+void Trc_Init_c0(void);
+void Trc_Init_c1(void);
+*/
+
+extern kal_bool trc_l2_is_inited[L2_BUFFER_END]; // = {KAL_FALSE};
+
+//In L1_SIM, hack l2trc_send_x_word_cb to L1 trace macro to support L2 logging in xL1SIM
+#if !defined(L1_SIM)
+
+typedef void (*l2trc_send_1_word_cb_t)(kal_uint32 v1);
+extern l2trc_send_1_word_cb_t l2trc_send_1_word_cb[L2_BUFFER_END];
+#define l2trc_send_1_word(L2_BUFFER_SETTING, v1, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint32 _v1 = v1; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS) && trc_l2_is_inited[L2_BUFFER_SETTING]) { \
+            l2trc_send_1_word_cb[L2_BUFFER_SETTING](_v1); \
+        } \
+    } while(0)
+
+typedef void (*l2trc_send_2_word_cb_t)(kal_uint32 v1, kal_uint32 v2);
+extern l2trc_send_2_word_cb_t l2trc_send_2_word_cb[L2_BUFFER_END];
+#define l2trc_send_2_word(L2_BUFFER_SETTING, v1, v2, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint32 _v1, _v2; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS) && trc_l2_is_inited[L2_BUFFER_SETTING]) { \
+            _v1 = v1; \
+            _v2 = v2; \
+            l2trc_send_2_word_cb[L2_BUFFER_SETTING](_v1, _v2); \
+        } \
+    } while(0)
+
+typedef void (*l2trc_send_3_word_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+extern l2trc_send_3_word_cb_t l2trc_send_3_word_cb[L2_BUFFER_END];
+#define l2trc_send_3_word(L2_BUFFER_SETTING, v1, v2, v3, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint32 _v1, _v2, _v3; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS) && trc_l2_is_inited[L2_BUFFER_SETTING]) { \
+            _v1 = v1; \
+            _v2 = v2; \
+            _v3 = v3; \
+            l2trc_send_3_word_cb[L2_BUFFER_SETTING](_v1, _v2, _v3); \
+        } \
+    } while(0)
+
+typedef void (*l2trc_send_4_word_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+extern l2trc_send_4_word_cb_t l2trc_send_4_word_cb[L2_BUFFER_END];
+#define l2trc_send_4_word(L2_BUFFER_SETTING, v1, v2, v3, v4, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint32 _v1, _v2, _v3, _v4; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS) && trc_l2_is_inited[L2_BUFFER_SETTING]) { \
+            _v1 = v1; \
+            _v2 = v2; \
+            _v3 = v3; \
+            _v4 = v4; \
+            l2trc_send_4_word_cb[L2_BUFFER_SETTING](_v1, _v2, _v3, _v4); \
+        } \
+    } while(0)
+
+typedef void (*l2trc_send_5_word_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+extern l2trc_send_5_word_cb_t l2trc_send_5_word_cb[L2_BUFFER_END];
+#define l2trc_send_5_word(L2_BUFFER_SETTING, v1, v2, v3, v4, v5, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS) && trc_l2_is_inited[L2_BUFFER_SETTING]) { \
+            _v1 = v1; \
+            _v2 = v2; \
+            _v3 = v3; \
+            _v4 = v4; \
+            _v5 = v5; \
+            l2trc_send_5_word_cb[L2_BUFFER_SETTING](_v1, _v2, _v3, _v4, _v5); \
+        } \
+    } while(0)
+
+typedef void (*l2trc_send_6_word_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+extern l2trc_send_6_word_cb_t l2trc_send_6_word_cb[L2_BUFFER_END];
+#define l2trc_send_6_word(L2_BUFFER_SETTING, v1, v2, v3, v4, v5, v6, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS) && trc_l2_is_inited[L2_BUFFER_SETTING]) { \
+            _v1 = v1; \
+            _v2 = v2; \
+            _v3 = v3; \
+            _v4 = v4; \
+            _v5 = v5; \
+            _v6 = v6; \
+            l2trc_send_6_word_cb[L2_BUFFER_SETTING](_v1, _v2, _v3, _v4, _v5, _v6); \
+        } \
+    } while(0)
+
+typedef void (*l2trc_send_7_word_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7);
+extern l2trc_send_7_word_cb_t l2trc_send_7_word_cb[L2_BUFFER_END];
+#define l2trc_send_7_word(L2_BUFFER_SETTING, v1, v2, v3, v4, v5, v6, v7, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS) && trc_l2_is_inited[L2_BUFFER_SETTING]) { \
+            _v1 = v1; \
+            _v2 = v2; \
+            _v3 = v3; \
+            _v4 = v4; \
+            _v5 = v5; \
+            _v6 = v6; \
+            _v7 = v7; \
+            l2trc_send_7_word_cb[L2_BUFFER_SETTING](_v1, _v2, _v3, _v4, _v5, _v6, _v7); \
+        } \
+    } while(0)
+
+typedef void (*l2trc_send_8_word_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8);
+extern l2trc_send_8_word_cb_t l2trc_send_8_word_cb[L2_BUFFER_END];
+#define l2trc_send_8_word(L2_BUFFER_SETTING, v1, v2, v3, v4, v5, v6, v7, v8, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS) && trc_l2_is_inited[L2_BUFFER_SETTING]) { \
+            _v1 = v1; \
+            _v2 = v2; \
+            _v3 = v3; \
+            _v4 = v4; \
+            _v5 = v5; \
+            _v6 = v6; \
+            _v7 = v7; \
+            _v8 = v8; \
+            l2trc_send_8_word_cb[L2_BUFFER_SETTING](_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8); \
+        } \
+    } while(0)
+
+typedef void (*l2trc_send_9_word_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+extern l2trc_send_9_word_cb_t l2trc_send_9_word_cb[L2_BUFFER_END];
+#define l2trc_send_9_word(L2_BUFFER_SETTING, v1, v2, v3, v4, v5, v6, v7, v8, v9, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS) && trc_l2_is_inited[L2_BUFFER_SETTING]) { \
+            _v1 = v1; \
+            _v2 = v2; \
+            _v3 = v3; \
+            _v4 = v4; \
+            _v5 = v5; \
+            _v6 = v6; \
+            _v7 = v7; \
+            _v8 = v8; \
+            _v9 = v9; \
+            l2trc_send_9_word_cb[L2_BUFFER_SETTING](_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9); \
+        } \
+    } while(0)
+
+typedef void (*l2trc_send_10_word_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+extern l2trc_send_10_word_cb_t l2trc_send_10_word_cb[L2_BUFFER_END];
+#define l2trc_send_10_word(L2_BUFFER_SETTING, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS) && trc_l2_is_inited[L2_BUFFER_SETTING]) { \
+            _v1 = v1; \
+            _v2 = v2; \
+            _v3 = v3; \
+            _v4 = v4; \
+            _v5 = v5; \
+            _v6 = v6; \
+            _v7 = v7; \
+            _v8 = v8; \
+            _v9 = v9; \
+            _v10 = v10; \
+            l2trc_send_10_word_cb[L2_BUFFER_SETTING](_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10); \
+        } \
+    } while(0)
+
+typedef void (*l2trc_send_11_word_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+extern l2trc_send_11_word_cb_t l2trc_send_11_word_cb[L2_BUFFER_END];
+#define l2trc_send_11_word(L2_BUFFER_SETTING, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS) && trc_l2_is_inited[L2_BUFFER_SETTING]) { \
+            _v1 = v1; \
+            _v2 = v2; \
+            _v3 = v3; \
+            _v4 = v4; \
+            _v5 = v5; \
+            _v6 = v6; \
+            _v7 = v7; \
+            _v8 = v8; \
+            _v9 = v9; \
+            _v10 = v10; \
+            _v11 = v11; \
+            l2trc_send_11_word_cb[L2_BUFFER_SETTING](_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11); \
+        } \
+    } while(0)
+
+typedef void (*l2trc_send_12_word_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+extern l2trc_send_12_word_cb_t l2trc_send_12_word_cb[L2_BUFFER_END];
+#define l2trc_send_12_word(L2_BUFFER_SETTING, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS) && trc_l2_is_inited[L2_BUFFER_SETTING]) { \
+            _v1 = v1; \
+            _v2 = v2; \
+            _v3 = v3; \
+            _v4 = v4; \
+            _v5 = v5; \
+            _v6 = v6; \
+            _v7 = v7; \
+            _v8 = v8; \
+            _v9 = v9; \
+            _v10 = v10; \
+            _v11 = v11; \
+            _v12 = v12; \
+            l2trc_send_12_word_cb[L2_BUFFER_SETTING](_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12); \
+        } \
+    } while(0)
+
+typedef void (*l2trc_send_13_word_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13);
+extern l2trc_send_13_word_cb_t l2trc_send_13_word_cb[L2_BUFFER_END];
+#define l2trc_send_13_word(L2_BUFFER_SETTING, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS) && trc_l2_is_inited[L2_BUFFER_SETTING]) { \
+            _v1 = v1; \
+            _v2 = v2; \
+            _v3 = v3; \
+            _v4 = v4; \
+            _v5 = v5; \
+            _v6 = v6; \
+            _v7 = v7; \
+            _v8 = v8; \
+            _v9 = v9; \
+            _v10 = v10; \
+            _v11 = v11; \
+            _v12 = v12; \
+            _v13 = v13; \
+            l2trc_send_13_word_cb[L2_BUFFER_SETTING](_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13); \
+        } \
+    } while(0)
+
+typedef void (*l2trc_send_14_word_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14);
+extern l2trc_send_14_word_cb_t l2trc_send_14_word_cb[L2_BUFFER_END];
+#define l2trc_send_14_word(L2_BUFFER_SETTING, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS) && trc_l2_is_inited[L2_BUFFER_SETTING]) { \
+            _v1 = v1; \
+            _v2 = v2; \
+            _v3 = v3; \
+            _v4 = v4; \
+            _v5 = v5; \
+            _v6 = v6; \
+            _v7 = v7; \
+            _v8 = v8; \
+            _v9 = v9; \
+            _v10 = v10; \
+            _v11 = v11; \
+            _v12 = v12; \
+            _v13 = v13; \
+            _v14 = v14; \
+            l2trc_send_14_word_cb[L2_BUFFER_SETTING](_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14); \
+        } \
+    } while(0)
+
+typedef void (*l2trc_send_15_word_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+extern l2trc_send_15_word_cb_t l2trc_send_15_word_cb[L2_BUFFER_END];
+#define l2trc_send_15_word(L2_BUFFER_SETTING, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS) && trc_l2_is_inited[L2_BUFFER_SETTING]) { \
+            _v1 = v1; \
+            _v2 = v2; \
+            _v3 = v3; \
+            _v4 = v4; \
+            _v5 = v5; \
+            _v6 = v6; \
+            _v7 = v7; \
+            _v8 = v8; \
+            _v9 = v9; \
+            _v10 = v10; \
+            _v11 = v11; \
+            _v12 = v12; \
+            _v13 = v13; \
+            _v14 = v14; \
+            _v15 = v15; \
+            l2trc_send_15_word_cb[L2_BUFFER_SETTING](_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15); \
+        } \
+    } while(0)
+
+typedef void (*l2trc_send_16_word_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+extern l2trc_send_16_word_cb_t l2trc_send_16_word_cb[L2_BUFFER_END];
+#define l2trc_send_16_word(L2_BUFFER_SETTING, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS) && trc_l2_is_inited[L2_BUFFER_SETTING]) { \
+            _v1 = v1; \
+            _v2 = v2; \
+            _v3 = v3; \
+            _v4 = v4; \
+            _v5 = v5; \
+            _v6 = v6; \
+            _v7 = v7; \
+            _v8 = v8; \
+            _v9 = v9; \
+            _v10 = v10; \
+            _v11 = v11; \
+            _v12 = v12; \
+            _v13 = v13; \
+            _v14 = v14; \
+            _v15 = v15; \
+            _v16 = v16; \
+            l2trc_send_16_word_cb[L2_BUFFER_SETTING](_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16); \
+        } \
+    } while(0)
+
+#endif /*#if !defined(L1_SIM) */
+
+
+/*********************************************************
+ *       CORE 0 VPE0 (VPE0) L1 TRACE SEND functions      *
+ *********************************************************/
+void TRC_SEND_1_DATA_vpe0(kal_uint32 v1);
+void TRC_SEND_2_DATA_vpe0(kal_uint32 v1, kal_uint32 v2);
+void TRC_SEND_3_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+void TRC_SEND_4_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+void TRC_SEND_5_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+void TRC_SEND_6_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+void TRC_SEND_7_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7);
+void TRC_SEND_8_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7, kal_uint32 v8);
+void TRC_SEND_9_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+void TRC_SEND_10_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+void TRC_SEND_11_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+void TRC_SEND_12_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+void TRC_SEND_13_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13);
+void TRC_SEND_14_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14);
+void TRC_SEND_15_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+void TRC_SEND_16_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+void TRC_SEND_17_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17);
+void TRC_SEND_18_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18);
+void TRC_SEND_19_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19);
+void TRC_SEND_20_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20);
+void TRC_SEND_21_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21);
+void TRC_SEND_22_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22);
+void TRC_SEND_23_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23);
+void TRC_SEND_24_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24);
+void TRC_SEND_25_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25);
+void TRC_SEND_26_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26);
+void TRC_SEND_27_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27);
+void TRC_SEND_28_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28);
+void TRC_SEND_29_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29);
+void TRC_SEND_30_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30);
+void TRC_SEND_31_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30,
+                           kal_uint32 v31);
+void TRC_SEND_32_DATA_vpe0(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30,
+                           kal_uint32 v31, kal_uint32 v32);
+
+/*********************************************************
+ *       CORE 0 VPE1 (VPE1) L1 TRACE SEND functions      *
+ *********************************************************/
+void TRC_SEND_1_DATA_vpe1(kal_uint32 v1);
+void TRC_SEND_2_DATA_vpe1(kal_uint32 v1, kal_uint32 v2);
+void TRC_SEND_3_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+void TRC_SEND_4_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+void TRC_SEND_5_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+void TRC_SEND_6_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+void TRC_SEND_7_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7);
+void TRC_SEND_8_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7, kal_uint32 v8);
+void TRC_SEND_9_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+void TRC_SEND_10_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+void TRC_SEND_11_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+void TRC_SEND_12_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+void TRC_SEND_13_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13);
+void TRC_SEND_14_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14);
+void TRC_SEND_15_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+void TRC_SEND_16_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+void TRC_SEND_17_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17);
+void TRC_SEND_18_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18);
+void TRC_SEND_19_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19);
+void TRC_SEND_20_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20);
+void TRC_SEND_21_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21);
+void TRC_SEND_22_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22);
+void TRC_SEND_23_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23);
+void TRC_SEND_24_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24);
+void TRC_SEND_25_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25);
+void TRC_SEND_26_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26);
+void TRC_SEND_27_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27);
+void TRC_SEND_28_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28);
+void TRC_SEND_29_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29);
+void TRC_SEND_30_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30);
+void TRC_SEND_31_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30,
+                           kal_uint32 v31);
+void TRC_SEND_32_DATA_vpe1(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30,
+                           kal_uint32 v31, kal_uint32 v32);
+
+/*********************************************************
+ *       CORE 1 VPE0 (VPE2) L1 TRACE SEND functions      *
+ *********************************************************/
+void TRC_SEND_1_DATA_vpe2(kal_uint32 v1);
+void TRC_SEND_2_DATA_vpe2(kal_uint32 v1, kal_uint32 v2);
+void TRC_SEND_3_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+void TRC_SEND_4_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+void TRC_SEND_5_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+void TRC_SEND_6_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+void TRC_SEND_7_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7);
+void TRC_SEND_8_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7, kal_uint32 v8);
+void TRC_SEND_9_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+void TRC_SEND_10_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+void TRC_SEND_11_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+void TRC_SEND_12_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+void TRC_SEND_13_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13);
+void TRC_SEND_14_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14);
+void TRC_SEND_15_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+void TRC_SEND_16_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+void TRC_SEND_17_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17);
+void TRC_SEND_18_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18);
+void TRC_SEND_19_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19);
+void TRC_SEND_20_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20);
+void TRC_SEND_21_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21);
+void TRC_SEND_22_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22);
+void TRC_SEND_23_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23);
+void TRC_SEND_24_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24);
+void TRC_SEND_25_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25);
+void TRC_SEND_26_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26);
+void TRC_SEND_27_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27);
+void TRC_SEND_28_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28);
+void TRC_SEND_29_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29);
+void TRC_SEND_30_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30);
+void TRC_SEND_31_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30,
+                           kal_uint32 v31);
+void TRC_SEND_32_DATA_vpe2(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30,
+                           kal_uint32 v31, kal_uint32 v32);
+
+/*********************************************************
+ *       CORE 1 VPE1 (VPE3) L1 TRACE SEND functions      *
+ *********************************************************/
+void TRC_SEND_1_DATA_vpe3(kal_uint32 v1);
+void TRC_SEND_2_DATA_vpe3(kal_uint32 v1, kal_uint32 v2);
+void TRC_SEND_3_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+void TRC_SEND_4_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+void TRC_SEND_5_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+void TRC_SEND_6_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+void TRC_SEND_7_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7);
+void TRC_SEND_8_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7, kal_uint32 v8);
+void TRC_SEND_9_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+void TRC_SEND_10_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+void TRC_SEND_11_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+void TRC_SEND_12_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+void TRC_SEND_13_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13);
+void TRC_SEND_14_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14);
+void TRC_SEND_15_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+void TRC_SEND_16_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+void TRC_SEND_17_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17);
+void TRC_SEND_18_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18);
+void TRC_SEND_19_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19);
+void TRC_SEND_20_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20);
+void TRC_SEND_21_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21);
+void TRC_SEND_22_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22);
+void TRC_SEND_23_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23);
+void TRC_SEND_24_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24);
+void TRC_SEND_25_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25);
+void TRC_SEND_26_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26);
+void TRC_SEND_27_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27);
+void TRC_SEND_28_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28);
+void TRC_SEND_29_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29);
+void TRC_SEND_30_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30);
+void TRC_SEND_31_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30,
+                           kal_uint32 v31);
+void TRC_SEND_32_DATA_vpe3(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30,
+                           kal_uint32 v31, kal_uint32 v32);
+
+/*********************************************************
+ *       CORE 2 VPE0 (VPE4) L1 TRACE SEND functions      *
+ *********************************************************/
+void TRC_SEND_1_DATA_vpe4(kal_uint32 v1);
+void TRC_SEND_2_DATA_vpe4(kal_uint32 v1, kal_uint32 v2);
+void TRC_SEND_3_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+void TRC_SEND_4_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+void TRC_SEND_5_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+void TRC_SEND_6_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+void TRC_SEND_7_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7);
+void TRC_SEND_8_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7, kal_uint32 v8);
+void TRC_SEND_9_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+void TRC_SEND_10_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+void TRC_SEND_11_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+void TRC_SEND_12_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+void TRC_SEND_13_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13);
+void TRC_SEND_14_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14);
+void TRC_SEND_15_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+void TRC_SEND_16_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+void TRC_SEND_17_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17);
+void TRC_SEND_18_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18);
+void TRC_SEND_19_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19);
+void TRC_SEND_20_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20);
+void TRC_SEND_21_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21);
+void TRC_SEND_22_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22);
+void TRC_SEND_23_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23);
+void TRC_SEND_24_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24);
+void TRC_SEND_25_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25);
+void TRC_SEND_26_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26);
+void TRC_SEND_27_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27);
+void TRC_SEND_28_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28);
+void TRC_SEND_29_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29);
+void TRC_SEND_30_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30);
+void TRC_SEND_31_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30,
+                           kal_uint32 v31);
+void TRC_SEND_32_DATA_vpe4(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30,
+                           kal_uint32 v31, kal_uint32 v32);
+
+/*********************************************************
+ *       CORE 2 VPE1 (VPE5) L1 TRACE SEND functions      *
+ *********************************************************/
+void TRC_SEND_1_DATA_vpe5(kal_uint32 v1);
+void TRC_SEND_2_DATA_vpe5(kal_uint32 v1, kal_uint32 v2);
+void TRC_SEND_3_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+void TRC_SEND_4_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+void TRC_SEND_5_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+void TRC_SEND_6_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+void TRC_SEND_7_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7);
+void TRC_SEND_8_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7, kal_uint32 v8);
+void TRC_SEND_9_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                          kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+void TRC_SEND_10_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+void TRC_SEND_11_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+void TRC_SEND_12_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+void TRC_SEND_13_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13);
+void TRC_SEND_14_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14);
+void TRC_SEND_15_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+void TRC_SEND_16_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+void TRC_SEND_17_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17);
+void TRC_SEND_18_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18);
+void TRC_SEND_19_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19);
+void TRC_SEND_20_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20);
+void TRC_SEND_21_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21);
+void TRC_SEND_22_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22);
+void TRC_SEND_23_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23);
+void TRC_SEND_24_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24);
+void TRC_SEND_25_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25);
+void TRC_SEND_26_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26);
+void TRC_SEND_27_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27);
+void TRC_SEND_28_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28);
+void TRC_SEND_29_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29);
+void TRC_SEND_30_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30);
+void TRC_SEND_31_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30,
+                           kal_uint32 v31);
+void TRC_SEND_32_DATA_vpe5(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6,
+                           kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12,
+                           kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18,
+                           kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24,
+                           kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30,
+                           kal_uint32 v31, kal_uint32 v32);
+/**************************************************
+ *  CORE 0/1/2 L1 TRACE SEND functions callbacks  *
+ **************************************************/
+typedef void (*TRC_SEND_1_DATA_cb_t)(kal_uint32 v1);
+extern TRC_SEND_1_DATA_cb_t TRC_SEND_1_DATA_cb[6];
+typedef void (*TRC_SEND_2_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2);
+extern TRC_SEND_2_DATA_cb_t TRC_SEND_2_DATA_cb[6];
+typedef void (*TRC_SEND_3_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+extern TRC_SEND_3_DATA_cb_t TRC_SEND_3_DATA_cb[6];
+typedef void (*TRC_SEND_4_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+extern TRC_SEND_4_DATA_cb_t TRC_SEND_4_DATA_cb[6];
+typedef void (*TRC_SEND_5_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+extern TRC_SEND_5_DATA_cb_t TRC_SEND_5_DATA_cb[6];
+typedef void (*TRC_SEND_6_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+extern TRC_SEND_6_DATA_cb_t TRC_SEND_6_DATA_cb[6];
+typedef void (*TRC_SEND_7_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7);
+extern TRC_SEND_7_DATA_cb_t TRC_SEND_7_DATA_cb[6];
+typedef void (*TRC_SEND_8_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8);
+extern TRC_SEND_8_DATA_cb_t TRC_SEND_8_DATA_cb[6];
+typedef void (*TRC_SEND_9_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+extern TRC_SEND_9_DATA_cb_t TRC_SEND_9_DATA_cb[6];
+typedef void (*TRC_SEND_10_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+extern TRC_SEND_10_DATA_cb_t TRC_SEND_10_DATA_cb[6];
+typedef void (*TRC_SEND_11_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+extern TRC_SEND_11_DATA_cb_t TRC_SEND_11_DATA_cb[6];
+typedef void (*TRC_SEND_12_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+extern TRC_SEND_12_DATA_cb_t TRC_SEND_12_DATA_cb[6];
+typedef void (*TRC_SEND_13_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13);
+extern TRC_SEND_13_DATA_cb_t TRC_SEND_13_DATA_cb[6];
+typedef void (*TRC_SEND_14_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14);
+extern TRC_SEND_14_DATA_cb_t TRC_SEND_14_DATA_cb[6];
+typedef void (*TRC_SEND_15_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+extern TRC_SEND_15_DATA_cb_t TRC_SEND_15_DATA_cb[6];
+typedef void (*TRC_SEND_16_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+extern TRC_SEND_16_DATA_cb_t TRC_SEND_16_DATA_cb[6];
+typedef void (*TRC_SEND_17_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17);
+extern TRC_SEND_17_DATA_cb_t TRC_SEND_17_DATA_cb[6];
+typedef void (*TRC_SEND_18_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18);
+extern TRC_SEND_18_DATA_cb_t TRC_SEND_18_DATA_cb[6];
+typedef void (*TRC_SEND_19_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19);
+extern TRC_SEND_19_DATA_cb_t TRC_SEND_19_DATA_cb[6];
+typedef void (*TRC_SEND_20_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20);
+extern TRC_SEND_20_DATA_cb_t TRC_SEND_20_DATA_cb[6];
+typedef void (*TRC_SEND_21_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21);
+extern TRC_SEND_21_DATA_cb_t TRC_SEND_21_DATA_cb[6];
+typedef void (*TRC_SEND_22_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22);
+extern TRC_SEND_22_DATA_cb_t TRC_SEND_22_DATA_cb[6];
+typedef void (*TRC_SEND_23_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23);
+extern TRC_SEND_23_DATA_cb_t TRC_SEND_23_DATA_cb[6];
+typedef void (*TRC_SEND_24_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24);
+extern TRC_SEND_24_DATA_cb_t TRC_SEND_24_DATA_cb[6];
+typedef void (*TRC_SEND_25_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25);
+extern TRC_SEND_25_DATA_cb_t TRC_SEND_25_DATA_cb[6];
+typedef void (*TRC_SEND_26_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26);
+extern TRC_SEND_26_DATA_cb_t TRC_SEND_26_DATA_cb[6];
+typedef void (*TRC_SEND_27_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27);
+extern TRC_SEND_27_DATA_cb_t TRC_SEND_27_DATA_cb[6];
+typedef void (*TRC_SEND_28_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28);
+extern TRC_SEND_28_DATA_cb_t TRC_SEND_28_DATA_cb[6];
+typedef void (*TRC_SEND_29_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29);
+extern TRC_SEND_29_DATA_cb_t TRC_SEND_29_DATA_cb[6];
+typedef void (*TRC_SEND_30_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30);
+extern TRC_SEND_30_DATA_cb_t TRC_SEND_30_DATA_cb[6];
+typedef void (*TRC_SEND_31_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31);
+extern TRC_SEND_31_DATA_cb_t TRC_SEND_31_DATA_cb[6];
+typedef void (*TRC_SEND_32_DATA_cb_t)(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31, kal_uint32 v32);
+extern TRC_SEND_32_DATA_cb_t TRC_SEND_32_DATA_cb[6];
+
+/***************************************************************************
+ *  CORE 0/1/2 L1 TRACE SEND functions marco with filter without checking  *
+ ***************************************************************************/
+
+#if defined(__DHL_L1_VPE0_AFFINITY__)
+/* VPE0 affinity optimization */
+#define DO_TRC_SEND_n_DATA(n) \
+    TRC_SEND_##n##_DATA_vpe0
+#elif defined(__DHL_L1_VPE1_AFFINITY__)
+/* VPE1 affinity optimization */
+#define DO_TRC_SEND_n_DATA(n) \
+    TRC_SEND_##n##_DATA_vpe1
+#elif defined(__DHL_L1_VPE2_AFFINITY__)
+/* VPE2 affinity optimization */
+#define DO_TRC_SEND_n_DATA(n) \
+    TRC_SEND_##n##_DATA_vpe2
+#elif defined(__DHL_L1_VPE3_AFFINITY__)
+/* VPE3 affinity optimization */
+#define DO_TRC_SEND_n_DATA(n) \
+    TRC_SEND_##n##_DATA_vpe3
+#elif defined(__DHL_L1_VPE4_AFFINITY__)
+/* VPE4 affinity optimization */
+#define DO_TRC_SEND_n_DATA(n) \
+    TRC_SEND_##n##_DATA_vpe4
+#elif defined(__DHL_L1_VPE5_AFFINITY__)
+/* VPE5 affinity optimization */
+#define DO_TRC_SEND_n_DATA(n) \
+    TRC_SEND_##n##_DATA_vpe5
+#else
+/* SMP */
+#define DO_TRC_SEND_n_DATA(n) \
+    vpe_id = kal_get_current_vpe_id(); \
+    TRC_SEND_##n##_DATA_cb[vpe_id]
+
+#endif  /* affinity optimization */
+
+#define TRC_SEND_1_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(1)(v1); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+
+#define TRC_SEND_2_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(2)(v1, v2); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_3_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(3)(v1, v2, v3); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_4_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(4)(v1, v2, v3, v4); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_5_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(5)(v1, v2, v3, v4, v5); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_6_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(6)(v1, v2, v3, v4, v5, v6); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_7_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(7)(v1, v2, v3, v4, v5, v6, v7); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_8_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(8)(v1, v2, v3, v4, v5, v6, v7, v8); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_9_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(9)(v1, v2, v3, v4, v5, v6, v7, v8, v9); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_10_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(10)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_11_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(11)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_12_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(12)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_13_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(13)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_14_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(14)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_15_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(15)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_16_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(16)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_17_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(17)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_18_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(18)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_19_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(19)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_20_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(20)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_21_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(21)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_22_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(22)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_23_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(23)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_24_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(24)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_25_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(25)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_26_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(26)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_27_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(27)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_28_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(28)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_29_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(29)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_30_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(30)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_31_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(31)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+#define TRC_SEND_32_DATA_NOFLTR(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) \
+    do { \
+        kal_uint32 oldmask=0; \
+        kal_uint8 vpe_id = 0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        DO_TRC_SEND_n_DATA(32)(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32); \
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    } while(0)
+
+/*******************************************************************
+ *  CORE 0/1/2 L1 TRACE SEND functions marco with filter checking  *
+ *******************************************************************/
+#define TRC_SEND_1_DATA(CRITICAL_SETCION_PROTECT, v1, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(1)(_v1); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_2_DATA(CRITICAL_SETCION_PROTECT, v1, v2, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(2)(_v1, _v2); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_3_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(3)(_v1, _v2, _v3); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_4_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(4)(_v1, _v2, _v3, _v4); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_5_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(5)(_v1, _v2, _v3, _v4, _v5); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_6_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(6)(_v1, _v2, _v3, _v4, _v5, _v6); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_7_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(7)(_v1, _v2, _v3, _v4, _v5, _v6, _v7); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_8_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(8)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_9_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(9)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_10_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(10)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_11_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(11)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_12_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(12)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_13_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(13)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_14_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(14)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_15_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(15)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_16_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; _v16 = v16; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(16)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_17_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; _v16 = v16; _v17 = v17; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(17)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_18_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; _v16 = v16; _v17 = v17; _v18 = v18; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(18)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_19_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; _v16 = v16; _v17 = v17; _v18 = v18; _v19 = v19; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(19)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_20_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; _v16 = v16; _v17 = v17; _v18 = v18; _v19 = v19; _v20 = v20; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(20)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_21_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; _v16 = v16; _v17 = v17; _v18 = v18; _v19 = v19; _v20 = v20; _v21 = v21; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(21)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_22_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; _v16 = v16; _v17 = v17; _v18 = v18; _v19 = v19; _v20 = v20; _v21 = v21; _v22 = v22; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(22)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_23_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; _v16 = v16; _v17 = v17; _v18 = v18; _v19 = v19; _v20 = v20; _v21 = v21; _v22 = v22; _v23 = v23; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(23)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_24_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; _v16 = v16; _v17 = v17; _v18 = v18; _v19 = v19; _v20 = v20; _v21 = v21; _v22 = v22; _v23 = v23; _v24 = v24; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(24)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_25_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24, _v25; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; _v16 = v16; _v17 = v17; _v18 = v18; _v19 = v19; _v20 = v20; _v21 = v21; _v22 = v22; _v23 = v23; _v24 = v24; _v25 = v25; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(25)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24, _v25); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_26_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24, _v25, _v26; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; _v16 = v16; _v17 = v17; _v18 = v18; _v19 = v19; _v20 = v20; _v21 = v21; _v22 = v22; _v23 = v23; _v24 = v24; _v25 = v25; _v26 = v26; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(26)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24, _v25, _v26); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_27_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24, _v25, _v26, _v27; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; _v16 = v16; _v17 = v17; _v18 = v18; _v19 = v19; _v20 = v20; _v21 = v21; _v22 = v22; _v23 = v23; _v24 = v24; _v25 = v25; _v26 = v26; _v27 = v27; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(27)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24, _v25, _v26, _v27); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_28_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24, _v25, _v26, _v27, _v28; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; _v16 = v16; _v17 = v17; _v18 = v18; _v19 = v19; _v20 = v20; _v21 = v21; _v22 = v22; _v23 = v23; _v24 = v24; _v25 = v25; _v26 = v26; _v27 = v27; _v28 = v28; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(28)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24, _v25, _v26, _v27, _v28); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_29_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24, _v25, _v26, _v27, _v28, _v29; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; _v16 = v16; _v17 = v17; _v18 = v18; _v19 = v19; _v20 = v20; _v21 = v21; _v22 = v22; _v23 = v23; _v24 = v24; _v25 = v25; _v26 = v26; _v27 = v27; _v28 = v28; _v29 = v29; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(29)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24, _v25, _v26, _v27, _v28, _v29); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_30_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24, _v25, _v26, _v27, _v28, _v29, _v30; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; _v16 = v16; _v17 = v17; _v18 = v18; _v19 = v19; _v20 = v20; _v21 = v21; _v22 = v22; _v23 = v23; _v24 = v24; _v25 = v25; _v26 = v26; _v27 = v27; _v28 = v28; _v29 = v29; _v30 = v30; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(30)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24, _v25, _v26, _v27, _v28, _v29, _v30); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_31_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24, _v25, _v26, _v27, _v28, _v29, _v30, _v31; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; _v16 = v16; _v17 = v17; _v18 = v18; _v19 = v19; _v20 = v20; _v21 = v21; _v22 = v22; _v23 = v23; _v24 = v24; _v25 = v25; _v26 = v26; _v27 = v27; _v28 = v28; _v29 = v29; _v30 = v30; _v31 = v31; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(31)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24, _v25, _v26, _v27, _v28, _v29, _v30, _v31); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_SEND_32_DATA(CRITICAL_SETCION_PROTECT, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    do { \
+        kal_uint8  vpe_id;  \
+        kal_uint32 oldmask; \
+        kal_uint32 _v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24, _v25, _v26, _v27, _v28, _v29, _v30, _v31, _v32; \
+        if(FILTER_CHECK(FILTER_ARRAY,FILTER_ARRAY_INDEX,FILTER_CLASS)) { \
+            _v1 = v1; _v2 = v2; _v3 = v3; _v4 = v4; _v5 = v5; _v6 = v6; _v7 = v7; _v8 = v8; _v9 = v9; _v10 = v10; _v11 = v11; _v12 = v12; _v13 = v13; _v14 = v14; _v15 = v15; _v16 = v16; _v17 = v17; _v18 = v18; _v19 = v19; _v20 = v20; _v21 = v21; _v22 = v22; _v23 = v23; _v24 = v24; _v25 = v25; _v26 = v26; _v27 = v27; _v28 = v28; _v29 = v29; _v30 = v30; _v31 = v31; _v32 = v32; \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            DO_TRC_SEND_n_DATA(32)(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10, _v11, _v12, _v13, _v14, _v15, _v16, _v17, _v18, _v19, _v20, _v21, _v22, _v23, _v24, _v25, _v26, _v27, _v28, _v29, _v30, _v31, _v32); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+
+
+#endif // _DHL_L1_LEGACY_SW_INTERFACE_H
+
+
diff --git a/mcu/interface/service/dhl/v1/dhl_l1_trace_utmd.json b/mcu/interface/service/dhl/v1/dhl_l1_trace_utmd.json
new file mode 100644
index 0000000..6273ea7
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/dhl_l1_trace_utmd.json
@@ -0,0 +1,412 @@
+{
+  "legacyParameters": {
+    "modemType": "dhl"
+  }, 
+  "module": "DHL_L1",
+  "startGen": "Legacy", 
+  "endGen": "Legacy",    
+  "stringTranslationDefs": [], 
+  "traceClassDefs": [
+    {
+      "L1_L2_TIME": {
+        "_comment": "filterDefaulValue is used in xl1sim, will be phased out later", 
+        "debugLevel": "Ultra-High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "L1L2_TIME","Force_Reserved"
+        ], 
+        "traceType": "Public"
+      }
+    },
+	{
+      "L1_L2_EX": {
+        "_comment": "filterDefaulValue is used in xl1sim, will be phased out later", 
+        "debugLevel": "Ultra-High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Exception"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    },	
+    {
+      "L1_L2_Debug": {
+        "_comment": "filterDefaulValue is used in xl1sim, will be phased out later", 
+        "debugLevel": "Ultra-High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Force_Debug"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }
+  ], 
+  "traceDefs": [
+    {
+      "UMTS_3G_GEMINI_TIME": {
+        "format": "sim_idx=%b frame=%d ebit=%l bsfn=%d timestamp=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "UMTS_3G_TIME": {
+        "format": "frame=%d ebit=%l bsfn=%d timestamp=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "UMTS_2G_GEMINI_TIME": {
+        "format": "sim_idx=%b frame=%f ebit=%d timestamp=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "UMTS_2G_TIME": {
+        "format": "frame=%f ebit=%d timestamp=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "UMTS_2G_HANDOVER_TIME": {
+        "format": "frame=%f time=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "UMTS_3G_HANDOVER_TIME": {
+        "format": "frame=%f time=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME": {
+        "format": "phy_timer=%l sample=%d timestamp=%l sfn=%d", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME_2": {
+        "format": "phy_timer=%l sample=%d timestamp=%l sfn=%d _4g_time=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_L2_TIME": {
+        "dhlReserved": "force_l2", 
+        "format": "padding=%d timestamp=%l celltime=%l abstick=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_TRC_REDUMP": {
+        "dhlReserved": "ex_force_l1", 
+        "format": " !!!!!Redump L1 Trace at System Crash!!!!! ", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME_GFRC": {
+        "format": "phy_timer=%l sample=%d timestamp=%l sfn=%d", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME_MET_RTOS": {
+        "format": "rtos_time=%ul timestamp=%ul timestamp_H=%ul", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_HIGH_RESOLUTION_TIME": {
+        "format": "hs_time_msb=%d hs_time_lsb=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_LOW_RESOLUTION_TIME": {
+        "format": "ls_time=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_PERIODIC_TIME": {
+        "format": "periodic_time=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_INCREMENTAL_TIME": {
+        "format": "incremental_time=%b", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME_MET_WCLK": {
+        "format": "rtos_time=%ul timestamp=%ul timestamp_H=%ul WCLK=%ul", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "C2K_1X_TIME": {
+        "format": "[C2K][1x] Fn(Upper6)=%xb, Fn(Lower32)=%xl, Slot=%b, Echip=%xl, FRC=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "C2K_DO_TIME": {
+        "format": "[C2K][Do] Fn(Upper6)=%xb, Fn(Lower32)=%xl, Slot=%b, Echip=%xl, FRC=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME_GFRC_2": {
+        "format": "phy_time=%l, timestamp=%l, cell_time=%d, abs_time=%l:%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_TRC_REDUMP": {
+        "dhlReserved": "ex_force_l2", 
+        "format": " !!!!!Redump L2 Trace at System Crash!!!!! ", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_DHL_DEBUG_TRC1": {
+        "format": "DHL Debug Trace 1 variables v1=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_DHL_DEBUG_TRC2": {
+        "format": "DHL Debug Trace 2 variables v1=%l v2=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_DHL_DEBUG_TRC3": {
+        "format": "DHL Debug Trace 3 variables v1=%l v2=%l v3=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_DHL_DEBUG_TRC4": {
+        "format": "DHL Debug Trace 4 variables v1=%l v2=%l v3=%l v4=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_DHL_DEBUG_TRC5": {
+        "format": "DHL Debug Trace 5 variables v1=%l v2=%l v3=%l v4=%l v5=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_DHL_DEBUG_TRC6": {
+        "format": "DHL Debug Trace 6 variables v1=%l v2=%l v3=%l v4=%l v5=%l v6=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_DHL_DEBUG_TRC7": {
+        "format": "DHL Debug Trace 7 variables v1=%l v2=%l v3=%l v4=%l v5=%l v6=%l v7=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_DHL_DEBUG_TRC8": {
+        "format": "DHL Debug Trace 8 variables v1=%l v2=%l v3=%l v4=%l v5=%l v6=%l v7=%l v8=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_DHL_DEBUG_TRC1": {
+        "dhlReserved": "force_l2", 
+        "format": "DHL Debug Trace 1 variables v1=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_DHL_DEBUG_TRC2": {
+        "dhlReserved": "force_l2", 
+        "format": "DHL Debug Trace 2 variables v1=%l v2=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_DHL_DEBUG_TRC3": {
+        "dhlReserved": "force_l2", 
+        "format": "DHL Debug Trace 3 variables v1=%l v2=%l v3=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_DHL_DEBUG_TRC4": {
+        "dhlReserved": "force_l2", 
+        "format": "DHL Debug Trace 4 variables v1=%l v2=%l v3=%l v4=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_DHL_DEBUG_TRC5": {
+        "dhlReserved": "force_l2", 
+        "format": "DHL Debug Trace 5 variables v1=%l v2=%l v3=%l v4=%l v5=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_DHL_DEBUG_TRC6": {
+        "dhlReserved": "force_l2", 
+        "format": "DHL Debug Trace 6 variables v1=%l v2=%l v3=%l v4=%l v5=%l v6=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_DHL_DEBUG_TRC7": {
+        "dhlReserved": "force_l2", 
+        "format": "DHL Debug Trace 7 variables v1=%l v2=%l v3=%l v4=%l v5=%l v6=%l v7=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_DHL_DEBUG_TRC8": {
+        "dhlReserved": "force_l2", 
+        "format": "DHL Debug Trace 8 variables v1=%l v2=%l v3=%l v4=%l v5=%l v6=%l v7=%l v8=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_DEBUGL1_L1_WAKE_INFO": {
+        "format": "[DHL][HD][Time][L1] Debug wake up time = %l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_DEBUGL1_L2_WAKE_INFO": {
+        "dhlReserved": "force_l2", 
+        "format": "[DHL][HD][Time][L2] Debug wake up time = %l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_TRC_STOP_BEFORE_EE": {
+        "dhlReserved": "ex_force_l1", 
+        "format": " !!!!![WARNING] Logging was stopped before MD exception. Trace before MD exception is lost and redump is out-of-date.!!!!! ", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "error"
+      }
+    }, 
+    {
+      "L2_TRC_STOP_BEFORE_EE": {
+        "dhlReserved": "ex_force_l2", 
+        "format": " !!!!![WARNING] Logging was stopped before MD exception. Trace before MD exception is lost and redump is out-of-date.!!!!! ", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "error"
+      }
+    }, 
+    {
+      "DUMP_COND_L1_TRC_START": {
+        "dhlReserved": "ex_force_l1", 
+        "format": " !!!!! Start of Conditional L1 Trace !!!!! ", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DUMP_COND_L1_TRC_END": {
+        "dhlReserved": "ex_force_l1", 
+        "format": " !!!!! End of Conditional L1 Trace !!!!", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_TRC_REDUMP_END": {
+        "dhlReserved": "ex_force_l1", 
+        "format": " !!!!!Redump L1 Trace END!!!!! ", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_TRC_REDUMP_END": {
+        "dhlReserved": "ex_force_l2", 
+        "format": " !!!!!Redump L2 Trace END!!!!! ", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_DEBUG_ULSP_DSP_LOCK": {
+        "format": "[DHL][ULSP] Debug lock dsp power %Mkal_bool at FRC %l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_DEBUG_ULSP_DSP_UNLOCK": {
+        "format": "[DHL][ULSP] Debug unlock dsp power at FRC %l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }
+  ], 
+  "traceFamily": "L1"
+}
\ No newline at end of file
diff --git a/mcu/interface/service/dhl/v1/dhl_trace.h b/mcu/interface/service/dhl/v1/dhl_trace.h
new file mode 100644
index 0000000..0835196
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/dhl_trace.h
@@ -0,0 +1,842 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ *   dhl_trace.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   PS trace define macros and trace API
+ *
+ * Author:
+ * -------
+ * -------
+ * -------
+ * -------
+ *
+ * 05 16 2019 victoria.wang
+ * [MOLY00354132] [Gen 95][ERRC][SYS] Stored SIB C-struct debug trace
+ * [Add][DHL] print c structure logging API
+ *
+ * 04 21 2019 yh.sung
+ * [MOLY00392990] [VMOLY][UTF] Phase 2 Landing
+ * [UTF][DHL] UTF Trace API - trace interface
+ *
+ * 04 18 2018 yancy.chien
+ * [MOLY00321239] [Gen95] tst_log_primitive migration for MSG_ID_FDD_CPHY_MSG_CONTAINER_REQ/ MSG_ID_TDD_CPHY_MSG_CONTAINER_REQ
+ * 	1. Add dhl_log_primitive_custom API.
+ * 	2. Remove special handling for TDD/FDD in tst_log_primitive.
+ *
+ * 04 28 2017 yu-hsiang.peng
+ * [MOLY00243678] [VTF_SMT][MT6293]  Assert message output in META mode without ELT connect
+ * [UMOLYA.TRUNK] Support Meta EE trace before MDLogger connect - phase1
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ * 	     Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ * 01 06 2017 yu-hsiang.peng
+ * [MOLY00222943] [MT6293] DHL Seamless Meta Support
+ * [UMOLYA.TRUNK] Merge Seamless Meta mode from IT CBr  -DHL
+ *
+ * 10 27 2016 yancy.chien
+ * [MOLY00181823] [DHL] UMOLY Migrate to UMOLYA - W16.44 Migration.
+ *
+ * 09 21 2016 yancy.chien
+ * [MOLY00181823] [DHL] UMOLY Migrate to UMOLYA
+ *
+ * 05 26 2016 yancy.chien
+ * [MOLY00181823] [DHL] UMOLY Migrate to UMOLYA
+ * .
+ *
+ * 04 08 2016 eason.lai
+ * [MOLY00172942] SMP modem warning migration
+ *  DHL modem warning message porting
+ *
+ * 12 23 2015 hk.yang
+ * [MOLY00152442] [LR11][DHL] L2 PDU logging
+ * [UMOLY] L2 pdu logging API.
+ *
+ * 11 25 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ * refine the xl1sim option in DHL and restore the patch of CL#1796032.
+ *
+ * 11 23 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ * xl1sim introduce SMP DHL
+ *
+ * 09 11 2015 eason.lai
+ * [MOLY00141576] [DHL] fixed LR11 build error
+ * .
+ *
+ * 08 24 2015 eason.lai
+ * [MOLY00138696] [DHL] replace CC IRQ with intra-event and polling to descresing support effort when l1core hang
+ *  add MTB L1 access level
+ *
+ * 07 22 2015 eason.lai
+ * [MOLY00130157] [TK6291][DHL] smart logging migration
+ *  .
+ *
+ * 07 10 2015 eason.lai
+ * merge code
+ *
+ * 04 09 2015 eason.lai
+ * [MOLY00105513] [TK6291][DHL] introduce GPD/SPD wrapper
+ *       GPD/SPD wrapper and L2copro log dma
+ *
+ * 11 14 2014 eason.lai
+ * [MOLY00084440] [MT6291][DHL] Patch back UMOLY trunk from MT6291_DEV
+ *  first time patch back
+ *
+ * 09 25 2014 ken.liu
+ * [MOLY00079600] Modify the access level of EL1 trace for MBJ
+ * Add internal trace access level for MBJ L1.
+ *
+ * 05 07 2014 eason.lai
+ * [MOLY00064969] [DHL]expand tab to 4 spaces to have better typesettings
+ * .
+ *
+ * 04 23 2014 eason.lai
+ * [MOLY00063500] [DHL] set dhl_log_primitve6 as empty function when disable dhl module
+ *  .
+ *
+ * 04 01 2014 mojo.lai
+ * [MOLY00060735] Custom read write memory feature
+ *
+ * 01 14 2014 ken.liu
+ * [MOLY00049431] [MT6290E1][DHL] Reserve MOD_NIL (0) to support trace decoding without database
+ * enable new sys trace and dhl header format
+ *
+ * 01 14 2014 mojo.lai
+ * [MOLY00053674] Add new log primitive API
+ *  .
+ *
+ * 01 08 2014 ken.liu
+ * [MOLY00052051] [DHL] add support for internal trace access level
+ * update access level define names.
+ *
+ * 01 08 2014 ken.liu
+ * [MOLY00052051] [DHL] add support for internal trace access level
+ * add access level defines.
+ *
+ * 12 31 2013 ken.liu
+ * [MOLY00052051] [DHL] add support for internal trace access level
+ * enable dhl_internal_trace support.
+ *
+ * 12 06 2013 ken.liu
+ * [MOLY00049267] [MT6290E1][DHL] kal_brief_trace_macro support for MIPS reduction
+ * add flag to skip function call when trace is off.
+ *
+ * 10 18 2013 mojo.lai
+ * [MOLY00041595] [MT6290E1][MMDS_DC] MMDC feature patch back to MOLY trunk
+ *  .
+ *
+ * 10 18 2013 mojo.lai
+ * [MOLY00041595] [MT6290E1][MMDS_DC] MMDC feature patch back to MOLY trunk
+ *  .
+ *
+ * 08 20 2013 mojo.lai
+ * [MOLY00034193] Show yellow screen while modem warning happens
+ * .
+ *
+ * 07 30 2013 mojo.lai
+ * [MOLY00031661] Support IP packet logging
+ * .
+ *
+ * 06 11 2013 mojo.lai
+ * [MOLY00025737] DHL multimode support peer trace
+ * .
+ *
+ * 05 27 2013 ken.liu
+ * [MOLY00023653] Driver test environment updated for no_ltelib
+ * provide dummy dhl api for driver test load.
+ *
+ * 05 22 2013 mojo.lai
+ * [MOLY00009210] DHL
+ * L2 copro support
+ *
+ * 05 14 2013 mojo.lai
+ * [MOLY00009210] DHL
+ * Add virtual channel id for BTT
+ *
+ * 04 30 2013 ken.liu
+ * [MOLY00012607] MOLY multimode build tst API migration
+ * sync dhl_peer_trace and dhl_EM_logger() from stanleyHY's CBr.
+ *
+ * 04 09 2013 ken.liu
+ * [MOLY00012607] MOLY multimode build tst API migration
+ * add _kal_trace and _kal_brief_trace function wrapper for users via function pointer.
+ *
+ * 04 02 2013 ken.liu
+ * [MOLY00012607] MOLY multimode build tst API migration
+ * enable macro for kal_trace & kal_brief_trace api wrapper.
+ *
+ * 03 20 2013 ken.liu
+ * [MOLY00011772] [MT7208][NW-UE SIM][TC 6.2.2.8] ASSERT at m11301.c, 2027
+ * Back out changelist 107910
+ *
+ * 12 21 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * add dhl_brief_trace api.
+ *
+ * 12 05 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * add wrapper for kal_brief_trace_macro
+ *
+ * 11 13 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * sync new ps trace definition macro.
+ *
+ * 11 07 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * dhl module check-in.
+ ****************************************************************************/
+
+#ifndef _DHL_TRACE_H
+#define _DHL_TRACE_H
+
+#if !defined(__DHL_MODULE__)
+#include "kal_trace.h"
+
+#define dhl_trace(...)
+#define dhl_internal_trace(...)
+#define dhl_brief_trace(...)
+#define dhl_peer_trace(...)
+#define dhl_raw_trace(...)
+#define dhl_print(...)
+#define dhl_print_string(...)
+#define dhl_print_system_trace(...)
+
+#define dhl_print_struct(...)
+#define dhl_debug_print(...)
+
+#define dhl_trace_impl(...)
+#define dhl_internal_trace_impl(...)
+#define dhl_print_impl(...)
+#define dhl_EM_logger(...)
+#define dhl_log_primitive6(...)
+
+#define dhl_print_meta_string(...)
+
+#define DHL_MAC_LOG_L2_PDU(pointer, length) do {\
+    } while(0)
+#define DHL_RLC_LOG_L2_PDU(pointer, length) do {\
+    } while(0)
+#define DHL_PDCP_LOG_L2_PDU(pointer, length) do {\
+    }while(0)
+
+#define DHL_MAC_CHECK_L2_PDU() do {\
+    }while(0)
+#define DHL_RLC_CHECK_L2_PDU() do {\
+    }while(0)
+#define DHL_PDCP_CHECK_L2_PDU() do {\
+    }while(0)
+
+#else
+
+#ifndef GEN_FOR_PC
+#include <stdio.h>
+#include <stdarg.h>
+#else
+typedef char *va_list;
+#endif
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+#if defined(__RVCT__)
+#pragma diag_suppress 870
+#endif /* __RVCT_ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(__DHL_MODULE__) && defined(__EM_MODE__) /* for ilm_struct type definition */
+#ifndef GEN_FOR_PC
+struct ilm_struct;
+extern void tst_EM_logger(struct ilm_struct *ilm_ptr);
+extern void dhl_EM_logger(struct ilm_struct *ilm_ptr);
+#endif
+#endif  //#if defined(__DHL_MODULE__) && defined(__EM_MODE__)
+
+#define MAX_MSG_NBR_IN_MODULE       20
+
+//Define Trace Macro for PS trace
+#if defined(GEN_FOR_PC) && !defined(GEN_FOR_CPARSER)
+#define BEGIN_TRACE_MAP(MOD)     START_MODULE_MSG MOD MAX_MSG_NBR_IN_MODULE
+#define BEGIN_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL) START_RANGE_MODULE_MSG MOD MAX_MSG_NBR_IN_MODULE MIN_VAL MAX_VAL
+#define TRC_MSG(MSG,STR)         MSG STR
+#define TRC_MSG_NEWLINE(MSG,STR,NUM)         MSG STR NUM
+#define END_TRACE_MAP(MOD)       END_MODULE_MSG
+#define END_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL)   MOD MIN_VAL MAX_VAL END_RANGE_MODULE_MSG
+#else //Define Trace Macro for PS trace
+#define BEGIN_TRACE_MAP(MOD)     enum MOD##_MSG_ENUM{\
+    MOD##_empty_string=MOD<<MAX_MSG_NBR_IN_MODULE,
+#define BEGIN_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL) enum MOD##_##MIN_VAL##_MSG_ENUM{\
+    MOD##_##MIN_VAL##_empty_string = (MOD<<MAX_MSG_NBR_IN_MODULE) + MIN_VAL - 1,
+#define TRC_MSG(MSG,STR)         MSG##__enum,
+#define TRC_MSG_NEWLINE(MSG,STR,NUM)         MSG##__enum, MSG##_NEWLINE_EXPAND__enum = MSG##__enum+NUM,
+#define  END_TRACE_MAP(MOD)      MOD##__end};
+#define  END_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL)  MOD##_##MIN_VAL##__end};
+#endif //Define Trace Macro for PS trace
+
+
+#if defined(__DHL_MODULE__) && !defined(__DHL_BRINUP_DUMMY_BUILD__)
+#define __DHL_TRACE_ENABLED__
+#endif  //#ifdef __DHL_MODULE__
+
+#ifndef __DHL_TRACE_ENABLED__
+#if defined(L1_SIM) && !defined (__UE_SIMULATOR__)
+#define __DHL_TRACE_ENABLED__
+#elif defined(KAL_ON_OSCAR) || defined(MCD_DLL_EXPORT)
+#define __DHL_TRACE_EMPTY_FUNCTION__
+#endif  //#if defined(KAL_ON_OSCAR) || defined(MCD_DLL_EXPORT)
+#endif
+
+
+
+typedef enum
+{
+    TRACE_FUNC,
+    TRACE_STATE,
+    TRACE_INFO,
+    TRACE_WARNING,
+    TRACE_ERROR,
+    TRACE_GROUP_1,
+    TRACE_GROUP_2,
+    TRACE_GROUP_3,
+    TRACE_GROUP_4,
+    TRACE_GROUP_5,
+    TRACE_GROUP_6,
+    TRACE_GROUP_7,
+    TRACE_GROUP_8,
+    TRACE_GROUP_9,
+    TRACE_GROUP_10,
+    TRACE_PEER
+} trace_class_enum;
+
+typedef enum
+{
+    DHL_CUSTOM_ILM_NO_LOG,
+    DHL_CUSTOM_ILM_HEADER_ONLY,
+    DHL_CUSTOM_ILM_WO_PEER_BUFF,
+    DHL_CUSTOM_ILM_CPHY_MSG_CONTAINER
+} e_custom_ilm_trace_option;
+
+
+#if defined (__DHL_TRACE_ENABLED__)
+
+#define DHL_USER_FLAG_NONE          (0x0)
+#define DHL_FLAG_EM                 (0x1)
+
+/* User API for querying trace started to output or not, contact: Shengfu Tsai */
+extern kal_bool dhl_is_trace_started();
+
+/* trace */
+#define DHL_ACCESS_LEVEL_1_ALL_USER             (0x01)
+#define DHL_ACCESS_LEVEL_4_MTK_INTERNAL         (0x04)
+#define DHL_ACCESS_LEVEL_5_MBJ_L1               (0x05)
+#define DHL_ACCESS_LEVEL_5_MTB_L1               (0x05)
+#define DHL_ACCESS_LEVEL_7_HQ_ONLY              (0x07)
+/* trace */
+extern void dhl_print(trace_class_enum trc_class, kal_uint32 user_flag, module_type mod_id, const char *fmt, ...);
+extern void dhl_print_string(trace_class_enum trc_class, kal_uint32 user_flag, module_type mod_id, const char *str);
+extern void meta_print_string(trace_class_enum trc_class, kal_uint32 user_flag, module_type mod_id, const char *str);
+#define dhl_print_system_trace(_c, _s) \
+    dhl_print_string((_c), DHL_USER_FLAG_NONE, 0, (_s));
+
+
+/*
+#ifndef GEN_FOR_PC
+struct ilm_struct;
+extern void dhl_log_primitive(struct ilm_struct *ilm);
+extern void dhl_log_primitive_without_filter_check(struct ilm_struct *ilm);
+extern void dhl_log_primitive_custom(struct ilm_struct *ilm, e_custom_ilm_trace_option option);
+extern void dhl_FT_log_primitive(struct ilm_struct *ilm);
+#else
+*/
+/* primitive */
+/**
+* \brief output internal message communication log if module's filter on. send by KAL service.
+* \param ilm_struct for internal message
+*/
+extern void dhl_log_primitive(ilm_struct *ilm);
+extern void dhl_log_primitive_without_filter_check(ilm_struct *ilm);
+extern void dhl_log_primitive_custom(ilm_struct *ilm, e_custom_ilm_trace_option option);
+/**
+* \brief Only for FT task. internal message communication log.
+* \param ilm_struct for internal message
+*/
+extern void dhl_FT_log_primitive(ilm_struct *ilm);
+/**
+* \brief output primitive C structure if module's filter on.
+* \param module's id
+* \param sap_type if need partial logging
+* \param msg_type for getting c structure that define in message structure definition
+* \param buf_len the size of c structure
+* \param buf pointer to the stucture data
+* \par Sample code
+* \code{.c}
+* dhl_string_struct buf; 
+* kal_uint32 buf_len = sizeof(dhl_string_struct);
+* dhl_log_primitive_struct(MOD_DHL, INVALID_SAP, MSG_ID_DHL_STRING, buf_len, &buf);
+* \endcode
+*/
+extern void dhl_log_primitive_struct(module_type src_mod, sap_type sap_id,  msg_type msg_id, kal_uint32 buf_len, void *buf);
+//#endif
+
+
+//for seamless meta 
+extern void meta_print_system_trace(trace_class_enum trc_class, kal_uint32 user_flag, module_type mod_id, const kal_char *str);
+#define dhl_print_meta_string(_c, _s)  meta_print_system_trace((_c), DHL_USER_FLAG_NONE, 0, (_s))
+
+
+// Only available on MoDIS
+#ifdef UNIT_TEST
+#include "kal_public_defs.h"
+extern void _dhl_print_struct(module_type src, msg_type msg_id, int buf_len, void *buf);
+#define dhl_print_struct(_s,_m,_l,_b) _dhl_print_struct(_s,_m,_l,_b)
+#define dhl_debug_print(_c,_m,_f, ...) dhl_print(_c, DHL_USER_FLAG_NONE, _m, _f, __VA_ARGS__);
+#else
+#define dhl_print_struct(_s,_m,_l,_b)
+#define dhl_debug_print(_f, ...)
+#endif
+
+#define dhl_trace_impl(_t, _u, _msg, _mod, _argv, _arg_info) \
+    dhl_internal_trace_impl(_t, _u, DHL_ACCESS_LEVEL_1_ALL_USER, _msg, _mod, _argv, _arg_info)
+
+extern void dhl_internal_trace_impl(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint8 access_level, kal_uint32 msg_index, kal_uint32 module_id, const char *arg_type, va_list argument_info);
+extern void dhl_print_impl(trace_class_enum trc_class, kal_uint32 user_flag, module_type mod_id, const char *fmt, va_list argument_info);
+extern void dhl_raw_trace_impl(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 buf_len, const kal_uint8 *pData, kal_bool chk_filter);
+extern void dhl_peer_trace_impl(kal_uint32 global_peer_msg_id, kal_uint32 raw_data_len, kal_uint8 *raw_data, kal_uint32 trace_index, kal_uint32 module_id, const char *arg_type, va_list argument_info);
+
+//typedef void (*TST_String_Inject_CB)(kal_uint32 index, kal_uint8 *pData);
+// External buffer logging via ILM
+typedef enum
+{
+    DHL_EXTERNAL_BUFFER_TYPE_BEGIN = 0,
+    DHL_EXTERNAL_BUFFER_L2COPRO_IP_HEADER_LOG,
+    DHL_EXTERNAL_BUFFER_TYPE_MAX
+} dhl_external_buffer_type;
+
+/*
+ * Parameter note:
+ * sent_end
+ *    the end of buffer address sent
+ *    may not align with the buffer end sent
+ *    (fragment should be handled by user)
+ */
+typedef void (*buffer_tx_done_cb)(dhl_external_buffer_type type, kal_uint8 *sent_end, kal_int32 sent_len);
+kal_bool register_buffer_tx_done_callback(dhl_external_buffer_type type, buffer_tx_done_cb cb);
+/*
+ * Parameter usage note:
+ * msg_id
+ *    MSG_ID_DHL_L2COPRO_DL_IP_HEADER_LOG
+ *    MSG_ID_DHL_L2COPRO_UL_IP_HEADER_LOG
+ * local_para
+ *    caller-free
+ * local_para_len
+ *    <= 64 bytes
+ */
+typedef struct
+{
+    kal_uint8 *buf_address;
+    kal_uint32 buf_len;
+} S_DHL_SEND_BODY;
+kal_bool dhl_send_ilm_log(dhl_external_buffer_type type, msg_type msg_id, kal_uint8 *local_para, kal_int32 local_para_len, S_DHL_SEND_BODY *p_send_body_array, kal_uint32 body_number);
+
+#ifdef TST_TRACE_COMPAT
+#define kal_print_string_trace kal_wap_trace  //alias kal_print_string_trace as kal_wap_trace
+extern void kal_wap_trace(module_type mod_id, trace_class_enum trc_class, const char *fmt, ...);
+extern void kal_bootup_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_prompt_trace(module_type, const kal_char *fmt, ...);
+extern void kal_trace_for_3rd_party(trace_class_enum, kal_uint32, const kal_char *, va_list);
+#endif
+//#define __DHL_LEGACY_TRACE_API_ENABLED__
+#if defined(__DHL_LEGACY_TRACE_API_ENABLED__)
+/*index trace & raw trace & peer trace*/
+/*dhl*/
+extern void dhl_trace(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const char *arg_type, ...);
+extern void dhl_internal_trace(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint8 access_level, kal_uint32 msg_index, const char *arg_type, ...);
+extern void dhl_brief_trace(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const char *arg_type, ...);
+extern void dhl_raw_trace(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 buf_len, const kal_uint8 *pData);
+extern void dhl_peer_trace(kal_uint32 global_peer_msg_id, kal_uint32 raw_data_len, kal_uint8 *raw_data, kal_uint32 trace_index, const char *arg_type, ...);
+/*kal*/
+#ifdef TST_TRACE_COMPAT
+#define kal_critical_trace kal_trace
+#define kal_critical_brief_trace kal_brief_trace
+#define kal_critical_assert_trace kal_assert_trace
+extern void kal_critical_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_critical_brief_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_critical_assert_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+#if !defined(_MSC_VER)
+#define kal_trace(trc_class, msg_index, ...) \
+    dhl_trace(trc_class, DHL_USER_FLAG_NONE, msg_index, ##__VA_ARGS__)
+#define kal_brief_trace(trc_class, msg_index, ...) \
+    dhl_brief_trace(trc_class, DHL_USER_FLAG_NONE, msg_index, ##__VA_ARGS__)
+//Target build
+extern kal_bool tst_is_PsTrc_open_and_pstrace_flag;  //For optimization, the AND flag of tst_is_PsTrc_open and tst_pstrace_flag
+extern void dhl_brief_trace_opt_helper(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const char *arg_type, ...);
+#define kal_brief_trace_macro(trc_class, msg_index, ...) do { \
+    if (tst_is_PsTrc_open_and_pstrace_flag) {\
+        dhl_brief_trace_opt_helper(trc_class, DHL_USER_FLAG_NONE, msg_index, ##__VA_ARGS__); \
+    } \
+    } while(0)
+#else
+extern void kal_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_brief_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+//PC build (MoDIS or MCDDLL)
+extern void kal_brief_trace_macro(trace_class_enum, kal_uint32, const kal_char *, ...);
+#endif // _MSC_VER
+extern void _kal_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void _kal_brief_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_lib_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_assert_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_buffer_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 buf_len, const kal_uint8 *pData);
+extern void kal_dev_trace(trace_class_enum trc_class, kal_uint32 msg_index, const char *arg_type, ...);
+#endif // TST_TRACE_COMPAT
+#endif //__DHL_LEGACY_TRACE_API_ENABLED__
+#else //__DHL_TRACE_ENABLED__
+#if defined(__DHL_TRACE_EMPTY_FUNCTION__)
+/*
+ * For non-target platform (PC simulator or MNT),
+ * we define trace-related functions as inline function to avoid compile error
+ * in VC++.
+ */
+
+static __inline void dhl_trace(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const char *arg_type, ...)
+{
+    return;
+}
+
+static __inline void dhl_internal_trace(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint8 access_level, kal_uint32 msg_index, const char *arg_type, ...)
+{
+    return;
+}
+
+static __inline void dhl_brief_trace(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const char *arg_type, ...)
+{
+    return;
+}
+
+static __inline void dhl_raw_trace(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 buf_len, const kal_uint8 *pData)
+{
+    return;
+}
+
+static __inline void dhl_print(trace_class_enum trc_class, kal_uint32 user_flag, module_type mod_id, const char *fmt, ...)
+{
+    return;
+}
+
+#define dhl_print_system_trace(_c, _s)
+#define dhl_print_struct(_s,_m,_l,_b)
+#define dhl_debug_print(_f, ...)
+
+static __inline void dhl_peer_trace(kal_uint32 global_peer_msg_id, kal_uint32 raw_data_len, kal_uint8 *raw_data, kal_uint32 trace_index, const char *arg_type, ...)
+{
+    return;
+}
+
+static __inline void dhl_trace_impl(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const char *arg_type, va_list argument_info)
+{
+    return;
+}
+
+static __inline void dhl_print_impl(trace_class_enum trc_class, kal_uint32 user_flag, module_type mod_id, const char *fmt, va_list argument_info)
+{
+    return;
+}
+
+static __inline void kal_critical_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_critical_brief_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+static __inline void kal_critical_assert_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+
+static __inline void kal_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_brief_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_brief_trace_macro(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_trace_for_3rd_party(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, va_list argument_info)
+{
+    return ;
+}
+
+static __inline void kal_lib_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+static __inline void kal_assert_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+static __inline void kal_wap_trace(module_type mod_id, trace_class_enum trc_class, const char *fmt, ...)
+{
+    return ;
+}
+static __inline void kal_print_string_trace(module_type mod_id, trace_class_enum trc_class, const char *fmt, ...)
+{
+    return ;
+}
+
+static __inline void kal_buffer_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 buf_len, const kal_uint8 *pData)
+{
+    return;
+}
+
+static __inline void kal_dev_trace(trace_class_enum trc_class, kal_uint32 msg_index, const char *arg_type, ...)
+{
+    return;
+}
+
+static __inline void kal_bootup_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+#if !defined(__LTE_REMOVE_TEMPERAL__)
+static __inline void kal_prompt_trace(module_type mod_id, const kal_char *fmt, ...)
+{
+    return;
+}
+#endif /* end of !__LTE_REMOVE_TEMPERAL__ */
+#else // __DHL_TRACE_EMPTY_FUNCTION__
+//Define empty functions for Target SW
+#define dhl_trace(...)
+#define dhl_internal_trace(...)
+#define dhl_brief_trace(...)
+#define dhl_raw_trace(...)
+#define dhl_print(...)
+#define dhl_print_string(...)
+#define dhl_print_system_trace(...)
+
+#define dhl_print_struct(...)
+#define dhl_debug_print(...)
+#define dhl_peer_trace(...)
+
+#define dhl_trace_impl(...)
+#define dhl_print_impl(...)
+#define dhl_internal_trace_impl(...)
+
+#define kal_trace(...)
+#define kal_brief_trace(...)
+#define _kal_trace(...)
+#define _kal_brief_trace(...)
+#define kal_brief_trace_macro(...)
+#define kal_trace_for_3rd_party(...)
+#define kal_lib_trace(...)
+#define kal_assert_trace(...)
+#define kal_wap_trace(...)
+#define kal_print_string_trace(...)
+#define kal_buffer_trace(...)
+#define kal_dev_trace(...)
+#define kal_bootup_trace(...)
+#define kal_prompt_trace(...)
+#define kal_critical_trace(...)
+#define kal_critical_brief_trace(...)
+#define kal_critical_assert_trace(...)
+
+#define dhl_EM_logger(...)
+#define dhl_brief_trace_opt_helper(...)
+#endif
+#endif
+
+#define kal_sys_trace        tst_sys_trace
+#define kal_sys_init_trace   tst_sys_init_trace
+#define kal_sys_fatal_trace  tst_sysfatal_trace
+
+#if defined(__DHL_MODULE__)
+extern void tst_log_primitive(ilm_struct *ilm_ptr);
+extern void tst_sys_init_trace(const kal_char *info);
+extern void tst_sys_trace(kal_char *info);
+extern void tst_sysfatal_trace(kal_char *info);
+extern kal_int32 tst_trace_check_ps_filter_off(trace_class_enum trc_class, kal_uint32 *module_id, kal_uint32 supportOption);
+
+#define kal_bootup_print tst_sys_init_trace
+#else
+#ifdef __DHL_TRACE_EMPTY_FUNCTION__
+#if !defined(__LTE_REMOVE_TEMPERAL__)
+static __inline void tst_sys_init_trace(const kal_char *info)
+{
+    return ;
+}
+static __inline void tst_sys_trace(kal_char *info)
+{
+    return ;
+}
+static __inline void tst_sysfatal_trace(kal_char *info)
+{
+    return ;
+}
+static __inline kal_int32 tst_trace_check_ps_filter_off(trace_class_enum trc_class, kal_uint32 *module_id, kal_uint32 supportOption)
+{
+    return ;
+}
+#endif /* end of !__LTE_REMOVE_TEMPERAL__ */
+#else
+#define tst_sys_init_trace(...)
+#define tst_sys_trace(...)
+#define tst_sysfatal_trace(...)
+#define tst_trace_check_ps_filter_off(...)
+#endif
+#endif  //#ifdef __DHL_MODULE__
+
+typedef void (*TST_VC_CallBack)(const kal_uint8 *pData, kal_uint32 nLen);
+typedef void (*TST_String_Inject_CB)(kal_uint32 index, kal_uint8 *pData);
+
+/*
+* tst_virtual_channel_id:
+* regiester new virtual channel here and remake tst
+*/
+typedef enum
+{
+    TVCI_GPS_LOGGING,
+    TVCI_DNT_L2COPRO_LOGGING,
+    TVCI_CATCHER_POLLING,
+    TVCI_GDB_COMM,
+    TVCI_AST_LOGGING,
+    TVCI_MINI_LOG,
+    TVCI_VM_LOGGING,
+    TVCI_BTT,
+    TVCI_LAST_ID
+}
+tst_virtual_channel_id;
+
+#define MAX_VC_RESPONSE_LEN (1023)
+
+kal_bool tst_vc_register_channel(tst_virtual_channel_id channel_id, TST_VC_CallBack fnCmd);
+kal_bool tst_vc_response(tst_virtual_channel_id channel_id, const kal_uint8 *pData, kal_uint16 len);
+
+#define TVCI_CREATE_FILE 0x24540001
+#define TVCI_CLOSE_FILE 0x24540002
+
+void tst_log_with_offset_single_gpd(sap_type desc_SAP, sap_type raw_data_sap, kal_uint32 msg_index, const char *arg_type, kal_uint32 offset, kal_uint32 *dl_gpd);
+
+kal_bool dhl_get_assert_bypass_buf(kal_char **buf, kal_uint32 *buf_size, kal_uint32 *buf_index);
+kal_bool dhl_ack_assert_bypass_buf(kal_char *buf, kal_uint32 message_size, kal_uint32 buf_index);
+
+void dhl_log_primitive6(module_type src_mod_id, module_type dest_mod_id, sap_type sap_id, msg_type msg_id, local_para_struct *local_para_ptr, peer_buff_struct *peer_buff_ptr);
+
+typedef enum
+{
+    DHL_CUSTOM_MEM_PMIC,
+    DHL_CUSTOM_MEM_MAX
+} DHL_CUSTOM_MEM_TYPE;
+
+typedef void (*DHL_CUSTOM_READ_MEM_CALLBACK)(void *read_addr, kal_uint32 len, kal_uint32 option, void **read_buffer_addr, kal_uint32 *read_buffer_len);
+typedef void (*DHL_CUSTOM_WRITE_MEM_CALLBACK)(void *write_addr, kal_uint32 len, kal_uint32 option, void *write_buffer_addr);
+
+kal_bool dhl_register_custom_mem_read(DHL_CUSTOM_MEM_TYPE mem_type, DHL_CUSTOM_READ_MEM_CALLBACK read_cb);
+kal_bool dhl_register_custom_mem_write(DHL_CUSTOM_MEM_TYPE mem_type, DHL_CUSTOM_WRITE_MEM_CALLBACK write_cb);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+typedef enum
+{
+    /* 0~7 reserve for L2 PDU */
+    /* should not over DHL_L2_PDU_TYPE_NUM */
+    DHL_L2_PDU_MAC_TYPE = 1,
+    DHL_L2_PDU_RLC_TYPE = 2,
+    DHL_L2_PDU_PDCP_TYPE = 3,
+    DHL_L2_PDU_RLC_PDU_TYPE = 4,
+} dhl_log_pdu_type;
+
+void dhl_log_pdu(dhl_log_pdu_type type, kal_uint8 *data, kal_uint32 length);
+void dhl_flush_pdu(dhl_log_pdu_type type);
+kal_bool dhl_check_pdu_filter(dhl_log_pdu_type type);
+
+#define DHL_MAC_CHECK_L2_PDU() dhl_check_pdu_filter(DHL_L2_PDU_MAC_TYPE)
+#define DHL_RLC_CHECK_L2_PDU() (dhl_check_pdu_filter(DHL_L2_PDU_RLC_TYPE) || dhl_check_pdu_filter(DHL_L2_PDU_RLC_PDU_TYPE))
+#define DHL_PDCP_CHECK_L2_PDU() dhl_check_pdu_filter(DHL_L2_PDU_PDCP_TYPE)
+
+#define DHL_MAC_LOG_L2_PDU(pointer, length) do {          \
+        if(DHL_MAC_CHECK_L2_PDU()) {       \
+            dhl_log_pdu(DHL_L2_PDU_MAC_TYPE, pointer, length);\
+        }                                                     \
+    } while(0)
+#define DHL_RLC_LOG_L2_PDU(pointer, length) do {          \
+        if(DHL_RLC_CHECK_L2_PDU()) {       \
+            dhl_log_pdu(DHL_L2_PDU_RLC_TYPE, pointer, length);\
+        }                                                     \
+    } while(0)
+#define DHL_PDCP_LOG_L2_PDU(pointer, length) do {          \
+        if(DHL_PDCP_CHECK_L2_PDU()) {       \
+            dhl_log_pdu(DHL_L2_PDU_PDCP_TYPE, pointer, length);\
+        }                                                      \
+    }while(0)
+
+
+//for UT only
+void dhl_mon_set_l2_pdu_filter(dhl_log_pdu_type type, kal_bool enable);
+
+
+#endif
+#endif /* _DHL_TRACE_H */
+
diff --git a/mcu/interface/service/dhl/v1/dhl_ulsp_hw_interface.h b/mcu/interface/service/dhl/v1/dhl_ulsp_hw_interface.h
new file mode 100644
index 0000000..378809c
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/dhl_ulsp_hw_interface.h
@@ -0,0 +1,707 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   dhl_hwulsp_interface.h
+ *
+ * Project:
+ * --------
+ *   UMOLYA
+ *
+ * Description:
+ * ------------
+ *   This file will be include bu l1trc.h
+ *   The interface for HW ULSP(Real Target)
+ *   Cannot include this file directly
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 08 14 2018 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * .
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_ULSP_HW_INTERFACE_H
+#define _DHL_ULSP_HW_INTERFACE_H
+
+#define TRC_ULSP_MCU_BUFFER_SIZE (2 * 1024 * 1024)
+#define TRC_ULSP_DSP_BUFFER_SIZE (2 * 1024 * 1024)
+#define __DHL_ULSP_EMI_DATA     __attribute__((zero_init, section ("NONCACHEDZI") , aligned(128)))
+
+#ifdef TRC_C
+
+#define _MCU_TRC_ULSP_EXT __DHL_ULSP_EMI_DATA
+#define _DSP_TRC_ULSP_EXT __DHL_ULSP_EMI_DATA
+
+#else //TRC_C
+
+#define _MCU_TRC_ULSP_EXT extern
+#define _DSP_TRC_ULSP_EXT extern
+#endif //TRC_C
+
+
+#if defined(__DHL_SP_LOGGING_SUPPORT__)
+_MCU_TRC_ULSP_EXT void *trc_ulsp_mcu_buffer_ptr;
+_MCU_TRC_ULSP_EXT void *trc_ulsp_dsp_buffer_ptr;
+_MCU_TRC_ULSP_EXT kal_uint32 trc_ulsp_mcu_buffer_size;
+_MCU_TRC_ULSP_EXT kal_uint32 trc_ulsp_dsp_buffer_size;
+#else
+#if defined (__MD97__)
+_MCU_TRC_ULSP_EXT kal_uint8   trc_ulsp_mcu_normal_buffer[TRC_ULSP_MCU_BUFFER_SIZE];
+_MCU_TRC_ULSP_EXT kal_uint8   trc_ulsp_mcu_ondemand_buffer[TRC_ULSP_MCU_BUFFER_SIZE];
+_DSP_TRC_ULSP_EXT kal_uint8   trc_ulsp_4gdsp_normal_buffer[TRC_ULSP_DSP_BUFFER_SIZE];
+_DSP_TRC_ULSP_EXT kal_uint8   trc_ulsp_4gdsp_ondemand_buffer[TRC_ULSP_DSP_BUFFER_SIZE];
+_DSP_TRC_ULSP_EXT kal_uint8   trc_ulsp_5gdsp_normal_buffer[TRC_ULSP_DSP_BUFFER_SIZE];
+_DSP_TRC_ULSP_EXT kal_uint8   trc_ulsp_5gdsp_ondemand_buffer[TRC_ULSP_DSP_BUFFER_SIZE];
+#else //defined (__MD97__)
+_MCU_TRC_ULSP_EXT kal_uint8   trc_ulsp_mcu_buffer[TRC_ULSP_MCU_BUFFER_SIZE];
+_DSP_TRC_ULSP_EXT kal_uint8   trc_ulsp_dsp_buffer[TRC_ULSP_DSP_BUFFER_SIZE];
+#endif //defined (__MD97__)
+#endif //#if defined(__DHL_SP_LOGGING_SUPPORT__) && defined(__MTK_TARGET__)
+
+
+
+/********************************************
+* 6293 Default Macro Version
+* This will use local variable to catch user parameter
+* and use DI/EI to protect trace
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    if((FILTER_ARRAY[FILTER_ARRAY_INDEX] & FILTER_CLASS) != 0) {
+
+#define TRC_END_FILTER_CHECK_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    }
+    
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1(cgen_local_var, var) kal_uint32 cgen_local_var = (kal_uint32)(var);
+#define TRC_PREPROCESS_DATA_SECTION2_L1(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L1()  {\
+        kal_uint32 oldmask=0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask);
+
+#define TRC_END_FILL_L1()  \
+    DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    }
+
+//Implement layer
+//First
+#define TRC_OUTPUT_16_FIRST_L1(value) ULSP_WRITE_PB0_F_16(value);
+#define TRC_OUTPUT_32_FIRST_L1(value) ULSP_WRITE_PB0_F_32(value);
+
+//Middle
+#define TRC_OUTPUT_32_MID_L1(value) ULSP_WRITE_PB0_M_32(value);
+#define TRC_OUTPUT_24_MID_L1(value) ULSP_WRITE_PB0_M_24(value);
+#define TRC_OUTPUT_16_MID_L1(value) ULSP_WRITE_PB0_M_16(value);
+#define TRC_OUTPUT_8_MID_L1(value) ULSP_WRITE_PB0_M_8(value);
+//Last
+#define TRC_OUTPUT_32_LAST_L1(value) ULSP_WRITE_PB0_L_32(value);
+#define TRC_OUTPUT_24_LAST_L1(value) ULSP_WRITE_PB0_L_24(value);
+#define TRC_OUTPUT_16_LAST_L1(value) ULSP_WRITE_PB0_L_16(value);
+#define TRC_OUTPUT_8_LAST_L1(value) ULSP_WRITE_PB0_L_8(value);
+//Single
+#define TRC_OUTPUT_32_SINGLE_L1(value) ULSP_WRITE_PB0_S_32(value);
+#define TRC_OUTPUT_24_SINGLE_L1(value) ULSP_WRITE_PB0_S_24(value);
+#define TRC_OUTPUT_16_SINGLE_L1(value) ULSP_WRITE_PB0_S_16(value);
+#define TRC_OUTPUT_8_SINGLE_L1(value) ULSP_WRITE_PB0_S_8(value);
+
+// Array Trace Interface
+
+#define FILL_ARRAY_VAL(protocol, trace_id, align, array_ptr, count) \
+do { \
+    kal_uint8 i; \
+    kal_uint##align *ptr = (kal_uint##align *) array_ptr; \
+    TRC_OUTPUT_16_FIRST_WRAPPER_##protocol (trace_id, trace_id); \
+    for(i = 0 ; i < count - 1; i++) \
+    { \
+        TRC_OUTPUT_##align##_MID_WRAPPER_##protocol (*ptr, *ptr); \
+        ptr++; \
+    } \
+    TRC_OUTPUT_##align##_LAST_WRAPPER_##protocol (*ptr, *ptr); \
+} while(0)
+
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L1(cgen_local_var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_32_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_24_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_16_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_8_MID_L1(cgen_local_var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_32_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_24_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_16_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_8_LAST_L1(cgen_local_var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L1(cgen_local_var)
+
+//For L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    if((FILTER_ARRAY[FILTER_ARRAY_INDEX] & FILTER_CLASS) != 0) {
+
+#define TRC_END_FILTER_CHECK_L2( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    }
+    
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2(cgen_local_var, var) kal_uint32 cgen_local_var = (kal_uint32)(var);
+#define TRC_PREPROCESS_DATA_SECTION2_L2(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L2()  {\
+        kal_uint32 oldmask=0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask);
+
+#define TRC_END_FILL_L2()  \
+    DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    }
+
+//Implement layer
+//First
+#define TRC_OUTPUT_16_FIRST_L2(value) ULSP_WRITE_PB1_F_16(value);
+#define TRC_OUTPUT_32_FIRST_L2(value) ULSP_WRITE_PB1_F_32(value);
+
+//Middle
+#define TRC_OUTPUT_32_MID_L2(value) ULSP_WRITE_PB1_M_32(value);
+#define TRC_OUTPUT_24_MID_L2(value) ULSP_WRITE_PB1_M_24(value);
+#define TRC_OUTPUT_16_MID_L2(value) ULSP_WRITE_PB1_M_16(value);
+#define TRC_OUTPUT_8_MID_L2(value) ULSP_WRITE_PB1_M_8(value);
+//Last
+#define TRC_OUTPUT_32_LAST_L2(value) ULSP_WRITE_PB1_L_32(value);
+#define TRC_OUTPUT_24_LAST_L2(value) ULSP_WRITE_PB1_L_24(value);
+#define TRC_OUTPUT_16_LAST_L2(value) ULSP_WRITE_PB1_L_16(value);
+#define TRC_OUTPUT_8_LAST_L2(value) ULSP_WRITE_PB1_L_8(value);
+//Single
+#define TRC_OUTPUT_32_SINGLE_L2(value) ULSP_WRITE_PB1_S_32(value);
+#define TRC_OUTPUT_24_SINGLE_L2(value) ULSP_WRITE_PB1_S_24(value);
+#define TRC_OUTPUT_16_SINGLE_L2(value) ULSP_WRITE_PB1_S_16(value);
+#define TRC_OUTPUT_8_SINGLE_L2(value) ULSP_WRITE_PB1_S_8(value);
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L2(cgen_local_var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_32_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_24_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_16_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_8_MID_L2(cgen_local_var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_32_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_24_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_16_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_8_LAST_L2(cgen_local_var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L2(cgen_local_var)
+
+/********************************************
+* 6297 ON_DEMAND Special User Version
+* This will use local variable to catch user parameter
+* and use DI/EI to protect trace
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_ON_DEMAND( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    if((FILTER_ARRAY[FILTER_ARRAY_INDEX] & FILTER_CLASS) != 0) {
+
+#define TRC_END_FILTER_CHECK_L1_ON_DEMAND( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    }
+    
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_ON_DEMAND(cgen_local_var, var) kal_uint32 cgen_local_var = (kal_uint32)(var);
+#define TRC_PREPROCESS_DATA_SECTION2_L1_ON_DEMAND(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L1_ON_DEMAND()  {\
+        kal_uint32 oldmask=0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask);
+
+#define TRC_END_FILL_L1_ON_DEMAND()  \
+    DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L1(cgen_local_var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_MID_L1(cgen_local_var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_LAST_L1(cgen_local_var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L1(cgen_local_var)
+
+//For L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2_ON_DEMAND( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    if((FILTER_ARRAY[FILTER_ARRAY_INDEX] & FILTER_CLASS) != 0) {
+
+#define TRC_END_FILTER_CHECK_L2_ON_DEMAND( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    }
+    
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2_ON_DEMAND(cgen_local_var, var) kal_uint32 cgen_local_var = (kal_uint32)(var);
+#define TRC_PREPROCESS_DATA_SECTION2_L2_ON_DEMAND(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L2_ON_DEMAND()  {\
+        kal_uint32 oldmask=0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask);
+
+#define TRC_END_FILL_L2_ON_DEMAND()  \
+    DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    }
+
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L2(cgen_local_var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_MID_L2(cgen_local_var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_LAST_L2(cgen_local_var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L2(cgen_local_var)
+
+
+
+/********************************************
+* Only for 6293 Non-SMP Special User Version
+* This will  "NOT" use local variable to catch user parameter
+* and use SMP check fail let user assert to protect trace
+********************************************/
+//For L1 Non SMP trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_NON_SMP TRC_START_FILTER_CHECK_L1
+#define TRC_END_FILTER_CHECK_L1_NON_SMP TRC_END_FILTER_CHECK_L1
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP(cgen_local_var, var) 
+#define TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L1_NON_SMP( ) \
+    l1_trc_assure_lisr(); \
+    {
+
+#define TRC_END_FILL_L1_NON_SMP( ) \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L1(var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_32_MID_L1(var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_24_MID_L1(var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_16_MID_L1(var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_8_MID_L1(var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_32_LAST_L1(var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_24_LAST_L1(var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_16_LAST_L1(var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_8_LAST_L1(var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L1(var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L1(var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L1(var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L1(var)
+
+//For L2 Non SMP trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2_NON_SMP TRC_START_FILTER_CHECK_L2
+#define TRC_END_FILTER_CHECK_L2_NON_SMP TRC_END_FILTER_CHECK_L2
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2_NON_SMP(cgen_local_var, var) 
+#define TRC_PREPROCESS_DATA_SECTION2_L2_NON_SMP(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L2_NON_SMP( ) \
+    l1_trc_assure_lisr(); \
+    {
+
+#define TRC_END_FILL_L2_NON_SMP( ) \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L2(var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_32_MID_L2(var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_24_MID_L2(var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_16_MID_L2(var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_8_MID_L2(var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_32_LAST_L2(var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_24_LAST_L2(var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_16_LAST_L2(var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_8_LAST_L2(var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L2(var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L2(var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L2(var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L2(var)
+
+/********************************************
+* Only for 6293 Non-SMP ON_DEMAND Special User Version
+* This will  "NOT" use local variable to catch user parameter
+* and use SMP check fail let user assert to protect trace
+********************************************/
+//For L1 Non SMP trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_NON_SMP_ON_DEMAND TRC_START_FILTER_CHECK_L1
+#define TRC_END_FILTER_CHECK_L1_NON_SMP_ON_DEMAND TRC_END_FILTER_CHECK_L1
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) 
+#define TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L1_NON_SMP_ON_DEMAND( ) \
+    l1_trc_assure_lisr(); \
+    {
+
+#define TRC_END_FILL_L1_NON_SMP_ON_DEMAND( ) \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L1(var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_MID_L1(var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_MID_L1(var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_MID_L1(var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_MID_L1(var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_LAST_L1(var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_LAST_L1(var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_LAST_L1(var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_LAST_L1(var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L1(var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L1(var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L1(var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L1(var)
+
+//For L2 Non SMP trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2_NON_SMP_ON_DEMAND TRC_START_FILTER_CHECK_L2
+#define TRC_END_FILTER_CHECK_L2_NON_SMP_ON_DEMAND TRC_END_FILTER_CHECK_L2
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) 
+#define TRC_PREPROCESS_DATA_SECTION2_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L2_NON_SMP_ON_DEMAND( ) \
+    l1_trc_assure_lisr(); \
+    {
+
+#define TRC_END_FILL_L2_NON_SMP_ON_DEMAND( ) \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L2(var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_MID_L2(var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_MID_L2(var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_MID_L2(var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_MID_L2(var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_LAST_L2(var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_LAST_L2(var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_LAST_L2(var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_LAST_L2(var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L2(var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L2(var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L2(var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L2(var)
+
+/********************************************
+*(Hack Code)Only for 6293 "DHL" L2 Time
+*Only Support L1 .tmd File
+*   L1 tmd force print L2 trace
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_FORCE_L2 TRC_START_FILTER_CHECK_L2
+#define TRC_END_FILTER_CHECK_L1_FORCE_L2 TRC_END_FILTER_CHECK_L2
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_FORCE_L2 TRC_PREPROCESS_DATA_SECTION1_L2
+#define TRC_PREPROCESS_DATA_SECTION2_L1_FORCE_L2 TRC_PREPROCESS_DATA_SECTION2_L2
+
+//fill data interval
+#define TRC_START_FILL_L1_FORCE_L2 TRC_START_FILL_L2
+#define TRC_END_FILL_L1_FORCE_L2 TRC_END_FILL_L2
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_FIRST_WRAPPER_L2
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_32_MID_WRAPPER_L2
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_24_MID_WRAPPER_L2
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_MID_WRAPPER_L2
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_8_MID_WRAPPER_L2
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_32_LAST_WRAPPER_L2
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_24_LAST_WRAPPER_L2
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_LAST_WRAPPER_L2
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_8_LAST_WRAPPER_L2
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_32_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_24_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_8_SINGLE_WRAPPER_L2
+
+/*********************************************
+* (Hack Code)Only for 6293 DHL Exception Direct TX Out
+* Only Support L1 .tmd File
+*   L1 tmd force print L1 EX trace
+*   L1 tmd force print L2 EX trace
+* Only Support Single Version
+*********************************************/
+//For EX L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_EX_FORCE_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+#define TRC_END_FILTER_CHECK_L1_EX_FORCE_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_PREPROCESS_DATA_SECTION2_L1_EX_FORCE_L1(cgen_local_var, var)
+
+//fill data interval
+#define TRC_START_FILL_L1_EX_FORCE_L1() \
+    if(INT_QueryExceptionStatus()) {
+
+#define TRC_END_FILL_L1_EX_FORCE_L1() \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var) \
+    kal_uint8 buffer[256]; \
+    kal_uint32 trace_len =0 ;\
+    extern kal_int32 dhl_tty_dev_write_ex(DCL_DEV port, dhl_mux_id id, kal_uint8 *buffaddr, kal_uint32 length); \
+    UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L1_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);\
+    UlspEncodeIdleSync(buffer,256,ULSP_ENC_L1_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);\
+    UlspEncodeMessage(buffer,256,ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L1_LOG, var);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);
+
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var) \
+    kal_uint8 buffer[256]; \
+    kal_uint32 trace_len =0 ;\
+    extern kal_int32 dhl_tty_dev_write_ex(DCL_DEV port, dhl_mux_id id, kal_uint8 *buffaddr, kal_uint32 length); \
+    UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L1_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);\
+    UlspEncodeIdleSync(buffer,256,ULSP_ENC_L1_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);\
+    UlspEncodeMessage(buffer,256,ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_24, ULSP_ENC_L1_LOG, var);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);
+
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var) \
+    kal_uint8 buffer[256]; \
+    kal_uint32 trace_len =0 ;\
+    extern kal_int32 dhl_tty_dev_write_ex(DCL_DEV port, dhl_mux_id id, kal_uint8 *buffaddr, kal_uint32 length); \
+    UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L1_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);\
+    UlspEncodeIdleSync(buffer,256,ULSP_ENC_L1_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);\
+    UlspEncodeMessage(buffer,256,ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L1_LOG, var);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);
+
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var) \
+    kal_uint8 buffer[256]; \
+    kal_uint32 trace_len =0 ;\
+    extern kal_int32 dhl_tty_dev_write_ex(DCL_DEV port, dhl_mux_id id, kal_uint8 *buffaddr, kal_uint32 length); \
+    UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L1_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);\
+    UlspEncodeIdleSync(buffer,256,ULSP_ENC_L1_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);\
+    UlspEncodeMessage(buffer,256,ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_8, ULSP_ENC_L1_LOG, var);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);
+
+//For EX L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_EX_FORCE_L2( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+#define TRC_END_FILTER_CHECK_L1_EX_FORCE_L2( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_PREPROCESS_DATA_SECTION2_L1_EX_FORCE_L2(cgen_local_var, var)
+
+//fill data interval
+#define TRC_START_FILL_L1_EX_FORCE_L2() \
+    if(INT_QueryExceptionStatus()) {
+
+#define TRC_END_FILL_L1_EX_FORCE_L2() \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var) \
+    kal_uint8 buffer[256]; \
+    kal_uint32 trace_len =0 ;\
+    extern kal_int32 dhl_tty_dev_write_ex(DCL_DEV port, dhl_mux_id id, kal_uint8 *buffaddr, kal_uint32 length); \
+    UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L2_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);\
+    UlspEncodeIdleSync(buffer,256,ULSP_ENC_L2_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);\
+    UlspEncodeMessage(buffer,256,ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L2_LOG, var);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);
+
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var) \
+    kal_uint8 buffer[256]; \
+    kal_uint32 trace_len =0 ;\
+    extern kal_int32 dhl_tty_dev_write_ex(DCL_DEV port, dhl_mux_id id, kal_uint8 *buffaddr, kal_uint32 length); \
+    UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L2_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);\
+    UlspEncodeIdleSync(buffer,256,ULSP_ENC_L2_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);\
+    UlspEncodeMessage(buffer,256,ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_24, ULSP_ENC_L2_LOG, var);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);
+
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var) \
+    kal_uint8 buffer[256]; \
+    kal_uint32 trace_len =0 ;\
+    extern kal_int32 dhl_tty_dev_write_ex(DCL_DEV port, dhl_mux_id id, kal_uint8 *buffaddr, kal_uint32 length); \
+    UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L2_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);\
+    UlspEncodeIdleSync(buffer,256,ULSP_ENC_L2_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);\
+    UlspEncodeMessage(buffer,256,ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L2_LOG, var);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);
+
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var) \
+    kal_uint8 buffer[256]; \
+    kal_uint32 trace_len =0 ;\
+    extern kal_int32 dhl_tty_dev_write_ex(DCL_DEV port, dhl_mux_id id, kal_uint8 *buffaddr, kal_uint32 length); \
+    UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L2_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);\
+    UlspEncodeIdleSync(buffer,256,ULSP_ENC_L2_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);\
+    UlspEncodeMessage(buffer,256,ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_8, ULSP_ENC_L2_LOG, var);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_tty_dev_write_ex(tst_PsTrc_port , DHL_MUX_MCU_ULSP, buffer, trace_len);
+
+extern void trc_init_ulsp_hw(void);
+
+#endif
+
diff --git a/mcu/interface/service/dhl/v1/dhl_ulsp_swsim_interface.h b/mcu/interface/service/dhl/v1/dhl_ulsp_swsim_interface.h
new file mode 100644
index 0000000..53b6836
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/dhl_ulsp_swsim_interface.h
@@ -0,0 +1,697 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   dhl_ulsp_swsim_interface.h
+ *
+ * Project:
+ * --------
+ *   UMOLYA
+ *
+ * Description:
+ * ------------
+ *   This file will be include bu l1trc.h
+ *   The interface for HW ULSP(Real Target SW logging version)
+ *   Cannot include this file directly
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 08 14 2018 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * .
+ *
+ * 05 07 2018 yancy.chien
+ * [DHL][DB] Gen97 format.
+ * 	1. add 5G enum for ELT.
+ * 	2. Modify ULSP header to new format.
+ *
+ * 05 04 2018 yancy.chien
+ * [DHL][ULSPSWSIM] 1st phase-in on EL1S.
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_ULSP_SWSIM_INTERFACE_H
+#define _DHL_ULSP_SWSIM_INTERFACE_H
+
+#include "ulsp_mcu_logging.h"
+
+#define ULSP_SWSIM_TRC_BUF_SIZE (128)
+
+// init
+void dhl_ulsp_swsim_l1_init();
+
+// write
+void dhl_ulsp_swsim_l1_write_sync();
+void dhl_ulsp_swsim_l1_write(kal_uint32 source_id, kal_uint8 *buffaddr, kal_uint8 length);
+void dhl_ulsp_swsim_l1_flush();
+
+// exception
+void dhl_ulsp_swsim_l1_write_ex(kal_uint8 *buffaddr, kal_uint32 length);
+void dhl_ulsp_swsim_l1_flush_buf_ex();
+void dhl_ulsp_swsim_l1_redump_buf();
+
+
+/********************************************
+* ULSP Macro for SWSIM
+********************************************/
+
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    if( (FILTER_ARRAY[FILTER_ARRAY_INDEX] & FILTER_CLASS) != 0 ) { 
+
+#define TRC_END_FILTER_CHECK_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    }
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1(cgen_local_var, var) 
+// Must put here otherwise VC will build error!!
+#define TRC_PREPROCESS_DATA_SECTION2_L1(cgen_local_var, var) kal_uint32 cgen_local_var = (kal_uint32)(var)
+
+
+//fill data interval
+#define TRC_START_FILL_L1()  { \
+        kal_uint8 buffer[ULSP_SWSIM_TRC_BUF_SIZE]; \
+        kal_uint8 trace_len = 0
+
+#define TRC_END_FILL_L1() \
+        dhl_ulsp_swsim_l1_write(ULSP_PB_L1_LOG_BASE_SOURCEID, buffer, trace_len); }
+
+//Implement layer
+//First
+#define TRC_OUTPUT_16_FIRST_L1(value) \
+    *( (kal_uint16*) &buffer[trace_len] ) = value; \
+    trace_len += 2;
+
+#define TRC_OUTPUT_32_FIRST_L1(value) \
+    *( (kal_uint32*) &buffer[trace_len] ) = value; \
+    trace_len += 4;
+
+//Middle
+#define TRC_OUTPUT_32_MID_L1(value) \
+    *( (kal_uint32*) &buffer[trace_len]) = value; \
+    trace_len += 4; 
+#define TRC_OUTPUT_24_MID_L1(value) \
+  *(   (kal_uint16*) &buffer[trace_len]) = ((value) & 0x00FFFF); \
+    trace_len += 2; \
+  *(   (kal_uint8*) &buffer[trace_len]) = (((value) & 0x00FF0000) >> 16); \
+    trace_len += 1; 
+#define TRC_OUTPUT_16_MID_L1(value) \
+    *( (kal_uint16*) &buffer[trace_len]) = value; \
+    trace_len += 2; 
+#define TRC_OUTPUT_8_MID_L1(value) \
+   *( (kal_uint8*) &buffer[trace_len]) = value; \
+    trace_len += 1;
+
+//Last
+#define TRC_OUTPUT_32_LAST_L1(value) \
+    *( (kal_uint32*) &buffer[trace_len]) = value; \
+    trace_len += 4; 
+#define TRC_OUTPUT_24_LAST_L1(value) \
+  *(   (kal_uint16*) &buffer[trace_len]) = ((value) & 0x00FFFF); \
+    trace_len += 2; \
+  *(   (kal_uint8*) &buffer[trace_len]) = (((value) & 0x00FF0000) >> 16); \
+    trace_len += 1; 
+#define TRC_OUTPUT_16_LAST_L1(value) \
+    *( (kal_uint16*) &buffer[trace_len]) = value; \
+    trace_len += 2; 
+#define TRC_OUTPUT_8_LAST_L1(value) \
+    *( (kal_uint8*) &buffer[trace_len]) = value; \
+    trace_len += 1; 
+
+//Single
+#define TRC_OUTPUT_32_SINGLE_L1(value) \
+    *( (kal_uint32*) &buffer[trace_len]) = value; \
+    trace_len += 4; 
+#define TRC_OUTPUT_24_SINGLE_L1(value) \
+  *(   (kal_uint16*) &buffer[trace_len]) = ((value) & 0x00FFFF); \
+    trace_len += 2; \
+  *(   (kal_uint8*) &buffer[trace_len]) = (((value) & 0x00FF0000) >> 16); \
+    trace_len += 1; 
+#define TRC_OUTPUT_16_SINGLE_L1(value) \
+    *( (kal_uint16*) &buffer[trace_len]) = value; \
+    trace_len += 2; 
+#define TRC_OUTPUT_8_SINGLE_L1(value) \
+   *(  (kal_uint8*) &buffer[trace_len]) = value; \
+    trace_len += 1; 
+
+//Array interface
+// 1. Do trc_start_fill & trc_end_fill again since we are inside function now
+// 2. Use memcpy to avoid unalign access 
+#define FILL_ARRAY_VAL(protocol, trace_id, align, array_ptr, count) \
+    do { \
+        TRC_START_FILL_##protocol (); \
+        kal_uint32 size = count * (align / 8); \
+        *( (kal_uint16*) &buffer[trace_len] ) = trace_id; \
+        trace_len += 2; \
+        memcpy((kal_uint8*) &(buffer[trace_len]), array_ptr, size); \
+        trace_len += size; \
+        TRC_END_FILL_##protocol (); \
+    } while(0)
+
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L1(cgen_local_var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_32_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_24_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_16_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_8_MID_L1(cgen_local_var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_32_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_24_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_16_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_8_LAST_L1(cgen_local_var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L1(cgen_local_var)
+
+//For L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2 TRC_START_FILTER_CHECK_L1
+#define TRC_END_FILTER_CHECK_L2 TRC_END_FILTER_CHECK_L1
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2 TRC_PREPROCESS_DATA_SECTION1_L1
+#define TRC_PREPROCESS_DATA_SECTION2_L2 TRC_PREPROCESS_DATA_SECTION2_L1
+
+//fill data interval
+#define TRC_START_FILL_L2() TRC_START_FILL_L1()
+
+
+#define TRC_END_FILL_L2() \
+        dhl_ulsp_swsim_l1_write(ULSP_PB_L2_LOG_BASE_SOURCEID, buffer, trace_len); }
+
+
+//Implement layer
+//First
+#define TRC_OUTPUT_16_FIRST_L2(value) TRC_OUTPUT_16_FIRST_L1(value)
+#define TRC_OUTPUT_32_FIRST_L2(value) TRC_OUTPUT_32_FIRST_L1(value)
+
+
+//Middle
+#define TRC_OUTPUT_32_MID_L2(value) TRC_OUTPUT_32_MID_L1(value)
+#define TRC_OUTPUT_24_MID_L2(value) TRC_OUTPUT_24_MID_L1(value)
+#define TRC_OUTPUT_16_MID_L2(value) TRC_OUTPUT_16_MID_L1(value)
+#define TRC_OUTPUT_8_MID_L2(value)  TRC_OUTPUT_8_MID_L1(value)
+
+//Last
+#define TRC_OUTPUT_32_LAST_L2(value) TRC_OUTPUT_32_LAST_L1(value)
+#define TRC_OUTPUT_24_LAST_L2(value) TRC_OUTPUT_24_LAST_L1(value)
+#define TRC_OUTPUT_16_LAST_L2(value) TRC_OUTPUT_16_LAST_L1(value)
+#define TRC_OUTPUT_8_LAST_L2(value)  TRC_OUTPUT_8_LAST_L1(value)
+
+//Single
+#define TRC_OUTPUT_32_SINGLE_L2(value) TRC_OUTPUT_32_SINGLE_L1(value)
+#define TRC_OUTPUT_24_SINGLE_L2(value) TRC_OUTPUT_24_SINGLE_L1(value)
+#define TRC_OUTPUT_16_SINGLE_L2(value) TRC_OUTPUT_16_SINGLE_L1(value)
+#define TRC_OUTPUT_8_SINGLE_L2(value)  TRC_OUTPUT_8_SINGLE_L1(value)
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L2(cgen_local_var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_32_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_24_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_16_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_8_MID_L2(cgen_local_var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_32_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_24_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_16_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_8_LAST_L2(cgen_local_var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L2(cgen_local_var)
+
+/********************************************
+* Only for 6297 ON_DEMAND Special User Version
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_ON_DEMAND TRC_START_FILTER_CHECK_L1
+#define TRC_END_FILTER_CHECK_L1_ON_DEMAND TRC_END_FILTER_CHECK_L1
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_ON_DEMAND TRC_PREPROCESS_DATA_SECTION1_L1
+#define TRC_PREPROCESS_DATA_SECTION2_L1_ON_DEMAND TRC_PREPROCESS_DATA_SECTION2_L1
+
+//fill data interval
+#define TRC_START_FILL_L1_ON_DEMAND TRC_START_FILL_L1
+
+#define TRC_END_FILL_L1_ON_DEMAND TRC_END_FILL_L1
+
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_16_FIRST_WRAPPER_L1
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_32_MID_WRAPPER_L1
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_24_MID_WRAPPER_L1
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_16_MID_WRAPPER_L1
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_8_MID_WRAPPER_L1
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_32_LAST_WRAPPER_L1
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_24_LAST_WRAPPER_L1
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_16_LAST_WRAPPER_L1
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_8_LAST_WRAPPER_L1
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_32_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_24_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_16_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_8_SINGLE_WRAPPER_L1
+
+//For L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2_ON_DEMAND TRC_START_FILTER_CHECK_L2
+#define TRC_END_FILTER_CHECK_L2_ON_DEMAND TRC_END_FILTER_CHECK_L2
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2_ON_DEMAND TRC_PREPROCESS_DATA_SECTION1_L2
+#define TRC_PREPROCESS_DATA_SECTION2_L2_ON_DEMAND TRC_PREPROCESS_DATA_SECTION2_L2 
+
+//fill data interval
+#define TRC_START_FILL_L2_ON_DEMAND TRC_START_FILL_L2
+#define TRC_END_FILL_L2_ON_DEMAND TRC_END_FILL_L2
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_16_FIRST_WRAPPER_L2
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_32_MID_WRAPPER_L2
+#define TRC_OUTPUT_24_MID_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_24_MID_WRAPPER_L2
+#define TRC_OUTPUT_16_MID_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_16_MID_WRAPPER_L2
+#define TRC_OUTPUT_8_MID_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_8_MID_WRAPPER_L2
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_32_LAST_WRAPPER_L2
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_24_LAST_WRAPPER_L2
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_16_LAST_WRAPPER_L2
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_8_LAST_WRAPPER_L2
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_32_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_24_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_16_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_8_SINGLE_WRAPPER_L2
+
+
+/********************************************
+* Only for 6293 Non-SMP Special User Version
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_NON_SMP TRC_START_FILTER_CHECK_L1
+#define TRC_END_FILTER_CHECK_L1_NON_SMP TRC_END_FILTER_CHECK_L1
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP TRC_PREPROCESS_DATA_SECTION1_L1
+#define TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP TRC_PREPROCESS_DATA_SECTION2_L1
+
+//fill data interval
+#define TRC_START_FILL_L1_NON_SMP TRC_START_FILL_L1
+
+#define TRC_END_FILL_L1_NON_SMP TRC_END_FILL_L1
+
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_NON_SMP TRC_OUTPUT_16_FIRST_WRAPPER_L1
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_NON_SMP TRC_OUTPUT_32_MID_WRAPPER_L1
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_NON_SMP TRC_OUTPUT_24_MID_WRAPPER_L1
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_NON_SMP TRC_OUTPUT_16_MID_WRAPPER_L1
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_NON_SMP TRC_OUTPUT_8_MID_WRAPPER_L1
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_NON_SMP TRC_OUTPUT_32_LAST_WRAPPER_L1
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_NON_SMP TRC_OUTPUT_24_LAST_WRAPPER_L1
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_NON_SMP TRC_OUTPUT_16_LAST_WRAPPER_L1
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_NON_SMP TRC_OUTPUT_8_LAST_WRAPPER_L1
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_NON_SMP TRC_OUTPUT_32_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_NON_SMP TRC_OUTPUT_24_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_NON_SMP TRC_OUTPUT_16_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_NON_SMP TRC_OUTPUT_8_SINGLE_WRAPPER_L1
+
+//For L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2_NON_SMP TRC_START_FILTER_CHECK_L2
+#define TRC_END_FILTER_CHECK_L2_NON_SMP TRC_END_FILTER_CHECK_L2
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2_NON_SMP TRC_PREPROCESS_DATA_SECTION1_L2
+#define TRC_PREPROCESS_DATA_SECTION2_L2_NON_SMP TRC_PREPROCESS_DATA_SECTION2_L2 
+
+//fill data interval
+#define TRC_START_FILL_L2_NON_SMP TRC_START_FILL_L2
+#define TRC_END_FILL_L2_NON_SMP TRC_END_FILL_L2
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2_NON_SMP TRC_OUTPUT_16_FIRST_WRAPPER_L2
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2_NON_SMP TRC_OUTPUT_32_MID_WRAPPER_L2
+#define TRC_OUTPUT_24_MID_WRAPPER_L2_NON_SMP TRC_OUTPUT_24_MID_WRAPPER_L2
+#define TRC_OUTPUT_16_MID_WRAPPER_L2_NON_SMP TRC_OUTPUT_16_MID_WRAPPER_L2
+#define TRC_OUTPUT_8_MID_WRAPPER_L2_NON_SMP TRC_OUTPUT_8_MID_WRAPPER_L2
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2_NON_SMP TRC_OUTPUT_32_LAST_WRAPPER_L2
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2_NON_SMP TRC_OUTPUT_24_LAST_WRAPPER_L2
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2_NON_SMP TRC_OUTPUT_16_LAST_WRAPPER_L2
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2_NON_SMP TRC_OUTPUT_8_LAST_WRAPPER_L2
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2_NON_SMP TRC_OUTPUT_32_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2_NON_SMP TRC_OUTPUT_24_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2_NON_SMP TRC_OUTPUT_16_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2_NON_SMP TRC_OUTPUT_8_SINGLE_WRAPPER_L2
+
+
+/********************************************
+* Only for 6293 Non-SMP Special User Version
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_NON_SMP_ON_DEMAND TRC_START_FILTER_CHECK_L1
+#define TRC_END_FILTER_CHECK_L1_NON_SMP_ON_DEMAND TRC_END_FILTER_CHECK_L1
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP_ON_DEMAND TRC_PREPROCESS_DATA_SECTION1_L1
+#define TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP_ON_DEMAND TRC_PREPROCESS_DATA_SECTION2_L1
+
+//fill data interval
+#define TRC_START_FILL_L1_NON_SMP_ON_DEMAND TRC_START_FILL_L1
+
+#define TRC_END_FILL_L1_NON_SMP_ON_DEMAND TRC_END_FILL_L1
+
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_16_FIRST_WRAPPER_L1
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_32_MID_WRAPPER_L1
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_24_MID_WRAPPER_L1
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_16_MID_WRAPPER_L1
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_8_MID_WRAPPER_L1
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_32_LAST_WRAPPER_L1
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_24_LAST_WRAPPER_L1
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_16_LAST_WRAPPER_L1
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_8_LAST_WRAPPER_L1
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_32_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_24_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_16_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_8_SINGLE_WRAPPER_L1
+
+//For L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2_NON_SMP_ON_DEMAND TRC_START_FILTER_CHECK_L2
+#define TRC_END_FILTER_CHECK_L2_NON_SMP_ON_DEMAND TRC_END_FILTER_CHECK_L2
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2_NON_SMP_ON_DEMAND TRC_PREPROCESS_DATA_SECTION1_L2
+#define TRC_PREPROCESS_DATA_SECTION2_L2_NON_SMP_ON_DEMAND TRC_PREPROCESS_DATA_SECTION2_L2 
+
+//fill data interval
+#define TRC_START_FILL_L2_NON_SMP_ON_DEMAND TRC_START_FILL_L2
+#define TRC_END_FILL_L2_NON_SMP_ON_DEMAND TRC_END_FILL_L2
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_16_FIRST_WRAPPER_L2
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_32_MID_WRAPPER_L2
+#define TRC_OUTPUT_24_MID_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_24_MID_WRAPPER_L2
+#define TRC_OUTPUT_16_MID_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_16_MID_WRAPPER_L2
+#define TRC_OUTPUT_8_MID_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_8_MID_WRAPPER_L2
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_32_LAST_WRAPPER_L2
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_24_LAST_WRAPPER_L2
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_16_LAST_WRAPPER_L2
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_8_LAST_WRAPPER_L2
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_32_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_24_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_16_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_8_SINGLE_WRAPPER_L2
+
+/********************************************
+*(Hack Code)Only for 6293 "DHL" L2 Time
+*Only Support L1 .tmd File
+*   L1 tmd force print L2 trace
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_FORCE_L2 TRC_START_FILTER_CHECK_L2
+#define TRC_END_FILTER_CHECK_L1_FORCE_L2 TRC_END_FILTER_CHECK_L2
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_FORCE_L2 TRC_PREPROCESS_DATA_SECTION1_L2
+#define TRC_PREPROCESS_DATA_SECTION2_L1_FORCE_L2 TRC_PREPROCESS_DATA_SECTION2_L2
+
+//fill data interval
+#define TRC_START_FILL_L1_FORCE_L2 TRC_START_FILL_L2
+#define TRC_END_FILL_L1_FORCE_L2 TRC_END_FILL_L2
+
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_FIRST_WRAPPER_L2
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_32_MID_WRAPPER_L2
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_24_MID_WRAPPER_L2
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_MID_WRAPPER_L2
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_8_MID_WRAPPER_L2
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_32_LAST_WRAPPER_L2
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_24_LAST_WRAPPER_L2
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_LAST_WRAPPER_L2
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_8_LAST_WRAPPER_L2
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_32_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_24_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_8_SINGLE_WRAPPER_L2
+
+/*********************************************
+* (Hack Code)Only for 6293 DHL Exception Direct TX Out
+* Only Support L1 .tmd File
+*   L1 tmd force print L1 EX trace
+*   L1 tmd force print L2 EX trace
+* Only Support Single Version
+*********************************************/
+//For EX L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_EX_FORCE_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+#define TRC_END_FILTER_CHECK_L1_EX_FORCE_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_PREPROCESS_DATA_SECTION2_L1_EX_FORCE_L1(cgen_local_var, var)
+
+//fill data interval
+#define TRC_START_FILL_L1_EX_FORCE_L1() \
+    if(INT_QueryExceptionStatus()) {
+
+#define TRC_END_FILL_L1_EX_FORCE_L1() \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var) \
+do { \
+    kal_uint8 buffer[256]; \
+    kal_uint32 trace_len =0 ;\
+    UlspEncodeBoundarySync(buffer, 256,ULSP_ENC_L1_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+    UlspEncodeIdleSync(buffer,256,ULSP_ENC_L1_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+    UlspEncodeMessage(buffer,256,ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L1_LOG, var);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len); \
+} while(0)
+
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var) \
+do { \
+    kal_uint8 buffer[256]; \
+    kal_uint32 trace_len = 0 ;\
+    UlspEncodeBoundarySync(buffer, 256, ULSP_ENC_L1_LOG);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+    UlspEncodeIdleSync(buffer,256,ULSP_ENC_L1_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+    UlspEncodeMessage(buffer,256,ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_24, ULSP_ENC_L1_LOG, var);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len); \
+} while(0)    
+
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var) \
+do { \
+    kal_uint8 buffer[256]; \
+    kal_uint32 trace_len = 0; \
+    UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L1_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+    UlspEncodeIdleSync(buffer,256,ULSP_ENC_L1_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+    UlspEncodeMessage(buffer,256,ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L1_LOG, var);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len); \
+} while(0)
+
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var) \
+do { \
+    kal_uint8 buffer[256]; \
+    kal_uint32 trace_len =0 ;\
+    UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L1_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+    UlspEncodeIdleSync(buffer,256,ULSP_ENC_L1_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+    UlspEncodeMessage(buffer,256,ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_8, ULSP_ENC_L1_LOG, var);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len); \
+} while(0)
+
+//For EX L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_EX_FORCE_L2( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+#define TRC_END_FILTER_CHECK_L1_EX_FORCE_L2( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_PREPROCESS_DATA_SECTION2_L1_EX_FORCE_L2(cgen_local_var, var)
+
+//fill data interval
+#define TRC_START_FILL_L1_EX_FORCE_L2() \
+    if(INT_QueryExceptionStatus()) {
+
+#define TRC_END_FILL_L1_EX_FORCE_L2() \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var) \
+do { \
+    kal_uint8 buffer[256]; \
+    kal_uint32 trace_len = 0;\
+    UlspEncodeBoundarySync(buffer, 256, ULSP_ENC_L2_LOG);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+    UlspEncodeIdleSync(buffer,256,ULSP_ENC_L2_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+    UlspEncodeMessage(buffer,256,ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L2_LOG, var);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+} while(0)
+
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var) \
+do { \
+    kal_uint8 buffer[256]; \
+    kal_uint32 trace_len =0 ;\
+    UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L2_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+    UlspEncodeIdleSync(buffer,256,ULSP_ENC_L2_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+    UlspEncodeMessage(buffer,256,ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_24, ULSP_ENC_L2_LOG, var);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+} while(0)    
+
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var) \
+do { \
+    kal_uint8 buffer[256]; \
+    kal_uint32 trace_len =0 ;\
+    UlspEncodeBoundarySync(buffer, 256, ULSP_ENC_L2_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+    UlspEncodeIdleSync(buffer,256,ULSP_ENC_L2_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+    UlspEncodeMessage(buffer,256,ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L2_LOG, var);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+} while(0)
+
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var) \
+do { \
+    kal_uint8 buffer[256]; \
+    kal_uint32 trace_len =0 ;\
+    UlspEncodeBoundarySync(buffer, 256, ULSP_ENC_L2_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+    UlspEncodeIdleSync(buffer,256,ULSP_ENC_L2_LOG );\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+    UlspEncodeMessage(buffer,256,ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_8, ULSP_ENC_L2_LOG, var);\
+    trace_len = UlspEncoderGetCurrentPacketSize();\
+    dhl_ulsp_swsim_l1_write_ex( buffer, trace_len);\
+} while(0)
+
+#endif
+
diff --git a/mcu/interface/service/dhl/v1/dhl_ulsp_xl1sim_interface.h b/mcu/interface/service/dhl/v1/dhl_ulsp_xl1sim_interface.h
new file mode 100644
index 0000000..74078c1
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/dhl_ulsp_xl1sim_interface.h
@@ -0,0 +1,661 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   dhl_ulsp_xl1sim_interface.h
+ *
+ * Project:
+ * --------
+ *   UMOLYE
+ *
+ * Description:
+ * ------------
+ *   This file will be include bu l1trc.h
+ *   The interface for XL1sim
+ *   Cannot include this file directly
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 08 14 2018 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * .
+ *
+ * 06 26 2018 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * 	
+ * 	Fix build warrning on xL1SIM.
+ *
+ * 05 17 2018 yancy.chien
+ * [DHL] Function implement for ULSP SWSIM.
+ *
+ ****************************************************************************/
+     
+#ifndef _DHL_ULSP_XL1SIM_INTERFACE_H
+#define _DHL_ULSP_XL1SIM_INTERFACE_H
+
+
+/********************************************
+* ULSP Macro for XL1SIM
+********************************************/
+
+/********************************************
+* 6293 Default Macro Version
+********************************************/
+//For L1 trace
+//filter check interval
+extern void SendToCatcherWrapper(kal_uint8 *buf, kal_uint32 size, ULSP_Encoder_Message_Type type);
+#define TRC_BUFFER_SIZE 256
+#define TRC_START_FILTER_CHECK_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    if((FILTER_ARRAY[FILTER_ARRAY_INDEX] & FILTER_CLASS) != 0) { \
+        kal_uint8 buffer[TRC_BUFFER_SIZE]; \
+        kal_uint32 trace_len
+
+#define TRC_START_FILTER_CHECK_L1_COND( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    if((FILTER_ARRAY[FILTER_ARRAY_INDEX] & FILTER_CLASS) != 0) { volatile kal_uint32 unused=0
+
+#define TRC_END_FILTER_CHECK_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    }
+
+#define TRC_END_FILTER_CHECK_L1_COND( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    (void)(unused);}
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1(cgen_local_var, var) kal_uint32 cgen_local_var = (kal_uint32)(var)
+#define TRC_PREPROCESS_DATA_SECTION2_L1(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L1()  {\
+        kal_uint32 oldmask=0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask);
+
+#define TRC_END_FILL_L1()  \
+    trace_len = UlspEncoderGetCurrentPacketSize(); \
+    SendToCatcherWrapper(buffer, trace_len, ULSP_ENC_L1_LOG); \
+    DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    }
+
+//Implement layer
+//First
+#define TRC_OUTPUT_16_FIRST_L1(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_FIRST, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_32_FIRST_L1(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_FIRST, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L1_LOG, value);
+
+//Middle
+#define TRC_OUTPUT_32_MID_L1(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_MIDDLE, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_24_MID_L1(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_MIDDLE, ULSP_ENC_MSG_SIZE_24, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_16_MID_L1(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_MIDDLE, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_8_MID_L1(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_MIDDLE, ULSP_ENC_MSG_SIZE_8, ULSP_ENC_L1_LOG, value);
+//Last
+#define TRC_OUTPUT_32_LAST_L1(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_LAST, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_24_LAST_L1(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_LAST, ULSP_ENC_MSG_SIZE_24, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_16_LAST_L1(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_LAST, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_8_LAST_L1(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_LAST, ULSP_ENC_MSG_SIZE_8, ULSP_ENC_L1_LOG, value);
+//Single
+#define TRC_OUTPUT_32_SINGLE_L1(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_24_SINGLE_L1(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_24, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_16_SINGLE_L1(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_8_SINGLE_L1(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_8, ULSP_ENC_L1_LOG, value);
+
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L1(cgen_local_var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_32_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_24_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_16_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_8_MID_L1(cgen_local_var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_32_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_24_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_16_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_8_LAST_L1(cgen_local_var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L1(cgen_local_var)
+
+//For L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2 TRC_START_FILTER_CHECK_L1
+#define TRC_END_FILTER_CHECK_L2 TRC_END_FILTER_CHECK_L1
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2(cgen_local_var, var) kal_uint32 cgen_local_var = (kal_uint32)(var)
+#define TRC_PREPROCESS_DATA_SECTION2_L2(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L2() {\
+        kal_uint32 oldmask=0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask);
+
+#define TRC_END_FILL_L2() \
+    trace_len = UlspEncoderGetCurrentPacketSize(); \
+    SendToCatcherWrapper(buffer, trace_len, ULSP_ENC_L2_LOG); \
+    DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    }
+
+//Implement layer
+//First
+#define TRC_OUTPUT_16_FIRST_L2(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_FIRST, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_32_FIRST_L2(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_FIRST, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L2_LOG, value);
+
+//Middle
+#define TRC_OUTPUT_32_MID_L2(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_MIDDLE, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_24_MID_L2(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_MIDDLE, ULSP_ENC_MSG_SIZE_24, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_16_MID_L2(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_MIDDLE, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_8_MID_L2(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_MIDDLE, ULSP_ENC_MSG_SIZE_8, ULSP_ENC_L2_LOG, value);
+//Last
+#define TRC_OUTPUT_32_LAST_L2(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_LAST, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_24_LAST_L2(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_LAST, ULSP_ENC_MSG_SIZE_24, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_16_LAST_L2(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_LAST, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_8_LAST_L2(value)  \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_LAST, ULSP_ENC_MSG_SIZE_8, ULSP_ENC_L2_LOG, value);
+//Single
+#define TRC_OUTPUT_32_SINGLE_L2(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_24_SINGLE_L2(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_24, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_16_SINGLE_L2(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_8_SINGLE_L2(value)  \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_8, ULSP_ENC_L2_LOG, value);
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L2(cgen_local_var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_32_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_24_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_16_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_8_MID_L2(cgen_local_var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_32_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_24_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_16_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_8_LAST_L2(cgen_local_var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L2(cgen_local_var)
+
+#define TRC_START_FILTER_CHECK_L1_ON_DEMAND( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    if((FILTER_ARRAY[FILTER_ARRAY_INDEX] & FILTER_CLASS) != 0) { \
+        kal_uint8 buffer[TRC_BUFFER_SIZE]; \
+        kal_uint32 trace_len
+
+#define TRC_END_FILTER_CHECK_L1_ON_DEMAND( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    }
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_ON_DEMAND(cgen_local_var, var) kal_uint32 cgen_local_var = (kal_uint32)(var)
+#define TRC_PREPROCESS_DATA_SECTION2_L1_ON_DEMAND(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L1_ON_DEMAND()  {\
+        kal_uint32 oldmask=0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask);
+
+#define TRC_END_FILL_L1_ON_DEMAND()  \
+    trace_len = UlspEncoderGetCurrentPacketSize(); \
+    SendToCatcherWrapper(buffer, trace_len, ULSP_ENC_L1_LOG); \
+    DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    }
+
+//Implement layer
+//First
+#define TRC_OUTPUT_16_FIRST_L1_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_FIRST, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_32_FIRST_L1_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_FIRST, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L1_LOG, value);
+
+//Middle
+#define TRC_OUTPUT_32_MID_L1_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_MIDDLE, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_24_MID_L1_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_MIDDLE, ULSP_ENC_MSG_SIZE_24, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_16_MID_L1_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_MIDDLE, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_8_MID_L1_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_MIDDLE, ULSP_ENC_MSG_SIZE_8, ULSP_ENC_L1_LOG, value);
+//Last
+#define TRC_OUTPUT_32_LAST_L1_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_LAST, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_24_LAST_L1_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_LAST, ULSP_ENC_MSG_SIZE_24, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_16_LAST_L1_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_LAST, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_8_LAST_L1_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_LAST, ULSP_ENC_MSG_SIZE_8, ULSP_ENC_L1_LOG, value);
+//Single
+#define TRC_OUTPUT_32_SINGLE_L1_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_24_SINGLE_L1_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_24, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_16_SINGLE_L1_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L1_LOG, value);
+#define TRC_OUTPUT_8_SINGLE_L1_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_8, ULSP_ENC_L1_LOG, value);
+
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L1(cgen_local_var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_MID_L1(cgen_local_var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_LAST_L1(cgen_local_var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L1(cgen_local_var)
+
+//For L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2 TRC_START_FILTER_CHECK_L1
+#define TRC_END_FILTER_CHECK_L2 TRC_END_FILTER_CHECK_L1
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2_ON_DEMAND(cgen_local_var, var) kal_uint32 cgen_local_var = (kal_uint32)(var)
+#define TRC_PREPROCESS_DATA_SECTION2_L2_ON_DEMAND(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L2_ON_DEMAND() {\
+        kal_uint32 oldmask=0; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask);
+
+#define TRC_END_FILL_L2_ON_DEMAND() \
+    trace_len = UlspEncoderGetCurrentPacketSize(); \
+    SendToCatcherWrapper(buffer, trace_len, ULSP_ENC_L2_LOG); \
+    DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    }
+
+//Implement layer
+//First
+#define TRC_OUTPUT_16_FIRST_L2_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_FIRST, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_32_FIRST_L2_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_FIRST, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L2_LOG, value);
+
+//Middle
+#define TRC_OUTPUT_32_MID_L2_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_MIDDLE, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_24_MID_L2_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_MIDDLE, ULSP_ENC_MSG_SIZE_24, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_16_MID_L2_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_MIDDLE, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_8_MID_L2_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_MIDDLE, ULSP_ENC_MSG_SIZE_8, ULSP_ENC_L2_LOG, value);
+//Last
+#define TRC_OUTPUT_32_LAST_L2_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_LAST, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_24_LAST_L2_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_LAST, ULSP_ENC_MSG_SIZE_24, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_16_LAST_L2_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_LAST, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_8_LAST_L2_ON_DEMAND(value)  \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_LAST, ULSP_ENC_MSG_SIZE_8, ULSP_ENC_L2_LOG, value);
+//Single
+#define TRC_OUTPUT_32_SINGLE_L2_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_32, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_24_SINGLE_L2_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_24, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_16_SINGLE_L2_ON_DEMAND(value) \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_16, ULSP_ENC_L2_LOG, value);
+#define TRC_OUTPUT_8_SINGLE_L2_ON_DEMAND(value)  \
+    UlspEncodeMessage(buffer, TRC_BUFFER_SIZE, ULSP_ENC_SINGLE, ULSP_ENC_MSG_SIZE_8, ULSP_ENC_L2_LOG, value);
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L2(cgen_local_var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_MID_L2(cgen_local_var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_LAST_L2(cgen_local_var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L2(cgen_local_var)
+
+/********************************************
+* Only for 6293 Non-SMP Special User Version
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_NON_SMP TRC_START_FILTER_CHECK_L1
+#define TRC_END_FILTER_CHECK_L1_NON_SMP TRC_END_FILTER_CHECK_L1
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP(cgen_local_var, var) 
+#define TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L1_NON_SMP( ) \
+    if(l1_trc_assure_lisr(__FUNCTION__, __FILE__, __LINE__)){
+
+#define TRC_END_FILL_L1_NON_SMP( ) \
+    trace_len = UlspEncoderGetCurrentPacketSize(); \
+    SendToCatcherWrapper(buffer, trace_len, ULSP_ENC_L1_LOG); \
+    }
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L1(var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_32_MID_L1(var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_24_MID_L1(var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_16_MID_L1(var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_8_MID_L1(var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_32_LAST_L1(var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_24_LAST_L1(var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_16_LAST_L1(var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_8_LAST_L1(var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L1(var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L1(var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L1(var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_NON_SMP(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L1(var)
+
+//For L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2_NON_SMP TRC_START_FILTER_CHECK_L2
+#define TRC_END_FILTER_CHECK_L2_NON_SMP TRC_END_FILTER_CHECK_L2
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2_NON_SMP(cgen_local_var, var) 
+#define TRC_PREPROCESS_DATA_SECTION2_L2_NON_SMP(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L2_NON_SMP( ) \
+    if(l1_trc_assure_lisr(__FUNCTION__, __FILE__, __LINE__)){ \
+
+#define TRC_END_FILL_L2_NON_SMP( ) \
+    trace_len = UlspEncoderGetCurrentPacketSize(); \
+    SendToCatcherWrapper(buffer, trace_len, ULSP_ENC_L2_LOG); \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L2(var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_32_MID_L2(var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_24_MID_L2(var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_16_MID_L2(var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_8_MID_L2(var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_32_LAST_L2(var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_24_LAST_L2(var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_16_LAST_L2(var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_8_LAST_L2(var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L2(var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L2(var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L2(var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2_NON_SMP(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L2(var)
+
+/********************************************
+* Only for 6293 Non-SMP Special User Version
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_NON_SMP_ON_DEMAND TRC_START_FILTER_CHECK_L1
+#define TRC_END_FILTER_CHECK_L1_NON_SMP_ON_DEMAND TRC_END_FILTER_CHECK_L1
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) 
+#define TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L1_NON_SMP_ON_DEMAND( ) \
+    if(l1_trc_assure_lisr(__FUNCTION__, __FILE__, __LINE__)){
+
+#define TRC_END_FILL_L1_NON_SMP_ON_DEMAND( ) \
+    trace_len = UlspEncoderGetCurrentPacketSize(); \
+    SendToCatcherWrapper(buffer, trace_len, ULSP_ENC_L1_LOG); \
+    }
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L1(var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_MID_L1(var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_MID_L1(var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_MID_L1(var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_MID_L1(var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_LAST_L1(var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_LAST_L1(var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_LAST_L1(var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_LAST_L1(var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L1(var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L1(var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L1(var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L1(var)
+
+//For L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2_NON_SMP_ON_DEMAND TRC_START_FILTER_CHECK_L2
+#define TRC_END_FILTER_CHECK_L2_NON_SMP_ON_DEMAND TRC_END_FILTER_CHECK_L2
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) 
+#define TRC_PREPROCESS_DATA_SECTION2_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L2_NON_SMP_ON_DEMAND( ) \
+    if(l1_trc_assure_lisr(__FUNCTION__, __FILE__, __LINE__)){ \
+
+#define TRC_END_FILL_L2_NON_SMP_ON_DEMAND( ) \
+    trace_len = UlspEncoderGetCurrentPacketSize(); \
+    SendToCatcherWrapper(buffer, trace_len, ULSP_ENC_L2_LOG); \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L2(var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_MID_L2(var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_MID_L2(var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_MID_L2(var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_MID_L2(var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_LAST_L2(var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_LAST_L2(var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_LAST_L2(var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_LAST_L2(var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L2(var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L2(var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L2(var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L2(var)
+
+/********************************************
+*(Hack Code)Only for 6293 "DHL" L2 Time
+*Only Support L1 .tmd File
+*   L1 tmd force print L2 trace
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_FORCE_L2 TRC_START_FILTER_CHECK_L2
+#define TRC_END_FILTER_CHECK_L1_FORCE_L2 TRC_END_FILTER_CHECK_L2
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_FORCE_L2 TRC_PREPROCESS_DATA_SECTION1_L2
+#define TRC_PREPROCESS_DATA_SECTION2_L1_FORCE_L2 TRC_PREPROCESS_DATA_SECTION2_L2
+
+//fill data interval
+#define TRC_START_FILL_L1_FORCE_L2 TRC_START_FILL_L2
+#define TRC_END_FILL_L1_FORCE_L2 TRC_END_FILL_L2
+
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_FIRST_WRAPPER_L2
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_32_MID_WRAPPER_L2
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_24_MID_WRAPPER_L2
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_MID_WRAPPER_L2
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_8_MID_WRAPPER_L2
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_32_LAST_WRAPPER_L2
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_24_LAST_WRAPPER_L2
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_LAST_WRAPPER_L2
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_8_LAST_WRAPPER_L2
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_32_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_24_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_8_SINGLE_WRAPPER_L2
+
+/*********************************************
+* (Hack Code)Only for 6293 DHL Exception Direct TX Out
+* Only Support L1 .tmd File
+*   L1 tmd force print L1 EX trace
+*   L1 tmd force print L2 EX trace
+* Only Support Single Version
+*********************************************/
+//For EX L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_EX_FORCE_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+#define TRC_END_FILTER_CHECK_L1_EX_FORCE_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_PREPROCESS_DATA_SECTION2_L1_EX_FORCE_L1(cgen_local_var, var)
+
+//fill data interval
+#define TRC_START_FILL_L1_EX_FORCE_L1() \
+    if(INT_QueryExceptionStatus()) {
+
+#define TRC_END_FILL_L1_EX_FORCE_L1() \
+    trace_len = UlspEncoderGetCurrentPacketSize(); \
+    SendToCatcherWrapper(buffer, trace_len, ULSP_ENC_L1_LOG); \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_EX_FORCE_L1
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_EX_FORCE_L1
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_EX_FORCE_L1
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_EX_FORCE_L1
+
+//For EX L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_EX_FORCE_L2( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+#define TRC_END_FILTER_CHECK_L1_EX_FORCE_L2( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_PREPROCESS_DATA_SECTION2_L1_EX_FORCE_L2(cgen_local_var, var)
+
+//fill data interval
+#define TRC_START_FILL_L1_EX_FORCE_L2() \
+    if(INT_QueryExceptionStatus()) {
+
+#define TRC_END_FILL_L1_EX_FORCE_L2() \
+    trace_len = UlspEncoderGetCurrentPacketSize(); \
+    SendToCatcherWrapper(buffer, trace_len, ULSP_ENC_L2_LOG); \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+
+#endif
diff --git a/mcu/interface/service/dhl/v1/dhl_unified_trace.h b/mcu/interface/service/dhl/v1/dhl_unified_trace.h
new file mode 100644
index 0000000..5a36af5
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/dhl_unified_trace.h
@@ -0,0 +1,263 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file dhl_unified_trace.h
+ *
+ * Description:
+ * ------------
+ *   @brief Gen interface of unified trace logging API.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 07 12 2019 victoria.wang
+ * [MOLY00420732] [SMO][UTF][logging service][DHL] check number of trace API argument when build
+ * [DHL] add expand define for expand trace API first than check number of argument
+ *
+ * 03 22 2019 yh.sung
+ * [MOLY00392990] [VMOLY][UTF] Phase 2 Landing
+ * 	
+ * 	empty MD_TRC macro
+ *
+ * 03 22 2019 yh.sung
+ * [MOLY00392990] [VMOLY][UTF] Phase 2 Landing
+ * empty MD_TRC() macro for basic load usage
+ *
+ * 03 22 2019 victoria.wang
+ * [MOLY00392990] [VMOLY][UTF] Phase 2 Landing
+ * [Fix] for non-use trace
+ *
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_UNIFIED_TRACE_H
+#define _DHL_UNIFIED_TRACE_H
+#ifndef GEN_FOR_PC
+#include <stdio.h>
+#include <stdarg.h>
+#else
+typedef char *va_list;
+#endif
+#if defined(__MAUI_BASIC__)
+#define MD_TRC(...)
+#else // #if defined(__MAUI_BASIC__)
+#include "dhl_trace.h"
+#include "L1Trc.h"
+
+typedef enum
+{
+    MAX_UNIFIED_TRACE_CLASS_BYTE = 8
+}E_UNIFIED_TRACE_CLASS;
+
+#define UNIFIED_API_PARAM_NONE 0
+#define UNIFIED_API_PARAM_GEN_VAL 1
+#define UNIFIED_API_PARAM_USER_EXTEND 2
+
+typedef enum
+{
+    UNIFIED_API_PARAM_TYPE_raw = UNIFIED_API_PARAM_NONE,
+    UNIFIED_API_PARAM_TYPE_sys= UNIFIED_API_PARAM_NONE,
+    UNIFIED_API_PARAM_TYPE_index = UNIFIED_API_PARAM_USER_EXTEND, //UNIFIED_API_PARAM_GEN_VAL,
+    UNIFIED_API_PARAM_TYPE_ota = UNIFIED_API_PARAM_USER_EXTEND, //UNIFIED_API_PARAM_GEN_VAL,
+    UNIFIED_API_PARAM_TYPE_string = UNIFIED_API_PARAM_USER_EXTEND    /* EX. #define MD_TRC_XXX(...) DHL_PSTRC_xxx(class, mod_id, msg_index, ##__VA_ARGS__)*/
+}E_UNIFIED_API_PARAM_TYPE;
+
+typedef enum
+{
+    UNIFIED_API_PARAM_NUM_index,
+    UNIFIED_API_PARAM_NUM_sys= 1,       /*fmt*/
+    UNIFIED_API_PARAM_NUM_string= 1,    /*str*/
+    UNIFIED_API_PARAM_NUM_raw= 2,      /*raw_data_len,pRaw_data*/
+    UNIFIED_API_PARAM_NUM_ota = 3       /*peer_msg_id,raw_data_len,pRaw_data*/
+}E_UNIFIED_API_PARAM_NUM;
+
+/* for expand trace API's user argument macro. */
+#define MD_TRC_EXPAND(x) x
+/*
+ * if there's only one argument, expands to nothing.  if there is more
+ * than one argument, expands to a comma followed by everything but
+ * the first argument.  only supports up to 128 arguments but can be
+ * trivially expanded.
+ */
+#if defined(__MTK_TARGET__)
+#define VA_ARG_FUNC(...) VA_ARG_HELPER(NUM_ARG(__VA_ARGS__), __VA_ARGS__)
+#define VA_ARG_HELPER(qty, ...) VA_ARG_HELPER2(qty, __VA_ARGS__)
+#define VA_ARG_HELPER2(qty, ...) VA_ARG_HELPER_##qty(__VA_ARGS__)
+#define VA_ARG_HELPER__ZERO(...)
+#define VA_ARG_HELPER__ONE(...) , __VA_ARGS__
+#define VA_ARG_HELPER_MORE_TRACE_ARGUMENTS(...) , __VA_ARGS__
+#define VA_ARG_HELPER_ONEORZERO_TRACE_ARGUMENT(...) VA_ARG_ONEORZERO_TRACE_ARGUMENT(CHECK_IS_EMPTY_ARG(__VA_ARGS__), __VA_ARGS__) 
+#define NUM_ARG(...) SELECT_SIZE( __VA_ARGS__ , \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, ONEORZERO_TRACE_ARGUMENT)
+
+#define SELECT_SIZE(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17,\
+                    a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33,\
+                    a34, a35, a36, a37, a38, a39, a40, a41, a42, a43, a44, a45, a46, a47, a48, a49,\
+                    a50, a51, a52, a53, a54, a55, a56, a57, a58, a59, a60, a61, a62, a63, a64, a65,\
+                    a66, a67, a68, a69, a70, a71, a72, a73, a74, a75, a76, a77, a78, a79, a80, a81,\
+                    a82, a83, a84, a85, a86, a87, a88, a89, a90, a91, a92, a93, a94, a95, a96, a97,\
+                    a98, a99, a100, a101, a102, a103, a104, a105, a106, a107, a108, a109, a110, a111,\
+                    a112, a113, a114, a115, a116, a117, a118, a119, a120, a121, a122, a123, a124,\
+                    a125, a126, a127, a128, ...) a128
+#define VA_ARG_ONEORZERO_TRACE_ARGUMENT(qty, ...) VA_ARG_ONEORZERO_TRACE_ARGUMENT_DISPATCH(qty, __VA_ARGS__)
+#define VA_ARG_ONEORZERO_TRACE_ARGUMENT_DISPATCH(qty, ...) VA_ARG_HELPER__##qty(__VA_ARGS__)
+#define SELECT_3TH(a0, a1, a2, ...) a2
+#define _TRIGER_PARA_(...) RECHECK_PARENTHESSES_1 __VA_ARGS__ ()
+/*for remove user's parenthesses*/
+#define RECHECK_PARENTHESSES_1(...)  RECHECK_PARENTHESSES_2 __VA_ARGS__ ()
+#define RECHECK_PARENTHESSES_2(...)  RECHECK_PARENTHESSES_3 __VA_ARGS__ ()
+#define RECHECK_PARENTHESSES_3(...)  RECHECK_PARENTHESSES_4 __VA_ARGS__ ()
+#define RECHECK_PARENTHESSES_4(...)  RECHECK_PARENTHESSES_5 __VA_ARGS__ ()
+#define RECHECK_PARENTHESSES_5()     ,
+#define EMPTY_ARG_DISAPTCH(...) SELECT_3TH(__VA_ARGS__ , ZERO, ONE, ...)
+#define CHECK_IS_EMPTY_ARG(...) EMPTY_ARG_DISAPTCH(_TRIGER_PARA_ __VA_ARGS__ ())
+#else
+#define VA_ARG_FUNC(...) ,##__VA_ARGS__
+#endif
+/**
+* \param ... value follow trace format in trace definition to input value
+* \par Sample code
+* json file trace definition: HELLO_INDEX_TRACE
+* \code{.c}
+* kal_uint32 val1 = 1;
+* kal_uint32 val2 = 2;
+* MD_TRC_HELLO_INDEX_TRACE(val1, val2);
+*/
+//#define DHL_PSTRC_FUNC_ARG_index
+
+/**
+* \param raw_data_len is the size of the memory region
+* \param pRaw_data pointer th the address of memory region
+* \par Sample code
+* json file trace definition: HELLO_RAW_TRACE
+* \code{.c}
+* kal_uint32 valArray[5] = {1,2,3,4,5};
+* MD_TRC_HELLO_RAW_TRACE(5, valArray);
+*/
+#define DHL_PSTRC_FUNC_ARG_raw raw_data_len,pRaw_data
+
+/**
+* \param fmt is string of output log
+* \param ... parameter of string
+* \par Sample code
+* json file trace definition: HELLO_PRINT
+* \code{.c}
+* MD_TRC_HELLO_PRINT("hello %d,%d", 1,2);
+*/
+#define DHL_PSTRC_FUNC_ARG_string fmt
+
+/**
+* \param str is string of output log
+* \par Sample code
+* \code{.c}
+* MD_TRC_HELLO_SYS("hello trace");
+*/
+#define DHL_PSTRC_FUNC_ARG_sys str
+
+/**
+* \param peer_msg_id value follow prinitive structure format in prinitive definition to input value
+* \param raw_data_len prinitive structure size
+* \param pRaw_data pointer to data
+* \par Sample code
+* json file trace definition: HELLO_PEER_TRACE
+* \code{.c}
+* MD_TRC_HELLO_PEER_TRACE(peer_msg_id, raw_data_len, pRaw_data);
+*/
+#define DHL_PSTRC_FUNC_ARG_ota peer_msg_id,raw_data_len,pRaw_data
+
+#define DHL_PSTRC_index      _dhl_index_trace
+#define DHL_PSTRC_raw        _dhl_raw_trace
+#define DHL_PSTRC_string     _dhl_string_trace
+#define DHL_PSTRC_sys        _dhl_sys_trace
+#define DHL_PSTRC_ota        _dhl_ota_trace
+
+/* Unified Trace wrapper API */
+void _dhl_index_trace(kal_uint8 trc_class, module_type mod_id, kal_uint32 msg_index, const kal_char *arg_type, ...);
+void _dhl_index_trace_vl(kal_uint8 trc_class, module_type mod_id, kal_uint32 msg_index, const kal_char *arg_type, va_list arg_list);
+void _dhl_raw_trace(kal_uint8 trc_class, module_type mod_id, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 raw_data_len, const kal_uint8 *pRaw_data, ...);
+void _dhl_string_trace(kal_uint8 trc_class, module_type mod_id, kal_uint32 msg_index, const kal_char *arg_type, const char *fmt, ...);
+void _dhl_sys_trace(kal_uint8 trc_class, module_type mod_id, kal_uint32 msg_index, const kal_char *arg_type, const char *str, ...);
+void _dhl_ota_trace(kal_uint8 trc_class, module_type mod_id, kal_uint32 msg_index, const kal_char *arg_type, kal_uint32 peer_msg_id, kal_uint32 raw_data_len, kal_uint8 *pRaw_data, ...);
+
+#if defined(__DHL_LEGACY_TRACE_WRAPPER_TEST__)
+#define dhl_trace(trc_class, ...) _dhl_index_trace(trc_class, ##__VA_ARGS__)
+#define dhl_raw_trace(trc_class, ...) _dhl_raw_trace(trc_class, ##__VA_ARGS__)
+#define dhl_brief_trace(trc_class, ...) dhl_trace(trc_class, ##__VA_ARGS__)
+#define dhl_brief_trace_opt_helper(...) dhl_trace(__VA_ARGS__)
+#define dhl_internal_trace(trc_class, flag, level, msg_id, ...) dhl_trace(trc_class, flag, msg_id, ##__VA_ARGS__)
+#define dhl_peer_trace(...) _dhl_ota_trace(TRACE_PEER, 0, __VA_ARGS__)
+
+#define kal_trace(trc_class, ...) dhl_trace(trc_class, 0, ##__VA_ARGS__)
+#define kal_brief_trace(trc_class, ...) dhl_trace(trc_class, 0, ##__VA_ARGS__)
+#define kal_lib_trace(...) kal_trace(__VA_ARGS__)
+#define kal_assert_trace(...) kal_trace(__VA_ARGS__)
+#define kal_dev_trace(...) kal_trace(__VA_ARGS__)
+#define kal_buffer_trace(trc_class, msg_index, ...) _dhl_raw_trace(trc_class, 0, msg_index, ##__VA_ARGS__)
+extern kal_bool tst_is_PsTrc_open_and_pstrace_flag;  //For optimization, the AND flag of tst_is_PsTrc_open and tst_pstrace_flag
+#define kal_brief_trace_macro(trc_class, msg_index, ...) do { \
+    if (tst_is_PsTrc_open_and_pstrace_flag) {\
+        dhl_brief_trace_opt_helper(trc_class, DHL_USER_FLAG_NONE, msg_index, ##__VA_ARGS__); \
+    } \
+    } while(0)
+#define _kal_trace(...) kal_trace(__VA_ARGS__)
+#define _kal_brief_trace(...) kal_trace(__VA_ARGS__)
+
+#endif //(__DHL_LEGACY_TRACE_WRAPPER_TEST__)
+
+#define MD_TRC(TRACE_NAME, ...) MD_TRC_##TRACE_NAME(__VA_ARGS__)
+#endif // #if !defined(__MAUI_BASIC__)
+#endif /* _DHL_UNIFIED_TRACE_H */
+
diff --git a/mcu/interface/service/dhl/v1/dsp_logging.h b/mcu/interface/service/dhl/v1/dsp_logging.h
new file mode 100644
index 0000000..6850a5f
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/dsp_logging.h
@@ -0,0 +1,57 @@
+#ifndef _DSP_LOGGING_H
+#define _DSP_LOGGING_H
+
+#if defined(__MAUI_BASIC__)
+#define Dsp_Logging_Init()
+#else
+#if defined(__MTK_TARGET__)
+#include "dhl_def.h"
+#include "kal_public_defs.h"
+#include "kal_public_api.h"
+#include "kal_internal_def.h"
+#include "dhl_trace.h"
+
+/*---------------------------------------------------------------------------
+    Enum definition
+---------------------------------------------------------------------------*/
+typedef enum
+{
+    ULSP_DSP_REDUMP_START,
+    ULSP_DSP_REDUMP_END
+} ULSP_DSP_REDUMP_TYPE;
+
+typedef enum
+{
+    USIP0_INNER,
+    USIP0_BRP,
+    USIP1_FEC,
+    USIP1_SPEECH,
+    RAKE,
+    SCQ16_0,
+    SCQ16_1,
+    DSP_CORE_NUMBER
+} dsp_core_enum; //This enum order cannot be changed. (Dsp_Logging_Init also uses this enum)
+
+/*---------------------------------------------------------------------------
+    Funtion prototype
+---------------------------------------------------------------------------*/
+void Dsp_Logging_Init();
+void Dsp_Logging_Init_By_Core(dsp_core_enum core);
+void Dsp_Set_Filter(dhl_cmd_set_dsp_filter_struct *dsp_filter_from_elt);
+void Dsp_Set_Filter_Imp();
+void Dsp_Set_RAKE_Filter();
+void Dsp_Backup_Clear_All_Filter();
+void Dsp_Restore_Filter();
+
+kal_uint32 Get_Cxif_Address(dsp_core_enum core);
+void Save_Filter_To_Cxif(dsp_core_enum core);
+void Print_Filter_Setting(dhl_cmd_set_dsp_filter_struct *filter_setting);
+void redump_dsp_log(ULSP_DSP_REDUMP_TYPE redump_type);
+kal_uint8 Check_Dsp_Abort_Timeout();
+void ULSP_Lock_DSP_Power(kal_bool flag);
+void Ulsp_Check_If_Unlock_DSP_power();
+void Force_DSP_Filter_CUIF_On();
+
+#endif // __MTK_TARGET__
+#endif // __MAUI_BASIC__
+#endif // _DSP_LOGGING_H
diff --git a/mcu/interface/service/dhl/v1/dspsys_statistics.h b/mcu/interface/service/dhl/v1/dspsys_statistics.h
new file mode 100644
index 0000000..9aabbc3
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/dspsys_statistics.h
@@ -0,0 +1,104 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   dspsys_statistics.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   This file provides the DSP system statistics definition
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ * 	     Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ * 05 07 2014 eason.lai
+ * [MOLY00064969] [DHL]expand tab to 4 spaces to have better typesettings
+ * .
+ *
+ * 11 07 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * dhl module check-in.
+ ****************************************************************************/
+
+#ifndef __DSPSYS_STATISTICS_H__
+#define __DSPSYS_STATISTICS_H__
+
+//#include "stack_buff_pool.h"
+//#include "ctrl_buff_pool.h"
+#include "sysconf_statistics.h"
+/*RHR*/
+#include "kal_general_types.h"
+/*RHR*/
+
+/* The defines for dspsys_stat_status */
+enum
+{
+    DSPSYS_STATS_NONE,
+    DSPSYS_STATS_UPDATE,
+    DSPSYS_STATS_END
+};
+
+/* The structure for dsp sysytem statistics record */
+typedef struct dspsys_stat_t
+{
+    kal_uint16 stack_stats_status;                                    /* Statistics record status */
+    kal_uint8  dspsys_stat[DSPSYS_STAT_DATA_LEN - sizeof(kal_uint16)]; /* keep the total length to be  DSPSYSY_STAT_DATA_LEN*/
+} dspsys_stat_structure;
+
+
+extern kal_bool get_dspsys_stat(void *dspsys_stat_data);
+extern void init_dspsys_stat(void);
+
+
+#endif /* __DSPSYS_STATISTICS_H__ */
+
diff --git a/mcu/interface/service/dhl/v1/kal_trace.h b/mcu/interface/service/dhl/v1/kal_trace.h
new file mode 100644
index 0000000..c5d0318
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/kal_trace.h
@@ -0,0 +1,1039 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2005
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ *   kal_trace.h
+ *
+ * Project:
+ * --------
+ *   Maui_Software
+ *
+ * Description:
+ * ------------
+ *   This file provides typedefs and definiton for PS index trace.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ *             HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+#ifndef _KAL_TRACE_H
+#define _KAL_TRACE_H
+
+#include "dhl_unified_trace.h"
+#if defined(__DHL_MODULE__)
+#else
+
+#include <stdarg.h>
+#ifndef GEN_FOR_PC
+#include <stdio.h>
+#endif
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+#if defined(__MTK_TARGET__) && !defined(__GNUC__)
+#pragma diag_suppress 870
+#endif  //#ifdef __MTK_TARGET__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(__TST_MODULE__) && defined(__EM_MODE__) /* for ilm_struct type definition */
+#ifndef GEN_FOR_PC
+struct ilm_struct;
+extern void tst_EM_logger(struct ilm_struct *ilm_ptr);
+#if defined(__DHL_MODULE__)
+extern void dhl_EM_logger(struct ilm_struct *ilm_ptr);
+#endif
+#endif
+#endif  //#if defined(__TST_MODULE__) && defined(__EM_MODE__)
+
+#if !defined(__DHL_MODULE__)
+#define dhl_trace(...)
+#define dhl_internal_trace(...)
+#define dhl_brief_trace(...)
+#define dhl_peer_trace(...)
+#define dhl_raw_trace(...)
+#define dhl_print(...)
+#define dhl_print_string(...)
+#define dhl_print_system_trace(...)
+
+#define dhl_print_struct(...)
+#define dhl_debug_print(...)
+
+#define dhl_trace_impl(...)
+#define dhl_internal_trace_impl(...)
+#define dhl_print_impl(...)
+#define dhl_EM_logger(...)
+#endif //#if !defined(__DHL_MODULE__)
+
+#define MAX_MSG_NBR_IN_MODULE       20
+#define ADDITIONAL_BUFFER_FOR_MUX   45
+#define DEFAULT_RS232_FRAME_SIZE    5                 /* STX, LenHi, LenLo, Type, Checksum*/
+#define SAP_LOCAL_PARA_FILTER       0x02
+#define SAP_PEER_BUFF_FILTER        0x04
+
+#define STX_OCTET                   0x55
+#define LOGGED_PRIMITIVE_TYPE       0x60
+#define PS_TRACE_INDEX_TRACE_TYPE   0x61
+#define PS_PROMPT_TRACE_TYPE        0x62
+#define CONTROL_COMMAND_TYPE        0x63
+#define INJECT_PRIMITIVE_TYPE       0x64
+#define SYS_TRACE_TYPE              0x65
+
+//Define Trace Macro for PS trace
+#if defined(GEN_FOR_PC) && !defined(GEN_FOR_CPARSER)
+#define BEGIN_TRACE_MAP(MOD)     START_MODULE_MSG MOD MAX_MSG_NBR_IN_MODULE
+#define BEGIN_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL) START_RANGE_MODULE_MSG MOD MAX_MSG_NBR_IN_MODULE MIN_VAL MAX_VAL
+#define TRC_MSG(MSG,STR)         MSG STR
+#define TRC_MSG_NEWLINE(MSG,STR,NUM)         MSG STR NUM
+#define END_TRACE_MAP(MOD)       END_MODULE_MSG
+#define END_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL)   MOD MIN_VAL MAX_VAL END_RANGE_MODULE_MSG
+#else //Define Trace Macro for PS trace
+#define BEGIN_TRACE_MAP(MOD)     enum MOD##_MSG_ENUM{\
+    MOD##_empty_string=MOD<<MAX_MSG_NBR_IN_MODULE,
+#define BEGIN_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL) enum MOD##_##MIN_VAL##_MSG_ENUM{\
+    MOD##_##MIN_VAL##_empty_string = (MOD<<MAX_MSG_NBR_IN_MODULE) + MIN_VAL - 1,
+#define TRC_MSG(MSG,STR)         MSG##__enum,
+#define TRC_MSG_NEWLINE(MSG,STR,NUM)         MSG##__enum, MSG##_NEWLINE_EXPAND__enum = MSG##__enum+NUM,
+#define  END_TRACE_MAP(MOD)      MOD##__end};
+#define  END_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL)  MOD##_##MIN_VAL##__end};
+#endif //Define Trace Macro for PS trace
+
+
+//Decide which path should enter
+#ifdef __TST_MODULE__
+#if !defined(__FUE__) && !defined(__UBL__)
+#if !defined(MODULE_TRACE_OFF)
+#define __TST_TRACE_ENABLED__
+#elif defined(__TST_CRITICAL_TRACE_LEVEL__) //__PRIORITY_TRACING_ENABLED__ should be disabled in MoDIS      
+#define __TST_CRITICAL_TRACE_ENABLED__
+#endif  //!defined(MODULE_TRACE_OFF) && 
+#endif
+#endif  //#ifdef __TST_MODULE__
+
+#ifndef __TST_TRACE_ENABLED__
+#if defined(KAL_ON_OSCAR) || defined(MCD_DLL_EXPORT) || defined(L1_SIM)
+#define __TST_TRACE_EMPTY_FUNCTION__
+
+#if defined(__TST_CRITICAL_TRACE_ENABLED__)
+#undef __TST_CRITICAL_TRACE_ENABLED__
+#endif  //__TST_CRITICAL_TRACE_ENABLED__
+#endif  //#if defined(KAL_ON_OSCAR) || defined(MCD_DLL_EXPORT) || defined(L1_SIM)
+#endif
+
+
+#if !defined(__TST_CRITICAL_TRACE_ENABLED__) || defined(GEN_FOR_PC)
+typedef enum
+{
+    TRACE_FUNC,
+    TRACE_STATE,
+    TRACE_INFO,
+    TRACE_WARNING,
+    TRACE_ERROR,
+    TRACE_GROUP_1,
+    TRACE_GROUP_2,
+    TRACE_GROUP_3,
+    TRACE_GROUP_4,
+    TRACE_GROUP_5,
+    TRACE_GROUP_6,
+    TRACE_GROUP_7,
+    TRACE_GROUP_8,
+    TRACE_GROUP_9,
+    TRACE_GROUP_10,
+    TRACE_PEER
+} trace_class_enum;
+
+
+typedef enum
+{
+    DHL_CUSTOM_MEM_PMIC,
+    DHL_CUSTOM_MEM_MAX
+} DHL_CUSTOM_MEM_TYPE;
+
+#else   //__TST_CRITICAL_TRACE_ENABLED__
+typedef unsigned char trace_class_enum;
+#endif  //__TST_CRITICAL_TRACE_ENABLED__
+
+
+#if defined(__TST_TRACE_ENABLED__)
+#define kal_print_string_trace kal_wap_trace  //alias kal_print_string_trace as kal_wap_trace
+//#define kal_critical_trace kal_trace
+//#define kal_critical_brief_trace kal_brief_trace
+//#define kal_critical_assert_trace kal_assert_trace
+extern void kal_critical_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_critical_brief_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_critical_assert_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+
+/*******************************************************************************
+* <GROUP Functions>
+*
+* FUNCTION
+*  kal_trace
+* DESCRIPTION
+*  This function is used to output the pre-defined trace to PC.
+*  The engineers SHOULD define their own traces before using this function.
+*  If a trace is defined as ��Today is %d-$d-%d��, kal_trace simply sends the trace ID and the content of %d to PC.
+*  That will reduce the communication traffic. In the chapter 2, we will introduce how to ass a new trace.
+*
+*
+* Property:
+*��    ��Message Compression�� type API
+*��    Cannot be invoked in LISR/HISR context.
+*��    Can send up to 128 bytes parameters
+*��    Suggested to use this API for most of the scenario.
+*
+* PARAMETERS
+*  trc_class: [IN] The trace class of this trace. Each module has 15 classes to category.
+*  msg_index: [IN] Message index. This part will be handled by tool.
+*  arg_type:  [IN] This part will be handled by tool.
+*  ...: [IN] Parameters to log
+* RETURNS
+*  NONE
+* NOTE
+*
+******************************************************************************/
+extern void kal_trace_for_3rd_party(trace_class_enum, kal_uint32, const kal_char *, va_list);
+extern void kal_lib_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_assert_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_wap_trace(module_type mod_id, trace_class_enum trc_class, const char *fmt, ...);
+extern void kal_buffer_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 buf_len, const kal_uint8 *pData);
+extern void kal_dev_trace(trace_class_enum trc_class, kal_uint32 msg_index, const char *arg_type, ...);
+extern void kal_bootup_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_brief_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+
+#define __TST_OPTIMIZATION_FOR_SPEED__ //Default enable in MOLY 
+
+#ifdef __TST_OPTIMIZATION_FOR_SPEED__  //Optimization, kal_brief_trace_macro definition
+
+#if !defined(_MSC_VER)
+
+//Target build
+extern kal_bool tst_is_PsTrc_open_and_pstrace_flag;  //For optimization, the AND flag of tst_is_PsTrc_open and tst_pstrace_flag
+extern void kal_brief_trace_opt_helper(trace_class_enum trc_class, kal_uint32 msg_index, const char *arg_type, ...);
+
+#define kal_brief_trace_macro(trc_class, msg_index,...) do{\
+    if(tst_is_PsTrc_open_and_pstrace_flag){\
+        kal_brief_trace_opt_helper(trc_class, msg_index, ##__VA_ARGS__);\
+    }\
+    }while(0)
+
+#else
+
+//PC build (MoDIS or MCDDLL)
+extern void kal_trace_macro(trace_class_enum, kal_uint32, const kal_char *, ...);
+
+#endif
+
+#else //__TST_OPTIMIZATION_FOR_SPEED__
+
+#if !defined(_MSC_VER)
+
+//Target build
+#define kal_brief_trace_macro(...)     kal_brief_trace(__VA_ARGS__)
+
+#else
+
+//PC build (MoDIS or MCDDLL)
+extern void kal_trace_macro(trace_class_enum, kal_uint32, const kal_char *, ...);
+
+#endif
+
+#endif //__TST_OPTIMIZATION_FOR_SPEED__
+
+
+#else //__TST_TRACE_ENABLED__
+#if defined(__TST_TRACE_EMPTY_FUNCTION__)
+/*
+* For non-target platform (PC simulator or MNT),
+* we define trace-related functions as inline function to avoid compile error
+* in VC++.
+*/
+
+static __inline void kal_critical_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_critical_brief_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+static __inline void kal_critical_assert_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_brief_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_trace_for_3rd_party(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, va_list argument_info)
+{
+    return ;
+}
+
+static __inline void kal_lib_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+static __inline void kal_assert_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+static __inline void kal_wap_trace(module_type mod_id, trace_class_enum trc_class, const char *fmt, ...)
+{
+    return ;
+}
+static __inline void kal_print_string_trace(module_type mod_id, trace_class_enum trc_class, const char *fmt, ...)
+{
+    return ;
+}
+
+static __inline void kal_buffer_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 buf_len, const kal_uint8 *pData)
+{
+    return;
+}
+
+static __inline void kal_dev_trace(trace_class_enum trc_class, kal_uint32 msg_index, const char *arg_type, ...)
+{
+    return;
+}
+
+static __inline void kal_bootup_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_brief_trace_macro(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+#elif defined(__TST_CRITICAL_TRACE_ENABLED__)
+//Support partial tracing API enable
+extern void kal_critical_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_critical_brief_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_critical_assert_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+
+#define kal_trace(...)
+#define kal_brief_trace(...)
+#define kal_trace_for_3rd_party(...)
+#define kal_lib_trace(...)
+#define kal_assert_trace(...)
+#define kal_wap_trace(...)
+#define kal_print_string_trace(...)
+#define kal_buffer_trace(...)
+#define kal_dev_trace(...)
+#define kal_bootup_trace(...)
+#define kal_brief_trace_macro(...)
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 0
+
+#define TRACE_FUNC 0
+#define TRACE_STATE 1
+#define TRACE_INFO 2
+#define TRACE_WARNING 3
+#define TRACE_ERROR 4
+#define TRACE_GROUP_1 5
+#define TRACE_GROUP_2 6
+#define TRACE_GROUP_3 7
+#define TRACE_GROUP_4 8
+#define TRACE_GROUP_5 9
+#define TRACE_GROUP_6 10
+#define TRACE_GROUP_7 11
+#define TRACE_GROUP_8 12
+#define TRACE_GROUP_9 13
+#define TRACE_GROUP_10 14
+#define TRACE_PEER 15
+
+#undef kal_trace
+#undef kal_brief_trace
+
+#define _kal_trace(trace_class_enum, ...) kal_critical_trace_##trace_class_enum(trace_class_enum, __VA_ARGS__)
+#define _kal_brief_trace(trace_class_enum, ...) kal_critical_brief_trace_##trace_class_enum(trace_class_enum, __VA_ARGS__)
+
+#define kal_trace(trace_class_enum, ...) _kal_trace(trace_class_enum, __VA_ARGS__)
+#define kal_brief_trace(trace_class_enum, ...) _kal_brief_trace(trace_class_enum, __VA_ARGS__)
+#define kal_brief_trace_macro(trace_class_enum, ...) _kal_brief_trace(trace_class_enum, __VA_ARGS__)
+
+//#define kal_assert_trace_(trace_class_enum, ...) kal_critical_assert_trace_##trace_class_enum(__VA_ARGS__)
+
+//declare the empty defined
+#define kal_critical_trace_0(...)
+#define kal_critical_trace_1(...)
+#define kal_critical_trace_2(...)
+#define kal_critical_trace_3(...)
+#define kal_critical_trace_5(...)
+#define kal_critical_trace_6(...)
+#define kal_critical_trace_7(...)
+#define kal_critical_trace_8(...)
+#define kal_critical_trace_9(...)
+#define kal_critical_trace_10(...)
+#define kal_critical_trace_11(...)
+#define kal_critical_trace_12(...)
+#define kal_critical_trace_13(...)
+#define kal_critical_trace_14(...)
+#define kal_critical_trace_15(...)
+
+#define kal_critical_brief_trace_0(...)
+#define kal_critical_brief_trace_1(...)
+#define kal_critical_brief_trace_2(...)
+#define kal_critical_brief_trace_3(...)
+#define kal_critical_brief_trace_5(...)
+#define kal_critical_brief_trace_6(...)
+#define kal_critical_brief_trace_7(...)
+#define kal_critical_brief_trace_8(...)
+#define kal_critical_brief_trace_9(...)
+#define kal_critical_brief_trace_10(...)
+#define kal_critical_brief_trace_11(...)
+#define kal_critical_brief_trace_12(...)
+#define kal_critical_brief_trace_13(...)
+#define kal_critical_brief_trace_14(...)
+#define kal_critical_brief_trace_15(...)
+
+//ignore the known issues, wrap logging APIs in other APIs
+#define kal_critical_trace_trc_class(...)
+#define kal_critical_brief_trace_trc_class(...)
+
+//define ERROR --> 4
+#define kal_critical_trace_4 kal_critical_trace
+#define kal_critical_brief_trace_4 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 1
+//define WARNING 3
+#undef kal_critical_trace_3
+#undef kal_critical_brief_trace_3
+#define kal_critical_trace_3 kal_critical_trace
+#define kal_critical_brief_trace_3 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 2
+//define TRACE_STATE 1
+#undef kal_critical_trace_1
+#undef kal_critical_brief_trace_1
+#define kal_critical_trace_1 kal_critical_trace
+#define kal_critical_brief_trace_1 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 3
+//define TRACE_INFO 2
+#undef kal_critical_trace_2
+#undef kal_critical_brief_trace_2
+#define kal_critical_trace_2 kal_critical_trace
+#define kal_critical_brief_trace_2 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 4
+//#define TRACE_PEER 15
+#undef kal_critical_trace_15
+#undef kal_critical_brief_trace_15
+#define kal_critical_trace_15 kal_critical_trace
+#define kal_critical_brief_trace_15 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 5
+//#define TRACE_GROUP_1 5
+#undef kal_critical_trace_5
+#undef kal_critical_brief_trace_5
+#define kal_critical_trace_5 kal_critical_trace
+#define kal_critical_brief_trace_5 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 6
+//#define TRACE_GROUP_2 6
+#undef kal_critical_trace_6
+#undef kal_critical_brief_trace_6
+#define kal_critical_trace_6 kal_critical_trace
+#define kal_critical_brief_trace_6 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 7
+//#define TRACE_GROUP_3 7
+#undef kal_critical_trace_7
+#undef kal_critical_brief_trace_7
+#define kal_critical_trace_7 kal_critical_trace
+#define kal_critical_brief_trace_7 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 8
+//#define TRACE_GROUP_4 8
+#undef kal_critical_trace_8
+#undef kal_critical_brief_trace_8
+#define kal_critical_trace_8 kal_critical_trace
+#define kal_critical_brief_trace_8 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 9
+//#define TRACE_GROUP_5 9
+#undef kal_critical_trace_9
+#undef kal_critical_brief_trace_9
+#define kal_critical_trace_9 kal_critical_trace
+#define kal_critical_brief_trace_9 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 10
+//#define TRACE_GROUP_6 10
+#undef kal_critical_trace_10
+#undef kal_critical_brief_trace_10
+#define kal_critical_trace_10 kal_critical_trace
+#define kal_critical_brief_trace_10 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 11
+//#define TRACE_GROUP_7 11
+#undef kal_critical_trace_11
+#undef kal_critical_brief_trace_11
+#define kal_critical_trace_11 kal_critical_trace
+#define kal_critical_brief_trace_11 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 12
+//#define TRACE_GROUP_8 12
+#undef kal_critical_trace_12
+#undef kal_critical_brief_trace_12
+#define kal_critical_trace_12 kal_critical_trace
+#define kal_critical_brief_trace_12 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 13
+//#define TRACE_GROUP_9 13
+#undef kal_critical_trace_13
+#undef kal_critical_brief_trace_13
+#define kal_critical_trace_13 kal_critical_trace
+#define kal_critical_brief_trace_13 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 14
+//#define TRACE_GROUP_10 14
+#undef kal_critical_trace_14
+#undef kal_critical_brief_trace_14
+#define kal_critical_trace_14 kal_critical_trace
+#define kal_critical_brief_trace_14 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 15
+//#define TRACE_FUNC 0
+#undef kal_critical_trace_0
+#undef kal_critical_brief_trace_0
+#define kal_critical_trace_0 kal_critical_trace
+#define kal_critical_brief_trace_0 kal_critical_brief_trace
+#endif
+
+#else  // #if defined(__TST_TRACE_EMPTY_FUNCTION__)
+//Define empty functions for Target SW
+#define kal_trace(...)
+#define kal_brief_trace(...)
+#define kal_trace_for_3rd_party(...)
+#define kal_lib_trace(...)
+#define kal_assert_trace(...)
+#define kal_wap_trace(...)
+#define kal_print_string_trace(...)
+#define kal_buffer_trace(...)
+#define kal_dev_trace(...)
+#define kal_bootup_trace(...)
+#define kal_critical_trace(...)
+#define kal_critical_brief_trace(...)
+#define kal_critical_assert_trace(...)
+#define kal_brief_trace_macro(...)
+#endif   // #if defined(__TST_TRACE_EMPTY_FUNCTION__)
+#endif  //__TST_TRACE_ENABLED__
+
+#define kal_sys_trace        tst_sys_trace
+#define kal_sys_init_trace   tst_sys_init_trace
+#define kal_sys_fatal_trace  tst_sysfatal_trace
+
+#ifdef __TST_MODULE__
+/*******************************************************************************
+* <GROUP Functions>
+*
+* FUNCTION
+*  kal_prompt_trace
+* DESCRIPTION
+*  It's a printf-like function which outputs log to Catcher Tool.
+*  Property:
+*  The message is sent in plaintext
+*��    Cannot be invoked in LISR context.
+*��    Can send up to 128 bytes logs
+*��    This API can only be used in customer side to reduce the impact of ROM size increase.
+*��    Heavy resource consumption.
+*��      a.Caller��s RO-DATA
+*��        b. Logging Bandwidth
+*
+* PARAMETERS
+*  mod_id: [IN] Module id
+*  fmt: [IN] The format string. Please refer to print function of C standard library.
+* RETURNS
+*  NONE
+* NOTE
+*
+******************************************************************************/
+extern void kal_prompt_trace(module_type mod_id, const kal_char *fmt, ...);
+extern void tst_sys_init_trace(const kal_char *info);
+extern void tst_sys_trace(kal_char *info);
+extern void tst_sysfatal_trace(kal_char *info);
+extern kal_int32 tst_trace_check_ps_filter_off(trace_class_enum trc_class, kal_uint32 *module_id, kal_uint32 supportOption);
+
+#define kal_bootup_print tst_sys_init_trace
+#else
+#ifdef __TST_TRACE_EMPTY_FUNCTION__
+static __inline void kal_prompt_trace(module_type mod_id, const kal_char *fmt, ...)
+{
+    return ;
+}
+static __inline void tst_sys_init_trace(const kal_char *info)
+{
+    return ;
+}
+static __inline void tst_sys_trace(kal_char *info)
+{
+    return ;
+}
+static __inline void tst_sysfatal_trace(kal_char *info)
+{
+    return ;
+}
+static __inline kal_int32 tst_trace_check_ps_filter_off(trace_class_enum trc_class, kal_uint32 *module_id, kal_uint32 supportOption)
+{
+    return 0;
+}
+#else
+#define kal_prompt_trace(...)
+#define tst_sys_init_trace(...)
+#define tst_sys_trace(...)
+#define tst_sysfatal_trace(...)
+#define tst_trace_check_ps_filter_off(...)
+#endif
+#endif  //#ifdef __TST_MODULE__
+
+typedef void (*TST_VC_CallBack)(const kal_uint8 *pData, kal_uint32 nLen);
+typedef void (*TST_String_Inject_CB)(kal_uint32 index, kal_uint8 *pData);
+
+/*
+* tst_virtual_channel_id:
+* regiester new virtual channel here and remake tst
+*/
+typedef enum
+{
+    TVCI_GPS_LOGGING,
+    TVCI_DNT_L2COPRO_LOGGING,
+    TVCI_CATCHER_POLLING,
+    TVCI_GDB_COMM,
+    TVCI_AST_LOGGING,
+    TVCI_MINI_LOG,
+    TVCI_VM_LOGGING,
+    TVCI_BTT,
+    TVCI_LAST_ID
+}
+tst_virtual_channel_id;
+
+#define MAX_VC_RESPONSE_LEN (1023)
+
+kal_bool tst_vc_register_channel(tst_virtual_channel_id channel_id, TST_VC_CallBack fnCmd);
+kal_bool tst_vc_response(tst_virtual_channel_id channel_id, const kal_uint8 *pData, kal_uint16 len);
+
+#define TVCI_CREATE_FILE 0x24540001
+#define TVCI_CLOSE_FILE 0x24540002
+
+void tst_log_with_offset_single_gpd(sap_type desc_SAP, sap_type raw_data_sap, kal_uint32 msg_index, const char *arg_type, kal_uint32 offset, kal_uint32 *dl_gpd);
+
+kal_bool tst_save_assert_bypass_trace(kal_char *info);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __LTE_RAT__ */
+
+#endif /* _KAL_TRACE_H */
+
diff --git a/mcu/interface/service/dhl/v1/tst.h b/mcu/interface/service/dhl/v1/tst.h
new file mode 100644
index 0000000..239c755
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/tst.h
@@ -0,0 +1,141 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   tst.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   TST legacy interface
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 05 03 2019 guan-ren.chen
+ * [MOLY00400853] [Gen97] Logging service enhancement
+ * ULSP to SIB path implement.
+ *
+ * 04 21 2019 yh.sung
+ * [MOLY00392990] [VMOLY][UTF] Phase 2 Landing
+ * [UTF][DHL] UTF Trace API - trace interface
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ * 	     Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ * 09 03 2015 cynthia.sun
+ * [MOLY00140141] [MDL] Change DSP filter to a new LID on NVRAM
+ * .
+ *
+ * 02 04 2015 eason.lai
+ * [MOLY00084440] [MT6291][DHL] Patch back UMOLY trunk from MT6291_DEV
+ *  increase filter nvram size
+ *
+ * 06 06 2014 ken.liu
+ * [MOLY00068654] [K2] DHL migration for K2
+ * sync from K2 pre-bringup dev branch.
+ *
+ * 11 15 2013 ken.liu
+ * [MOLY00046623] [MT6290E1][DHL] Add filter on/off control for META tool
+ * add filter on/off control for META tool.
+ *
+ * 07 25 2013 ken.liu
+ * [MOLY00031306] [MT6290E1] DHL mux filter
+ * check-in dhl mux filter support (disabled by default until next ELT release)
+ *
+ * 11 07 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * dhl module check-in.
+ ****************************************************************************/
+
+#ifndef _TST_H
+#define _TST_H
+
+/********************/
+/* Constant definition */
+/********************/
+#if defined(__LTE_RAT__) || defined(__UMTS_RAT__)
+#define TST_L1TRC_FILTER_NUM 50
+#else
+#define TST_L1TRC_FILTER_NUM 40
+#endif  //TST_L1TRC_FILTER_NUM definition
+
+//For world phone projects, we need to have common nvram lid size for both td and fd
+//So, we define the maximal number for both of them
+
+//Willie: We need to consider about NVRAM checksum size (2 byte)
+#define NVRAM_CHECKSUM_SIZE (2)
+#define NVRAM_PEER_BUF_HEADER_SIZE (8)
+#if defined(__LTE_RAT__) || defined(__UMTS_RAT__) || defined(__GSM_RAT__)
+#define NVRAM_EF_TST_FILTER_ALLOCATE_SIZE  (32768-NVRAM_CHECKSUM_SIZE-NVRAM_PEER_BUF_HEADER_SIZE)
+#define NVRAM_EF_DHL_FILTER_ALLOCATE_SIZE  (32768-NVRAM_CHECKSUM_SIZE-NVRAM_PEER_BUF_HEADER_SIZE)
+#define NVRAM_EF_DSP_FILTER_ALLOCATE_SIZE  (4096-NVRAM_CHECKSUM_SIZE-NVRAM_PEER_BUF_HEADER_SIZE)
+#else
+#define NVRAM_EF_TST_FILTER_ALLOCATE_SIZE  (2048-NVRAM_CHECKSUM_SIZE)
+#define NVRAM_EF_DHL_FILTER_ALLOCATE_SIZE  (2048-NVRAM_CHECKSUM_SIZE)
+#define NVRAM_EF_DSP_FILTER_ALLOCATE_SIZE  (2048-NVRAM_CHECKSUM_SIZE)
+#endif
+
+#define NVRAM_EF_DHL_INITIAL_CFG_ALLOCATE_SIZE 512
+
+extern void tst_init_filters(char *src, unsigned short len);
+extern void tst_save_filter_to_nvram(void);
+
+typedef struct
+{
+    kal_bool spare_logging_enabled;
+    kal_bool usb_dma_logging_enable;
+    kal_bool malmo_disable;
+    kal_bool dnt_enable;    //only effective if __TST_LMU_LOGGING__ is not defined
+    kal_uint8 meta_mode_trace_enable; //0: disable, 1: relay, 2: save to file
+}
+tst_config_struct_t;
+
+#endif /* _TST_H */
+
diff --git a/mcu/interface/service/dhl/v1/tst_Catcher_version.h b/mcu/interface/service/dhl/v1/tst_Catcher_version.h
new file mode 100644
index 0000000..8973ef2
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/tst_Catcher_version.h
@@ -0,0 +1,484 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   tst_Catcher_version.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   Version info used by host tool (ELT/Catcher)
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 04 21 2019 yh.sung
+ * [MOLY00392990] [VMOLY][UTF] Phase 2 Landing
+ * [UTF][DHL] UTF Trace API - trace interface
+ *
+ * 07 05 2018 yancy.chien
+ * [MOLY00332776] [Gen95] MD Low Power Montior Development
+ * Add system statistic no peer header enum.
+ *
+ * 06 22 2018 yancy.chien
+ * [MOLY00331449] [Gen97] DHL logging development
+ * 	Migration on UMOLYE.
+ *
+ * 06 21 2018 yancy.chien
+ * [MOLY00332776] [Gen95] MD Low Power Montior Development
+ * Add no_peer_header msg id for LPM
+ *
+ * 05 22 2018 yancy.chien
+ * [MOLY00258174] [Gen95][DHL] logging development.
+ *
+ * 05 14 2018 mojo.lai
+ * [MOLY00325736] ICD 1.26 phase-in
+ * 	
+ * 	.
+ *
+ * 03 15 2018 yancy.chien
+ * [MOLY00313685] [ICD] Interface Control Document
+ * 	V1.25 phase-in.
+ *
+ * 11 03 2017 yancy.chien
+ * [MOLY00258174] [Gen95][DHL] logging development
+ * Merge from DEV branch.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ * 	     Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ * 04 19 2017 yu-hsiang.peng
+ * [MOLY00242860] [6293]EL1 time trace revise in l1trace in ELT
+ * [UMOLYA.TRUNK] elt set as v2.1715.1 and remove EBS init call sp log
+ *
+ * 12 20 2016 cynthia.sun
+ * [MOLY00173325] [MDL] 93 Integration
+ * . VRF memory dump
+ *
+ * 08 12 2016 yu-hsiang.peng
+ * [MOLY00185213] [MT6293] DHL MT6292 SW logging migrate to MT6293 & MT6293 ULSP logging development
+ * UMOLYA.TRUNK]  ULSP Logging release 1. ELT force 35 2. filter setting enable (stage 5)
+ *
+ * 07 11 2016 yu-hsiang.peng
+ * [MOLY00185213] [MT6293] DHL MT6292 SW logging migrate to MT6293 & MT6293 ULSP logging development
+ * Add L1 debug trace & ELT ULSP enum
+ *
+ * 05 26 2016 yancy.chien
+ * [MOLY00181823] [DHL] UMOLY Migrate to UMOLYA
+ * .
+ *
+ * 03 22 2016 eason.lai
+ * [MOLY00170160] [6292/Elbrus][DHL] L1trace HRT enhancement
+ *  force update ELT to v2.1611 for 6 VPE l1trace view
+ *
+ * 02 15 2016 jean.tsao
+ * [MOLY00164902] [UMOLY] Add enum to decide whether peer buffer header exists or not
+ * [UMOLY] Add enum to decide whether peer buffer header exists or not
+ *
+ * 01 26 2016 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *  1. load filter from nvram at task init
+ *  2. exception log dump
+ *
+ * 12 15 2015 eason.lai
+ * [MOLY00152953] [Elbrus][FPGA Regression][L1S_L1DISABLE] boot to idle - failed in dhl_task_init()
+ *  1. L1S_L1DISABLE replaced fma with kal sys tick
+ *  2. MDL init flow added FPGA platform check
+ *
+ * 11 26 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *  update the min version of ELT
+ *
+ * 11 25 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ * refine the xl1sim option in DHL and restore the patch of CL#1796032.
+ *
+ * 11 23 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ * xl1sim introduce SMP DHL
+ *
+ * 10 30 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *
+ *  remove __PCORE__ and __L1CORE__ option
+ *
+ * 10 23 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *
+ *  .
+ *
+ * 10 23 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *
+ *  SMP DHL logging migration
+ *
+ * 07 22 2015 eason.lai
+ * [MOLY00130157] [TK6291][DHL] smart logging migration
+ *  .
+ *
+ * 05 21 2015 eason.lai
+ * [MOLY00115364] [TK6291][DHL] trigger flush depended on log threshold
+ *  1. add log flush threshold
+ *                       2. remove unnecessary ELT db info
+ *                       3. fixed meta mode enable trace event trigger fail case
+ *
+ * 04 27 2015 eason.lai
+ * [MOLY00109573] [TK6291] [DHL] force user update ELT to v2.1515
+ *  .
+ *
+ * 04 01 2015 cynthia.sun
+ * [MOLY00105635] [TK6291][DHL] L1CORE ASM
+ * .
+ *
+ * 11 24 2014 eason.lai
+ * [MOLY00084440] [MT6291][DHL] Patch back UMOLY trunk from MT6291_DEV
+ * FMA global timer
+ *
+ * 11 14 2014 eason.lai
+ * [MOLY00084440] [MT6291][DHL] Patch back UMOLY trunk from MT6291_DEV
+ *  first time patch back
+ *
+ * 08 07 2014 hk.yang
+ * [MOLY00074542] [K2 MD2] make swtr work well on K2 MD2
+ *  Enable SWTR
+ *
+ * 05 07 2014 eason.lai
+ * [MOLY00064969] [DHL]expand tab to 4 spaces to have better typesettings
+ * .
+ *
+ * 03 04 2014 mojo.lai
+ * [MOLY00058206] Add Sim information to database
+ *  .
+ *
+ * 01 21 2014 wcpuser_integrator
+ * [MOLY00054475] SGLTE option rename
+ * .
+ *
+ * 11 08 2013 mojo.lai
+ * [MOLY00043724] Fix klockwork warning
+ *  .
+ *
+ * 10 18 2013 mojo.lai
+ * [MOLY00041595] [MT6290E1][MMDS_DC] MMDC feature patch back to MOLY trunk
+ *  .
+ *
+ * 10 18 2013 mojo.lai
+ * [MOLY00041595] [MT6290E1][MMDS_DC] MMDC feature patch back to MOLY trunk
+ *  .
+ *
+ * 04 03 2013 mojo.lai
+ * [MOLY00009210] TATAKA merge to MOLY
+ * SWTR merge
+ *
+ * 02 04 2013 ken.liu
+ * [MOLY00009212] LTE Multimode merge back to MOLY
+ * rename MT7208 to MT6290.
+ *
+ * 11 07 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * dhl module check-in.
+ ****************************************************************************/
+
+#ifndef __TST_CATCHER_VERSION_H__
+#define __TST_CATCHER_VERSION_H__
+
+#if defined (L1_SIM)
+#if (defined(__MTK_TARGET__) && !defined(__MAUI_BASIC__))
+#define __MAUI_SOFTWARE_TRACER__
+#endif
+#else
+#include "swtr.h"   // for __MAUI_SOFTWARE_TRACER__ definition
+#include "us_timer.h"   // for __HW_US_TIMER_SUPPORT__ definition
+#endif
+
+#if defined(GEN_FOR_PC)
+
+//This structure is for Catcher usage only
+//Catcher owners should update these enum if they would like keep some information into the database.
+
+#include "global_def.h"
+
+typedef enum
+{
+    Catcher_Info_Enum_Begin,
+    //Please add content here
+
+    //Common indications
+    CATCHER_NEW_DESCR_INFO_STRUCT,
+    CATCHER_TST_END_REDUMP_TRACE,
+    CATCHER_DB_ON_MD_ARM,
+
+    //General Optional indications
+#if defined(__UMTS_RAT__)
+    CATCHER_L1_TIMESTAMP,                  // support timestamp packed in all L1 frames
+#endif  //#if defined(__UMTS_RAT__)
+
+    CATCHER_STATISTICS_STRING_REPLACING,   // support Statistics and FLC string replacing
+
+#ifdef __EM_MODE__
+    CATCHER_ENGINEERING_MODE_INDEPENDENT_UPDATE,
+#endif  //#ifdef __EM_MODE__
+
+
+#if defined(MTK_SLEEP_ENABLE)
+#if defined(__EGPRS_MODE__)||defined(__SMART_PHONE_MODEM__)||defined(__UMTS_RAT__)
+    FORCE_CATCHER_XON,
+#endif  //#if defined(__EGPRS_MODE__)||defined(__SMART_PHONE_MODEM__)||defined(__UMTS_RAT__)
+#endif  //#if defined(MTK_SLEEP_ENABLE)  
+
+#if defined(__UMTS_RAT__)
+    CATCHER_UL1_TIMESTAMP,                  // support RTOS_TimeStamp in UL1 Time Trace
+#else
+    CATCHER_L1_TIMESTAMP_SIM1,
+#endif  //#if defined(__UMTS_RAT__)  
+
+
+#if defined(__MAUI_SOFTWARE_TRACER__)
+    CATCHER_SW_TRACER_ENABLE,
+#else   //#if defined(__MAUI_SOFTWARE_TRACER__)
+    CATCHER_SW_TRACER_DISABLE,
+#endif  //#if defined(__MAUI_SOFTWARE_TRACER__)
+
+    //MTK Internal Optional indications
+#if defined(__MTK_TARGET__) && !defined(__MAUI_BASIC__)
+    CATCHER_SWLA_SWTR_DYNAMIC_ENABLE,
+
+#if defined(__HW_US_TIMER_SUPPORT__)
+    CATCHER_SWLA_NEW_CLOCK_ENABLE,
+#endif  //#if defined(__HW_US_TIMER_SUPPORT__)
+    CATCHER_SWLA_SWTR_DYNAMIC_DISABLE,
+    CATCHER_SWLA_EMI_QUERY_ENABLE,
+
+#endif  //#if defined(__MTK_TARGET__) && !defined(__MAUI_BASIC__)
+#if defined(__DSP_FCORE4__) && !defined(UNIT_TEST)
+    CATCHER_FCORE_MEMORY_DUMP_ENABLE,
+#endif  
+    CATCHER_R5R6_CPHY_CONTAINER_STRUCT,
+    CATCHER_GDI_LAYER_BYTES_PER_PIXEL_INFO,
+#if defined(__AST_TL1_TDD__) && !defined(UNIT_TEST)
+    CATCHER_AST_MEMORY_DUMP_ENABLE,
+#endif  //#if defined(__AST_TL1_TDD__) && !defined(UNIT_TEST) 
+
+#if defined( __UMTS_TDD128_MODE__)
+    CATCHER_DB_FOR_TDD,
+#endif  //#if defined( __UMTS_TDD128_MODE__)
+
+#if defined(__AST_TL1_TDD__)
+    CATCHER_AST_FAST_MEMORY_DUMP,
+#endif  //#if defined(__AST_TL1_TDD__)
+
+    CATCHER_EM_MULTIPLE_SIM_ENABLE,
+    CATCHER_SIM_READ_MULTIPLE_SIM_ENABLE,
+    CATCHER_PS_NO_FN, //Indicate PS log won't send out FNs.
+
+#if defined(__SMART_PHONE_MODEM__)
+    CATCHER_PS_NO_CHECK_SUM_ENABLED, //Support 0x58 and 0x59
+    CATCHER_L1_NO_CHECK_SUM_ENABLED, //Support 0xA6
+#endif
+
+#if defined(__LTE_RAT__)
+#if defined(__GSM_RAT__) || defined(__UMTS_RAT__)
+    LTE_MM,
+#else
+    LTE_SM,
+#endif
+#else
+    GSM_UMTS,
+#endif
+
+#if !defined(__UE_SIMULATOR__) && !defined(UNIT_TEST)
+#endif
+
+
+#if defined (__MAUI_SOFTWARE_TRACER__)
+    CATCHER_SWTR_NEW_TIME_SCALE,  // change SWTR time scale from 1/16 to 1/1024
+#endif
+
+    Catcher_Info_Enum_End
+} Catcher_Version_Info_Enum;
+
+typedef enum
+{
+    SWLA_Clock_Origin_Wrap = 5000,
+    SWLA_Clock_Origin_Rate = 1083000,   //1.083MHZ
+#ifdef MT6268
+    SWLA_Clock_Rate = 3250000,   //3.25MHZ
+    SWLA_Clock_Wrap = 0x0FFFFFFF,
+#else
+    SWLA_Clock_Rate = 1000000,   //1MHZ
+    SWLA_Clock_Wrap = 0xFFFFFFFF,
+#endif
+#if defined(OS_TICK_PERIOD_US)
+    SWLA_TimeStamp_Ratio = OS_TICK_PERIOD_US,
+#else
+    SWLA_TimeStamp_Ratio = 4615,  // For LMU-based SWLA to convert us to frame
+#endif
+    SWLA_CLOCK_END
+} Catcher_SWLA_Clock;
+
+#ifdef NUM_OF_SIM
+#define CATCHER_NUM_OF_SIM NUM_OF_SIM
+#undef NUM_OF_SIM
+#endif  //NUM_OF_SIM
+
+//workaround
+#if defined(__GEMINI__) && !defined(GEMINI_PLUS)
+#define GEMINI_PLUS 2
+#endif  //GEMINI_PLUS
+
+typedef enum
+{
+    NUM_OF_GSM_SIM = MAX_GSM_NUM,
+#if defined(__UMTS_RAT__)
+    NUM_OF_UMTS_SIM = MAX_UMTS_NUM,
+#else
+    NUM_OF_UMTS_SIM = 0,
+#endif
+#if defined(__LTE_RAT__)
+    NUM_OF_LTE_SIM = MAX_LTE_NUM,
+#else
+    NUM_OF_LTE_SIM = 0,
+#endif
+    NUM_OF_SIM = MAX_SIM_NUM,
+}
+sim_info_enum;
+
+#ifdef CATCHER_NUM_OF_SIM
+#define NUM_OF_SIM CATCHER_NUM_OF_SIM
+#endif  //NUM_OF_SIM
+
+//Catcher version checking
+typedef enum
+{
+    v3_1105_00
+}
+catcher_min_version;
+
+typedef enum
+{
+#if defined(__FLAVOR_L1S_L1DISABLE__)
+    TIMESTAMP_PRECISION = 1000,
+    PERIODIC_TIMESTAMP_PRECISION = 1000,
+    LOW_RES_TIMESTAMP_PRECISION = 1000,
+    HIGH_RES_TIMESTAMP_PRECISION = 1000,
+#else
+    TIMESTAMP_PRECISION = 64,
+    PERIODIC_TIMESTAMP_PRECISION = 64,
+    LOW_RES_TIMESTAMP_PRECISION = 64,
+#if defined(L1_SIM) && !defined (__UE_SIMULATOR__)
+    HIGH_RES_TIMESTAMP_PRECISION = 64,
+#else
+    HIGH_RES_TIMESTAMP_PRECISION = 1,
+#endif
+#endif
+} ETimeStampPrecisionUS;
+
+typedef enum
+{
+    PS_11A
+#if defined(__AST_TL1_TDD__) || defined(__UMTS_TDD128_MODE__)
+    , TDD_11A
+#endif
+}
+catcher_default_filter_info;
+
+//For ELT version checking
+typedef enum
+{
+    V2_1915_1
+} elt_min_version;
+
+#define MULTI_DB_MASTER_ID (0)
+#define MULTI_DB_SLAVE_ID (1)
+typedef enum
+{
+    MULTI_DB_MASTER = MULTI_DB_MASTER_ID,
+} dhl_multiple_db_type;
+
+typedef enum
+{
+    PCORE_DATABASE
+} dhl_multiple_db_desc;
+typedef enum
+{
+#ifdef __MD97__
+    DHL_MDB_VIEW_TYPE_5G_MD
+#elif defined(__USE_ULSP__) || defined(__USE_ULSP_SW_SIMULATOR__) // Enable ULSP decoder
+    DHL_MDB_VIEW_TYPE_LTE_ULS_PLUS
+
+#else  // SW logging version
+    DHL_MDB_VIEW_TYPE_LTE_ADVANCED__PLUS   //add L1 Trace(PCORE), Sys trace(L1CORE), PS Integrated (L1CORE)
+
+#endif
+} dhl_multiple_db_view_mapping_type;
+
+#ifdef __MD97__
+
+typedef enum
+{
+    /* V_MAJORVERSION_MINORVERSION */
+    V_5_0     /*5 means 5G platform*/
+}ulsp_protocol_version;
+
+#endif
+
+typedef enum
+{
+    NO_PH_MSG_ID_TST_R8_DL_PKT_SINGLE_GPD_IND,
+    NO_PH_MSG_ID_DHL_L2COPRO_DL_IP_HEADER_LOG,
+    NO_PH_MSG_ID_DHL_L2COPRO_UL_IP_HEADER_LOG,
+    NO_PH_MSG_ID_DHL_ICD_TUNNELING,
+    NO_PH_MSG_ID_LPM,
+    NO_PH_MSG_ID_DHL_IND_NVRAM_READ_CNF
+}
+dhl_no_peer_header_msg_id_enum;
+
+#endif //#if defined(GEN_FOR_PC) 
+
+#endif //__TST_CATCHER_VERSION_H__
diff --git a/mcu/interface/service/dhl/v1/tst_catcher_diagonsis_info.h b/mcu/interface/service/dhl/v1/tst_catcher_diagonsis_info.h
new file mode 100644
index 0000000..ae0cc1e
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/tst_catcher_diagonsis_info.h
@@ -0,0 +1,344 @@
+/*******************************************************************************
+*  Modification Notice:
+*  --------------------------
+*  This software is modified by MediaTek Inc. and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2005
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * tst_catcher_diagonsis_info.h
+ *
+ * Project:
+ * --------
+ *   Maui_Software
+ *
+ * Description:
+ * ------------
+ *   This file contains the exception handle diagnosis Info of Catcher
+ *   With this file, catcher can detect the memory dump failure cause and find the proper owner.
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ *             HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ *
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+#ifndef __TST_CATCHER_DIAGONOSIS_INFO_H__
+#define __TST_CATCHER_DIAGONOSIS_INFO_H__
+
+
+#if defined(GEN_FOR_PC)
+
+typedef enum
+{
+    //Format: CATCHER_EXC_MODULES_[Function],
+    //Format: CATCHER_EXC_OWNER_[Function]_[Owner Fist Name]_[Owner Last Name]  = CATCHER_EXC_MODULES_[Function],
+    CATCHER_EXC_MODULES_UARTUSB,
+#if defined(__DHL_SP_LOGGING_SUPPORT__)
+#if defined(__FPGA__) // FPGA stage, the AP is bach and the exception flow is need to fine tune.
+    CATCHER_EXC_OWNER_CCCI_DHL_1stLine = CATCHER_EXC_MODULES_UARTUSB, //owners should be up-to-date
+#else
+    CATCHER_EXC_OWNER_CCCI_DHL_1stLine = CATCHER_EXC_MODULES_UARTUSB, //owners should be up-to-date
+#endif
+#else
+    CATCHER_EXC_OWNER_USB_DHL_1stLine = CATCHER_EXC_MODULES_UARTUSB, //owners should be up-to-date
+    CATCHER_EXC_OWNER_UART_Da_Li = CATCHER_EXC_MODULES_UARTUSB, //owners should be up-to-date
+#endif
+
+    CATCHER_EXC_MODULES_COMPORT,
+#if defined(__DHL_SP_LOGGING_SUPPORT__)
+    CATCHER_EXC_OWNER_COMPORT_Chihhao_Chen = CATCHER_EXC_MODULES_COMPORT, //owners should be up-to-date
+#else
+    CATCHER_EXC_OWNER_COMPORT_Sherry_Zhang = CATCHER_EXC_MODULES_COMPORT, //owners should be up-to-date
+#endif
+    CATCHER_EXC_MODULES_WATCHDOG,
+    CATCHER_EXC_OWNER_WATCHDOG_Owen_Ho = CATCHER_EXC_MODULES_WATCHDOG, //owners should be up-to-date
+    CATCHER_EXC_MODULES_CORESONIC_DSP,
+    CATCHER_EXC_OWNER_DSP_Ruta_Lin = CATCHER_EXC_MODULES_CORESONIC_DSP, //owners should be up-to-date
+    CATCHER_EXC_MODULES_CCCI,
+    CATCHER_EXC_OWNER_CCCI_CS_Huang = CATCHER_EXC_MODULES_CCCI, //owners should be up-to-date
+    CATCHER_EXC_MODULES_FLC,
+    CATCHER_EXC_OWNER_FLC_TC_Chang = CATCHER_EXC_MODULES_FLC, //owners should be up-to-date
+    CATCHER_EXC_MODULES_FLASH,
+    CATCHER_EXC_OWNER_FLASH_Way_Chen = CATCHER_EXC_MODULES_FLASH, //owners should be up-to-date
+    CATCHER_EXC_MODULES_FS,
+    CATCHER_EXC_OWNER_FS_Qinghua_Yu = CATCHER_EXC_MODULES_FS, //owners should be up-to-date
+    CATCHER_EXC_MODULES_NVRAM,
+    CATCHER_EXC_OWNER_NVRAM_Yaohua_Liu = CATCHER_EXC_MODULES_NVRAM, //owners should be up-to-date
+    CATCHER_EXC_MODULES_SS,
+    CATCHER_EXC_OWNER_ExceptionHandle_Qmei_Yang = CATCHER_EXC_MODULES_SS,
+    CATCHER_EXC_MODULES_SWLA,
+    CATCHER_EXC_OWNER_ExceptionHandle_YenChun_Liu = CATCHER_EXC_MODULES_SWLA,
+    CATCHER_EXC_MODULES_TIMER,
+    CATCHER_EXC_OWNER_ExceptionHandle_CheWei_Chang = CATCHER_EXC_MODULES_TIMER, //owners should be up-to-date
+    CATCHER_EXC_MODULES_TOPSM,
+    CATCHER_EXC_OWNER_ExceptionHandle_CheWei_Chang = CATCHER_EXC_MODULES_TOPSM, //owners should be up-to-date
+    CATCHER_EXC_MODULES_DHL,
+    CATCHER_EXC_OWNER_DHL_DHL_1stLine = CATCHER_EXC_MODULES_DHL, //owners should be up-to-date
+}
+catcher_exception_handler_owner_list_t;
+
+typedef enum
+{
+    //format OWNER____[trace name]
+    //____ can't be shown in the trace name
+    OWNER____TST_EX_MSG_NESTED_EX_DETECTED                      = CATCHER_EXC_MODULES_SS,
+    OWNER____TST_EX_MSG_DUMP_SST_LOG_START                      = CATCHER_EXC_MODULES_SS,
+    OWNER____TST_EX_MSG_DUMP_SST_LOG_END                        = CATCHER_EXC_MODULES_DHL,
+    OWNER____TST_EX_MSG_REDUMP_PS_BUF_START                     = CATCHER_EXC_MODULES_DHL,
+    OWNER____TST_EX_MSG_REDUMP_PS_BUF_END                       = CATCHER_EXC_MODULES_DHL,
+
+    OWNER____SST_EXC_WATCHDOG_RESET_ENTER                    = CATCHER_EXC_MODULES_WATCHDOG,
+    OWNER____SST_EXC_WATCHDOG_RESET_EXIT                     = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_WATCHDOG_DISABLE_ENTER                  = CATCHER_EXC_MODULES_WATCHDOG,
+    OWNER____SST_EXC_WATCHDOG_DISABLE_EXIT                   = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_OPEN_LOGGING_PORT_ENTER                 = CATCHER_EXC_MODULES_DHL,
+    OWNER____SST_EXC_OPEN_LOGGING_PORT_EXIT                  = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_UST_GET_TIME_ENTER                      = CATCHER_EXC_MODULES_TIMER,
+    OWNER____SST_EXC_UST_GET_TIME_EXIT                       = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_USC_GET_TIME_ENTER                      = CATCHER_EXC_MODULES_TIMER,
+    OWNER____SST_EXC_USC_GET_TIME_EXIT                       = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_NOTIFY_DSP_ENTER                        = CATCHER_EXC_MODULES_CORESONIC_DSP,
+    OWNER____SST_EXC_NOTIFY_DSP_EXIT                         = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_CCCI_HANDSHAKING_ENTER                  = CATCHER_EXC_MODULES_CCCI,
+    OWNER____SST_EXC_CCCI_HANDSHAKING_EXIT                   = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_TOPSM_ENABLE_FRC_ENTER                  = CATCHER_EXC_MODULES_TOPSM,
+    OWNER____SST_EXC_TOPSM_ENABLE_FRC_EXIT                   = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_RESET_HARDWARE_ENTER                    = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_RESET_HARDWARE_EXIT                     = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_INIT_EXCEPTION_RECORD_ENTER             = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_INIT_EXCEPTION_RECORD_EXIT              = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_VFP_REGISTER_DUMP_ENTER                 = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_VFP_REGISTER_DUMP_EXIT                  = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_CLEAR_PENDING_LOG_ENTER                 = CATCHER_EXC_MODULES_DHL,
+    OWNER____SST_EXC_CLEAR_PENDING_LOG_EXIT                  = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_OUTPUT_EXC_MSG_ENTER                    = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_OUTPUT_EXC_MSG_EXIT                     = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_INVOKE_SST_ENGINE_ENTER                 = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_INVOKE_SST_ENGINE_EXIT                  = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_OUTPUT_EXCEPTION_RECORD_ENTER           = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_OUTPUT_EXCEPTION_RECORD_EXIT            = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_SWLA_PRINT_LOWRAM_ENTER                 = CATCHER_EXC_MODULES_SWLA,
+    OWNER____SST_EXC_SWLA_PRINT_LOWRAM_EXIT                  = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_PASS_CCCI_EXCINFO_ENTER                 = CATCHER_EXC_MODULES_CCCI,
+    OWNER____SST_EXC_PASS_CCCI_EXCINFO_EXIT                  = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_FLC_DEBUG_INFO_ENTER                    = CATCHER_EXC_MODULES_FLC,
+    OWNER____SST_EXC_FLC_DEBUG_INFO_EXIT                     = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_INIT_FDD_TABLE_ENTER                    = CATCHER_EXC_MODULES_FLASH,
+    OWNER____SST_EXC_INIT_FDD_TABLE_EXIT                     = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_SAVE_EXCEPTION_RECORD_ENTER             = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_SAVE_EXCEPTION_RECORD_EXIT              = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_FS_UNLOCK_ALL_ENTER                     = CATCHER_EXC_MODULES_FS,
+    OWNER____SST_EXC_FS_UNLOCK_ALL_EXIT                      = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_FS_SHUTDOWN_ENTER                       = CATCHER_EXC_MODULES_FS,
+    OWNER____SST_EXC_FS_SHUTDOWN_EXIT                        = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_NVRAM_WRITE_EXC_ENTER                   = CATCHER_EXC_MODULES_NVRAM,
+    OWNER____SST_EXC_NVRAM_WRITE_EXC_EXIT                    = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_TST_DUMP2FILE_ENTER                     = CATCHER_EXC_MODULES_DHL,
+    OWNER____SST_EXC_TST_DUMP2FILE_EXIT                      = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_DUMP_USB_DEBUG_DATA_ENTER               = CATCHER_EXC_MODULES_UARTUSB,
+    OWNER____SST_EXC_DUMP_USB_DEBUG_DATA_EXIT                = CATCHER_EXC_MODULES_SS,
+
+    OWNER____SST_EXC_RESET_EXCSP_ENTER                      = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_RESET_EXCSP_EXIT                       = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_MINILOG_DUMP_ENTER                     = CATCHER_EXC_MODULES_DHL,
+    OWNER____SST_EXC_MINILOG_DUMP_EXIT                      = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_CLEAN_RES_PROT_ENTER                   = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_CLEAN_RES_PROT_EXIT                    = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_UNGUARD_STACKSPACE_ENTER               = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_UNGUARD_STACKSPACE_EXIT                = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_INIT_DUMP_ENTER                        = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_INIT_DUMP_EXIT                         = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_CORESONIC_DSP_DUMP_DEBUGINFO_ENTER     = CATCHER_EXC_MODULES_CORESONIC_DSP,
+    OWNER____SST_EXC_CORESONIC_DSP_DUMP_DEBUGINFO_EXIT      = CATCHER_EXC_MODULES_SS,
+
+    OWNER____SST_EXC_HANDOVER2TST                                       = CATCHER_EXC_MODULES_DHL,
+}
+catcher_exception_handler_owner_mapping_t;
+
+typedef enum
+{
+    sys_mem___Kari_Suvanto,
+    slave_sys_mem___Kari_Suvanto,
+    bb_reg___Kari_Suvanto,
+
+    core0_swla_sla_mem___HW_Jheng,
+    core1_swla_sla_mem___HW_Jheng,
+    core2_swla_sla_mem___HW_Jheng,
+    mcu_sla_mem___HW_Jheng,
+    infra_sla_mem___HW_Jheng,
+
+    dsp_mem___Shriram_Krishnamurthy,
+
+    coresonic_dsp_mem___Ruta_Lin,
+
+    ast_mem___Cruze_Yu,
+
+    md32_mem___YuanYuan_Wang,
+    usip_scq16_mem___YuanYuan_Wang,
+    rake_mem___YuanYuan_Wang,
+    vrf_mem___YuanYuan_Wang,
+
+} catcher_BEE_failed_readmem_owner;
+
+#endif //#if defined(GEN_FOR_PC) 
+
+#endif //__TST_CATCHER_DIAGONOSIS_INFO_H__
diff --git a/mcu/interface/service/dhl/v1/tst_def.h b/mcu/interface/service/dhl/v1/tst_def.h
new file mode 100644
index 0000000..979cdef
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/tst_def.h
@@ -0,0 +1,77 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   tst_def.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *  Dummy header for compat with legacy TST
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ * 	     Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ * 04 08 2013 ken.liu
+ * [MOLY00013653] [MT6290 Bring-up]
+ * add dummy header for compat with TST.
+ *
+ ****************************************************************************/
+
+#ifndef _TST_DEF_H
+#define _TST_DEF_H
+
+#if defined (__DHL_MODULE__)
+#include "dhl_def.h"
+#endif
+
+#endif
diff --git a/mcu/interface/service/dhl/v1/tst_ex_handler_trc.h b/mcu/interface/service/dhl/v1/tst_ex_handler_trc.h
new file mode 100644
index 0000000..10c7184
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/tst_ex_handler_trc.h
@@ -0,0 +1,114 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   tst_ex_handler_trc.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   This file defines the index trace of TST exception handler
+ *   This file is included by SST\include\SST_trc.h
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 06 05 2017 yu-hsiang.peng
+ * [MOLY00254166] [Gen93] dsp swla dump feature
+ * [UMOLYA.TRUNK] memory dump feature
+ * 	1. DSP SWLA support
+ * 	2. mini com logger support
+ *
+ * 01 04 2017 yu-hsiang.peng
+ * [MOLY00222223] [MT6293] memory dump flow enhance
+ * [UMOLYA.TRUNK] EE flow debug log
+ *
+ * 05 07 2014 eason.lai
+ * [MOLY00064969] [DHL]expand tab to 4 spaces to have better typesettings
+ * .
+ *
+ * 12 03 2013 mojo.lai
+ * [MOLY00047331] Support new error detect mechanism BEE
+ *  .
+ *
+ * 11 07 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * dhl module check-in.
+ ****************************************************************************/
+
+TRC_MSG(TST_EX_MSG_DUMP_UART_RING_BUFFER_START, "[EXC][COMMON] Dump UART ring buffer data start (port:%MDCL_DEV_T)!")
+TRC_MSG(TST_EX_MSG_DUMP_UART_RING_BUFFER_END, "[EXC][COMMON] Dump UART ring buffer data end (port:%MDCL_DEV_T)!")
+TRC_MSG(TST_EX_MSG_DISABLE_LGA_BUF_UNDER_SS_START, "[EXC][COMMON] Disable Lga buffer start!")
+TRC_MSG(TST_EX_MSG_DISABLE_LGA_BUF_UNDER_SS_END, "[EXC][COMMON] Disable Lga buffer end!")
+TRC_MSG(TST_EX_MSG_CLEAN_UART_UNDER_SS_START, "[EXC][COMMON] Clean up UART channel start (port:%MDCL_DEV_T)!")
+TRC_MSG(TST_EX_MSG_CLEAN_UART_UNDER_SS_END, "[EXC][COMMON] Clean up UART channel end (port:%MDCL_DEV_T)!")
+TRC_MSG(TST_EX_MSG_DUMP_PS_BUF_START, "[EXC][COMMON] Dump PS Buf start!")
+TRC_MSG(TST_EX_MSG_DUMP_PS_BUF_END, "[EXC][COMMON] Dump PS Buf end!")
+TRC_MSG(TST_EX_MSG_DISABLE_LGA_BUF_START, "[EXC][ELT] Disable Lga buffer start!")
+TRC_MSG(TST_EX_MSG_DISABLE_LGA_BUF_END, "[EXC][ELT] Disable Lga buffer end!")
+TRC_MSG(TST_EX_MSG_REOPEN_PORT_START, "[EXC][ELT] Reopen logging ports start!")
+TRC_MSG(TST_EX_MSG_REOPEN_PORT_END, "[EXC][ELT] Reopen logging ports end!")
+TRC_MSG(TST_EX_MSG_OPEN_PORT_START, "[EXC][ELT] open logging ports start! (Port:%MDCL_DEV_T)")
+TRC_MSG(TST_EX_MSG_OPEN_PORT_END, "[EXC][ELT] open logging ports end! (Port:%MDCL_DEV_T)")
+TRC_MSG(TST_EX_MSG_CLEAN_UART_START, "[EXC][ELT] Clean up UART channel start! (Port:%MDCL_DEV_T)")
+TRC_MSG(TST_EX_MSG_CLEAN_UART_END, "[EXC][ELT] Clean up UART channel end! (Port:%MDCL_DEV_T)")
+TRC_MSG(TST_EX_MSG_CLOSE_PORT_START, "[EXC][ELT] close logging ports start! (Port:%MDCL_DEV_T)")
+TRC_MSG(TST_EX_MSG_CLOSE_PORT_END, "[EXC][ELT] close logging ports end! (Port:%MDCL_DEV_T)")
+TRC_MSG(TST_EX_MSG_CHANGE_L1_PORT, "[EXC][ELT] Change L1 logging port from %MDCL_DEV_T to %MDCL_DEV_T !")
+TRC_MSG(TST_EX_MSG_NESTED_EX_DETECTED, "[EXC][ELT] Detect nested exception! (times:%d)")
+TRC_MSG(TST_EX_MSG_DUMP_SST_LOG_START, "[EXC][ELT] Redump exception log start!")
+TRC_MSG(TST_EX_MSG_DUMP_SST_LOG_END, "[EXC][ELT] Redump exception log end!")
+TRC_MSG(TST_EX_MSG_DRV_EX_HANDLER_START, "[EXC][ELT] Drv ex handler start!")
+TRC_MSG(TST_EX_MSG_DRV_EX_HANDLER_END, "[EXC][ELT] Drv ex handler end!")
+TRC_MSG(TST_EX_MSG_DUMP_LGA_BUF_START, "[EXC][ELT] Dump Lga buffer start!")
+TRC_MSG(TST_EX_MSG_DUMP_LGA_BUF_END, "[EXC][ELT] Dump Lga buffer end!")
+TRC_MSG(TST_EX_MSG_REDUMP_PS_BUF_START, "[EXC][ELT] Redump PS buffer start!")
+TRC_MSG(TST_EX_MSG_REDUMP_PS_BUF_END, "[EXC][ELT] Redump PS buffer end!")
+TRC_MSG(TST_EX_MSG_REDUMP_L1_BUF_START, "[EXC][ELT] Redump L1 buffer start!")
+TRC_MSG(TST_EX_MSG_REDUMP_L1_BUF_END, "[EXC][ELT] Redump L1 buffer end!")
+TRC_MSG(TST_EX_MSG_GET_ELT_CMD, "[EXC][ELT] Get one PC exception command:%Mdhl_command_type !")
+TRC_MSG(TST_EX_MSG_GET_ELT_CMD_CHECKSUM_ERROR, "[EXC][ELT] Get one PC exception command:%Mdhl_command_type, but the checksum is incorrect! Expected checksum: %x, Got checksum: %x")
+TRC_MSG(TST_EX_MSG_QUERY_MEMORY_DEUMP_INFO, "[EXC][ELT] Query %MDHL_MEM_TYPE(type) to dump, result = %d!")
+TRC_MSG(TST_EX_MSG_DUMP_MEMORY_DETAIL_INFO, "[EXC][ELT] Start dump %MDHL_MEM_TYPE(type) 0X%x(address) 0X%x(length)!")
+TRC_MSG(TST_EX_MSG_QUERY_SWLA_DETAIL_INFO, "[EXC][ELT] Query SWLA dump  0X%x(address) 0X%x(length) 0X%x(ptr)!")
diff --git a/mcu/interface/service/dhl/v1/tst_hal_internal_wrapper_defs.h b/mcu/interface/service/dhl/v1/tst_hal_internal_wrapper_defs.h
new file mode 100644
index 0000000..142d9ca
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/tst_hal_internal_wrapper_defs.h
@@ -0,0 +1,85 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   tst_hal_internal_wrapper_defs.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *  Dummy header for compat with legacy TST
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ * 	     Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ * 10 30 2015 eason.lai
+ * [MOLY00134958] [MT6292] [DHL] logging service migration
+ *
+ *  remove __PCORE__ and __L1CORE__ option
+ *
+ * 11 14 2014 eason.lai
+ * [MOLY00084440] [MT6291][DHL] Patch back UMOLY trunk from MT6291_DEV
+ *  first time patch back
+ *
+ ****************************************************************************/
+
+#ifndef __TST_HAL_INTERNAL_WRAPPER_DEFS_H__
+#define __TST_HAL_INTERNAL_WRAPPER_DEFS_H__
+
+#include "kal_public_api.h"
+#include "dcl.h"
+
+kal_bool tst_hal_USBDL_Is_USB_Download_Mode(void);
+kal_bool tst_hal_USB_Meta_Mode(DCL_CTRL_CMD dcl_cmd);
+kal_bool tst_hal_USBDL_Is_USB_Fast_Meta_Mode(void);
+
+#endif
diff --git a/mcu/interface/service/dhl/v1/tst_lmu_hw.h b/mcu/interface/service/dhl/v1/tst_lmu_hw.h
new file mode 100644
index 0000000..d3a98bf
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/tst_lmu_hw.h
@@ -0,0 +1,94 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ *   tst_lmu_hw.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   Dummy driver for LMU HW
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ * 	     Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ * 11 07 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * dhl module check-in.
+ ****************************************************************************/
+
+#ifndef __TST_LMU_HW_H__
+#define __TST_LMU_HW_H__
+
+#if defined(__TST_LMU_LOGGING__) || defined(USE_DNT_LOGGING)
+#error "LMU is not avaiable"
+#else //#if defined(__TST_LMU_LOGGING__) || defined(USE_DNT_LOGGING)
+
+#define LMU_Write_CSM_Addr_TS(reg_num, value)
+#define LMU_Write_Short_Ary(ptr, ptr_length)
+#define LMU_Write_Short_Word(word_data)
+
+#define LMU_Write_Task_CSM(thread_id)
+#if !defined(__FCORE__) || !defined(_LANGUAGE_ASM)
+#define LMU_Write_ISR_CSM(isr_id)
+#define LMU_Write_ISR_END_CSM(isr_id)
+#define LMU_Write_ISR_END_RESUME_CSM(marker)
+#else
+#define LMU_Write_ISR_CSM(pReg, dReg)
+#define LMU_Write_ISR_END_CSM(pReg, dReg)
+#define LMU_Write_ISR_END_RESUME_CSM(pReg, dReg)
+#endif
+
+#endif  //#if defined(__TST_LMU_LOGGING__) || defined(USE_DNT_LOGGING)
+#endif  //#ifndef __TST_LMU_HW_H__ 
+
diff --git a/mcu/interface/service/dhl/v1/tst_sap.h b/mcu/interface/service/dhl/v1/tst_sap.h
new file mode 100644
index 0000000..bae0813
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/tst_sap.h
@@ -0,0 +1,92 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   tst_sap.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   TST legacy interface
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ * 	     Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ * 05 07 2014 eason.lai
+ * [MOLY00064969] [DHL]expand tab to 4 spaces to have better typesettings
+ * .
+ *
+ * 11 07 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * dhl module check-in.
+ ****************************************************************************/
+
+#ifndef _TST_SAP_H
+#define _TST_SAP_H
+
+#include "kal_general_types.h"
+
+typedef struct
+{
+    kal_uint8   ref_count;
+    kal_uint16   param_len;
+    kal_uint8   index;
+#if defined(__UE_SIMULATOR__)
+    kal_uint8   string[256];
+#else
+    kal_uint8   string[128];
+#endif
+}
+tst_module_string_inject_struct;
+
+#endif /* _TST_SAP_H */
+
diff --git a/mcu/interface/service/dhl/v1/ulsp_interface.h b/mcu/interface/service/dhl/v1/ulsp_interface.h
new file mode 100644
index 0000000..90093cb
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/ulsp_interface.h
@@ -0,0 +1,73 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   ulsp_interface.h
+ *
+ * Project:
+ * --------
+ *   UMOLYA
+ *
+ * Description:
+ * ------------
+ *   ULS+ API for dormant flow
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ *
+ *
+ *
+ ****************************************************************************/
+
+#ifndef _ULSP_INTERFACE_H_
+#define _ULSP_INTERFACE_H_
+
+#include "kal_general_types.h"
+
+void ulsp_mcu_backup();
+void ulsp_mcu_restore();
+kal_bool ulsp_check_lock_sleep();
+
+
+#endif //_ULSP_INTERFACE_H_
+
+
diff --git a/mcu/interface/service/dhl/v1/ulsp_mcu_logging.h b/mcu/interface/service/dhl/v1/ulsp_mcu_logging.h
new file mode 100644
index 0000000..86a6abb
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/ulsp_mcu_logging.h
@@ -0,0 +1,809 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   ulsp_mcu_logging.h
+ *
+ * Project:
+ * --------
+ *   UMOLYA
+ *
+ * Description:
+ * ------------
+ *   ULS+ MCU side HW control level
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 08 14 2018 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * .
+ *
+ * 06 22 2018 yancy.chien
+ * [MOLY00331449] [Gen97] DHL logging development
+ * 	Migration on UMOLYE.
+ *
+ * 12 06 2017 yancy.chien
+ * [MOLY00258174] [Gen95][DHL] logging development
+ * 	1. Seperate reg base for 93/95.
+ * 	2. Remove L1 SW RESET in initial.
+ *
+ * 12 06 2017 yancy.chien
+ * [MOLY00258174] [Gen95][DHL] logging development
+ * 1. Seperate reg base for 93/95.
+ * 2. Remove L1 SW RESET in initial.
+ *
+ * 07 14 2017 yancy.chien
+ * [MOLY00257978] conditional trace development
+ * 1. Move Conditional buffer to SHM
+ * 2. Refine dump flow & avoid infinite loop
+ * 3. Print debug log
+ *
+ * 06 21 2017 yancy.chien
+ * [MOLY00258341] [MT6763][Bianco][N1][E2][MD issue][TW] Assert on ulsp_mod_function with PLS mode
+ * 1. Enlarge the abort fail assert check period to 30us
+ * 2. Record PB debug flag when timeout
+ *
+ * 06 19 2017 yancy.chien
+ * [MOLY00257978] conditional trace development
+ * 1st phase-in.
+ *
+ * 06 01 2017 kenneth.lin
+ * [MOLY00253974] [BIANCO][DHL] re-dump dsp log in exception flow
+ * .
+ * 	add redump dsp log trace
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ * 	     Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ * 03 14 2017 kenneth.lin
+ * [MOLY00235284] [xL1SIM][DHL] support ulsp logging feature in xl1sim
+ *
+ *  DHL support ulsp logging feature in xl1sim
+ *
+ *  1. enable __USE_ULSP__
+ *  2. implement ulsp macro to send ELT directly
+ *
+ * 11 29 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In]
+ *
+ *  . Add BoundarySync SW Encoder API
+ *
+ * 11 25 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In]
+ *
+ *  . ULSP SW Encoder: Add IDLE SYNC
+ *
+ * 09 22 2016 jean.tsao
+ * [MOLY00185213] [UMOLYA] DHL 92 SW logging migrate to 93
+ * [ULSP] MCU side driver API
+ *
+ * 09 19 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In] ULS+ SW Encoder Phase-In
+ *
+ * 09 14 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+] ULSP SW Encoder Interface Fix
+ *
+ * 09 14 2016 willie.pan
+ * [MOLY00163869] ULSP SW Encoder Phase-In
+ *
+ * 09 14 2016 willie.pan
+ * [MOLY00163869] [6293][ULS+][ULS+ Phase In]
+ *
+ *  . ULSP SW Encoder Phase In
+ *
+ * 08 04 2016 jean.tsao
+ * [MOLY00185213] [UMOLYA] DHL 92 SW logging migrate to 93
+ * [ULSP] MCU side driver API
+ *
+ * 07 05 2016 yu-hsiang.peng
+ * [MOLY00185213] [MT6293] DHL MT6292 SW logging migrate to MT6293 & MT6293 ULSP logging development
+ * [UMOLYA.TRUNK] Edit all description in ULSP-releated file
+ *
+ *
+ ****************************************************************************/
+
+#ifndef _ULSP_MCU_LOGGING_H_
+#define _ULSP_MCU_LOGGING_H_
+
+#include "kal_general_types.h"
+
+#if defined(__USE_ULSP__) || defined(__USE_ULSP_SW_SIMULATOR__)
+
+#define ULSP_FRC_ADDR 0xA00D0800
+#define ULSP_FRC_DATA 0xF2CC0001
+
+#define ULSP_IDLE_SYNC_PATTERN     (0x24823466)
+#define ULSP_BOUNDARY_SYNC_PATTERN (0x24546293)
+
+#define ULSP_FIXED_SYNC_PATTERN (0x7997)
+
+#if defined(__MD97__)
+#define ULSP_PB_L1_LOG_BASE_SOURCEID  (0x01) //normal
+#define ULSP_PB_L2_LOG_BASE_SOURCEID  (0x21)
+#define ULSP_PB_L1_LOG_ONDEMAND_BASE_SOURCEID (0x41)
+#define ULSP_PB_L2_LOG_ONDEMAND_BASE_SOURCEID (0x61)
+#else
+#define ULSP_PB_L1_LOG_BASE_SOURCEID  (1) //normal only
+#define ULSP_PB_L2_LOG_BASE_SOURCEID  (17)
+#define ULSP_PB_L1_LOG_ONDEMAND_BASE_SOURCEID (0x0) // 93 95 no support on-demand
+#define ULSP_PB_L2_LOG_ONDEMAND_BASE_SOURCEID (0x0)
+#endif
+#define ULSP_PB_L1_SETTING_SOURCEID ((ULSP_PB_L1_LOG_ONDEMAND_BASE_SOURCEID&0xFF) <<8 | (ULSP_PB_L1_LOG_BASE_SOURCEID &0xFF))
+#define ULSP_PB_L2_SETTING_SOURCEID ((ULSP_PB_L2_LOG_ONDEMAND_BASE_SOURCEID&0xFF) <<8 | (ULSP_PB_L2_LOG_BASE_SOURCEID &0xFF))
+
+
+#define ULSP_PB_DSP_LOG_BASE_SOURCEID (1)
+#define ULSP_PB_DSP_INNER_LOG_BASE_SOURCEID (1)
+#define ULSP_PB_DSP_BRP_LOG_BASE_SOURCEID (2)
+#define ULSP_PB_DSP_FEC_LOG_BASE_SOURCEID (3)
+#define ULSP_PB_DSP_SPEECH_LOG_BASE_SOURCEID (4)
+#define ULSP_PB_DSP_RAKE_LOG_BASE_SOURCEID (5)
+#define ULSP_PB_DSP_SCQ16_0_LOG_BASE_SOURCEID (6)
+#define ULSP_PB_DSP_SCQ16_1_LOG_BASE_SOURCEID (7)
+
+
+#if defined (__MTK_TARGET__)
+#include "boot.h"
+
+/*
+ | base addresses
+ */
+#define ULSP_PB0_BASE_ADDR (GCR_CUSTOM_ADDR+0xC000)
+#define ULSP_PB1_BASE_ADDR (GCR_CUSTOM_ADDR+0xC100)
+
+#if defined(__MD97__)
+
+enum ULSP_Registers
+{
+    REG_ULSP_PB0_DATA_F_8               = ULSP_PB0_BASE_ADDR + 0x00,
+    REG_ULSP_PB0_DATA_F_16              = ULSP_PB0_BASE_ADDR + 0x04,
+    REG_ULSP_PB0_DATA_F_24              = ULSP_PB0_BASE_ADDR + 0x08,
+    REG_ULSP_PB0_DATA_F_32              = ULSP_PB0_BASE_ADDR + 0x0c,
+    REG_ULSP_PB0_DATA_M_8               = ULSP_PB0_BASE_ADDR + 0x10,
+    REG_ULSP_PB0_DATA_M_16              = ULSP_PB0_BASE_ADDR + 0x14,
+    REG_ULSP_PB0_DATA_M_24              = ULSP_PB0_BASE_ADDR + 0x18,
+    REG_ULSP_PB0_DATA_M_32              = ULSP_PB0_BASE_ADDR + 0x1c,
+    REG_ULSP_PB0_DATA_L_8               = ULSP_PB0_BASE_ADDR + 0x20,
+    REG_ULSP_PB0_DATA_L_16              = ULSP_PB0_BASE_ADDR + 0x24,
+    REG_ULSP_PB0_DATA_L_24              = ULSP_PB0_BASE_ADDR + 0x28,
+    REG_ULSP_PB0_DATA_L_32              = ULSP_PB0_BASE_ADDR + 0x2c,
+    REG_ULSP_PB0_DATA_S_8               = ULSP_PB0_BASE_ADDR + 0x30,
+    REG_ULSP_PB0_DATA_S_16              = ULSP_PB0_BASE_ADDR + 0x34,
+    REG_ULSP_PB0_DATA_S_24              = ULSP_PB0_BASE_ADDR + 0x38,
+    REG_ULSP_PB0_DATA_S_32              = ULSP_PB0_BASE_ADDR + 0x3c,
+    REG_ULSP_PB0_FRC_16                 = ULSP_PB0_BASE_ADDR + 0x40,
+    REG_ULSP_PB0_FRC_32                 = ULSP_PB0_BASE_ADDR + 0x44,
+    REG_ULSP_PB0_FRC_40                 = ULSP_PB0_BASE_ADDR + 0x48,
+    REG_ULSP_PB0_SYNC                   = ULSP_PB0_BASE_ADDR + 0x4c,
+    REG_ULSP_PB0_DATA_ONDEMAND_F_8      = ULSP_PB0_BASE_ADDR + 0x50,
+    REG_ULSP_PB0_DATA_ONDEMAND_F_16     = ULSP_PB0_BASE_ADDR + 0x54,
+    REG_ULSP_PB0_DATA_ONDEMAND_F_24     = ULSP_PB0_BASE_ADDR + 0x58,
+    REG_ULSP_PB0_DATA_ONDEMAND_F_32     = ULSP_PB0_BASE_ADDR + 0x5c,
+    REG_ULSP_PB0_DATA_ONDEMAND_M_8      = ULSP_PB0_BASE_ADDR + 0x60,
+    REG_ULSP_PB0_DATA_ONDEMAND_M_16     = ULSP_PB0_BASE_ADDR + 0x64,
+    REG_ULSP_PB0_DATA_ONDEMAND_M_24     = ULSP_PB0_BASE_ADDR + 0x68,
+    REG_ULSP_PB0_DATA_ONDEMAND_M_32     = ULSP_PB0_BASE_ADDR + 0x6c,
+    REG_ULSP_PB0_DATA_ONDEMAND_L_8      = ULSP_PB0_BASE_ADDR + 0x70,
+    REG_ULSP_PB0_DATA_ONDEMAND_L_16     = ULSP_PB0_BASE_ADDR + 0x74,
+    REG_ULSP_PB0_DATA_ONDEMAND_L_24     = ULSP_PB0_BASE_ADDR + 0x78,
+    REG_ULSP_PB0_DATA_ONDEMAND_L_32     = ULSP_PB0_BASE_ADDR + 0x7c,
+    REG_ULSP_PB0_DATA_ONDEMAND_S_8      = ULSP_PB0_BASE_ADDR + 0x80,
+    REG_ULSP_PB0_DATA_ONDEMAND_S_16     = ULSP_PB0_BASE_ADDR + 0x84,
+    REG_ULSP_PB0_DATA_ONDEMAND_S_24     = ULSP_PB0_BASE_ADDR + 0x88,
+    REG_ULSP_PB0_DATA_ONDEMAND_S_32     = ULSP_PB0_BASE_ADDR + 0x8c,
+    REG_ULSP_PB0_FRC_ONDEMAND_16        = ULSP_PB0_BASE_ADDR + 0x90,
+    REG_ULSP_PB0_FRC_ONDEMAND_32        = ULSP_PB0_BASE_ADDR + 0x94,
+    REG_ULSP_PB0_FRC_ONDEMAND_40        = ULSP_PB0_BASE_ADDR + 0x98,
+    REG_ULSP_PB0_SYNC_ONDEMAND          = ULSP_PB0_BASE_ADDR + 0x9c,
+    REG_ULSP_PB0_SYNC_FIXED             = ULSP_PB0_BASE_ADDR + 0xa0,
+    REG_ULSP_PB0_SYNC_FIXED_ONDEMAND    = ULSP_PB0_BASE_ADDR + 0xa4,
+
+    REG_ULSP_PB0_CON_LOCK_MARKER        = ULSP_PB0_BASE_ADDR + 0xb0,
+    REG_ULSP_PB0_CON_BEFORE_START       = ULSP_PB0_BASE_ADDR + 0xb4,
+    REG_ULSP_PB0_RUN_TIME_MANAGE        = ULSP_PB0_BASE_ADDR + 0xb8,
+    REG_ULSP_PB0_STATUS                 = ULSP_PB0_BASE_ADDR + 0xbc,
+    REG_ULSP_PB0_OVERFLOW_STA           = ULSP_PB0_BASE_ADDR + 0xc0,
+    REG_ULSP_PB0_OVERFLOW_STA_CLR       = ULSP_PB0_BASE_ADDR + 0xc4,
+    REG_ULSP_PB0_BUF_DBG_READ_PTR       = ULSP_PB0_BASE_ADDR + 0xc8,
+    REG_ULSP_PB0_BUF_DBG_READ_DATA      = ULSP_PB0_BASE_ADDR + 0xcc,
+    REG_ULSP_PB0_BUF_DATA_WRITE_PTR     = ULSP_PB0_BASE_ADDR + 0xd0,
+    REG_ULSP_PB0_DBG_INFO               = ULSP_PB0_BASE_ADDR + 0xd4,
+    REG_ULSP_PB0_STALL_CORE_EN          = ULSP_PB0_BASE_ADDR + 0xe0,
+    REG_ULSP_PB0_CORE_SOURCE_ID_BASE    = ULSP_PB0_BASE_ADDR + 0xe4,
+    REG_ULSP_PB0_READ_FRC_EN            = ULSP_PB0_BASE_ADDR + 0xf0,
+    REG_ULSP_PB0_READ_FRC_READY         = ULSP_PB0_BASE_ADDR + 0xf4,
+    REG_ULSP_PB0_READ_FRC_VAL_MSB32     = ULSP_PB0_BASE_ADDR + 0xf8,
+    REG_ULSP_PB0_READ_FRC_VAL_LSB32     = ULSP_PB0_BASE_ADDR + 0xfc,
+
+    /*--------------------------------------------------------
+        ULS+ PB1 registers
+    --------------------------------------------------------*/
+
+    REG_ULSP_PB1_DATA_F_8        = ULSP_PB1_BASE_ADDR + 0x00,
+    REG_ULSP_PB1_DATA_F_16       = ULSP_PB1_BASE_ADDR + 0x04,
+    REG_ULSP_PB1_DATA_F_24       = ULSP_PB1_BASE_ADDR + 0x08,
+    REG_ULSP_PB1_DATA_F_32       = ULSP_PB1_BASE_ADDR + 0x0c,
+    REG_ULSP_PB1_DATA_M_8        = ULSP_PB1_BASE_ADDR + 0x10,
+    REG_ULSP_PB1_DATA_M_16       = ULSP_PB1_BASE_ADDR + 0x14,
+    REG_ULSP_PB1_DATA_M_24       = ULSP_PB1_BASE_ADDR + 0x18,
+    REG_ULSP_PB1_DATA_M_32       = ULSP_PB1_BASE_ADDR + 0x1c,
+    REG_ULSP_PB1_DATA_L_8        = ULSP_PB1_BASE_ADDR + 0x20,
+    REG_ULSP_PB1_DATA_L_16       = ULSP_PB1_BASE_ADDR + 0x24,
+    REG_ULSP_PB1_DATA_L_24       = ULSP_PB1_BASE_ADDR + 0x28,
+    REG_ULSP_PB1_DATA_L_32       = ULSP_PB1_BASE_ADDR + 0x2c,
+    REG_ULSP_PB1_DATA_S_8        = ULSP_PB1_BASE_ADDR + 0x30,
+    REG_ULSP_PB1_DATA_S_16       = ULSP_PB1_BASE_ADDR + 0x34,
+    REG_ULSP_PB1_DATA_S_24       = ULSP_PB1_BASE_ADDR + 0x38,
+    REG_ULSP_PB1_DATA_S_32       = ULSP_PB1_BASE_ADDR + 0x3c,
+    REG_ULSP_PB1_FRC_16          = ULSP_PB1_BASE_ADDR + 0x40,
+    REG_ULSP_PB1_FRC_32          = ULSP_PB1_BASE_ADDR + 0x44,
+    REG_ULSP_PB1_FRC_40          = ULSP_PB1_BASE_ADDR + 0x48,
+    REG_ULSP_PB1_SYNC            = ULSP_PB1_BASE_ADDR + 0x4c,
+    REG_ULSP_PB1_DATA_ONDEMAND_F_8      = ULSP_PB1_BASE_ADDR + 0x50,
+    REG_ULSP_PB1_DATA_ONDEMAND_F_16     = ULSP_PB1_BASE_ADDR + 0x54,
+    REG_ULSP_PB1_DATA_ONDEMAND_F_24     = ULSP_PB1_BASE_ADDR + 0x58,
+    REG_ULSP_PB1_DATA_ONDEMAND_F_32     = ULSP_PB1_BASE_ADDR + 0x5c,
+    REG_ULSP_PB1_DATA_ONDEMAND_M_8      = ULSP_PB1_BASE_ADDR + 0x60,
+    REG_ULSP_PB1_DATA_ONDEMAND_M_16     = ULSP_PB1_BASE_ADDR + 0x64,
+    REG_ULSP_PB1_DATA_ONDEMAND_M_24     = ULSP_PB1_BASE_ADDR + 0x68,
+    REG_ULSP_PB1_DATA_ONDEMAND_M_32     = ULSP_PB1_BASE_ADDR + 0x6c,
+    REG_ULSP_PB1_DATA_ONDEMAND_L_8      = ULSP_PB1_BASE_ADDR + 0x70,
+    REG_ULSP_PB1_DATA_ONDEMAND_L_16     = ULSP_PB1_BASE_ADDR + 0x74,
+    REG_ULSP_PB1_DATA_ONDEMAND_L_24     = ULSP_PB1_BASE_ADDR + 0x78,
+    REG_ULSP_PB1_DATA_ONDEMAND_L_32     = ULSP_PB1_BASE_ADDR + 0x7c,
+    REG_ULSP_PB1_DATA_ONDEMAND_S_8      = ULSP_PB1_BASE_ADDR + 0x80,
+    REG_ULSP_PB1_DATA_ONDEMAND_S_16     = ULSP_PB1_BASE_ADDR + 0x84,
+    REG_ULSP_PB1_DATA_ONDEMAND_S_24     = ULSP_PB1_BASE_ADDR + 0x88,
+    REG_ULSP_PB1_DATA_ONDEMAND_S_32     = ULSP_PB1_BASE_ADDR + 0x8c,
+    REG_ULSP_PB1_FRC_ONDEMAND_16        = ULSP_PB1_BASE_ADDR + 0x90,
+    REG_ULSP_PB1_FRC_ONDEMAND_32        = ULSP_PB1_BASE_ADDR + 0x94,
+    REG_ULSP_PB1_FRC_ONDEMAND_40        = ULSP_PB1_BASE_ADDR + 0x98,
+    REG_ULSP_PB1_SYNC_ONDEMAND          = ULSP_PB1_BASE_ADDR + 0x9c,
+    REG_ULSP_PB1_SYNC_FIXED      = ULSP_PB1_BASE_ADDR + 0xa0,
+    REG_ULSP_PB1_SYNC_FIXED_ONDEMAND    = ULSP_PB1_BASE_ADDR + 0xa4,
+
+    REG_ULSP_PB1_CON_LOCK_MARKER        = ULSP_PB1_BASE_ADDR + 0xb0,
+    REG_ULSP_PB1_CON_BEFORE_START       = ULSP_PB1_BASE_ADDR + 0xb4,
+    REG_ULSP_PB1_RUN_TIME_MANAGE        = ULSP_PB1_BASE_ADDR + 0xb8,
+    REG_ULSP_PB1_STATUS                 = ULSP_PB1_BASE_ADDR + 0xbc,
+    REG_ULSP_PB1_OVERFLOW_STA           = ULSP_PB1_BASE_ADDR + 0xc0,
+    REG_ULSP_PB1_OVERFLOW_STA_CLR       = ULSP_PB1_BASE_ADDR + 0xc4,
+    REG_ULSP_PB1_BUF_DBG_READ_PTR       = ULSP_PB1_BASE_ADDR + 0xc8,
+    REG_ULSP_PB1_BUF_DBG_READ_DATA      = ULSP_PB1_BASE_ADDR + 0xcc,
+    REG_ULSP_PB1_BUF_DATA_WRITE_PTR     = ULSP_PB1_BASE_ADDR + 0xd0,
+    REG_ULSP_PB1_DBG_INFO               = ULSP_PB1_BASE_ADDR + 0xd4,
+    REG_ULSP_PB1_STALL_CORE_EN          = ULSP_PB1_BASE_ADDR + 0xe0,
+    REG_ULSP_PB1_CORE_SOURCE_ID_BASE    = ULSP_PB1_BASE_ADDR + 0xe4,
+    REG_ULSP_PB1_READ_FRC_EN            = ULSP_PB1_BASE_ADDR + 0xf0,
+    REG_ULSP_PB1_READ_FRC_READY         = ULSP_PB1_BASE_ADDR + 0xf4,
+    REG_ULSP_PB1_READ_FRC_VAL_MSB32     = ULSP_PB1_BASE_ADDR + 0xf8,
+    REG_ULSP_PB1_READ_FRC_VAL_LSB32     = ULSP_PB1_BASE_ADDR + 0xfc,
+
+    /*--------------------------------------------------------
+        ULS+ L1 registers
+    --------------------------------------------------------*/
+
+    REG_ULSP_L1_DEBUG_INFO          = ULSP_PB0_BASE_ADDR + 0xd8,
+    REG_ULSP_L1_SW_RESET            = ULSP_PB0_BASE_ADDR + 0xdc
+};
+#else //defined(__MD97__)
+enum ULSP_Registers
+{
+    /*--------------------------------------------------------
+        ULS+ PB0 registers
+    --------------------------------------------------------*/
+
+    REG_ULSP_PB0_DATA_F_8               = ULSP_PB0_BASE_ADDR + 0x00,
+    REG_ULSP_PB0_DATA_F_16              = ULSP_PB0_BASE_ADDR + 0x04,
+    REG_ULSP_PB0_DATA_F_24              = ULSP_PB0_BASE_ADDR + 0x08,
+    REG_ULSP_PB0_DATA_F_32              = ULSP_PB0_BASE_ADDR + 0x0c,
+    REG_ULSP_PB0_DATA_M_8               = ULSP_PB0_BASE_ADDR + 0x10,
+    REG_ULSP_PB0_DATA_M_16              = ULSP_PB0_BASE_ADDR + 0x14,
+    REG_ULSP_PB0_DATA_M_24              = ULSP_PB0_BASE_ADDR + 0x18,
+    REG_ULSP_PB0_DATA_M_32              = ULSP_PB0_BASE_ADDR + 0x1c,
+    REG_ULSP_PB0_DATA_L_8               = ULSP_PB0_BASE_ADDR + 0x20,
+    REG_ULSP_PB0_DATA_L_16              = ULSP_PB0_BASE_ADDR + 0x24,
+    REG_ULSP_PB0_DATA_L_24              = ULSP_PB0_BASE_ADDR + 0x28,
+    REG_ULSP_PB0_DATA_L_32              = ULSP_PB0_BASE_ADDR + 0x2c,
+    REG_ULSP_PB0_DATA_S_8               = ULSP_PB0_BASE_ADDR + 0x30,
+    REG_ULSP_PB0_DATA_S_16              = ULSP_PB0_BASE_ADDR + 0x34,
+    REG_ULSP_PB0_DATA_S_24              = ULSP_PB0_BASE_ADDR + 0x38,
+    REG_ULSP_PB0_DATA_S_32              = ULSP_PB0_BASE_ADDR + 0x3c,
+    REG_ULSP_PB0_DATA_F_TS_8            = ULSP_PB0_BASE_ADDR + 0x40,
+    REG_ULSP_PB0_DATA_F_TS_16           = ULSP_PB0_BASE_ADDR + 0x44,
+    REG_ULSP_PB0_DATA_F_TS_24           = ULSP_PB0_BASE_ADDR + 0x48,
+    REG_ULSP_PB0_DATA_F_TS_32           = ULSP_PB0_BASE_ADDR + 0x4c,
+    REG_ULSP_PB0_DATA_S_TS_8            = ULSP_PB0_BASE_ADDR + 0x50,
+    REG_ULSP_PB0_DATA_S_TS_16           = ULSP_PB0_BASE_ADDR + 0x54,
+    REG_ULSP_PB0_DATA_S_TS_24           = ULSP_PB0_BASE_ADDR + 0x58,
+    REG_ULSP_PB0_DATA_S_TS_32           = ULSP_PB0_BASE_ADDR + 0x5c,
+    REG_ULSP_PB0_SYNC                   = ULSP_PB0_BASE_ADDR + 0x60,
+    REG_ULSP_PB0_FRC                    = ULSP_PB0_BASE_ADDR + 0x64,
+
+    REG_ULSP_PB0_CON_LOCK_MARKER        = ULSP_PB0_BASE_ADDR + 0x70,
+    REG_ULSP_PB0_CON_BEFORE_START       = ULSP_PB0_BASE_ADDR + 0x74,
+    REG_ULSP_PB0_RUN_TIME_MANAGE        = ULSP_PB0_BASE_ADDR + 0x78,
+    REG_ULSP_PB0_STATUS                 = ULSP_PB0_BASE_ADDR + 0x7c,
+    REG_ULSP_PB0_OVERFLOW_STA           = ULSP_PB0_BASE_ADDR + 0x80,
+    REG_ULSP_PB0_OVERFLOW_STA_CLR       = ULSP_PB0_BASE_ADDR + 0x84,
+    REG_ULSP_PB0_BUF_DBG_READ_PTR       = ULSP_PB0_BASE_ADDR + 0x88,
+    REG_ULSP_PB0_BUF_DBG_READ_DATA      = ULSP_PB0_BASE_ADDR + 0x8c,
+    REG_ULSP_PB0_BUF_DATA_WRITE_PTR     = ULSP_PB0_BASE_ADDR + 0x90,
+    REG_ULSP_PB0_DBG_INFO               = ULSP_PB0_BASE_ADDR + 0x94,
+    REG_ULSP_PB0_READ_FRC_EN            = ULSP_PB0_BASE_ADDR + 0xa0,
+    REG_ULSP_PB0_READ_FRC_READY         = ULSP_PB0_BASE_ADDR + 0xa4,
+    REG_ULSP_PB0_READ_FRC_VAL_MSB32     = ULSP_PB0_BASE_ADDR + 0xa8,
+    REG_ULSP_PB0_READ_FRC_VAL_LSB32     = ULSP_PB0_BASE_ADDR + 0xac,
+    REG_ULSP_PB0_STALL_CORE_EN          = ULSP_PB0_BASE_ADDR + 0xb0,
+    REG_ULSP_PB0_CORE_SOURCE_ID_BASE    = ULSP_PB0_BASE_ADDR + 0xd0,
+
+    /*--------------------------------------------------------
+        ULS+ PB1 registers
+    --------------------------------------------------------*/
+
+    REG_ULSP_PB1_DATA_F_8               = ULSP_PB1_BASE_ADDR + 0x00,
+    REG_ULSP_PB1_DATA_F_16              = ULSP_PB1_BASE_ADDR + 0x04,
+    REG_ULSP_PB1_DATA_F_24              = ULSP_PB1_BASE_ADDR + 0x08,
+    REG_ULSP_PB1_DATA_F_32              = ULSP_PB1_BASE_ADDR + 0x0c,
+    REG_ULSP_PB1_DATA_M_8               = ULSP_PB1_BASE_ADDR + 0x10,
+    REG_ULSP_PB1_DATA_M_16              = ULSP_PB1_BASE_ADDR + 0x14,
+    REG_ULSP_PB1_DATA_M_24              = ULSP_PB1_BASE_ADDR + 0x18,
+    REG_ULSP_PB1_DATA_M_32              = ULSP_PB1_BASE_ADDR + 0x1c,
+    REG_ULSP_PB1_DATA_L_8               = ULSP_PB1_BASE_ADDR + 0x20,
+    REG_ULSP_PB1_DATA_L_16              = ULSP_PB1_BASE_ADDR + 0x24,
+    REG_ULSP_PB1_DATA_L_24              = ULSP_PB1_BASE_ADDR + 0x28,
+    REG_ULSP_PB1_DATA_L_32              = ULSP_PB1_BASE_ADDR + 0x2c,
+    REG_ULSP_PB1_DATA_S_8               = ULSP_PB1_BASE_ADDR + 0x30,
+    REG_ULSP_PB1_DATA_S_16              = ULSP_PB1_BASE_ADDR + 0x34,
+    REG_ULSP_PB1_DATA_S_24              = ULSP_PB1_BASE_ADDR + 0x38,
+    REG_ULSP_PB1_DATA_S_32              = ULSP_PB1_BASE_ADDR + 0x3c,
+    REG_ULSP_PB1_DATA_F_TS_8            = ULSP_PB1_BASE_ADDR + 0x40,
+    REG_ULSP_PB1_DATA_F_TS_16           = ULSP_PB1_BASE_ADDR + 0x44,
+    REG_ULSP_PB1_DATA_F_TS_24           = ULSP_PB1_BASE_ADDR + 0x48,
+    REG_ULSP_PB1_DATA_F_TS_32           = ULSP_PB1_BASE_ADDR + 0x4c,
+    REG_ULSP_PB1_DATA_S_TS_8            = ULSP_PB1_BASE_ADDR + 0x50,
+    REG_ULSP_PB1_DATA_S_TS_16           = ULSP_PB1_BASE_ADDR + 0x54,
+    REG_ULSP_PB1_DATA_S_TS_24           = ULSP_PB1_BASE_ADDR + 0x58,
+    REG_ULSP_PB1_DATA_S_TS_32           = ULSP_PB1_BASE_ADDR + 0x5c,
+    REG_ULSP_PB1_SYNC                   = ULSP_PB1_BASE_ADDR + 0x60,
+    REG_ULSP_PB1_FRC                    = ULSP_PB1_BASE_ADDR + 0x64,
+
+    REG_ULSP_PB1_CON_LOCK_MARKER        = ULSP_PB1_BASE_ADDR + 0x70,
+    REG_ULSP_PB1_CON_BEFORE_START       = ULSP_PB1_BASE_ADDR + 0x74,
+    REG_ULSP_PB1_RUN_TIME_MANAGE        = ULSP_PB1_BASE_ADDR + 0x78,
+    REG_ULSP_PB1_STATUS                 = ULSP_PB1_BASE_ADDR + 0x7c,
+    REG_ULSP_PB1_OVERFLOW_STA           = ULSP_PB1_BASE_ADDR + 0x80,
+    REG_ULSP_PB1_OVERFLOW_STA_CLR       = ULSP_PB1_BASE_ADDR + 0x84,
+    REG_ULSP_PB1_BUF_DBG_READ_PTR       = ULSP_PB1_BASE_ADDR + 0x88,
+    REG_ULSP_PB1_BUF_DBG_READ_DATA      = ULSP_PB1_BASE_ADDR + 0x8c,
+    REG_ULSP_PB1_BUF_DATA_WRITE_PTR     = ULSP_PB1_BASE_ADDR + 0x90,
+    REG_ULSP_PB1_DBG_INFO               = ULSP_PB1_BASE_ADDR + 0x94,
+    REG_ULSP_PB1_READ_FRC_EN            = ULSP_PB1_BASE_ADDR + 0xa0,
+    REG_ULSP_PB1_READ_FRC_READY         = ULSP_PB1_BASE_ADDR + 0xa4,
+    REG_ULSP_PB1_READ_FRC_VAL_MSB32     = ULSP_PB1_BASE_ADDR + 0xa8,
+    REG_ULSP_PB1_READ_FRC_VAL_LSB32     = ULSP_PB1_BASE_ADDR + 0xac,
+    REG_ULSP_PB1_STALL_CORE_EN          = ULSP_PB1_BASE_ADDR + 0xb0,
+    REG_ULSP_PB1_CORE_SOURCE_ID_BASE    = ULSP_PB1_BASE_ADDR + 0xd0,
+
+    /*--------------------------------------------------------
+        ULS+ Level 1 registers
+    --------------------------------------------------------*/
+
+#ifdef __MD93__
+    REG_ULSP_L1_DEBUG_FLAG              = ULSP_PB0_BASE_ADDR + 0xc0,
+    REG_ULSP_L1_DEBUG_FLAG_SEL          = ULSP_PB0_BASE_ADDR + 0xc4,
+#else   // Note: Gen95 modified register base!!
+    REG_ULSP_L1_DEBUG_INFO              = ULSP_PB0_BASE_ADDR + 0xc0,
+    REG_ULSP_L1_DEBUG_SW_RESET          = ULSP_PB0_BASE_ADDR + 0xc4,
+#endif
+
+
+};
+#endif //defined(__MD97__)
+#define ULSP_CON_LOCK_MARKER (0xACCE)
+
+/*---------------------------------------------------------------------------
+ | @macro ULSP_READ
+ | @brief Read the contents of a ULS register.
+ |
+ | @param[in] ulsp_reg - name of ULS Register to read.
+ |
+ | @return kal_uint32 data read from the specified ULS register.
+ |
+ ---------------------------------------------------------------------------*/
+#define ULSP_READ(ulsp_reg)           (*(volatile kal_uint32 *)(ulsp_reg))
+
+/*---------------------------------------------------------------------------
+ | @macro ULSP_WRITE
+ | @brief Write a 32bit data to the specified ULS register.
+ |
+ | @param[in] ulsp_reg - Name of the ULS Register to be updated.
+ | @param[in] data    - 32 bit data word.
+ |
+ ---------------------------------------------------------------------------*/
+#define ULSP_WRITE(ulsp_reg, data) \
+    {ULSP_READ(ulsp_reg) = data;\
+        do { \
+            kal_uint32 lock = ULSP_READ(ulsp_reg); \
+            if(lock != (data)){lock = ULSP_READ(ulsp_reg);} \
+        } while(0);}
+
+#define ULSP_WRITE_DATA(ulsp_reg, data)   ULSP_READ(ulsp_reg) = ((kal_uint32)(data))
+
+
+//Macros to read and write 1 bit and set of bits in a register
+//TODO check BIT_MASK() on Target
+#define BIT_MASK_LSHIFT_COUNT(bit_from, bit_to) (32 - (bit_to - bit_from + 1))
+
+// BIT_MASK() 1. 32 bit 1s, 2. left shift, 3. right shift
+#define BIT_MASK(bit_from, bit_to) (((size_t)0xFFFFFFFFFFFFFFFF << BIT_MASK_LSHIFT_COUNT(bit_from, bit_to)) >> (BIT_MASK_LSHIFT_COUNT(bit_from, bit_to) - bit_from))
+
+#define CLEAR_BIT(val, bit)                         (val & ~(1 << bit))
+#define CLEAR_BITS(val, bit_from, bit_to)           (val & ~BIT_MASK(bit_from, bit_to))
+
+#define ULSP_READ_BIT(reg, bit)                     ((ULSP_READ(reg) & (1 << bit)) >> bit)
+#define ULSP_READ_BITS(reg, bit_from, bit_to)       ((ULSP_READ(reg) & BIT_MASK(bit_from, bit_to)) >> bit_from)
+
+#define ULSP_WRITE_BIT(reg, bit, val)               (ULSP_WRITE(reg, CLEAR_BIT(ULSP_READ(reg), bit) | ((val & 1) << bit)))
+
+// ULSP_WRITE_BITS() 1. read reg, 2. clear bits, 3. shift-left val, 4. mask bits with (3), 5. bit-or with (2) 6. write reg
+#define ULSP_WRITE_BITS(reg, bit_from, bit_to, val) (ULSP_WRITE(reg, CLEAR_BITS(ULSP_READ(reg), bit_from, bit_to) | ((val << bit_from) & BIT_MASK(bit_from, bit_to)) ))
+
+/*---------------------------------------------------------------------------
+    PB0_CON_BEFORE_START register fields
+---------------------------------------------------------------------------*/
+
+#define ULSP_READ_PB0_CLK_DIS()                 (ULSP_READ_BIT(REG_ULSP_PB0_CON_BEFORE_START, 0))
+#define ULSP_READ_PB0_START()                   (ULSP_READ_BIT(REG_ULSP_PB0_CON_BEFORE_START, 1))
+#define ULSP_READ_PB0_RESET()                   (ULSP_READ_BIT(REG_ULSP_PB0_CON_BEFORE_START, 2))
+#define ULSP_READ_PB0_AUTO_TEST_EN()            (ULSP_READ_BIT(REG_ULSP_PB0_CON_BEFORE_START, 3))
+#define ULSP_READ_PB0_INCR_TEST_EN()            (ULSP_READ_BIT(REG_ULSP_PB0_CON_BEFORE_START, 4))
+#define ULSP_READ_PB0_PRIORITY()                (ULSP_READ_BITS(REG_ULSP_PB0_CON_BEFORE_START, 8, 10))
+#define ULSP_READ_PB0_ULTRA_HIGH_PRIORITY()     (ULSP_READ_BIT(REG_ULSP_PB0_CON_BEFORE_START, 12))
+#define ULSP_READ_PB0_SOURCE_ID()               (ULSP_READ_BITS(REG_ULSP_PB0_CON_BEFORE_START, 16, 20))
+#define ULSP_READ_PB0_BUF_UNLOCK_THS()          (ULSP_READ_BITS(REG_ULSP_PB0_CON_BEFORE_START, 24, 25))
+
+#define ULSP_WRITE_PB0_CLK_DIS(val)             (ULSP_WRITE_BIT(REG_ULSP_PB0_CON_BEFORE_START, 0, (val)))
+#define ULSP_WRITE_PB0_START(val)               (ULSP_WRITE_BIT(REG_ULSP_PB0_CON_BEFORE_START, 1, (val)))
+#define ULSP_WRITE_PB0_RESET(val)               (ULSP_WRITE_BIT(REG_ULSP_PB0_CON_BEFORE_START, 2, (val)))
+#define ULSP_WRITE_PB0_AUTO_TEST_EN(val)        (ULSP_WRITE_BIT(REG_ULSP_PB0_CON_BEFORE_START, 3, (val)))
+#define ULSP_WRITE_PB0_INCR_TEST_EN(val)        (ULSP_WRITE_BIT(REG_ULSP_PB0_CON_BEFORE_START, 4, (val)))
+#define ULSP_WRITE_PB0_PRIORITY(val)            (ULSP_WRITE_BITS(REG_ULSP_PB0_CON_BEFORE_START, 8, 10, (val)))
+#define ULSP_WRITE_PB0_ULTRA_HIGH_PRIORITY(val) (ULSP_WRITE_BIT(REG_ULSP_PB0_CON_BEFORE_START, 12, (val)))
+#define ULSP_WRITE_PB0_SOURCE_ID(val)           (ULSP_WRITE_BITS(REG_ULSP_PB0_CON_BEFORE_START, 16, 20, (val)))
+#define ULSP_WRITE_PB0_BUF_UNLOCK_THS(val)      (ULSP_WRITE_BITS(REG_ULSP_PB0_CON_BEFORE_START, 24, 25, (val)))
+
+/*---------------------------------------------------------------------------
+    PB0_RUN_TIME_MANAGE register fields
+---------------------------------------------------------------------------*/
+
+#define ULSP_READ_PB0_RESUME_AFTER_ABORT()      (ULSP_READ_BIT(REG_ULSP_PB0_RUN_TIME_MANAGE, 0))
+#define ULSP_READ_PB0_RESUME_AFTER_FLUSH()      (ULSP_READ_BIT(REG_ULSP_PB0_RUN_TIME_MANAGE, 1))
+#define ULSP_READ_PB0_ABORT()                   (ULSP_READ_BIT(REG_ULSP_PB0_RUN_TIME_MANAGE, 2))
+#define ULSP_READ_PB0_FLUSH()                   (ULSP_READ_BIT(REG_ULSP_PB0_RUN_TIME_MANAGE, 3))
+#define ULSP_READ_PB0_DISABLE_OUTPUT()          (ULSP_READ_BIT(REG_ULSP_PB0_RUN_TIME_MANAGE, 4))
+#define ULSP_READ_PB0_DISABLE_INPUT()           (ULSP_READ_BIT(REG_ULSP_PB0_RUN_TIME_MANAGE, 5))
+
+#define ULSP_WRITE_PB0_RESUME_AFTER_ABORT(val)  (ULSP_WRITE_BIT(REG_ULSP_PB0_RUN_TIME_MANAGE, 0, (val)))
+#define ULSP_WRITE_PB0_RESUME_AFTER_FLUSH(val)  (ULSP_WRITE_BIT(REG_ULSP_PB0_RUN_TIME_MANAGE, 1, (val)))
+#define ULSP_WRITE_PB0_ABORT(val)               (ULSP_WRITE_BIT(REG_ULSP_PB0_RUN_TIME_MANAGE, 2, (val)))
+#define ULSP_WRITE_PB0_FLUSH(val)               (ULSP_WRITE_BIT(REG_ULSP_PB0_RUN_TIME_MANAGE, 3, (val)))
+#define ULSP_WRITE_PB0_DISABLE_OUTPUT(val)      (ULSP_WRITE_BIT(REG_ULSP_PB0_RUN_TIME_MANAGE, 4, (val)))
+#define ULSP_WRITE_PB0_DISABLE_INPUT(val)       (ULSP_WRITE_BIT(REG_ULSP_PB0_RUN_TIME_MANAGE, 5, (val)))
+
+/*---------------------------------------------------------------------------
+    PB0_STATUS register fields
+---------------------------------------------------------------------------*/
+
+#define ULSP_READ_PB0_ABORT_DONE()              (ULSP_READ_BIT(REG_ULSP_PB0_STATUS, 0))
+#define ULSP_READ_PB0_FLUSH_DONE()              (ULSP_READ_BIT(REG_ULSP_PB0_STATUS, 1))
+#define ULSP_READ_PB0_BUF_FULL()                (ULSP_READ_BIT(REG_ULSP_PB0_STATUS, 2))
+#define ULSP_READ_PB0_BUF_LOCK()                (ULSP_READ_BIT(REG_ULSP_PB0_STATUS, 3))
+#define ULSP_READ_PB0_BUF_SIZE()                (ULSP_READ_BITS(REG_ULSP_PB0_STATUS, 8, 9))
+#define ULSP_READ_PB0_BUF_USED_SPACE()          (ULSP_READ_BITS(REG_ULSP_PB0_STATUS, 24, 30))
+
+/*---------------------------------------------------------------------------
+    PB0_OVERFLOW_STA register fields
+---------------------------------------------------------------------------*/
+
+#define ULSP_READ_PB0_OVF_DATA_NUM()            (ULSP_READ_BITS(REG_ULSP_PB0_OVERFLOW_STA, 0, 11))
+#define ULSP_READ_PB0_OVF_PACKET_NUM()          (ULSP_READ_BITS(REG_ULSP_PB0_OVERFLOW_STA, 12, 19))
+
+/*---------------------------------------------------------------------------
+    PB0_OVERFLOW_STA_CLR register fields
+---------------------------------------------------------------------------*/
+
+#define ULSP_READ_PB0_OVF_DATA_NUM_CLEAR()      (ULSP_READ_BIT(REG_ULSP_PB0_OVERFLOW_STA_CLR, 0))
+#define ULSP_READ_PB0_OVF_PACKET_NUM_CLEAR()    (ULSP_READ_BIT(REG_ULSP_PB0_OVERFLOW_STA_CLR, 1))
+
+#define ULSP_WRITE_PB0_OVF_DATA_NUM_CLEAR(val)      (ULSP_WRITE_BIT(REG_ULSP_PB0_OVERFLOW_STA_CLR, 0, (val)))
+#define ULSP_WRITE_PB0_OVF_PACKET_NUM_CLEAR(val)    (ULSP_WRITE_BIT(REG_ULSP_PB0_OVERFLOW_STA_CLR, 1, (val)))
+
+/*---------------------------------------------------------------------------
+    PB1_CON_BEFORE_START register fields
+---------------------------------------------------------------------------*/
+
+#define ULSP_READ_PB1_CLK_DIS()                 (ULSP_READ_BIT(REG_ULSP_PB1_CON_BEFORE_START, 0))
+#define ULSP_READ_PB1_START()                   (ULSP_READ_BIT(REG_ULSP_PB1_CON_BEFORE_START, 1))
+#define ULSP_READ_PB1_RESET()                   (ULSP_READ_BIT(REG_ULSP_PB1_CON_BEFORE_START, 2))
+#define ULSP_READ_PB1_AUTO_TEST_EN()            (ULSP_READ_BIT(REG_ULSP_PB1_CON_BEFORE_START, 3))
+#define ULSP_READ_PB1_INCR_TEST_EN()            (ULSP_READ_BIT(REG_ULSP_PB1_CON_BEFORE_START, 4))
+#define ULSP_READ_PB1_PRIORITY()                (ULSP_READ_BITS(REG_ULSP_PB1_CON_BEFORE_START, 8, 10))
+#define ULSP_READ_PB1_ULTRA_HIGH_PRIORITY()     (ULSP_READ_BIT(REG_ULSP_PB1_CON_BEFORE_START, 12))
+#define ULSP_READ_PB1_SOURCE_ID()               (ULSP_READ_BITS(REG_ULSP_PB1_CON_BEFORE_START, 16, 20))
+#define ULSP_READ_PB1_BUF_UNLOCK_THS()          (ULSP_READ_BITS(REG_ULSP_PB1_CON_BEFORE_START, 24, 25))
+
+#define ULSP_WRITE_PB1_CLK_DIS(val)             (ULSP_WRITE_BIT(REG_ULSP_PB1_CON_BEFORE_START, 0, (val)))
+#define ULSP_WRITE_PB1_START(val)               (ULSP_WRITE_BIT(REG_ULSP_PB1_CON_BEFORE_START, 1, (val)))
+#define ULSP_WRITE_PB1_RESET(val)               (ULSP_WRITE_BIT(REG_ULSP_PB1_CON_BEFORE_START, 2, (val)))
+#define ULSP_WRITE_PB1_AUTO_TEST_EN(val)        (ULSP_WRITE_BIT(REG_ULSP_PB1_CON_BEFORE_START, 3, (val)))
+#define ULSP_WRITE_PB1_INCR_TEST_EN(val)        (ULSP_WRITE_BIT(REG_ULSP_PB1_CON_BEFORE_START, 4, (val)))
+#define ULSP_WRITE_PB1_PRIORITY(val)            (ULSP_WRITE_BITS(REG_ULSP_PB1_CON_BEFORE_START, 8, 10, (val)))
+#define ULSP_WRITE_PB1_ULTRA_HIGH_PRIORITY(val) (ULSP_WRITE_BIT(REG_ULSP_PB1_CON_BEFORE_START, 12, (val)))
+#define ULSP_WRITE_PB1_SOURCE_ID(val)           (ULSP_WRITE_BITS(REG_ULSP_PB1_CON_BEFORE_START, 16, 20, (val)))
+#define ULSP_WRITE_PB1_BUF_UNLOCK_THS(val)      (ULSP_WRITE_BITS(REG_ULSP_PB1_CON_BEFORE_START, 24, 25, (val)))
+
+/*---------------------------------------------------------------------------
+    PB1_RUN_TIME_MANAGE register fields
+---------------------------------------------------------------------------*/
+
+#define ULSP_READ_PB1_RESUME_AFTER_ABORT()      (ULSP_READ_BIT(REG_ULSP_PB1_RUN_TIME_MANAGE, 0))
+#define ULSP_READ_PB1_RESUME_AFTER_FLUSH()      (ULSP_READ_BIT(REG_ULSP_PB1_RUN_TIME_MANAGE, 1))
+#define ULSP_READ_PB1_ABORT()                   (ULSP_READ_BIT(REG_ULSP_PB1_RUN_TIME_MANAGE, 2))
+#define ULSP_READ_PB1_FLUSH()                   (ULSP_READ_BIT(REG_ULSP_PB1_RUN_TIME_MANAGE, 3))
+#define ULSP_READ_PB1_DISABLE_OUTPUT()          (ULSP_READ_BIT(REG_ULSP_PB1_RUN_TIME_MANAGE, 4))
+#define ULSP_READ_PB1_DISABLE_INPUT()           (ULSP_READ_BIT(REG_ULSP_PB1_RUN_TIME_MANAGE, 5))
+
+#define ULSP_WRITE_PB1_RESUME_AFTER_ABORT(val)  (ULSP_WRITE_BIT(REG_ULSP_PB1_RUN_TIME_MANAGE, 0, (val)))
+#define ULSP_WRITE_PB1_RESUME_AFTER_FLUSH(val)  (ULSP_WRITE_BIT(REG_ULSP_PB1_RUN_TIME_MANAGE, 1, (val)))
+#define ULSP_WRITE_PB1_ABORT(val)               (ULSP_WRITE_BIT(REG_ULSP_PB1_RUN_TIME_MANAGE, 2, (val)))
+#define ULSP_WRITE_PB1_FLUSH(val)               (ULSP_WRITE_BIT(REG_ULSP_PB1_RUN_TIME_MANAGE, 3, (val)))
+#define ULSP_WRITE_PB1_DISABLE_OUTPUT(val)      (ULSP_WRITE_BIT(REG_ULSP_PB1_RUN_TIME_MANAGE, 4, (val)))
+#define ULSP_WRITE_PB1_DISABLE_INPUT(val)       (ULSP_WRITE_BIT(REG_ULSP_PB1_RUN_TIME_MANAGE, 5, (val)))
+
+/*---------------------------------------------------------------------------
+    PB1_STATUS register fields
+---------------------------------------------------------------------------*/
+
+#define ULSP_READ_PB1_ABORT_DONE()              (ULSP_READ_BIT(REG_ULSP_PB1_STATUS, 0))
+#define ULSP_READ_PB1_FLUSH_DONE()              (ULSP_READ_BIT(REG_ULSP_PB1_STATUS, 1))
+#define ULSP_READ_PB1_BUF_FULL()                (ULSP_READ_BIT(REG_ULSP_PB1_STATUS, 2))
+#define ULSP_READ_PB1_BUF_LOCK()                (ULSP_READ_BIT(REG_ULSP_PB1_STATUS, 3))
+#define ULSP_READ_PB1_BUF_SIZE()                (ULSP_READ_BITS(REG_ULSP_PB1_STATUS, 8, 9))
+#define ULSP_READ_PB1_BUF_USED_SPACE()          (ULSP_READ_BITS(REG_ULSP_PB1_STATUS, 24, 30))
+
+/*---------------------------------------------------------------------------
+    PB1_OVERFLOW_STA register fields
+---------------------------------------------------------------------------*/
+
+#define ULSP_READ_PB1_OVF_DATA_NUM()            (ULSP_READ_BITS(REG_ULSP_PB1_OVERFLOW_STA, 0, 11))
+#define ULSP_READ_PB1_OVF_PACKET_NUM()          (ULSP_READ_BITS(REG_ULSP_PB1_OVERFLOW_STA, 12, 19))
+
+/*---------------------------------------------------------------------------
+    PB1_OVERFLOW_STA_CLR register fields
+---------------------------------------------------------------------------*/
+
+#define ULSP_READ_PB1_OVF_DATA_NUM_CLEAR()      (ULSP_READ_BIT(REG_ULSP_PB1_OVERFLOW_STA_CLR, 0))
+#define ULSP_READ_PB1_OVF_PACKET_NUM_CLEAR()    (ULSP_READ_BIT(REG_ULSP_PB1_OVERFLOW_STA_CLR, 1))
+
+#define ULSP_WRITE_PB1_OVF_DATA_NUM_CLEAR(val)      (ULSP_WRITE_BIT(REG_ULSP_PB1_OVERFLOW_STA_CLR, 0, (val)))
+#define ULSP_WRITE_PB1_OVF_PACKET_NUM_CLEAR(val)    (ULSP_WRITE_BIT(REG_ULSP_PB1_OVERFLOW_STA_CLR, 1, (val)))
+
+/*---------------------------------------------------------------------------
+ * Separate a wrapper layer between ULS+ and DHL
+ ---------------------------------------------------------------------------*/
+
+/************************************ PB0 ************************************/
+
+#define ULSP_WRITE_PB0_F_32(value)  ULSP_WRITE_DATA(REG_ULSP_PB0_DATA_F_32, value)
+#define ULSP_WRITE_PB0_F_24(value)  ULSP_WRITE_DATA(REG_ULSP_PB0_DATA_F_24, value)
+#define ULSP_WRITE_PB0_F_16(value)  ULSP_WRITE_DATA(REG_ULSP_PB0_DATA_F_16, value)
+#define ULSP_WRITE_PB0_F_8(value)   ULSP_WRITE_DATA(REG_ULSP_PB0_DATA_F_8, value)
+
+#define ULSP_WRITE_PB0_M_32(value)  ULSP_WRITE_DATA(REG_ULSP_PB0_DATA_M_32, value)
+#define ULSP_WRITE_PB0_M_24(value)  ULSP_WRITE_DATA(REG_ULSP_PB0_DATA_M_24, value)
+#define ULSP_WRITE_PB0_M_16(value)  ULSP_WRITE_DATA(REG_ULSP_PB0_DATA_M_16, value)
+#define ULSP_WRITE_PB0_M_8(value)   ULSP_WRITE_DATA(REG_ULSP_PB0_DATA_M_8, value)
+
+#define ULSP_WRITE_PB0_L_32(value)  ULSP_WRITE_DATA(REG_ULSP_PB0_DATA_L_32, value)
+#define ULSP_WRITE_PB0_L_24(value)  ULSP_WRITE_DATA(REG_ULSP_PB0_DATA_L_24, value)
+#define ULSP_WRITE_PB0_L_16(value)  ULSP_WRITE_DATA(REG_ULSP_PB0_DATA_L_16, value)
+#define ULSP_WRITE_PB0_L_8(value)   ULSP_WRITE_DATA(REG_ULSP_PB0_DATA_L_8, value)
+
+#define ULSP_WRITE_PB0_S_32(value)  ULSP_WRITE_DATA(REG_ULSP_PB0_DATA_S_32, value)
+#define ULSP_WRITE_PB0_S_24(value)  ULSP_WRITE_DATA(REG_ULSP_PB0_DATA_S_24, value)
+#define ULSP_WRITE_PB0_S_16(value)  ULSP_WRITE_DATA(REG_ULSP_PB0_DATA_S_16, value)
+#define ULSP_WRITE_PB0_S_8(value)   ULSP_WRITE_DATA(REG_ULSP_PB0_DATA_S_8, value)
+
+#define ULSP_WRITE_PB0_SYNC(value)  ULSP_WRITE_DATA(REG_ULSP_PB0_SYNC, value)
+#define ULSP_WRITE_PB0_FRC(value)   ULSP_WRITE_DATA(REG_ULSP_PB0_FRC, value)
+
+
+/************************************ PB1 ************************************/
+
+#define ULSP_WRITE_PB1_F_32(value)  ULSP_WRITE_DATA(REG_ULSP_PB1_DATA_F_32, value)
+#define ULSP_WRITE_PB1_F_24(value)  ULSP_WRITE_DATA(REG_ULSP_PB1_DATA_F_24, value)
+#define ULSP_WRITE_PB1_F_16(value)  ULSP_WRITE_DATA(REG_ULSP_PB1_DATA_F_16, value)
+#define ULSP_WRITE_PB1_F_8(value)   ULSP_WRITE_DATA(REG_ULSP_PB1_DATA_F_8, value)
+
+#define ULSP_WRITE_PB1_M_32(value)  ULSP_WRITE_DATA(REG_ULSP_PB1_DATA_M_32, value)
+#define ULSP_WRITE_PB1_M_24(value)  ULSP_WRITE_DATA(REG_ULSP_PB1_DATA_M_24, value)
+#define ULSP_WRITE_PB1_M_16(value)  ULSP_WRITE_DATA(REG_ULSP_PB1_DATA_M_16, value)
+#define ULSP_WRITE_PB1_M_8(value)   ULSP_WRITE_DATA(REG_ULSP_PB1_DATA_M_8, value)
+
+#define ULSP_WRITE_PB1_L_32(value)  ULSP_WRITE_DATA(REG_ULSP_PB1_DATA_L_32, value)
+#define ULSP_WRITE_PB1_L_24(value)  ULSP_WRITE_DATA(REG_ULSP_PB1_DATA_L_24, value)
+#define ULSP_WRITE_PB1_L_16(value)  ULSP_WRITE_DATA(REG_ULSP_PB1_DATA_L_16, value)
+#define ULSP_WRITE_PB1_L_8(value)   ULSP_WRITE_DATA(REG_ULSP_PB1_DATA_L_8, value)
+
+#define ULSP_WRITE_PB1_S_32(value)  ULSP_WRITE_DATA(REG_ULSP_PB1_DATA_S_32, value)
+#define ULSP_WRITE_PB1_S_24(value)  ULSP_WRITE_DATA(REG_ULSP_PB1_DATA_S_24, value)
+#define ULSP_WRITE_PB1_S_16(value)  ULSP_WRITE_DATA(REG_ULSP_PB1_DATA_S_16, value)
+#define ULSP_WRITE_PB1_S_8(value)   ULSP_WRITE_DATA(REG_ULSP_PB1_DATA_S_8, value)
+
+#define ULSP_WRITE_PB1_SYNC(value)  ULSP_WRITE_DATA(REG_ULSP_PB1_SYNC, value)
+#define ULSP_WRITE_PB1_FRC(value)   ULSP_WRITE_DATA(REG_ULSP_PB1_FRC, value)
+
+
+#endif
+
+/*---------------------------------------------------------------------------
+    ULSP SW Encoder
+---------------------------------------------------------------------------*/
+typedef enum
+{
+    ULSP_ENC_FIRST,
+    ULSP_ENC_MIDDLE,
+    ULSP_ENC_LAST,
+    ULSP_ENC_SINGLE
+} ULSP_Encoder_Message_Type;
+
+typedef enum
+{
+    ULSP_ENC_L1_LOG,
+    ULSP_ENC_L2_LOG,
+    ULSP_ENC_DSP_INNER_LOG,
+    ULSP_ENC_DSP_BRP_LOG,
+    ULSP_ENC_DSP_FEC_LOG,
+    ULSP_ENC_DSP_SPEECH_LOG,
+    ULSP_ENC_DSP_RAKE_LOG,
+    ULSP_ENC_DSP_SCQ16_0_LOG,
+    ULSP_ENC_DSP_SCQ16_1_LOG,
+    ULSP_ENC_DSP_LOG
+} ULSP_Encoder_Log_Type;
+
+typedef enum
+{
+    ULSP_ENC_MSG_SIZE_8 = 1,
+    ULSP_ENC_MSG_SIZE_16 = 2,
+    ULSP_ENC_MSG_SIZE_24 = 3,
+    ULSP_ENC_MSG_SIZE_32 = 4
+} ULSP_Encoder_Log_Size;
+
+typedef enum
+{
+    ULSP_ENC_PACKET_TYPE_DROP = 0,
+    ULSP_ENC_PACKET_TYPE_COMPLETE_PKT,
+    ULSP_ENC_PACKET_TYPE_INCOMPLETE_PKT_F,
+    ULSP_ENC_PACKET_TYPE_INCOMPLETE_PKT_M_ONLY,
+    ULSP_ENC_PACKET_TYPE_INCOMPLETE_PKT_L,
+    ULSP_ENC_PACKET_TYPE_SYNC,
+    ULSP_ENC_PACKET_TYPE_GLOBAL_TS
+} ULSP_Encoder_Packet_Type;
+
+typedef struct
+{
+    kal_uint8 packet_type: 3;
+    kal_uint8 source_id:   5;
+} ulsp_header1;
+
+#ifdef __MD97__
+typedef struct
+{
+    kal_uint8 packet_length: 6;
+    kal_uint8 source_id_h:   2;
+} ulsp_header2;
+
+#else
+typedef struct
+{
+    kal_uint8 packet_length: 7;
+    kal_uint8 timestamp: 1;
+} ulsp_header2;
+
+#endif
+
+extern unsigned int g_ulsp_encoder_curr_len;
+extern char g_ulsp_encoder_error;
+
+void ulsp_encode_header(ULSP_Encoder_Log_Type log_type, kal_uint8 *buf, kal_uint32 length);
+
+void UlspEncodeMessage(kal_uint8 *buf, kal_uint32 max_length,
+                       ULSP_Encoder_Message_Type msg_type,
+                       ULSP_Encoder_Log_Size msg_size,
+                       ULSP_Encoder_Log_Type log_type,
+                       kal_uint32 value);
+
+void UlspEncodeIdleSync(kal_uint8 *buf, kal_uint32 max_length,
+                        ULSP_Encoder_Log_Type log_type);
+
+void UlspEncodeBoundarySync(kal_uint8 *buf, kal_uint32 max_length, ULSP_Encoder_Log_Type log_type);
+
+void UlspEncodeSync(kal_uint8 *buf, kal_uint32 max_length,
+                    ULSP_Encoder_Log_Type log_type, kal_uint32 value);
+
+int UlspEncoderGetCurrentPacketSize();
+int UlspEncoderSourceIdHelper(ULSP_Encoder_Log_Type log_type);
+
+/*---------------------------------------------------------------------------
+    End of ULSP SW Encoder
+---------------------------------------------------------------------------*/
+void set_up_PB0_before_conf_reg();
+void set_up_PB0_after_conf_reg();
+void set_up_PB1_before_conf_reg();
+void set_up_PB1_after_conf_reg();
+
+void UlspMcuLoggingInit();
+
+void send_boundary_SYNC();
+void send_idle_SYNC();
+
+
+void flush_sync_in_l1_channel();
+
+
+
+
+
+
+#endif // defined(__USE_ULSP__) || defined(__USE_ULSP_SW_SIMULATOR__)
+
+
+
+#endif //_ULSP_MCU_LOGGING_H_
+
+
diff --git a/mcu/interface/service/dhl/v1/ulsp_mod_function.h b/mcu/interface/service/dhl/v1/ulsp_mod_function.h
new file mode 100644
index 0000000..6238ffb
--- /dev/null
+++ b/mcu/interface/service/dhl/v1/ulsp_mod_function.h
@@ -0,0 +1,188 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   ulsp_mod_function.h
+ *
+ * Project:
+ * --------
+ *   UMOLYA
+ *
+ * Description:
+ * ------------
+ *   ULS+ logging mod function. Integrating log sequence, uls+ hw control, TX out
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 08 14 2018 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * .
+ *
+ * 06 22 2018 yancy.chien
+ * [MOLY00331449] [Gen97] DHL logging development
+ * 	Migration on UMOLYE.
+ *
+ * 01 22 2018 yancy.chien
+ * [MOLY00298581] [MT6763][Bianco][N1][MTBF][PHONE][HQ][Lab][Ericsson][HCR][ASSERT] file:mcu/common/driver/devdrv/log_seq/src/logseq_drv.c line:800
+ * 	Workaround - DHL part.
+ *
+ * 01 22 2018 yancy.chien
+ * [MOLY00298581] [MT6763][Bianco][N1][MTBF][PHONE][HQ][Lab][Ericsson][HCR][ASSERT] file:mcu/common/driver/devdrv/log_seq/src/logseq_drv.c line:800
+ * Workaround - DHL part.
+ *
+ * 08 08 2017 yu-hsiang.peng
+ * [MOLY00269110] 【主基线】【Other】收集试用用户Modem LOG
+ * [UMOLYA.TRUNK] New PLS mode 1. PS only 2. Both mode
+ *
+ * 08 01 2017 yu-hsiang.peng
+ * [MOLY00266204] [Gen93] Common feature development before control
+ * [UMOLYA.TRUNK] Recycle LS buffer when mdlogger not connect after 60 seconde (FRC version)
+ *
+ * 05 03 2017 yancy.chien
+ * [MOLY00246569] [BIANCO] OST can't enter sleep because MCU/DSP log backup/restore procedure not ready
+ * 1. ULSP logging bandwidth logs
+ * 2. ULSP Dormant flow integration
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ * 	     Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ * 04 05 2017 yu-hsiang.peng
+ * [MOLY00239426] [Bianco] PLS logging support
+ * [UMOLYA.TRUNK] PLS mode porting.
+ *
+ * 03 31 2017 yancy.chien
+ * [MOLY00238999] [DHL][ULSP] Dormant flow integration.
+ *
+ * 03 14 2017 kenneth.lin
+ * [MOLY00235284] [xL1SIM][DHL] support ulsp logging feature in xl1sim
+ *
+ *  DHL support ulsp logging feature in xl1sim
+ *
+ *  1. enable __USE_ULSP__
+ *  2. implement ulsp macro to send ELT directly
+ *
+ * 03 10 2017 yu-hsiang.peng
+ * [MOLY00224307] [MT6293] General feature change before MP branch create
+ * [UMOLYA.TRUNK] Fix target build warning
+ *
+ * 11 01 2016 yu-hsiang.peng
+ * [MOLY00210769] [MT6293] MT6292 CCB service migrate to MT6293 and MT6293 ULSP logging on CCB development
+ * [UMOLYA.TRUNK] ULSP on CCB full load logging, normal logging(stage 1)
+ *
+ * 08 03 2016 yu-hsiang.peng
+ * [MOLY00185213] [MT6293] DHL MT6292 SW logging migrate to MT6293 & MT6293 ULSP logging development
+ * [UMOLYA.TRUNK] Merge back 93 ULSP 1st connect ELT code (stage 4)
+ *
+ * 07 05 2016 yu-hsiang.peng
+ * [MOLY00185213] [MT6293] DHL MT6292 SW logging migrate to MT6293 & MT6293 ULSP logging development
+ * [UMOLYA.TRUNK] Edit all description in ULSP-releated file
+ *
+ *
+ ****************************************************************************/
+
+#ifndef _ULSP_MOD_FUNCTION_H_
+#define _ULSP_MOD_FUNCTION_H_
+
+#include "kal_general_types.h"
+#include "dhl_internal_def.h"
+#include "dhl_def.h"
+
+#if defined(__USE_ULSP__) && defined(__MTK_TARGET__)
+#include "logseq_drv.h"
+#endif
+
+#if defined(__MD97__) && defined(__USE_ULSP__)
+void dhl_trigger_hd_flush_ulsp_mcu_normal_event(void);
+void dhl_trigger_hd_flush_ulsp_mcu_ondemand_event(void);
+void dhl_trigger_hd_flush_ulsp_4g_dsp_normal_event(void);
+void dhl_trigger_hd_flush_ulsp_4g_dsp_ondemand_event(void);
+void dhl_trigger_hd_flush_ulsp_5g_dsp_normal_event(void);
+void dhl_trigger_hd_flush_ulsp_5g_dsp_ondemand_event(void);
+#else
+void dhl_trigger_hd_flush_ulsp_mcu_event(void);
+void dhl_trigger_hd_flush_ulsp_dsp_event(void);
+#endif
+
+#if defined(__MTK_TARGET__)
+#if defined(__USE_ULSP__)
+
+void dhl_ulsp_disable_input();
+void dhl_ulsp_enable_input();
+void dhl_ulsp_config_PB_input_by_filter();
+
+
+void dhl_ulsp_init_ex_dump_region(void);
+
+// Callback functions register to LS
+void dhl_ulsp_ls_full_cb(kal_uint8 id);
+void dhl_ulsp_ls_ex_flush_cb(kal_uint8 id, kal_uint32 address, kal_uint32 length);
+void dhl_ulsp_ls_abort_timeout_cb(kal_uint8 ch_id);
+
+void dhl_ulsp_get_and_ouput_buffer(kal_uint8 ls_ch_id, module_type ownerid);
+void dhl_ulsp_send_buffer_sync(module_type ownerid, dhl_mux_id mux_id, kal_uint8 *buffer, kal_uint32 length);
+void dhl_ulsp_force_ls_trigger_flush();
+void dhl_ulsp_set_ls_stream_mode();
+void dhl_ulsp_set_ls_PLS_mode();
+void dhl_ulsp_recycle_LS_buffer(kal_uint8 ls_ch_id);
+#if defined(__DHL_SP_LOGGING_SUPPORT__) && defined(__MTK_TARGET__) && defined(__DHL_CCB_LOGGING_SUPPORT__)
+void dhl_ulsp_CCB_send_buffer(module_type ownerid, dhl_mux_id mux_id, kal_uint8 *buffer, kal_uint32 length);
+void dhl_ulsp_CCB_tx_done(kal_uint16 muxid,  CCB_ULSP_TYPE type, kal_uint32 *buf_addr, kal_uint32 length);
+void dhl_ulsp_CCB_page_release(CCB_ULSP_TYPE type);
+#endif //defined(__DHL_SP_LOGGING_SUPPORT__) && defined(__MTK_TARGET__) && defined(__DHL_CCB_LOGGING_SUPPORT__)
+
+#endif // #if defined(__USE_ULSP__)
+#endif //#if defined(__MTK_TARGET__)
+void ulsp_mcu_backup();
+void ulsp_mcu_restore();
+kal_bool ulsp_check_lock_sleep();
+void dhl_ulsp_disable_input();
+void dhl_ulsp_enable_input();
+void dhl_ulsp_config_PB_input_by_filter();
+
+#endif //_ULSP_MCU_LOGGING_H_
+
+
diff --git a/mcu/interface/service/dhl/v2/GV.h b/mcu/interface/service/dhl/v2/GV.h
new file mode 100644
index 0000000..28f2a87
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/GV.h
@@ -0,0 +1,80 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file GV.h
+ *
+ * Description:
+ * ------------
+ *   @brief Global variable read/write type definition.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 08 20 2019 yancy.chien
+ * [MOLY00331449] [Gen97] DHL logging development
+ * 	
+ * 	enlarge GV structure offset to kal_uint32.
+ *
+ ****************************************************************************/
+
+#ifndef _GV1_H
+#define _GV1_H
+
+#include "kal_general_types.h"
+
+typedef struct
+{
+    kal_uint32  ID;
+    kal_uint32  Type;
+    kal_uint32  offset;
+    kal_uint32  size;
+    kal_uint16  NbrOFPtr;
+    kal_uint16  Ptrs[1];
+} GV_Struct;
+
+typedef struct
+{
+    kal_uint16  size;
+    kal_uint8   *data;
+} GVReturn;
+
+void GV_ReadVar(kal_uint8 *_GVCmd, GVReturn *Var);
+void GV_WriteVar(kal_uint8 *_GVCmd, kal_uint8 *var);
+
+#endif
+
diff --git a/mcu/interface/service/dhl/v2/L1Trc.h b/mcu/interface/service/dhl/v2/L1Trc.h
new file mode 100644
index 0000000..9664eb7
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/L1Trc.h
@@ -0,0 +1,288 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file L1Trc.h
+ *
+ * Description:
+ * ------------
+ *   @brief Layer 1 /Layer 2 common & public interface for all trace user,
+ *   Detail trace macro implement will put in each module's own interface.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 09 18 2019 victoria.wang
+ * [MOLY00416922] DHL Legacy Wrapper migration and phase-out
+ * [Remove][DHL] phase out legacy wrapper API
+ *
+ * 04 21 2019 yh.sung
+ * [MOLY00392990] [VMOLY][UTF] Phase 2 Landing
+ * [UTF][DHL] UTF Trace API - trace interface
+ *
+ * 12 05 2018 yu-hsiang.peng
+ * [MOLY00370324] NL1 timing information trace
+ * [VMOLY.EVB.SPET] [New Feature] Support NL1 time (SWRD part)
+ *
+ * 08 15 2018 yu-hsiang.peng
+ * [MOLY00343261] [MT6297] [Logging Service] DHL 2.0 Landing
+ * [DHL2.0] [ULSP] re-org file name & function pos.
+ *
+ ****************************************************************************/
+
+/*******************/
+/* CGen gen format */
+/*******************/
+typedef int cgen_use_L1ULSP;
+typedef int cgen_use_L1BitField;
+typedef int cgen_use_L1CondTrace;
+
+#if defined(__USE_ULSP_SW_SIMULATOR__)
+typedef int cgen_use_L1ULSP_Func_Impl;
+#endif
+
+
+#if defined (L1_CATCHER)
+#ifndef _L1TRC_H
+#define _L1TRC_H
+
+//#define __DHL_LEGACY_TRACE_API_ENABLE__
+
+/* for Cgen 92 SW logging, need Cgen help to remove, otherwise build error */
+typedef enum
+{
+    L1CSPM_DEFAULT,
+    SPIN_LOCK,
+    HW_ITC
+} E_DHL_TMD_CRIT_PROT;
+typedef enum
+{
+    L2_BUFFER_DEFAULT = 0,
+    L2_BUFFER_EL2 = L2_BUFFER_DEFAULT,
+    L2_BUFFER_HIF = 1,
+    L2_BUFFER_ERT = 2,
+    L2_BUFFER_END = 3
+} E_DHL_L2_BUFFER_MAPPING_TABLE;
+
+typedef enum
+{
+    MAX_L1_TRACE_CLASS_BYTE = 8
+} E_NUM_L1_TRACE_CLASS;
+
+/*******************/
+/* Include                 */
+/*******************/
+#include "kal_general_types.h"
+#include "kal_public_api.h"
+#if defined(__USE_ULSP__)
+#include "ulsp_mcu_logging.h"
+#endif//#if defined(__USE_ULSP__)
+
+
+/*******************/
+/* Definition - IRQ     */
+/*******************/
+#if defined(__MTK_TARGET__)
+#if !defined(__L2_LOGGING_IRQ_LOC__)
+#define __L2_LOGGING_IRQ_LOC__
+#endif
+#endif
+
+#if defined(__L2_LOGGING_IRQ_LOC__)
+extern kal_uint32 dhl_SaveAndSetIRQMask_cirq_wrap(void);
+extern void dhl_RestoreIRQMask_cirq_wrap(kal_uint32 status);
+#define DHL_LOCK_CPU_INTERRUPT(oldmask) \
+    do{ \
+        oldmask = dhl_SaveAndSetIRQMask_cirq_wrap(); \
+    }while(0)
+
+#define DHL_UNLOCK_CPU_INTERRUPT(oldmask) \
+    do{ \
+        dhl_RestoreIRQMask_cirq_wrap(oldmask); \
+    }while(0)
+#elif defined(__MTK_TARGET__)
+
+extern kal_uint32 kal_hrt_SaveAndSetIRQMask(void);
+extern void kal_hrt_RestoreIRQMask(kal_uint32 irq);
+extern kal_uint32 dhl_SaveAndSetIRQMask_cirq_wrap(void);
+extern void dhl_RestoreIRQMask_cirq_wrap(kal_uint32 status);
+
+#define DHL_LOCK_CPU_INTERRUPT(oldmask) \
+    do{ \
+        oldmask = kal_hrt_SaveAndSetIRQMask(); \
+    }while(0)
+
+#define DHL_UNLOCK_CPU_INTERRUPT(oldmask) \
+    do{ \
+        kal_hrt_RestoreIRQMask(oldmask); \
+    }while(0)
+#else
+#define DHL_LOCK_CPU_INTERRUPT(oldmask) \
+    do{ \
+        oldmask = 0; \
+    }while(0)
+
+#define DHL_UNLOCK_CPU_INTERRUPT(oldmask) \
+    do{ \
+        oldmask = 0; \
+    }while(0)
+#endif /* __L2_LOGGING_IRQ_LOC__ */
+
+/************************/
+/* Definition -Trace Macro   */
+/************************/
+
+
+#include "L1Trc_function.h"
+
+#if defined(L1_SIM)
+#include "dhl_ulsp_swsim_interface.h"	// work around since xL1SIM can't get __USE_ULSP_SW_SIMULATOR__ option
+extern kal_bool l1_trc_assure_lisr(const char *func, const char *file, int line);
+
+#else
+
+#if defined(__USE_ULSP_L1L2SEQTEST__)
+#include "dhl_l1l2seqtest_hwulsp_interface.h"
+
+#elif defined(__USE_ULSP_SW_SIMULATOR__)
+#include "dhl_ulsp_swsim_interface.h"
+
+#elif defined(__USE_ULSP__)
+#include "dhl_ulsp_hw_interface.h"
+
+#endif
+
+#endif // L1_SIM
+
+#include "dhl_cond_l1_trace.h"
+
+/*******************/
+/* Definition -           */
+/* code setting          */
+/*******************/
+#if !defined(GEN_FOR_PC)
+
+#if defined(__MTK_TARGET__)
+#define __DHL_L2CACHE_LOCK_DATA __attribute__ ((section("L2CACHE_LOCK_RW")))
+#else
+#define __DHL_L2CACHE_LOCK_DATA
+#endif
+
+#define CONVERT_WORD_ALIGNMENT(val) (((val) + 4) / 4 * 4)
+
+typedef void (*trc_setfilterfunc)(unsigned char *);
+#define TRC_FILTER_FUNC_ARRAY       trc_filterfuncarray
+#define TRC_NBR_MODULE              trc_filterfuncnbr
+#define TRC_SET_FILTER_FUNC         trc_setfilterfunc
+
+/*********************************************/
+/*    Macro for declaring filter in codegen  */
+/*********************************************/
+//force all to l2 cache in 93 to reduce mips, the conclusion after W16 PAE
+#define DECLARE_TMD_FILTER(VAR_TYPE, VAR_NAME, VAR_SIZE, P0, P1, P2, P3, P4, P5, P6, P7) \
+    VAR_TYPE  VAR_NAME[VAR_SIZE] = {P0, P1, P2, P3, P4, P5, P6, P7};
+
+#define DECLARE_TMD_FILTER_L2SRAM(VAR_TYPE, VAR_NAME, VAR_SIZE, P0, P1, P2, P3, P4, P5, P6, P7) \
+    VAR_TYPE   VAR_NAME[VAR_SIZE] = {P0, P1, P2, P3, P4, P5, P6, P7};
+
+#define DECLARE_TMD_FILTER_TCM(VAR_TYPE, VAR_NAME, VAR_SIZE, P0, P1, P2, P3, P4, P5, P6, P7) \
+    VAR_TYPE   VAR_NAME[VAR_SIZE] = {P0, P1, P2, P3, P4, P5, P6, P7};
+
+/*********************************************/
+/*    Macro for extern filter in codegen  */
+/*********************************************/
+#define EXTERN_TMD_FILTER(VAR_TYPE, VAR_NAME, VAR_SIZE) \
+    extern VAR_TYPE    VAR_NAME[VAR_SIZE];
+
+#define SET_TMD_FILTER(VAR_NAME, VAR_ARRAY_PTR, VAR_ARRAY_SIZE) \
+    do{ \
+        kal_uint32 i; \
+        for(i=0; i<VAR_ARRAY_SIZE; i++) VAR_NAME[i] = VAR_ARRAY_PTR[i]; \
+    }while(0)
+
+#define FILTER_COPY(DES_BUFFER, FILTER_NAME, FILTER_SIZE) \
+    do{ \
+        memcpy(DES_BUFFER, FILTER_NAME, FILTER_SIZE); \
+    }while(0);
+
+#define FILTER_CHECK(FILTER_NAME, FILTER_ARRAY_INDEX, FILTER_CLASS) ((FILTER_NAME[FILTER_ARRAY_INDEX] & FILTER_CLASS) != 0)
+
+//for Cgen bit encode
+#define TRC_L2_PAD (0xFA)
+#define TRC_BOXSTER_PAD (0xFA)
+//Use MACRO
+#define TRC_MERGE_2S_MACRO(v1, v2) ( (kal_uint32)(v1&0xFFFF) + ( ((kal_uint32)v2)<<16 ))
+#define TRC_MERGE_1S2C_MACRO(v1, v2, v3) ( (kal_uint32)(v1&0xFFFF) + ( ( (kal_uint32)(v2&0xFF) )<<16) + ( ((kal_uint32)v3)<<24) )
+#define TRC_MERGE_4C_MACRO(v1, v2, v3, v4) ( (kal_uint32)(v1&0xFF) + ( ((kal_uint32)(v2&0xFF))<<8) + ( ((kal_uint32)(v3&0xFF))<<16) + ( ((kal_uint32)v4)<<24))
+
+#define TRC_MERGE_2S(v1, v2) TRC_MERGE_2S_MACRO((v1), (v2))
+#define TRC_MERGE_1S2C(v1, v2, v3) TRC_MERGE_1S2C_MACRO((v1), (v2), (v3))
+#define TRC_MERGE_4C(v1, v2, v3, v4) TRC_MERGE_4C_MACRO((v1), (v2), (v3), (v4))
+
+#endif // #if !defined(GEN_FOR_PC)
+
+/************/
+/*Functions */
+/************/
+void trc_fillFrameNumber_multiple(kal_uint32 framenumber, kal_uint32 ebit, kal_uint32 time, kal_uint32 sim_index);
+void trc_UFillFrameNumber_multiple(kal_uint16 framenumber, kal_uint32 ebit, kal_int16 bsfn, kal_uint32 time, kal_uint32 sim_index);
+void trc_fill_4g_time(kal_uint32 phytimer, kal_uint16 sample, kal_uint32 time, kal_uint16 sfn, kal_uint8 subframe);
+void trc_fill_4g_time_2(kal_uint32 phytimer, kal_uint16 sample, kal_uint32 time, kal_uint16 sfn, kal_uint8 subframe, kal_uint32 _4g_time);
+void trc_fill_4g_time_gfrc2(kal_uint32 phytimer, kal_uint32 time, kal_uint16 sfn, kal_uint8 subframe, kal_uint32 absH, kal_uint32 absL);
+void trc_UpdateTimeStamp(kal_uint32 time);
+// Export for HIF GPT use
+void l2trc_fill_4G_time();
+void l2trc_update_4G_time(kal_uint32 celltime, kal_uint32 abstick);
+void l2trc_fill_23G_time();
+#if defined(__C2K_RAT__)
+extern void trc_fill_c2k_do_time(kal_uint8 fn_up, kal_uint32 fn_low, kal_uint8 slot, kal_uint32 echip, kal_uint32 frc);
+extern void trc_fill_c2k_1x_time(kal_uint8 fn_up, kal_uint32 fn_low, kal_uint8 slot, kal_uint32 echip, kal_uint32 frc);
+#endif  // defined(__C2K_RAT__)
+void trc_fill_nl1_time(kal_uint8 nL1_idx, kal_uint32 timestamp, kal_uint32 abs_time, kal_uint16 cell_time, kal_uint32 sfbd_stime, kal_uint32 sfbd_frc, kal_uint32 frc);
+
+//if remove , will build error in el1
+void Trc_Init(void);
+void trc_handover(kal_uint32 handovertime, kal_uint32 framenumber);
+void trc_Uhandover(kal_uint32 handovertime, kal_uint32 framenumber);
+
+void trc_setfilter(kal_uint8 *setting, kal_uint32 len);
+void trc_set_l1_filter(kal_uint8 *setting, kal_uint32 len);
+void trc_set_l2_filter(kal_uint8 *setting, kal_uint32 len);
+kal_int32 trc_getfilter(kal_uint8 *buffer, kal_int32 len);
+
+#endif //_L1TRC_H
+#endif /* #if defined(L1_CATCHER) */
diff --git a/mcu/interface/service/dhl/v2/L1Trc_array.h b/mcu/interface/service/dhl/v2/L1Trc_array.h
new file mode 100644
index 0000000..36c5f2e
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/L1Trc_array.h
@@ -0,0 +1,109 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file L1Trc_array.h
+ *
+ * Description:
+ * ------------
+ *   @brief Interface of L1 trace array.
+ *   @note This header is included in L1Trc.h, please do not include this header alone!
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_L1TRC_ARRAY_H
+#define _DHL_L1TRC_ARRAY_H
+
+/********************************************
+* L1/L2 Array Type support
+********************************************/
+
+#if defined(__USE_ULSP__)
+
+// shrink the arg_count to max count to avoid whole L1 Trace frame decode fail
+
+#define TRC_OUTPUT_ARRAY_IMPL(func_name, begin_trace_id, array_ptr, align, count, max_count) \
+    do { \
+        func_name(begin_trace_id, array_ptr, align, count < max_count ? count : max_count); \
+    } while(0)
+
+
+#define TRC_OUTPUT_ARRAY_L1(begin_trace_id, array_ptr, align, count, max_count) TRC_OUTPUT_ARRAY_IMPL(trc_output_array_l1, begin_trace_id, array_ptr, align, count, max_count)
+#define TRC_OUTPUT_ARRAY_L2(begin_trace_id, array_ptr, align, count, max_count) TRC_OUTPUT_ARRAY_IMPL(trc_output_array_l2, begin_trace_id, array_ptr, align, count, max_count)
+
+// NON_SMP
+#define TRC_OUTPUT_ARRAY_L1_NON_SMP TRC_OUTPUT_ARRAY_L1
+#define TRC_OUTPUT_ARRAY_L2_NON_SMP TRC_OUTPUT_ARRAY_L2
+
+extern void trc_output_array_l1(kal_uint16 begin_trace_id, void *array_ptr, kal_uint8 align, kal_uint8 count);
+extern void trc_output_array_l2(kal_uint16 begin_trace_id, void *array_ptr, kal_uint8 align, kal_uint8 count);
+
+#else   // !defined(__USE_ULSP__)
+
+#define TRC_OUTPUT_ARRAY_L1(BEGIN_TRC_ID, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS, ARRAY_PTR, ALIGN, COUNT, MAX_COUNT) \
+    do { \
+        if(FILTER_CHECK(FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)) { \
+            kal_uint32 oldmask=0; \
+            kal_uint8 vpe_id = 0; \
+            EXT_ASSERT(0 < COUNT && COUNT <= MAX_COUNT, COUNT, MAX_COUNT, 0); /* suppose SW solution is for internal use only, the assert should be accepted */ \
+            DHL_LOCK_CPU_INTERRUPT(oldmask); \
+            vpe_id = kal_get_current_vpe_id(); \
+            TRC_SEND_ARRAY_DATA_cb[vpe_id](BEGIN_TRC_ID, ARRAY_PTR, ALIGN, COUNT); \
+            DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+        } \
+    } while(0)
+
+#define TRC_OUTPUT_ARRAY_L2(L2_BUFFER_SETTING, BEGIN_TRC_ID, FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS, ARRAY_PTR, ALIGN, COUNT, MAX_COUNT) \
+    do { \
+        if(FILTER_CHECK(FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)) { \
+            EXT_ASSERT(0 < COUNT && COUNT <= MAX_COUNT, COUNT, MAX_COUNT, 0); /* suppose SW solution is for internal use only, the assert should be accepted */ \
+            l2trc_send_array_cb[L2_BUFFER_SETTING](BEGIN_TRC_ID, ARRAY_PTR, ALIGN, COUNT); \
+        } \
+    } while(0)
+
+
+typedef void (*TRC_SEND_ARRAY_DATA_cb_t)(kal_uint16 begin_trace_id, void *array_ptr, kal_uint8 align, kal_uint8 count);
+
+extern TRC_SEND_ARRAY_DATA_cb_t TRC_SEND_ARRAY_DATA_cb[6];
+extern TRC_SEND_ARRAY_DATA_cb_t l2trc_send_array_cb[3];
+
+#endif  // defined(__USE_ULSP__)
+
+#endif  // _DHL_L1TRC_ARRAY_H
diff --git a/mcu/interface/service/dhl/v2/L1Trc_function.h b/mcu/interface/service/dhl/v2/L1Trc_function.h
new file mode 100644
index 0000000..0d872af
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/L1Trc_function.h
@@ -0,0 +1,611 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file L1Trc_function.h
+ *
+ * Description:
+ * ------------
+ *   @brief Interface of L1/L2 trace function version for Cgen
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 08 20 2018 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * Fix Clang warrning.
+ *
+ * 08 15 2018 yu-hsiang.peng
+ * [MOLY00343261] [MT6297] [Logging Service] DHL 2.0 Landing
+ * [DHL2.0] [ULSP] re-org file name & function pos.
+ *
+ ****************************************************************************/
+
+/* Function Trace Examples
+
+1. default
+#define UMTS_3G_GEMINI_TIME(v1, v2, v3, v4, v5) do {\
+    {\
+        TRC_START_FILTER_CHECK_L1(DHL_L1_Trace_Filter, 1, 0x01);\
+        TRC_SEND_4_DATA_ULSP_L1(TRC_MERGE_2S(0x0000, (short)(v2)), TRC_MERGE_1S2C((short)(v4), (char)(v1), TRC_BOXSTER_PAD), (long)(v3), (long)(v5));\
+        TRC_END_FILTER_CHECK_L1(DHL_L1_Trace_Filter, 1, 0x01);\     
+    }\  
+} while(0)
+
+2. non_smp
+#define EL1D_TRC_AGC_CONTEXT_ENTRY_H(v1) do {\
+    {\
+        TRC_START_FILTER_CHECK_L1_NON_SMP(EL1D_AGC0_Trace_Filter, 1, 0x02);\
+        TRC_SEND_1_DATA_ULSP_L1_NON_SMP(TRC_MERGE_1S2C(0x0133, (unsigned char)(v1), TRC_BOXSTER_PAD));\
+        TRC_END_FILTER_CHECK_L1_NON_SMP(EL1D_AGC0_Trace_Filter, 1, 0x02);\
+    }\
+} while(0)
+
+3. force_l2
+#define L2_DHL_DEBUG_TRC2(v1, v2) do {\
+    {\
+        TRC_START_FILTER_CHECK_L1_FORCE_L2(DHL_L1_Trace_Filter, 1, 0x01);\
+        TRC_SEND_3_DATA_ULSP_L1_FORCE_L2(TRC_MERGE_1S2C(0x1E00, TRC_BOXSTER_PAD, TRC_BOXSTER_PAD), (long)(v1), (long)(v2));\
+        TRC_END_FILTER_CHECK_L1_FORCE_L2(DHL_L1_Trace_Filter, 1, 0x01);\
+    }\  
+} while(0)
+
+4. ex_force_l1
+#define DUMP_COND_L1_TRC_END() do {\
+    {\
+        TRC_START_FILTER_CHECK_L1_EX_FORCE_L1(DHL_L1_Trace_Filter, 1, 0x02);\
+        TRC_SEND_1_DATA_ULSP_L1_EX_FORCE_L1(TRC_MERGE_1S2C(0x2A00, TRC_BOXSTER_PAD, TRC_BOXSTER_PAD));\
+        TRC_END_FILTER_CHECK_L1_EX_FORCE_L1(DHL_L1_Trace_Filter, 1, 0x02);\
+    }\	
+} while(0)
+
+*/
+ 
+#ifndef _L1TRC_FUNCTION_H
+#define _L1TRC_FUNCTION_H
+#if __clang_analyzer__
+#pragma clang system_header
+#endif
+
+#define TRC_SEND_1_DATA_ULSP_L1(...) ulsp_l1_send_1_word(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L1(...) ulsp_l1_send_2_word(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L1(...) ulsp_l1_send_3_word(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L1(...) ulsp_l1_send_4_word(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L1(...) ulsp_l1_send_5_word(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L1(...) ulsp_l1_send_6_word(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L1(...) ulsp_l1_send_7_word(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L1(...) ulsp_l1_send_8_word(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L1(...) ulsp_l1_send_9_word(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L1(...) ulsp_l1_send_10_word(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L1(...) ulsp_l1_send_11_word(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L1(...) ulsp_l1_send_12_word(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L1(...) ulsp_l1_send_13_word(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L1(...) ulsp_l1_send_14_word(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L1(...) ulsp_l1_send_15_word(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L1(...) ulsp_l1_send_16_word(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L1(...) ulsp_l1_send_17_word(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L1(...) ulsp_l1_send_18_word(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L1(...) ulsp_l1_send_19_word(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L1(...) ulsp_l1_send_20_word(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L1(...) ulsp_l1_send_21_word(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L1(...) ulsp_l1_send_22_word(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L1(...) ulsp_l1_send_23_word(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L1(...) ulsp_l1_send_24_word(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L1(...) ulsp_l1_send_25_word(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L1(...) ulsp_l1_send_26_word(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L1(...) ulsp_l1_send_27_word(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L1(...) ulsp_l1_send_28_word(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L1(...) ulsp_l1_send_29_word(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L1(...) ulsp_l1_send_30_word(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L1(...) ulsp_l1_send_31_word(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L1(...) ulsp_l1_send_32_word(__VA_ARGS__)
+
+#define TRC_SEND_1_DATA_ULSP_L2(...) ulsp_l2_send_1_word(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L2(...) ulsp_l2_send_2_word(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L2(...) ulsp_l2_send_3_word(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L2(...) ulsp_l2_send_4_word(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L2(...) ulsp_l2_send_5_word(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L2(...) ulsp_l2_send_6_word(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L2(...) ulsp_l2_send_7_word(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L2(...) ulsp_l2_send_8_word(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L2(...) ulsp_l2_send_9_word(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L2(...) ulsp_l2_send_10_word(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L2(...) ulsp_l2_send_11_word(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L2(...) ulsp_l2_send_12_word(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L2(...) ulsp_l2_send_13_word(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L2(...) ulsp_l2_send_14_word(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L2(...) ulsp_l2_send_15_word(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L2(...) ulsp_l2_send_16_word(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L2(...) ulsp_l2_send_17_word(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L2(...) ulsp_l2_send_18_word(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L2(...) ulsp_l2_send_19_word(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L2(...) ulsp_l2_send_20_word(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L2(...) ulsp_l2_send_21_word(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L2(...) ulsp_l2_send_22_word(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L2(...) ulsp_l2_send_23_word(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L2(...) ulsp_l2_send_24_word(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L2(...) ulsp_l2_send_25_word(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L2(...) ulsp_l2_send_26_word(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L2(...) ulsp_l2_send_27_word(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L2(...) ulsp_l2_send_28_word(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L2(...) ulsp_l2_send_29_word(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L2(...) ulsp_l2_send_30_word(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L2(...) ulsp_l2_send_31_word(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L2(...) ulsp_l2_send_32_word(__VA_ARGS__)
+
+#define TRC_SEND_1_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_1_word(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_2_word(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_3_word(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_4_word(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_5_word(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_6_word(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_7_word(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_8_word(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_9_word(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_10_word(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_11_word(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_12_word(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_13_word(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_14_word(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_15_word(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_16_word(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_17_word(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_18_word(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_19_word(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_20_word(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_21_word(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_22_word(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_23_word(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_24_word(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_25_word(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_26_word(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_27_word(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_28_word(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_29_word(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_30_word(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_31_word(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L1_ON_DEMAND(...) ulsp_l1_send_32_word(__VA_ARGS__)
+
+#define TRC_SEND_1_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_1_word(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_2_word(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_3_word(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_4_word(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_5_word(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_6_word(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_7_word(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_8_word(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_9_word(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_10_word(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_11_word(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_12_word(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_13_word(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_14_word(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_15_word(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_16_word(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_17_word(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_18_word(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_19_word(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_20_word(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_21_word(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_22_word(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_23_word(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_24_word(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_25_word(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_26_word(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_27_word(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_28_word(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_29_word(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_30_word(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_31_word(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L2_ON_DEMAND(...) ulsp_l2_send_32_word(__VA_ARGS__)
+
+#define TRC_SEND_1_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_1_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_2_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_3_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_4_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_5_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_6_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_7_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_8_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_9_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_10_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_11_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_12_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_13_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_14_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_15_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_16_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_17_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_18_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_19_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_20_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_21_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_22_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_23_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_24_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_25_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_26_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_27_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_28_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_29_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_30_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_31_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L1_NON_SMP(...) ulsp_l1_send_32_word_non_smp(__VA_ARGS__)
+
+#define TRC_SEND_1_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_1_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_2_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_3_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_4_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_5_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_6_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_7_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_8_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_9_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_10_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_11_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_12_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_13_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_14_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_15_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_16_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_17_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_18_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_19_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_20_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_21_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_22_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_23_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_24_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_25_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_26_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_27_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_28_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_29_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_30_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_31_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L2_NON_SMP(...) ulsp_l2_send_32_word_non_smp(__VA_ARGS__)
+
+
+#define TRC_SEND_1_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_1_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_2_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_3_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_4_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_5_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_6_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_7_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_8_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_9_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_10_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_11_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_12_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_13_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_14_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_15_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_16_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_17_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_18_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_19_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_20_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_21_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_22_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_23_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_24_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_25_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_26_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_27_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_28_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_29_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_30_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_31_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L1_NON_SMP_ON_DEMAND(...) ulsp_l1_send_32_word_non_smp(__VA_ARGS__)
+
+#define TRC_SEND_1_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_1_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_2_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_3_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_4_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_5_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_6_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_7_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_8_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_9_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_10_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_11_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_12_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_13_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_14_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_15_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_16_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_17_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_18_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_19_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_20_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_21_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_22_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_23_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_24_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_25_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_26_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_27_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_28_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_29_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_30_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_31_word_non_smp(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L2_NON_SMP_ON_DEMAND(...) ulsp_l2_send_32_word_non_smp(__VA_ARGS__)
+
+#define TRC_SEND_1_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_1_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_2_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_2_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_3_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_3_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_4_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_4_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_5_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_5_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_6_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_6_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_7_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_7_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_8_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_8_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_9_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_9_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_10_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_10_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_11_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_11_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_12_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_12_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_13_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_13_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_14_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_14_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_15_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_15_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_16_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_16_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_17_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_17_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_18_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_18_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_19_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_19_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_20_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_20_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_21_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_21_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_22_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_22_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_23_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_23_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_24_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_24_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_25_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_25_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_26_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_26_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_27_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_27_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_28_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_28_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_29_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_29_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_30_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_30_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_31_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_31_word_hw_cond(__VA_ARGS__)
+#define TRC_SEND_32_DATA_ULSP_L1_HW_COND(...) ulsp_l1_send_32_word_hw_cond(__VA_ARGS__)
+
+
+
+#define TRC_SEND_1_DATA_ULSP_L1_FORCE_L2 TRC_SEND_1_DATA_ULSP_L2
+#define TRC_SEND_2_DATA_ULSP_L1_FORCE_L2 TRC_SEND_2_DATA_ULSP_L2
+#define TRC_SEND_3_DATA_ULSP_L1_FORCE_L2 TRC_SEND_3_DATA_ULSP_L2
+#define TRC_SEND_4_DATA_ULSP_L1_FORCE_L2 TRC_SEND_4_DATA_ULSP_L2
+#define TRC_SEND_5_DATA_ULSP_L1_FORCE_L2 TRC_SEND_5_DATA_ULSP_L2
+#define TRC_SEND_6_DATA_ULSP_L1_FORCE_L2 TRC_SEND_6_DATA_ULSP_L2
+#define TRC_SEND_7_DATA_ULSP_L1_FORCE_L2 TRC_SEND_7_DATA_ULSP_L2
+#define TRC_SEND_8_DATA_ULSP_L1_FORCE_L2 TRC_SEND_8_DATA_ULSP_L2
+#define TRC_SEND_9_DATA_ULSP_L1_FORCE_L2 TRC_SEND_9_DATA_ULSP_L2
+#define TRC_SEND_10_DATA_ULSP_L1_FORCE_L2 TRC_SEND_10_DATA_ULSP_L2
+#define TRC_SEND_11_DATA_ULSP_L1_FORCE_L2 TRC_SEND_11_DATA_ULSP_L2
+#define TRC_SEND_12_DATA_ULSP_L1_FORCE_L2 TRC_SEND_12_DATA_ULSP_L2
+#define TRC_SEND_13_DATA_ULSP_L1_FORCE_L2 TRC_SEND_13_DATA_ULSP_L2
+#define TRC_SEND_14_DATA_ULSP_L1_FORCE_L2 TRC_SEND_14_DATA_ULSP_L2
+#define TRC_SEND_15_DATA_ULSP_L1_FORCE_L2 TRC_SEND_15_DATA_ULSP_L2
+#define TRC_SEND_16_DATA_ULSP_L1_FORCE_L2 TRC_SEND_16_DATA_ULSP_L2
+#define TRC_SEND_17_DATA_ULSP_L1_FORCE_L2 TRC_SEND_17_DATA_ULSP_L2
+#define TRC_SEND_18_DATA_ULSP_L1_FORCE_L2 TRC_SEND_18_DATA_ULSP_L2
+#define TRC_SEND_19_DATA_ULSP_L1_FORCE_L2 TRC_SEND_19_DATA_ULSP_L2
+#define TRC_SEND_20_DATA_ULSP_L1_FORCE_L2 TRC_SEND_20_DATA_ULSP_L2
+#define TRC_SEND_21_DATA_ULSP_L1_FORCE_L2 TRC_SEND_21_DATA_ULSP_L2
+#define TRC_SEND_22_DATA_ULSP_L1_FORCE_L2 TRC_SEND_22_DATA_ULSP_L2
+#define TRC_SEND_23_DATA_ULSP_L1_FORCE_L2 TRC_SEND_23_DATA_ULSP_L2
+#define TRC_SEND_24_DATA_ULSP_L1_FORCE_L2 TRC_SEND_24_DATA_ULSP_L2
+#define TRC_SEND_25_DATA_ULSP_L1_FORCE_L2 TRC_SEND_25_DATA_ULSP_L2
+#define TRC_SEND_26_DATA_ULSP_L1_FORCE_L2 TRC_SEND_26_DATA_ULSP_L2
+#define TRC_SEND_27_DATA_ULSP_L1_FORCE_L2 TRC_SEND_27_DATA_ULSP_L2
+#define TRC_SEND_28_DATA_ULSP_L1_FORCE_L2 TRC_SEND_28_DATA_ULSP_L2
+#define TRC_SEND_29_DATA_ULSP_L1_FORCE_L2 TRC_SEND_29_DATA_ULSP_L2
+#define TRC_SEND_30_DATA_ULSP_L1_FORCE_L2 TRC_SEND_30_DATA_ULSP_L2
+#define TRC_SEND_31_DATA_ULSP_L1_FORCE_L2 TRC_SEND_31_DATA_ULSP_L2
+#define TRC_SEND_32_DATA_ULSP_L1_FORCE_L2 TRC_SEND_32_DATA_ULSP_L2
+
+
+// only provides 1 data macro since we only use for "Redump" raw string message for now
+#define TRC_SEND_1_DATA_ULSP_L1_EX_FORCE_L1(v1) TRC_OUTPUT_32_SINGLE_WRAPPER_L1_EX_FORCE_L1(v1, v1)
+#define TRC_SEND_1_DATA_ULSP_L1_EX_FORCE_L2(v1) TRC_OUTPUT_32_SINGLE_WRAPPER_L1_EX_FORCE_L2(v1, v1)
+
+
+
+
+extern void ulsp_l1_send_1_word(kal_uint32 v1);
+extern void ulsp_l1_send_2_word(kal_uint32 v1, kal_uint32 v2);
+extern void ulsp_l1_send_3_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+extern void ulsp_l1_send_4_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+extern void ulsp_l1_send_5_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+extern void ulsp_l1_send_6_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+extern void ulsp_l1_send_7_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7);
+extern void ulsp_l1_send_8_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8);
+extern void ulsp_l1_send_9_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+extern void ulsp_l1_send_10_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+extern void ulsp_l1_send_11_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+extern void ulsp_l1_send_12_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+extern void ulsp_l1_send_13_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13);
+extern void ulsp_l1_send_14_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14);
+extern void ulsp_l1_send_15_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+extern void ulsp_l1_send_16_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+extern void ulsp_l1_send_17_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17);
+extern void ulsp_l1_send_18_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18);
+extern void ulsp_l1_send_19_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19);
+extern void ulsp_l1_send_20_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20);
+extern void ulsp_l1_send_21_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21);
+extern void ulsp_l1_send_22_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22);
+extern void ulsp_l1_send_23_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23);
+extern void ulsp_l1_send_24_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24);
+extern void ulsp_l1_send_25_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25);
+extern void ulsp_l1_send_26_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26);
+extern void ulsp_l1_send_27_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27);
+extern void ulsp_l1_send_28_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28);
+extern void ulsp_l1_send_29_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29);
+extern void ulsp_l1_send_30_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30);
+extern void ulsp_l1_send_31_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31);
+extern void ulsp_l1_send_32_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31, kal_uint32 v32);
+
+extern void ulsp_l2_send_1_word(kal_uint32 v1);
+extern void ulsp_l2_send_2_word(kal_uint32 v1, kal_uint32 v2);
+extern void ulsp_l2_send_3_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+extern void ulsp_l2_send_4_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+extern void ulsp_l2_send_5_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+extern void ulsp_l2_send_6_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+extern void ulsp_l2_send_7_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7);
+extern void ulsp_l2_send_8_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8);
+extern void ulsp_l2_send_9_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+extern void ulsp_l2_send_10_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+extern void ulsp_l2_send_11_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+extern void ulsp_l2_send_12_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+extern void ulsp_l2_send_13_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13);
+extern void ulsp_l2_send_14_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14);
+extern void ulsp_l2_send_15_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+extern void ulsp_l2_send_16_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+extern void ulsp_l2_send_17_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17);
+extern void ulsp_l2_send_18_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18);
+extern void ulsp_l2_send_19_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19);
+extern void ulsp_l2_send_20_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20);
+extern void ulsp_l2_send_21_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21);
+extern void ulsp_l2_send_22_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22);
+extern void ulsp_l2_send_23_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23);
+extern void ulsp_l2_send_24_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24);
+extern void ulsp_l2_send_25_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25);
+extern void ulsp_l2_send_26_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26);
+extern void ulsp_l2_send_27_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27);
+extern void ulsp_l2_send_28_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28);
+extern void ulsp_l2_send_29_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29);
+extern void ulsp_l2_send_30_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30);
+extern void ulsp_l2_send_31_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31);
+extern void ulsp_l2_send_32_word(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31, kal_uint32 v32);
+
+extern void ulsp_l1_send_1_word_non_smp(kal_uint32 v1);
+extern void ulsp_l1_send_2_word_non_smp(kal_uint32 v1, kal_uint32 v2);
+extern void ulsp_l1_send_3_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+extern void ulsp_l1_send_4_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+extern void ulsp_l1_send_5_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+extern void ulsp_l1_send_6_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+extern void ulsp_l1_send_7_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7);
+extern void ulsp_l1_send_8_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8);
+extern void ulsp_l1_send_9_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+extern void ulsp_l1_send_10_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+extern void ulsp_l1_send_11_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+extern void ulsp_l1_send_12_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+extern void ulsp_l1_send_13_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13);
+extern void ulsp_l1_send_14_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14);
+extern void ulsp_l1_send_15_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+extern void ulsp_l1_send_16_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+extern void ulsp_l1_send_17_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17);
+extern void ulsp_l1_send_18_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18);
+extern void ulsp_l1_send_19_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19);
+extern void ulsp_l1_send_20_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20);
+extern void ulsp_l1_send_21_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21);
+extern void ulsp_l1_send_22_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22);
+extern void ulsp_l1_send_23_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23);
+extern void ulsp_l1_send_24_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24);
+extern void ulsp_l1_send_25_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25);
+extern void ulsp_l1_send_26_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26);
+extern void ulsp_l1_send_27_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27);
+extern void ulsp_l1_send_28_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28);
+extern void ulsp_l1_send_29_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29);
+extern void ulsp_l1_send_30_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30);
+extern void ulsp_l1_send_31_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31);
+extern void ulsp_l1_send_32_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31, kal_uint32 v32);
+
+extern void ulsp_l2_send_1_word_non_smp(kal_uint32 v1);
+extern void ulsp_l2_send_2_word_non_smp(kal_uint32 v1, kal_uint32 v2);
+extern void ulsp_l2_send_3_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+extern void ulsp_l2_send_4_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+extern void ulsp_l2_send_5_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+extern void ulsp_l2_send_6_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+extern void ulsp_l2_send_7_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7);
+extern void ulsp_l2_send_8_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8);
+extern void ulsp_l2_send_9_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+extern void ulsp_l2_send_10_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+extern void ulsp_l2_send_11_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+extern void ulsp_l2_send_12_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+extern void ulsp_l2_send_13_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13);
+extern void ulsp_l2_send_14_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14);
+extern void ulsp_l2_send_15_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+extern void ulsp_l2_send_16_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+extern void ulsp_l2_send_17_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17);
+extern void ulsp_l2_send_18_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18);
+extern void ulsp_l2_send_19_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19);
+extern void ulsp_l2_send_20_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20);
+extern void ulsp_l2_send_21_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21);
+extern void ulsp_l2_send_22_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22);
+extern void ulsp_l2_send_23_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23);
+extern void ulsp_l2_send_24_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24);
+extern void ulsp_l2_send_25_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25);
+extern void ulsp_l2_send_26_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26);
+extern void ulsp_l2_send_27_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27);
+extern void ulsp_l2_send_28_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28);
+extern void ulsp_l2_send_29_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29);
+extern void ulsp_l2_send_30_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30);
+extern void ulsp_l2_send_31_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31);
+extern void ulsp_l2_send_32_word_non_smp(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31, kal_uint32 v32);
+
+extern void ulsp_l1_send_1_word_hw_cond(kal_uint32 v1);
+extern void ulsp_l1_send_2_word_hw_cond(kal_uint32 v1, kal_uint32 v2);
+extern void ulsp_l1_send_3_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3);
+extern void ulsp_l1_send_4_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4);
+extern void ulsp_l1_send_5_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5);
+extern void ulsp_l1_send_6_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6);
+extern void ulsp_l1_send_7_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7);
+extern void ulsp_l1_send_8_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8);
+extern void ulsp_l1_send_9_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9);
+extern void ulsp_l1_send_10_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10);
+extern void ulsp_l1_send_11_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11);
+extern void ulsp_l1_send_12_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12);
+extern void ulsp_l1_send_13_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13);
+extern void ulsp_l1_send_14_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14);
+extern void ulsp_l1_send_15_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15);
+extern void ulsp_l1_send_16_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16);
+extern void ulsp_l1_send_17_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17);
+extern void ulsp_l1_send_18_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18);
+extern void ulsp_l1_send_19_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19);
+extern void ulsp_l1_send_20_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20);
+extern void ulsp_l1_send_21_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21);
+extern void ulsp_l1_send_22_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22);
+extern void ulsp_l1_send_23_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23);
+extern void ulsp_l1_send_24_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24);
+extern void ulsp_l1_send_25_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25);
+extern void ulsp_l1_send_26_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26);
+extern void ulsp_l1_send_27_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27);
+extern void ulsp_l1_send_28_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28);
+extern void ulsp_l1_send_29_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29);
+extern void ulsp_l1_send_30_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30);
+extern void ulsp_l1_send_31_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31);
+extern void ulsp_l1_send_32_word_hw_cond(kal_uint32 v1, kal_uint32 v2, kal_uint32 v3, kal_uint32 v4, kal_uint32 v5, kal_uint32 v6, kal_uint32 v7, kal_uint32 v8, kal_uint32 v9, kal_uint32 v10, kal_uint32 v11, kal_uint32 v12, kal_uint32 v13, kal_uint32 v14, kal_uint32 v15, kal_uint32 v16, kal_uint32 v17, kal_uint32 v18, kal_uint32 v19, kal_uint32 v20, kal_uint32 v21, kal_uint32 v22, kal_uint32 v23, kal_uint32 v24, kal_uint32 v25, kal_uint32 v26, kal_uint32 v27, kal_uint32 v28, kal_uint32 v29, kal_uint32 v30, kal_uint32 v31, kal_uint32 v32);
+
+
+#endif //_L1TRC_FUNCTION_H
diff --git a/mcu/interface/service/dhl/v2/adt.h b/mcu/interface/service/dhl/v2/adt.h
new file mode 100644
index 0000000..f148ee9
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/adt.h
@@ -0,0 +1,101 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file adt.h
+ *
+ * Description:
+ * ------------
+ *   @brief ADT structure and interface
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *       Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ * 05 07 2014 eason.lai
+ * [MOLY00064969] [DHL]expand tab to 4 spaces to have better typesettings
+ * .
+ *
+ * 11 07 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * dhl module check-in.
+ ****************************************************************************/
+
+#ifndef _ADT_H
+#define _ADT_H
+
+#include "kal_public_defs.h"
+
+typedef struct adt_node
+{
+    kal_int32 data_len;
+    void *data;
+    struct adt_node *first_child;
+    struct adt_node *next_sibling;
+} adt_node_t;
+
+/**
+ * @brief       pack adt tree into bytes
+ * @param root  root node of adt tree
+ * @param buf   pointer to byte buffer (caller-free)
+ * @return      number of packed bytes
+ */
+int adt_pack(adt_node_t *root, unsigned char **buf);
+
+/**
+ * @brief           unpack adt tree from bytes
+ * @param root      root node of adt tree (caller-free)
+ * @param buf       byte buffer
+ * @param buf_len   length of byte buffer
+ * @return          number of bytes processed
+ */
+int adt_unpack(adt_node_t **root, unsigned char *buf, int buf_len);
+
+/**
+ * @brief       free adt tree
+ * @param root  root node of adt tree
+ */
+void adt_free(adt_node_t *root);
+
+#endif
diff --git a/mcu/interface/service/dhl/v2/dhl_asm_interface.h b/mcu/interface/service/dhl/v2/dhl_asm_interface.h
new file mode 100644
index 0000000..0a7bcf8
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dhl_asm_interface.h
@@ -0,0 +1,57 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file dhl_asm_interface.h
+ *
+ * Description:
+ * ------------
+ *   @brief ASM config/interfaces for SS team
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_ASM_INTERFACE_H_
+#define _DHL_ASM_INTERFACE_H_
+
+kal_uint32 dhl_asm_init_buffer(kal_uint32 **buffer_address, kal_uint32 request_size);
+
+#endif //_DHL_ASM_INTERFACE_H_
+
+
diff --git a/mcu/interface/service/dhl/v2/dhl_builtin_filters.h b/mcu/interface/service/dhl/v2/dhl_builtin_filters.h
new file mode 100644
index 0000000..30a1634
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dhl_builtin_filters.h
@@ -0,0 +1,55 @@
+#ifndef _DHL_BUILT_IN_FILTER_H
+#define _DHL_BUILT_IN_FILTER_H
+typedef struct
+{
+    kal_uint8 *filter_addr;
+    kal_uint32 len;
+} dhl_buildin_mcu_filter_info;
+
+typedef struct
+{
+    kal_uint32 *filter_addr;
+    kal_uint32 len;
+} dhl_buildin_dsp_filter_info;
+
+typedef struct
+{
+    dhl_buildin_mcu_filter_info module_filter;
+    dhl_buildin_mcu_filter_info sap_filter;
+    dhl_buildin_mcu_filter_info trace_filter;
+    dhl_buildin_mcu_filter_info l1_filter;
+    dhl_buildin_dsp_filter_info INNER_filter;
+    dhl_buildin_dsp_filter_info BRP_filter;
+    dhl_buildin_dsp_filter_info FEC_filter;
+    dhl_buildin_dsp_filter_info SPEECH_filter;
+    dhl_buildin_dsp_filter_info RAKE_filter;
+    dhl_buildin_dsp_filter_info MCORE_filter;
+}dhl_builtin_filter;
+
+extern dhl_builtin_filter* builtin_filters[];
+extern kal_bool dhl_init_builtin_filter_loaded;
+
+#ifdef __ICD_LOGGING_SUPPORT__ 
+#include "icd_codes.h"
+#include "icd_dhl.h"
+typedef struct
+{
+    kal_uint16 protocol_mask[CAT_COUNT];
+    kal_uint8 *filter_addr[CAT_COUNT];
+    kal_uint32 len[CAT_COUNT];
+} icd_buildin_icd_filter_info;
+
+typedef struct
+{
+    icd_buildin_icd_filter_info event_filter;
+    icd_buildin_icd_filter_info record_filter;
+}icd_builtin_filter;
+
+extern icd_builtin_filter* icd_built_in_filters[];
+#endif
+
+kal_int8 dhl_get_scenario_id(char* scenario);
+void dhl_load_builtin_filter(kal_int8 scenario_id);
+kal_int8 dhl_custom_get_scenario_selection();//get cutomize default scenario id
+kal_uint8 dhl_get_max_scenario_num();//get max number of filter  
+#endif //#ifndef _DHL_BUILT_IN_FILTER_H
diff --git a/mcu/interface/service/dhl/v2/dhl_cc_public.h b/mcu/interface/service/dhl/v2/dhl_cc_public.h
new file mode 100644
index 0000000..c807888
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dhl_cc_public.h
@@ -0,0 +1,64 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file dhl_cc_public.h
+ *
+ * Description:
+ * ------------
+ *   @brief DHL Cross-core public include header TODO: phase-out
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ ****************************************************************************/
+
+#ifndef __DHL_CC_PUBLIC__
+#define __DHL_CC_PUBLIC__
+
+#include "kal_public_defs.h"
+#include "kal_public_api.h"
+#include "kal_general_types.h"
+
+#if !defined(GEN_FOR_PC)
+// meta mode flag
+extern kal_uint8 tst_meta_mode_trace_nvram_enable_flag;
+#endif  /* !GEN_FOR_PC */
+
+#endif /* __DHL_CC_PUBLIC__ */
+
+
diff --git a/mcu/interface/service/dhl/v2/dhl_cond_l1_trace.h b/mcu/interface/service/dhl/v2/dhl_cond_l1_trace.h
new file mode 100644
index 0000000..d5ef96f
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dhl_cond_l1_trace.h
@@ -0,0 +1,225 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file dhl_cond_l1_trace.h
+ *
+ * Description:
+ * ------------
+ *   @brief Conditional L1 trace interface.
+ *   @note  This header is included in L1Trc.h, please do not include this header alone!!
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 04 16 2019 guan-ren.chen
+ * [MOLY00399588] [Gen97] Dormant flow
+ * Dormant flow. Struct access ULSP reg.
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_COND_L1_TRACE_H
+#define _DHL_COND_L1_TRACE_H
+
+// Conversion for normal COND traces
+#define TRC_PREPROCESS_DATA_SECTION1_L1_COND   TRC_PREPROCESS_DATA_SECTION1_L1
+#define TRC_PREPROCESS_DATA_SECTION2_L1_COND   TRC_PREPROCESS_DATA_SECTION2_L1
+#define TRC_START_FILTER_CHECK_L1_COND         TRC_START_FILTER_CHECK_L1
+#define TRC_END_FILTER_CHECK_L1_COND           TRC_END_FILTER_CHECK_L1
+#define TRC_START_FILL_L1_COND()
+#define TRC_END_FILL_L1_COND()
+
+
+// Conversion for NON_SMP COND trace, should be removed
+#define TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP_COND    TRC_PREPROCESS_DATA_SECTION1_L1
+#define TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP_COND    TRC_PREPROCESS_DATA_SECTION2_L1
+#define TRC_START_FILTER_CHECK_L1_NON_SMP_COND          TRC_START_FILTER_CHECK_L1_COND
+#define TRC_END_FILTER_CHECK_L1_NON_SMP_COND            TRC_END_FILTER_CHECK_L1_COND
+#define TRC_START_FILL_L1_NON_SMP_COND                  TRC_START_FILL_L1_COND
+#define TRC_END_FILL_L1_NON_SMP_COND                    TRC_END_FILL_L1_COND
+
+#define TRC_SEND_N_DATA_L1_COND(word_cnt, ...) do \
+    {   \
+        dhl_l1_cond_send_n_word(word_cnt, __VA_ARGS__); \
+    } while(0)
+
+#define TRC_SEND_N_DATA_L2_COND(word_cnt, ...) do \
+    {   \
+        dhl_l1_cond_send_n_word(word_cnt, __VA_ARGS__); \
+    } while(0)
+
+
+// Conversion for HW_COND traces
+#define TRC_PREPROCESS_DATA_SECTION1_L1_HW_COND     TRC_PREPROCESS_DATA_SECTION1_L1
+#define TRC_PREPROCESS_DATA_SECTION2_L1_HW_COND     TRC_PREPROCESS_DATA_SECTION2_L1
+#define TRC_START_FILTER_CHECK_L1_HW_COND           TRC_START_FILTER_CHECK_L1_COND
+#define TRC_END_FILTER_CHECK_L1_HW_COND             TRC_END_FILTER_CHECK_L1_COND
+
+// Note: create local buffer may increase stack size!!
+#define TRC_START_FILL_L1_HW_COND() kal_uint8 hw_cond_tmp_buf[128]; \
+    kal_uint8 tmp_idx = 0;
+
+#define TRC_END_FILL_L1_HW_COND() do { \
+        dhl_l1_cond_send_array(&hw_cond_tmp_buf[0], tmp_idx); \
+    } while(0)
+
+// implemenation for HW_COND trace macro
+
+#define DHL_HW_COND_L1_FILL_TMP_BUF_8(val) do{ \
+        hw_cond_tmp_buf[tmp_idx++] = (val); \
+    } while(0)
+
+
+#define DHL_HW_COND_L1_FILL_TMP_BUF_16(val) do{ \
+        hw_cond_tmp_buf[tmp_idx++] = (kal_uint8) (val); \
+        hw_cond_tmp_buf[tmp_idx++] = (kal_uint8) ((val) >> 8); \
+    } while(0)
+
+#define DHL_HW_COND_L1_FILL_TMP_BUF_24(val) do{ \
+        hw_cond_tmp_buf[tmp_idx++]   = (kal_uint8) (val); \
+        hw_cond_tmp_buf[tmp_idx++]   = (kal_uint8) ((val) >> 8); \
+        hw_cond_tmp_buf[tmp_idx++]   = (kal_uint8) ((val) >> 16); \
+    } while(0)
+
+#define DHL_HW_COND_L1_FILL_TMP_BUF_32(val) do{ \
+        hw_cond_tmp_buf[tmp_idx++]   = (kal_uint8) (val); \
+        hw_cond_tmp_buf[tmp_idx++]   = (kal_uint8) ((val) >> 8); \
+        hw_cond_tmp_buf[tmp_idx++]   = (kal_uint8) ((val) >> 16); \
+        hw_cond_tmp_buf[tmp_idx++]   = (kal_uint8) ((val) >> 24); \
+    } while(0)
+
+// Conversion for HW_COND fill data macros
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_HW_COND(value,dummy)     DHL_HW_COND_L1_FILL_TMP_BUF_16(value);
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_HW_COND(value,dummy)       DHL_HW_COND_L1_FILL_TMP_BUF_32(value);
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_HW_COND(value,dummy)       DHL_HW_COND_L1_FILL_TMP_BUF_24(value);
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_HW_COND(value,dummy)       DHL_HW_COND_L1_FILL_TMP_BUF_16(value);
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_HW_COND(value,dummy)        DHL_HW_COND_L1_FILL_TMP_BUF_8(value);
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_HW_COND(value,dummy)      DHL_HW_COND_L1_FILL_TMP_BUF_32(value);
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_HW_COND(value,dummy)      DHL_HW_COND_L1_FILL_TMP_BUF_24(value);
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_HW_COND(value,dummy)      DHL_HW_COND_L1_FILL_TMP_BUF_16(value);
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_HW_COND(value,dummy)       DHL_HW_COND_L1_FILL_TMP_BUF_8(value);
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_HW_COND(value,dummy)    DHL_HW_COND_L1_FILL_TMP_BUF_32(value);
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_HW_COND(value,dummy)    DHL_HW_COND_L1_FILL_TMP_BUF_24(value);
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_HW_COND(value,dummy)    DHL_HW_COND_L1_FILL_TMP_BUF_16(value);
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_HW_COND(value,dummy)     DHL_HW_COND_L1_FILL_TMP_BUF_8(value);
+
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2_HW_COND(value,dummy)     DHL_HW_COND_L1_FILL_TMP_BUF_16(value);
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2_HW_COND(value,dummy)       DHL_HW_COND_L1_FILL_TMP_BUF_32(value);
+#define TRC_OUTPUT_24_MID_WRAPPER_L2_HW_COND(value,dummy)       DHL_HW_COND_L1_FILL_TMP_BUF_24(value);
+#define TRC_OUTPUT_16_MID_WRAPPER_L2_HW_COND(value,dummy)       DHL_HW_COND_L1_FILL_TMP_BUF_16(value);
+#define TRC_OUTPUT_8_MID_WRAPPER_L2_HW_COND(value,dummy)        DHL_HW_COND_L1_FILL_TMP_BUF_8(value);
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2_HW_COND(value,dummy)      DHL_HW_COND_L1_FILL_TMP_BUF_32(value);
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2_HW_COND(value,dummy)      DHL_HW_COND_L1_FILL_TMP_BUF_24(value);
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2_HW_COND(value,dummy)      DHL_HW_COND_L1_FILL_TMP_BUF_16(value);
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2_HW_COND(value,dummy)       DHL_HW_COND_L1_FILL_TMP_BUF_8(value);
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2_HW_COND(value,dummy)    DHL_HW_COND_L1_FILL_TMP_BUF_32(value);
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2_HW_COND(value,dummy)    DHL_HW_COND_L1_FILL_TMP_BUF_24(value);
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2_HW_COND(value,dummy)    DHL_HW_COND_L1_FILL_TMP_BUF_16(value);
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2_HW_COND(value,dummy)     DHL_HW_COND_L1_FILL_TMP_BUF_8(value);
+
+
+//========================================================================
+//============================ Array Support =============================
+//========================================================================
+#define TRC_OUTPUT_ARRAY_L1_COND(begin_trace_id, array_ptr, align, count, max_count) TRC_OUTPUT_ARRAY_IMPL(trc_output_array_l1_cond, begin_trace_id, array_ptr, align, count, max_count)
+
+#define TRC_OUTPUT_ARRAY_L2_COND(begin_trace_id, array_ptr, align, count, max_count) TRC_OUTPUT_ARRAY_IMPL(trc_output_array_l1_cond, begin_trace_id, array_ptr, align, count, max_count) // redirect to l1, since there is no conditional l2 buffer
+
+#define TRC_OUTPUT_ARRAY_L1_HW_COND(begin_trace_id, array_ptr, align, count, max_count) \
+    do { \
+        kal_uint32 *pWrite = &hw_cond_tmp_buf[0]; \
+        kal_uint32 array_data_bytes = count * align; \
+        EXT_ASSERT(0 < count && count <= max_count, count, max_count, 0); /* since it's used by DHL only, we can make sure not misuse happend */ \
+        *(pWrite) = begin_trace_id + ((count - 1) << 8); \
+        pWrite = (kal_uint32*) ((kal_uint32) pWrite + 2); \
+        memcpy(pWrite, array_ptr, array_data_bytes); \
+        if(align != 4) { \
+            pWrite = (kal_uint32*) ((kal_uint32) pWrite + array_data_bytes); \
+        } \
+        tmp_buf_idx = 2 /* TraceID */ + array_data_bytes; \
+    } while(0)
+
+#define TRC_OUTPUT_ARRAY_L2_HW_COND(BEGIN_TRC_ID, ARRAY_PTR, ALIGN, COUNT) TRC_OUTPUT_ARRAY_L1_HW_COND(BEGIN_TRC_ID, ARRAY_PTR, ALIGN, COUNT) // redirect to l1, since there is no conditional l2 buffer
+
+#define TRC_OUTPUT_ARRAY_L1_NON_SMP_COND TRC_OUTPUT_ARRAY_L1_COND
+#define TRC_OUTPUT_ARRAY_L2_NON_SMP_COND TRC_OUTPUT_ARRAY_L2_COND
+
+
+//========================================================================
+//========================== Function Declarion ==========================
+//========================================================================
+
+#if defined(__MTK_TARGET__)
+
+void dhl_l1_cond_send_array(kal_uint8 *src, kal_uint32 byte_cnt);
+void dhl_l1_cond_send_n_word(kal_uint32 word_cnt, ...);
+void dhl_dump_l1_cond_trace();
+extern void trc_output_array_l1_cond(kal_uint16 begin_trace_id, void *array_ptr, kal_uint8 align, kal_uint8 count);
+extern void trc_output_array_l1_hw_cond(kal_uint16 begin_trace_id, void *array_ptr, kal_uint8 align, kal_uint8 count);
+
+#else //Wrapper for xL1sim 
+
+#ifdef TRC_C
+// Workaround for XL1sim, TRC_C is defined in L1Trc.c, and since XL1SIM only build L1Trc.c rather than dhl_cond_l1_trace.c, we declare empty body here
+
+
+#else // other source file, only get prototype
+
+extern void dhl_l1_cond_send_array(kal_uint8 *src, kal_uint32 length);
+extern void dhl_l1_cond_send_n_word(kal_uint32 word_cnt, ...);
+extern void dhl_dump_l1_cond_trace();
+
+extern void trc_output_array_l1_cond(kal_uint16 begin_trace_id, void *array_ptr, kal_uint8 align, kal_uint8 count);
+extern void trc_output_array_l1_hw_cond(kal_uint16 begin_trace_id, void *array_ptr, kal_uint8 align, kal_uint8 count);
+
+
+#endif // #ifdef TRC_C
+
+#endif // defined(__MTK_TARGET__)
+
+
+
+#endif
+
diff --git a/mcu/interface/service/dhl/v2/dhl_custom.h b/mcu/interface/service/dhl/v2/dhl_custom.h
new file mode 100644
index 0000000..d477ba3
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dhl_custom.h
@@ -0,0 +1,96 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ------------
+ *   @file dhl_custom.h
+ *
+ * Description:
+ * ------------
+ *   @brief For dhl customize function definition.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 05 13 2020 kaijiun.yeo
+ * [MOLY00511883] 5G 循环LOG 直接将L1和DSP Buffer分配给PS,不需要每次都重启
+ * 	
+ * 	Customer buffer reallocation feature (OA domain)
+ *
+ * 05 07 2020 kaijiun.yeo
+ * [MOLY00506529] [Titan93 6M SP] patch customize whether MD mem dump by USIR compile option
+ * Patch customize whether MD mem dump by USIR compile option
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_CUSTOM_H
+#define _DHL_CUSTOM_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "kal_public_api.h"
+#include "kal_internal_def.h"
+#include "dhl_trace.h"
+
+/**
+* \brief how to mask sensitive data.
+* \param senitive_data the address of sensitive string data
+* \param sensitive_len length of sensitive string
+* \param left_over_buf_size how much trace buffer is left
+*/
+kal_int32 dhl_custom_usir_mask_sensitive(kal_uint8 *senitive_data, const kal_int32 sensitive_len, const kal_int32 left_over_buf_size);
+
+/**
+* Description:
+* determine whether to do memory dump when a nested exception occurs
+*/
+kal_bool dhl_custom_usir_disable_memdump_if_nested_ex();
+
+/**
+* Description:
+* determine if enlarge PS logging buffer in 1st boot via reducing L1L2 & DSP logging buffer
+* this function only take effect when DHL uses 64MB CCB (gear)
+* customer can add/remove "#define __CCB_64MB_PS_ONLY__" in custom/service/tst/dhl_custom_set_log_buf.c to adjust the return value
+* (add the option = return true, otherwise = return false)
+*
+* Return value:
+* true  -> enlarge PS logging buffer in 1st boot via reducing L1L2 & DSP logging buffer
+* false -> keep the original buffer allocation
+*/
+kal_bool dhl_custom_set_ccb_64mb_ps_only();
+
+#endif /* _DHL_CUSTOM_H */
+
diff --git a/mcu/interface/service/dhl/v2/dhl_debugl1_trace.tmd b/mcu/interface/service/dhl/v2/dhl_debugl1_trace.tmd
new file mode 100644
index 0000000..720c708
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dhl_debugl1_trace.tmd
@@ -0,0 +1,18 @@
+[Default]
+DHL_DEBUGL1
+On
+Buffer
+
+[Modem_Type]
+dhl
+
+[Class]
+L1_CHANNEL_DEBUG ON
+
+[String]
+
+[Message]
+info                    DHL_DEBUGL1_ULSP_SEND                  L1_CHANNEL_DEBUG           "[DHL][ULSP][SEND] Type= %l, Address= %xl, Len= %xl"
+info                    DHL_DEBUGL1_ULSP_ACK                   L1_CHANNEL_DEBUG           "[DHL][ULSP][ACK] Type= %l, Address= %xl, Len= %xl"
+info                    DHL_DEBUGL1_PS_SEND                  L1_CHANNEL_DEBUG           "[DHL][PS][SEND] Output buffer number %xl"
+info                    DHL_DEBUGL1_PS_ACK                   L1_CHANNEL_DEBUG           "[DHL][PS][ACK] Release buffer number %xl"
\ No newline at end of file
diff --git a/mcu/interface/service/dhl/v2/dhl_def.h b/mcu/interface/service/dhl/v2/dhl_def.h
new file mode 100644
index 0000000..90cf1f6
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dhl_def.h
@@ -0,0 +1,2158 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file dhl_def.h
+ *
+ * Description:
+ * ------------
+ *   @brief DHL function and struct definition. TODO: split it into files
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 12 22 2021 zhoumao.kang
+ * [MOLY00710879] [WIN] System can't sleep with MD logging enabled via PCIe
+ * [MOLY00710879][Gen97][DHL][Colgin][WIN] System can't sleep with MD logging enabled via PCIe
+ * [new][Patch back] modify logging flush interval by MBIM cmd
+ * ======
+ * - from MD700.TC35.SP, CL? 19443308
+ * - add msg struct in dhl_def.h; add msg id in tst_msgid.h
+ * - test case: set flush interval as 0,20,50,100,6000 and after each setting send query cmd by MBIM to check result.
+ *
+ * 09 18 2020 jude.fang
+ * [MOLY00535140] [Gen97] [DHL] logging development
+ * patch back from T700
+ *
+ * 06 09 2020 yancy.chien
+ * [MOLY00331449] [Gen97] DHL logging development
+ * 	
+ * 	.
+ *
+ * 05 05 2020 kaijiun.yeo
+ * [MOLY00520148] Fix rebootm command ID & send memory dump end indicator
+ * Fix reboot command ID & send memory dump end indicator
+ *
+ * 04 16 2020 kaijiun.yeo
+ * [MOLY00507931] Overwritable memorydump setting from AP (memory dump 2.0 phase 2)
+ * Memory dump 2.0 phase 2 - overwrite mdmp profile on runtime feature (OA domain)
+ *
+ * 04 15 2020 hk.yang
+ * [MOLY00426748] [VMOLY][PMC]DHL V2.0 ICD feature
+ * [NR15.R3] ICD control EM/OTA filter - header.
+ *
+ * 01 06 2020 wen-ting.cheah
+ * [MOLY00467612] [DHL] Log Scrambling
+ * VIVO Log Security Trace Scrambling Feature
+ *
+ * 12 09 2019 yen-hsuan.lin
+ * [MOLY00327199] [Gen97] Development
+ * [MOLY00464641] Fix the dhl low power problem
+ * 	
+ * 	merger the Gen98 Fix into VMOLY trunk
+ *
+ * 12 06 2019 jj.chang
+ * [MOLY00464212] Filter binary signature check
+ * 	
+ * 	.
+ *
+ * 11 11 2019 sunwhy.kuo
+ * [MOLY00458003] [Gen97] MoDIS UT enhancement
+ * VMOLY MODIS inhanced (Non MPD Part)
+ *
+ * 09 24 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * Dsp_Backup_Clear_All_Filter and Dsp_Restore_Filter implementation.
+ *
+ * 09 21 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * 1. ULSP DSP refactory SWRD.
+ * 	2. Remove SW pull power when PB is not empty
+ * 	3. Move DSP ST log definition file from HWRD to MPD
+ *
+ * 09 18 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * 1. ULSP DSP refactory SWRD.
+ * 	2. Remove SW pull power when PB is not empty
+ * 	3. Move DSP ST log definition file from HWRD to MPD
+ *
+ * 09 18 2019 mojo.lai
+ * [MOLY00439733] Cgen optimization
+ * 	
+ * 	Revert wrong check-in
+ *
+ * 09 18 2019 mojo.lai
+ * [MOLY00439733] Cgen optimization
+ * set trap filter array
+ *
+ * 09 09 2019 yu-hsiang.peng
+ * [MOLY00402569] [VMOLY] Logging Related Feature Patch
+ * [TRUNK] SWRD, custom cmd + sap reboot 
+ * 	2019.09.09
+ *
+ * 09 06 2019 yen-hsuan.lin
+ * [MOLY00437389] Porting Built in filter
+ * 	
+ * 	Add built in function
+ *
+ * 09 03 2019 sunwhy.kuo
+ * [MOLY00434510] Memory Dump 2.0
+ * mdmp patch to VMOLY dhl part (SWRD)
+ *
+ * 08 19 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * ULSP DSP UT.
+ *
+ * 08 08 2019 guan-ren.chen
+ * [MOLY00427332] [MT6297][Apollo][Overnight][LegacyRAT][CHT][TPE][VMOLY][20190730]assert fail:dhl_ulsp.c
+ * LS abort fail SW workaround for SCQ16 (WHQA_00039659).
+ *
+ * 07 31 2019 guan-ren.chen
+ * [MOLY00420032] [HCR][Top Issue][MT6297][Apollo][MP1][SQC][Dongle][HQ][MTBF][Lab][Ericsson][ErrorTimes:6][1][core0,vpe0,tc0(vpe0)]Assert fail: dhl_ulsp.c 688 0x2 0x0 0x0 - 0IDLE
+ * LS abort fail SW workaround (WHQA_00039659).
+ *
+ * 07 10 2019 sunwhy.kuo
+ * [MOLY00420552] [MT6297] [DSP] [Exception] dump msonic non-$ EMI space
+ * dump sonic dsp dhl part
+ *
+ * 04 21 2019 yh.sung
+ * [MOLY00392990] [VMOLY][UTF] Phase 2 Landing
+ * [UTF][DHL] UTF Trace API - trace interface
+ *
+ * 02 11 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * 	
+ * 	Add code review change.
+ *
+ * 02 11 2019 yancy.chien
+ * [MOLY00331449] [Gen97] DHL logging development
+ * Remove useless code.
+ *
+ * 01 23 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * On-demand corresponding change for SEPT.DEV.
+ *
+ * 01 15 2019 mojo.lai
+ * [MOLY00376312] Save PB abort and flush status to CXIF
+ * 	
+ * 	.
+ *
+ * 10 31 2018 mojo.lai
+ * [MOLY00361962] Set DSP Filter
+ * 	
+ * 	.
+ *
+ * 10 11 2018 yu-hsiang.peng
+ * [MOLY00356840] [Gen97][MCU][DSP]SWLA memory dump feature
+ * [MemDump] Support 97 SWLA
+ *
+ * 10 01 2018 mojo.lai
+ * [MOLY00348934] Patch ICD to Gen97/VMOLY
+ *
+ * 09 28 2018 yancy.chien
+ * [MOLY00345863] [Gen97] RRC signal logging & inject
+ * UPS mux header support over 64K
+ * UPS protocol phase-in
+ * EBS add NRRC_LOG type
+ * Custom ILM option remove no_log & wo_peer_buff
+ *
+ * 09 20 2018 yu-hsiang.peng
+ * [MOLY00350014] [MT6297] [DSP] [Exception] Sonic Memory Dump
+ * [Mem Dump] Support 97 DSP new region
+ *
+ * 08 13 2018 kenneth.lin
+ * [MOLY00310902] [Gen97] DSP logging porting
+ * [Gen97] dhl new dsp filter structure
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_DEF_H
+#define _DHL_DEF_H
+
+#include "dhl_trace.h"
+#include "kal_public_defs.h"
+#include "kal_public_api.h"
+#include "svc_sap.h"
+#include "cpu_info.h" // SYS_MCU_NUM_CORE
+
+#if defined(__EM_MODE__)
+#ifndef _EM_STRUCT_H
+#include "em_struct.h"
+#endif  //#ifndef _EM_STRUCT_H
+#endif  //#ifdef __EM_MODE__
+
+#include "dcl.h"
+
+#include "sysconf_statistics.h"
+
+#if !defined (L1_SIM) || defined (__UE_SIMULATOR__)
+#include "nvram_interface.h"
+//#include "nvram_data_items.h"
+#include "nvram_enums.h"
+#include "nvram_struct.h"
+#endif //#if !defined (L1_SIM) || defined (__UE_SIMULATOR__)
+
+#include "tst.h"
+#if defined(__L5_SUPPORT__)
+/* for log control over mipc*/
+#include "l5_common.h"
+#endif
+#define DHL_NVRAM_ACCESS_EXCEPTION 1
+#define DHL_NVRAM_ACCESS_STATISTIC 2
+#define DHL_NVRAM_ACCESS_OTHERS 3
+
+#define MAX_PS_TRACE_CLASS_BYTE  8 /*must some with MAX_UNIFIED_TRACE_CLASS_BYTE */
+#define TST_MODULE_FILTER_LEN       ((END_OF_MOD_ID+8)/8)
+#define TST_SAP_FILTER_LEN          (LAST_SAP_CODE+1)
+#define TST_TRACE_FILTER_LEN        (MAX_PS_TRACE_CLASS_BYTE * (END_OF_MOD_ID+1))
+#define TST_TOTAL_FILTER_LEN    (TST_MODULE_FILTER_LEN+ TST_SAP_FILTER_LEN+ TST_TRACE_FILTER_LEN)
+
+#define  INJECT_STRING_TO_MODULE_MAX_LENGTH  (256)
+#define  INJECT_AT_COMMAND_MAX_LENGTH        (256)
+
+extern kal_bool  tst_is_L1Trc_open;
+extern kal_bool  tst_is_PsTrc_open;
+extern kal_bool  tst_is_l1_writing_uart;/*protect UART Port from closing while writing*/
+extern kal_bool  tst_is_ps_writing_uart;/*protect UART Port from closing while writing*/
+
+/*for close/open UART port in run time*/
+extern kal_bool tst_is_uart_open;
+extern kal_bool tst_is_writing_uart;
+
+#if defined (UNIT_TEST) || defined (__UE_SIMULATOR__)
+#define LEGACY_TX
+#endif
+
+//extern kal_uint8  tst_ring_buffer[];
+//extern kal_uint32 tst_ptr_buffer_start;
+//extern kal_uint32 tst_ptr_buffer_end;
+#if !defined(LEGACY_TX) && !defined(__DHL_ON_WR8_PLATFORM__)
+extern kal_uint32 tst_ptr_buffer_sent;
+#endif
+
+#ifdef IN_MEMORY_EXCEPTION_BUFFER
+extern kal_uint8 dhl_exception_buffer[];
+extern kal_uint32 dhl_exception_buffer_pos;
+#endif
+
+//the following is dummy tst enums/structs to bypass cgen database check
+typedef enum
+{
+    TST_NULL_COMMAND
+} tst_command_type;
+
+typedef kal_uint8 tst_null_command_struct;
+
+typedef struct
+{
+    tst_command_type  command_type;
+    kal_uint16        cmd_len;
+} tst_command_header_struct;
+
+typedef struct
+{
+    kal_uint32     dummy;
+} tst_log_prim_header_struct;
+
+typedef struct
+{
+    kal_uint32     dummy;
+} tst_index_trace_header_struct;
+
+typedef struct
+{
+    kal_uint32     dummy;
+} tst_prompt_trace_header_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint8   index;
+    kal_uint8   string[INJECT_STRING_TO_MODULE_MAX_LENGTH];
+} tst_inject_string_struct;
+
+typedef tst_inject_string_struct dhl_inject_string_struct;
+
+
+
+#define TST_MSG_LOG_SAP_ENABLE 0x7
+
+// Remove stack_timer requirement from SS, contact: HW Jheng
+//typedef stack_timer_struct timer_expiry_struct;
+
+
+#define MAX_RAW_TRACE_SIZE (128)
+#define MAX_TRACE_SIZE (128)
+#define EX_MAX_TRACE_SIZE (128)
+#define MAX_SYS_TRACE_SIZE (120)
+#define MAX_RAW_TRACE_BUFFER (65523)
+
+#define MAX_HEADER_LEN (8)
+#define DHL_CHECKSUM_FRAME_SIZE  (4)
+
+#if defined(DHL_V_0_5_1) || defined(DHL_V_0_7_1)
+#define DHL_TYPE_CHECKSUM_FLAG      (0x10)
+#define DHL_TYPE_USER_FLAG          (0x20)
+#define DHL_TYPE_EXT_FLAG           (0x08)
+#define DHL_TYPE_MASK               (0x07)
+#else
+#define DHL_FLAG_EXTRA              (0x1)
+#define DHL_TX_FLAG_CHECKSUM              (0x20)
+#define DHL_RX_FLAG_CHECKSUM           (0x40)
+#endif
+
+#define DHL_UNKNOWN_TYPE            (0xFF)
+
+#define __TST_META_MODE_TRACE_ENABLE__ // for MOD_FT
+
+typedef enum
+{
+#if defined (DHL_V_0_5_1)
+    V0_5_1_W1118
+#elif defined(DHL_V_0_7_1)
+    V0_7_1_W1232
+#else
+    V0_7_2_W1346
+#endif
+} dhl_protocol_version;
+
+
+#define DHL_FLAG_CORE_ID_MASK (0x7)
+#define DHL_FLAG_GET_CORE_ID(_f) (((_f) >> 2) & DHL_FLAG_CORE_ID_MASK)
+#define DHL_FLAG_SET_CORE_ID(_des, _f) (_des) = ((_des) | (((_f) & DHL_FLAG_CORE_ID_MASK) << 2))
+
+typedef enum
+{
+    DHL_CORE_ID_MCU_MASTER = 0,
+    DHL_CORE_ID_MCU_SLAVE_1,
+    DHL_CORE_ID_MCU_SLAVE_2,
+    DHL_CORE_ID_MCU_SLAVE_3,
+    DHL_CORE_ID_MCU_SLAVE_4,
+    DHL_CORE_ID_MCU_SLAVE_5,
+    DHL_CORE_ID_MCU_SLAVE_6,
+    DHL_CORE_ID_MCU_SLAVE_7,
+} dhl_core_id_enum;
+
+/**
+ *   Enable checksum
+ *   define here for feeding into codegen when customer release / subsidiary
+ **/
+
+#define __DHL_RX_CHECKSUM__
+#define __DHL_HEADER_CHECKSUM__
+typedef enum
+{
+#if !defined(__DHL_RX_CHECKSUM__) && !defined(__DHL_HEADER_CHECKSUM__)
+    NO_CHECKSUM,
+#else
+#if defined(__DHL_HEADER_CHECKSUM__)
+    DHL_HEADER_CHECKSUM,
+#endif // __DHL_HEADER_CHECKSUM__
+#if defined(__DHL_RX_CHECKSUM__)
+    DHL_RX_CHECKSUM,
+#endif // __DHL_RX_CHECKSUM__
+#endif
+    NO_HEADER_COMPRESSION,
+
+#if defined(L1_CATCHER)
+    MULTI_CORE_SMP_SUPPORT,
+#endif
+
+    DHL_MUX_ENABLE,
+
+    SYSTEM_MONITOR_UMOLYA,
+    USB_MEMORY_DUMP_MODE_AUTO,
+    /* VPE info in check sum field */
+    DISPLAY_EXTENSION_INFO,
+#ifdef __ICD_LOGGING_SUPPORT__
+    ICD_LOGGING,
+    EM_FILTER_FORMAT_ICD,
+#endif
+} dhl_protocol_info;
+
+typedef enum
+{
+    DHL_PRIMITIVE = 0,
+    DHL_INDEX_TRACE = 1,
+    DHL_RAW_BYTE_TRACE = 2,
+    DHL_RAW_STRING_TRACE = 3,
+    DHL_DISCARD_INFO = 4,
+    DHL_TIME_INFO = 5,
+    DHL_RLE_PRIMITIVE = 6,
+    DHL_PRIMITIVE_ADT = 7,
+    DHL_L1_TRACE = 8,
+    DHL_META_CNF_PRIMITIVE = 9,
+    DHL_L2_TRACE = 10,
+
+    DHL_ICD_TUNNELING = 0xE0,    // Command & log share same ID, so we need to avoid it collides with command_type
+    //cannot use 0xFF, since it means unknown type
+} dhl_type;
+#define DHL_TYPE_NUM 11
+
+#if defined (DHL_V_0_5_1)
+typedef struct
+{
+    kal_uint16 type;
+    kal_uint16 len;
+} dhl_header_struct;
+#else
+typedef struct
+{
+    kal_uint8 flag;
+    kal_uint8 type;
+    kal_uint16 len;
+} dhl_header_struct;
+#endif
+
+typedef struct
+{
+    kal_uint8 type;
+    kal_uint8 len;
+} dhl_compact_header_struct;
+
+typedef struct
+{
+    kal_uint8 type;
+} dhl_ultra_compact_header_struct;
+
+typedef struct
+{
+    kal_uint32          msg_index;
+    trace_class_enum    trace_class;
+    kal_uint8           access_level;
+    module_type module_id;
+
+} dhl_index_trace_header_struct;
+
+typedef struct
+{
+    kal_uint16 key_len;
+    kal_uint16 data_len;
+} dhl_index_trace_ext_header_struct;
+
+typedef struct
+{
+    kal_uint32          msg_index;
+    trace_class_enum    trace_class;
+    module_type module_id;
+} dhl_raw_byte_trace_header_struct;
+
+typedef struct
+{
+    module_type         module_id;
+    trace_class_enum    trace_class;
+} dhl_raw_string_trace_header_struct;
+
+typedef struct
+{
+    module_type src_mod_id;
+    module_type dest_mod_id;
+    sap_type    sap_id;
+    msg_type    msg_id;
+    kal_uint32  local_len;
+    kal_uint32  peer_len;
+    kal_uint32  local_addr;
+    kal_uint32  peer_addr;
+} dhl_primitive_header_struct;
+
+typedef dhl_primitive_header_struct dhl_rle_primitive_header_struct;
+
+typedef struct
+{
+    module_type src_mod_id;
+    module_type dest_mod_id;
+    sap_type    sap_id;
+    msg_type    msg_id;
+    kal_uint16  local_len;
+    kal_uint16  peer_len;
+    kal_uint32  local_addr;
+    kal_uint32  peer_addr;
+    kal_uint8   local_access_type;
+    kal_uint8   peer_access_type;
+} dhl_ex_primitive_header_struct;
+
+typedef struct
+{
+    kal_uint32 src_mod_id;
+    kal_uint32 dest_mod_id;
+    kal_uint32 sap_id;
+    kal_uint32 msg_id;
+    kal_uint16 local_len;
+    kal_uint16 peer_len;
+} dhl_meta_cnf_primitive_header_struct;
+
+typedef struct
+{
+#if defined (DHL_V_0_5_1)
+    kal_uint16 count;
+#else
+    kal_uint8 count;
+#endif
+} dhl_discard_info_header_struct;
+
+#define DISCARD_INFO_TYPE_UNKNOWN       (0x0)
+#define DISCARD_INFO_TYPE_PS_TRACE      (0x1)
+#define DISCARD_INFO_TYPE_PRIMITIVE     (0x2)
+#define DISCARD_INFO_TYPE_TIMESTAMP     (0x3)
+#define DISCARD_INFO_TYPE_L1_TRACE      (0x4)
+#define DISCARD_INFO_TYPE_L1_BUFFER     (0x5)
+#define DISCARD_INFO_TYPE_L2_TRACE      (0x6)
+#define DISCARD_INFO_TYPE_L2_BUFFER     (0x7)
+
+typedef enum
+{
+    PS_TRACE = 1,
+    PRIMITIVE = 2,
+    TIMESTAMP = 3,
+    L1_TRACE = 4,
+    L1_BUFFER = 5,
+    L2_TRACE = 6,
+    L2_BUFFER = 7,
+} dhl_discard_info_type;
+
+typedef struct
+{
+    kal_uint32 count;
+} dhl_discard_info_type_ps_trace;
+
+typedef struct
+{
+    kal_uint32 count;
+} dhl_discard_info_type_primitive;
+
+typedef struct
+{
+    kal_uint16 count;
+} dhl_discard_info_type_timestamp;
+
+typedef struct
+{
+    kal_uint8 count;
+} dhl_discard_info_type_l1_trace;
+
+typedef struct
+{
+    kal_uint16 count;
+} dhl_discard_info_type_l1_buffer;
+
+typedef struct
+{
+    kal_uint8 count;
+} dhl_discard_info_type_l2_trace;
+
+typedef struct
+{
+    kal_uint16 count;
+} dhl_discard_info_type_l2_buffer;
+
+typedef struct
+{
+#if defined (DHL_V_0_5_1)
+    kal_uint16 count;
+#else
+    kal_uint8 count;
+#endif
+} dhl_time_info_header_struct;
+
+#define TIME_INFO_TYPE_RTOS_TIMESTAMP   (0x1)
+#define TIME_INFO_TYPE_3G_FRAME         (0x2)
+#define TIME_INFO_TYPE_3G_SFN           (0x3)
+
+typedef enum
+{
+    RTOS_TIME = 1,
+} dhl_time_info_type;
+
+typedef struct
+{
+    kal_uint32 timestamp;
+} dhl_time_info_type_rtos_time;
+
+typedef struct
+{
+    kal_uint16 count;
+} dhl_l1_trace_header_struct;
+
+#if defined(DHL_FRAME_LEN_WORD_ALIGN)
+#define RUP(_v) ((_v + 3) / 4 * 4)
+#else
+#define RUP(_v) (_v)
+#endif
+
+#define dhl_ex_trace_impl(_t, _u, _msg, _mod, _argv, _arg_info) \
+    dhl_ex_internal_trace_impl(_t, _u, DHL_ACCESS_LEVEL_1_ALL_USER, _msg, _mod, _argv, _arg_info)
+extern void dhl_ex_internal_trace_impl(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint8 access_level, kal_uint32 msg_index, kal_uint32 module_id, const char *arg_type, va_list argument_info);
+
+extern void dhl_ex_print_impl(trace_class_enum trc_class, kal_uint32 user_flag, module_type mod_id, const char *fmt, va_list argument_info);
+
+
+//extern void dhl_convert_ilm_header(ilm_struct *ilm, dhl_primitive_header_struct *hdr);
+#define dhl_convert_ilm_header(_ilm, _hdr) \
+    do { \
+        (_hdr)->local_len = 0; \
+        (_hdr)->peer_len  = 0; \
+        if (!msg_is_inline((_ilm))) { \
+            if ((_ilm)->local_para_ptr != NULL) { \
+                (_hdr)->local_len = (_ilm)->local_para_ptr->msg_len; \
+            } \
+            if ((_ilm)->peer_buff_ptr != NULL) { \
+                (_hdr)->peer_len = sizeof(peer_buff_struct) + \
+                                   (_ilm)->peer_buff_ptr->pdu_len + \
+                                   (_ilm)->peer_buff_ptr->free_header_space + \
+                                   (_ilm)->peer_buff_ptr->free_tail_space; \
+            } \
+        } \
+        (_hdr)->src_mod_id  = (_ilm)->src_mod_id; \
+        (_hdr)->dest_mod_id = (_ilm)->dest_mod_id; \
+        (_hdr)->sap_id      = (_ilm)->sap_id; \
+        (_hdr)->msg_id      = (_ilm)->msg_id; \
+        (_hdr)->local_addr  = (kal_uint32)(_ilm)->local_para_ptr; \
+        (_hdr)->peer_addr   = (kal_uint32)(_ilm)->peer_buff_ptr; \
+    } while(0)
+
+
+typedef struct
+{
+    kal_uint8 access_type;
+    kal_int32 len;
+    kal_uint8 *data;
+} buf_des;
+
+/*
+ * Macro: DHL_COPY_BY_BUF_DES
+ * ----------------------------
+ *   Memcpy to dest by buf_des struct, then increase the write pointer
+ *
+ *   PARAMETERS
+ *      buf_write_ptr   : kal_uint8*
+ *      body            : buf_des[]
+ *      body_count      : kal_uint32
+ *   RETURN: NONE
+ */
+
+#define DHL_COPY_BY_BUF_DES(buf_write_ptr, body, body_count) \
+    do { \
+        kal_uint32 i; \
+        for (i = 0; i < body_count; i++) { \
+            memcpy(buf_write_ptr, body[i].data, body[i].len); \
+            buf_write_ptr += body[i].len; \
+        } \
+    } while(0)
+
+extern void dhl_log_primitive_impl(kal_uint32 user_flag, dhl_primitive_header_struct *hdr, buf_des *des, kal_int32 count, kal_bool compressed);
+extern void dhl_print_primitive(kal_uint32 user_flag, dhl_primitive_header_struct *hdr);
+extern void dhl_print_primitive_impl(
+    kal_uint32 user_flag,
+    dhl_primitive_header_struct *hdr,
+    kal_uint8 *local_data,
+    kal_int32 local_len,
+    kal_uint8 *peer_data,
+    kal_int32 peer_len);
+extern void dhl_ex_print_primitive(kal_uint32 user_flag, dhl_ex_primitive_header_struct *hdr);
+
+/* layer-1 trace group */
+typedef enum
+{
+    UMTS_3G_GEMINI_TIME = 0,
+    UMTS_3G_TIME,
+    UMTS_2G_GEMINI_TIME,
+    UMTS_2G_TIME,
+    UMTS_2G_HANDOVER_TIME,
+    UMTS_3G_HANDOVER_TIME,
+    LTE_4G_TIME = 6,
+    LTE_4G_TIME_2 = 7,
+    LTE_4G_L2_TIME = 8,
+} dhl_l1_time_trace_type;
+
+typedef enum
+{
+    L1_TRACE_LOST_COUNT,
+    L1_BUFFER_LOST_COUNT,
+    L2_TRACE_LOST_COUNT,
+    L2_BUFFER_LOST_COUNT,
+} dhl_l1_lost_count_type;
+
+
+
+extern void dhl_ex_log_l1_trace_group(kal_uint32 user_flag, kal_uint16 count, kal_uint8 *buf, kal_uint32 buf_len);
+extern void dhl_ex_log_l2_trace_group(kal_uint32 user_flag, kal_uint16 count, kal_uint8 *buf, kal_uint32 buf_len);
+extern void dhl_ex_log_l1_lost_count(dhl_l1_lost_count_type type, kal_uint8 count);
+
+#include "adt.h"
+
+/* ADT logging */
+extern void dhl_log_primitive_with_adt(ilm_struct *ilm_ptr, translator_adt_enc_callback_t translator_cb, kal_bool filter);
+
+/* ADT inject for UT */
+typedef void (*translator_adt_dec_callback_t)(const ilm_struct *ilm_adt_ptr, ilm_struct **ilm_ptr);
+kal_bool register_translator_adt_decoder(msg_type msg_id, translator_adt_dec_callback_t cb);
+translator_adt_dec_callback_t get_adt_decoder(msg_type msg_id);
+kal_bool register_translator_adt_encoder(msg_type msg_id, translator_adt_enc_callback_t translator_cb);
+translator_adt_enc_callback_t get_adt_encoder(msg_type msg_id);
+
+/* control */
+extern void dhl_sync();
+extern void dhl_time();
+
+#ifdef UNIT_TEST
+void dhl_write_file(kal_bool outgoing, kal_uint8 *data, kal_int32 len);
+#endif
+
+#define SYNC_PATTERN_SIZE (4)
+
+/**
+* \brief Please check https://wiki.mediatek.inc/display/ST/DHL+Command+ID before any update.\n
+*/
+typedef enum
+{
+    DHL_CMD_NULL = 0,
+    DHL_CMD_META_REQ_PRIMITIVE = 1,
+    DHL_CMD_CHECK_DATABASE_SIGNATURE = 2,
+    DHL_CMD_MD_MONITOR_CMD = 3,
+    DHL_CMD_3RD_PARTY_TOOL_CMD = 4,
+    DHL_CMD_SET_PRIM_MOD_FILTER = 5,
+    DHL_CMD_SET_PRIM_SAP_FILTER = 6,
+    DHL_CMD_SET_TRAP_FILTER = 7,
+    DHL_CMD_SET_TRAP_FILTER_ARRAY = 8,
+    DHL_CMD_SET_PS_TRC_FILTER = 9,
+    DHL_CMD_SET_L1_TRC_FILTER = 10,
+    DHL_CMD_READ_GLOBAL_VARIABLE = 11,
+    DHL_CMD_WRITE_GLOBAL_VARIABLE = 12,
+    DHL_CMD_REBOOT_TARGET = 13, // for MODIS resetm command
+    DHL_CMD_INJECT_ILM = 14,
+    DHL_CMD_REDIRECT = 15,
+    DHL_CMD_FT_MODE_CONFIG = 16,
+    DHL_CMD_NVRAM = 17,
+    DHL_CMD_READ_STACK_STATISTICS = 18,
+    DHL_CMD_FILE_TRANSFER = 19,
+    DHL_CMD_FILE_SAVE = 20,
+    DHL_CMD_READ_MEMORY_ADDR = 21,
+    DHL_CMD_QUERY_MEMORY_RANGE = 22,
+    DHL_CMD_USB_MEMORY_DUMP_START = 23,
+    DHL_CMD_WRITE_MEMORY = 24,
+    DHL_CMD_QUERY_CTRL_BUF_MONITOR_DATA = 25,
+    DHL_CMD_QUERY_FLC_BUF_MONITOR_DATA = 26,
+    DHL_CMD_FORCE_ASSERT = 27,
+    DHL_CMD_INJECT_ILM_ADT = 28,
+    DHL_CMD_MSG_BKPT = 29,
+    DHL_CMD_INJECT_STRING_TO_MODULE = 30,
+    DHL_CMD_INJECT_AT_CMD = 31,
+    DHL_CMD_SIM_FILE_INFO_REQ = 32,
+    DHL_CMD_SIM_READ_REQ = 33,
+    DHL_CMD_SIM_WRITE_REQ = 34,
+    DHL_CMD_SWLA_EMI_MONITOR_MASTER_SELECT = 35,
+    DHL_CMD_VIRTUAL_CHANNEL = 36,
+    DHL_CMD_EM_MODE_CONFIG = 37,
+    DHL_CMD_SET_TRAP_MSG = 38,
+    DHL_CMD_UBDB = 39,
+    DHL_CMD_REBOOT_FOR_MMI_AUTO_TEST = 40, // for target rebootm command
+    DHL_CMD_SET_PARTIAL_PRIM_MOD_FILTER = 41,
+    DHL_CMD_SET_PARTIAL_PRIM_SAP_FILTER = 42,
+    DHL_CMD_SET_PARTIAL_PS_TRC_FILTER = 43,
+    DHL_CMD_SET_PARTIAL_L1_TRC_FILTER = 44,
+    DHL_CMD_SET_2G_DSP_FILTER = 45,
+    DHL_CMD_ELT_CONNECT = 46,
+    DHL_CMD_ELT_DISCONNECT = 47,
+    DHL_CMD_LOOP_BACK = 48,
+    DHL_CMD_CUSTOM_READ_MEMORY = 49,
+    DHL_CMD_CUSTOM_WRITE_MEMORY = 50,
+    DHL_CMD_MON_MODE_START = 51,
+    /* SWLA/SWTR MESSAGE ID -Start- */
+    DHL_CMD_SWLA_QUERY_HEADER = 52,
+    DHL_CMD_ASM_QUERY_HEADER = 53,
+    /* SWLA/SWTR MESSAGE ID -End- */
+    DHL_CMD_EXEC_CUSTOM_COMMAND = 54,
+    DHL_CMD_SET_FILTER_BY_SCENARIO = 55,
+    DHL_CMD_CHECK_FILTER_SIGNATURE = 56,
+    /* for memory dump profile update - start */
+    DHL_CMD_CHECK_MDMP_SIGNATURE = 57,
+    DHL_CMD_SET_MDMP_PROFILE = 58,
+    /* for memory dump profile update - end */
+
+//// Please add new command here
+    DHL_CMD_QUERY_UE_INFO = 59,
+
+//// Hard-coded for special purpose, DONOT add command below!
+    DHL_CMD_ICD_TUNNELING = DHL_ICD_TUNNELING,  // ICD tunneling command for 3rd party tool, need to be fixed
+    DHL_CMD_TMC_HANDSHAKE_DUMMY = 0xFE,  // ELT will send this command for entering TMC, but if MDLogger doesn't enter TMC yet, this will be regarded as general command and will send to DHL, and we just drop it.
+    DHL_CMD_ID_MAX = 0xFF
+} dhl_command_type;
+
+/* This enum is for ELT to parse the enum name and get L1/L2 time trace mapping. The value of the enum is meaningless. */
+typedef enum{
+    UMTS_3G_GEMINI_TIME_OD__UMTS_3G_GEMINI_TIME,
+    UMTS_3G_TIME_OD__UMTS_3G_TIME,
+    UMTS_2G_GEMINI_TIME_OD__UMTS_2G_GEMINI_TIME,
+    UMTS_2G_TIME_OD__UMTS_2G_TIME,
+    UMTS_2G_HANDOVER_TIME_OD__UMTS_2G_HANDOVER_TIME,
+    UMTS_3G_HANDOVER_TIME_OD__UMTS_3G_HANDOVER_TIME,
+    LTE_4G_TIME_OD__LTE_4G_TIME,
+    LTE_4G_TIME_2_OD__LTE_4G_TIME_2,
+    LTE_4G_L2_TIME_OD__LTE_4G_L2_TIME,
+    L1_TRC_REDUMP_OD__L1_TRC_REDUMP,
+    LTE_4G_TIME_GFRC_OD__LTE_4G_TIME_GFRC,
+    LTE_4G_TIME_MET_RTOS_OD__LTE_4G_TIME_MET_RTOS,
+    DHL_HIGH_RESOLUTION_TIME_OD__DHL_HIGH_RESOLUTION_TIME,
+    DHL_LOW_RESOLUTION_TIME_OD__DHL_LOW_RESOLUTION_TIME,
+    DHL_PERIODIC_TIME_OD__DHL_PERIODIC_TIME,
+    DHL_INCREMENTAL_TIME_OD__DHL_INCREMENTAL_TIME,
+    LTE_4G_TIME_MET_WCLK_OD__LTE_4G_TIME_MET_WCLK,
+    C2K_1X_TIME_OD__C2K_1X_TIME,
+    C2K_DO_TIME_OD__C2K_DO_TIME,
+    LTE_4G_TIME_GFRC_2_OD__LTE_4G_TIME_GFRC_2,
+    NL1_TIME_TRACE_OD__NL1_TIME_TRACE,
+    UMTS_3G_GEMINI_TIME__UMTS_3G_GEMINI_TIME,
+    UMTS_3G_TIME__UMTS_3G_TIME,
+    UMTS_2G_GEMINI_TIME__UMTS_2G_GEMINI_TIME,
+    UMTS_2G_TIME__UMTS_2G_TIME,
+    UMTS_2G_HANDOVER_TIME__UMTS_2G_HANDOVER_TIME,
+    UMTS_3G_HANDOVER_TIME__UMTS_3G_HANDOVER_TIME,
+    LTE_4G_TIME__LTE_4G_TIME,
+    LTE_4G_TIME_2__LTE_4G_TIME_2,
+    LTE_4G_L2_TIME__LTE_4G_L2_TIME,
+    L1_TRC_REDUMP__L1_TRC_REDUMP,
+    LTE_4G_TIME_GFRC__LTE_4G_TIME_GFRC,
+    LTE_4G_TIME_MET_RTOS__LTE_4G_TIME_MET_RTOS,
+    DHL_HIGH_RESOLUTION_TIME__DHL_HIGH_RESOLUTION_TIME,
+    DHL_LOW_RESOLUTION_TIME__DHL_LOW_RESOLUTION_TIME,
+    DHL_PERIODIC_TIME__DHL_PERIODIC_TIME,
+    DHL_INCREMENTAL_TIME__DHL_INCREMENTAL_TIME,
+    LTE_4G_TIME_MET_WCLK__LTE_4G_TIME_MET_WCLK,
+    C2K_1X_TIME__C2K_1X_TIME,
+    C2K_DO_TIME__C2K_DO_TIME,
+    LTE_4G_TIME_GFRC_2__LTE_4G_TIME_GFRC_2,
+    NL1_TIME_TRACE__NL1_TIME_TRACE,
+}dhl_time_trace_mapping_enum;
+
+typedef dhl_header_struct dhl_cmd_header_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    dhl_cmd_header_struct hdr;
+    kal_uint32 cksum;
+    kal_uint8 extra_len;
+    kal_uint8 *extra;
+    kal_uint16 recv_len;
+    kal_uint8 *value;
+} dhl_cmd_frame_buffer_struct;
+
+typedef kal_uint8 dhl_cmd_null_struct;
+
+typedef struct
+{
+    kal_uint8   mod_filter[TST_MODULE_FILTER_LEN];
+} dhl_cmd_set_prim_mod_filter_struct;
+
+typedef struct
+{
+    kal_uint8   sap_filter[TST_SAP_FILTER_LEN];
+} dhl_cmd_set_prim_sap_filter_struct;
+
+typedef struct
+{
+    kal_uint16  sap_id;
+    kal_uint8   is_trap;
+} dhl_cmd_set_trap_filter_struct;
+
+typedef struct
+{
+    kal_uint8 trap_filter[(LAST_SAP_CODE + 7) / 8];
+} dhl_cmd_set_trap_filter_array_struct;
+
+typedef struct
+{
+    kal_uint8  sap_filter[TST_TRACE_FILTER_LEN];
+} dhl_cmd_set_ps_trc_filter_struct;
+
+typedef dhl_cmd_set_ps_trc_filter_struct dhl_test_struct;
+
+typedef kal_uint8 dhl_cmd_set_l1_trc_filter_struct;
+
+typedef struct
+{
+    kal_uint32  gv_name_len;
+    kal_char    data[1];
+} dhl_cmd_read_global_variable_struct;
+
+typedef kal_uint8 dhl_ind_read_variable_return_struct;
+
+typedef struct
+{
+    kal_uint16      size1;
+    kal_uint16      size2;
+} dhl_cmd_write_global_variable_struct;
+
+typedef kal_uint8 dhl_cmd_reboot_target_struct;
+
+typedef kal_uint8 dhl_cmd_reboot_for_mmi_auto_test_struct;
+
+typedef struct
+{
+    kal_uint16      no_peer_buff_ptr;
+    kal_uint16      peer_buff_ptr_size;
+    kal_uint8       *peer_buff_ptr;
+    kal_uint8       ref_count;
+    kal_uint8       header_len;
+    kal_uint8       tail_len;
+    kal_uint8       unused1;
+} asn_peer_buff_struct;
+
+typedef struct
+{
+    kal_uint8       ref_count;
+    kal_uint16      no_local_params_ptr;
+    kal_uint16      local_params_ptr_size;
+    kal_uint8       *local_params_ptr;
+} asn_local_para_struct;
+
+typedef struct
+{
+    module_type     src_mod_id;
+    module_type     dest_mod_id;
+    sap_type        sap_id;
+    msg_type        msg_id;
+    asn_local_para_struct   local_params;
+    asn_peer_buff_struct    peer_buff;
+} ilmessage;
+
+typedef kal_uint8 dhl_cmd_inject_ilm_struct;
+
+typedef struct
+{
+    kal_uint32 src_mod_id;
+    kal_uint32 dest_mod_id;
+    kal_uint32 sap_id;
+    kal_uint32 msg_id;
+    kal_uint16 local_len;
+    kal_uint16 peer_len;
+} dhl_cmd_meta_req_primitive_struct;
+
+typedef struct
+{
+    kal_uint8   virtual_channel_id;
+    kal_uint8   pData[1];
+} dhl_cmd_redirect_struct;
+
+typedef struct
+{
+    kal_uint8   enable;
+} dhl_cmd_ft_mode_config_struct;
+
+typedef enum
+{
+    NVRAM_READ,
+    NVRAM_RESET,
+    NVRAM_WRITE,
+    NVRAM_RESET_FLAG
+    // reset stack stats status in NVRAM_EF_SYS_STATISTICS_LID
+} nvram_actions;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    nvram_actions act;
+    kal_uint32  file_id;
+} dhl_cmd_nvram_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+} dhl_cmd_read_stack_statistics_struct;
+
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+} dhl_cmd_read_stack_statistics_slave_struct ;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    module_type     src_mod_id;
+    module_type     dest_mod_id;
+    sap_type          sap_id;
+} dhl_slave2master_print_primitive_struct ;
+
+typedef stack_statistics_struct dhl_ind_stack_statistics_struct;
+typedef stack_statistics_struct dhl_ind_stack_statistics_slave_struct;
+
+#ifdef L1_SIM
+typedef kal_uint8 dhl_ind_nvram_read_cnf_struct;
+typedef kal_uint8 dhl_ind_nvram_reset_cnf_struct;
+#else
+typedef nvram_read_cnf_struct dhl_ind_nvram_read_cnf_struct;
+typedef nvram_reset_cnf_struct dhl_ind_nvram_reset_cnf_struct;
+#endif
+
+typedef struct
+{
+    kal_uint32 HISR_pair_num;
+    kal_char HISR_Name[KAL_MAX_NUM_HISRS * STACK_STATS_HISR_MAX_NAME];
+} dhl_HISR_name_struct;
+
+typedef struct
+{
+    stack_statistics_struct statistic;
+    dhl_HISR_name_struct hisr_name_struct;
+} dhl_nvram_statistics_struct;
+
+typedef dhl_nvram_statistics_struct tst_stack_statistics_struct;
+
+typedef struct
+{
+    kal_uint32  token;
+    kal_uint32  start_address; //if 0xFFFFFFFF => to delete the file
+    kal_uint32  buf_length;
+    kal_uint8   buf[1]; // full path
+} dhl_cmd_file_transfer_struct;
+
+typedef struct
+{
+    kal_uint32  time_stamp;
+    kal_uint32  token;
+    kal_uint32  start_address;//0xFFFFFFFF , to delete the file
+    kal_uint32  path_length;
+    kal_uint32  data_length; //0: end-of-file or file deleted
+} dhl_ind_file_transfer_report_struct;
+
+typedef enum
+{
+    DHL_FS_DELETE_FILE = -1,
+    DHL_FS_ALWAYS_CREATE,
+    DHL_FS_APPEND_END,
+    DHL_FS_SEEK_AND_APPEND
+} dhl_file_save_action_t;
+
+typedef struct
+{
+    kal_uint32 token;
+    dhl_file_save_action_t action;  //0: create, 1: append to the end, 2. open and append the seek pos, 0xFFFFFFFF: delete
+    kal_int32 seek_pos;
+    kal_uint32 data_len;  //the total length of data[1] array
+    kal_uint32 content_offset;  //the offset of file content start in the data[1] array
+    kal_uint8 data[1];  //file path name and file content segment
+} dhl_cmd_file_save_struct;
+
+typedef struct
+{
+    kal_uint32 token;
+    kal_uint32 action;  //0: create, 1: append to the end, 2. open and append the seek pos, 0xFFFFFFFF: delete
+    kal_uint32 fill_data_len;
+} dhl_ind_file_save_report_struct;
+
+typedef enum
+{
+    DHL_READ_MEMORY_ACCESS_TYPE_NOT_SPECIFIED = 0,
+    DHL_READ_MEMORY_ACCESS_TYPE_BYTE = 1,
+    DHL_READ_MEMORY_ACCESS_TYPE_HALF_WORD = 2,
+    DHL_READ_MEMORY_ACCESS_TYPE_WORD = 4
+} dhl_read_memory_access_type;
+
+typedef struct
+{
+    kal_uint8   token;
+    kal_uint8   reserved;
+    kal_uint16  chunk_size;
+    void        *address;
+    kal_uint32  length;
+    kal_uint32  mem_type;
+    dhl_read_memory_access_type  access_type;
+} dhl_cmd_read_memory_addr_struct;
+
+typedef struct
+{
+    kal_uint32 mem_type;
+} dhl_cmd_usb_memory_dump_start_struct;
+
+typedef struct
+{
+    kal_uint8   token;
+    kal_uint8   encoded; //0 for not encoded, 1 for encoded with RLE
+    const void  *address;
+    kal_uint32  length;
+    kal_uint32 mem_type;
+    dhl_read_memory_access_type access_type;
+} dhl_ind_read_memory_report_struct;
+
+// redefine structure for ELT decode MSG_ID_DHL_AUTO_MEMORY_DUMP_IN_ILM.
+typedef dhl_ind_read_memory_report_struct dhl_auto_memory_dump_in_ilm_struct;
+
+typedef kal_uint8 dhl_cmd_query_memory_range_struct;
+
+typedef struct
+{
+    kal_uint32 mem_type;
+} dhl_start_dump_memory_type_struct;
+
+typedef struct
+{
+    kal_uint32 mem_type;
+} dhl_end_dump_memory_type_struct;
+
+typedef struct
+{
+    kal_uint32 mem_type_num;
+    kal_uint8 token;
+    kal_bool last;
+} dhl_ind_query_memory_range_struct;
+
+typedef struct
+{
+    void        *address;
+    kal_uint32  length;
+    kal_uint8   data[1];
+} dhl_cmd_write_memory_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint32  token;
+} dhl_cmd_query_ctrl_buf_monitor_data_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint32  token;
+} dhl_cmd_query_flc_buf_monitor_data_struct;
+
+typedef struct
+{
+    kal_uint32  token;
+    kal_uint32  ack_type; //0: ctrl buffer, 1: flc buffer
+} dhl_ind_query_buf_monitor_report_struct;
+
+typedef enum
+{
+    MSG_BKPT_SET = 0,
+    MSG_BKPT_CLR,
+    MSG_BKPT_RESUME,
+    MSG_BKPT_CLR_ALL,
+    MSG_BKPT_CONFIG_MODE,
+} dhl_msg_bkpt_action;
+
+typedef enum
+{
+    MSG_BKPT_CONFIG_SENDER_HOLD = 0,
+    MSG_BKPT_CONFIG_RECEIVER_HOLD,
+    MSG_BKPT_CONFIG_SENDER_BREAK,
+    MSG_BKPT_CONFIG_RECEIVER_BREAK,
+    MSG_BKPT_CONFIG_BUFFER,
+    MSG_BKPT_CONFIG_SINGLE,
+} dhl_msg_bkpt_config;
+
+typedef struct _dhl_cmd_msg_bkpt
+{
+    dhl_msg_bkpt_config config;
+    module_type     src_mod_id;
+    module_type     dest_mod_id;
+    msg_type        msg_id;
+    struct _dhl_cmd_msg_bkpt *next;
+} dhl_cmd_msg_bkpt;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    dhl_msg_bkpt_action action;
+    dhl_msg_bkpt_config config;
+    module_type     src_mod_id;
+    module_type     dest_mod_id;
+    msg_type        msg_id;
+} dhl_cmd_msg_bkpt_struct;
+
+typedef enum
+{
+    MSG_BREAK_SENDER_HOLD = 0,
+    MSG_BREAK_RECEIVER_HOLD,
+    MSG_BREAK_SENDER_BREAK,
+    MSG_BREAK_RECEIVER_BREAK,
+    MSG_BREAK_SINGLE_STEP,
+} dhl_msg_break_type;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    dhl_msg_break_type type;
+    module_type src_mod_id;
+    module_type dest_mod_id;
+    msg_type msg_id;
+} dhl_dbg_msg_break_struct;
+
+typedef dhl_dbg_msg_break_struct dhldbg_msg_break_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    module_type dest_mod;
+    kal_uint8 index;
+    kal_uint8 string[INJECT_STRING_TO_MODULE_MAX_LENGTH];
+} dhl_cmd_inject_string_to_module_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint8 atcmd[INJECT_AT_COMMAND_MAX_LENGTH];
+} dhl_cmd_inject_at_cmd_struct;
+
+typedef struct
+{
+    kal_uint32 sim_num;
+    kal_uint16 file_idx;
+    kal_uint8 file_path[6];
+} dhl_cmd_sim_file_info_req_struct;
+
+typedef struct
+{
+    kal_uint32 sim_num;
+    kal_uint16 file_idx;
+    kal_uint16 para;
+    kal_uint16 length;
+    kal_uint8 file_path[6];
+} dhl_cmd_sim_read_req_struct;
+
+typedef struct
+{
+    kal_uint32 sim_num;
+    kal_uint16 file_idx;
+    kal_uint16 para;
+    kal_uint8 data[260];
+    kal_uint16 length;
+    kal_uint8 file_path[6];
+} dhl_cmd_sim_write_req_struct;
+
+typedef struct
+{
+    kal_uint32 token;
+    dhl_command_type ack_cmd_type;
+    kal_uint32 return_code;
+    kal_uint32 is_cmd_msg;
+    msg_type ack_cmd_msg_id;
+} dhl_ind_general_query_cmd_ack_struct;
+
+typedef kal_uint8 dhl_cmd_swla_legacy_query_header_struct;
+
+/**
+ * @brief: SWLA memory dump mode, header query command
+ * @parameters:
+ *      dhl_memory_type : please reference E_DHL_SWLA_DUMP_FOR_ELT
+ **/
+typedef struct
+{
+    kal_uint32 dhl_memory_type;
+} dhl_cmd_swla_query_header_struct;
+
+/**
+ * @brief: SWLA memory dump mode, header query command response
+ * @parameters:
+ *      dhl_memory_type : response the same vaule with ELT command to be the token
+ *      swla_header_len : the length of swla header in the peer buffer
+ **/
+typedef struct
+{
+    kal_uint32 dhl_memory_type;
+    kal_uint32 swla_header_len;
+} dhl_ind_swla_query_header_report_struct;
+
+/**
+ * @brief: ASM SWLA/SWTR streaming mode, header query command
+ * @parameters:
+ *      dhl_mux_id : please reference dhl_mux_id enum type
+ **/
+typedef struct
+{
+    kal_uint32 dhl_mux_id;
+} dhl_cmd_asm_query_header_struct;
+
+/**
+ * @brief: ASM SWLA/SWTR streaming mode, header query command response
+ * @parameters:
+ *      dhl_mux_id : response the same vaule with ELT command to be the token
+ *      swla_header_len : the length of ASM swla/swtr header in the peer buffer
+ **/
+typedef struct
+{
+    kal_uint32  dhl_mux_id;
+    kal_uint32  asm_header_len;
+} dhl_ind_asm_query_header_report_struct;
+
+/**
+ * @brief: SWLA/SWTR maximum header length.
+ *         DHL truncates the header, if header length larger than this definition.
+ *         SS has to restore the header manually.
+ **/
+#define DHL_SWLA_MAX_HEADER_LEN_DEF (512)
+#define DHL_SWTR_MAX_HEADER_LEN_DEF (512)
+typedef enum
+{
+    DHL_SWLA_MAX_HEADER_LEN = DHL_SWLA_MAX_HEADER_LEN_DEF,
+    DHL_SWTR_MAX_HEADER_LEN = DHL_SWTR_MAX_HEADER_LEN_DEF
+} dhl_software_monitor;
+
+
+
+
+
+#define DHL_SWLA_EMI_MONITOR_MASTER_NUM (3)
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint16 master_select[DHL_SWLA_EMI_MONITOR_MASTER_NUM];
+} dhl_cmd_swla_emi_monitor_master_select_cmd_struct;
+
+typedef struct
+{
+    kal_uint8 channel_id;
+    kal_uint8 pData[1];
+} dhl_cmd_virtual_channel_struct;
+
+typedef struct
+{
+    kal_uint8 channel_id;
+} dhl_ind_virtual_channel_struct;
+
+typedef struct
+{
+#ifdef __EM_MODE__
+    em_info_status_enum  info_request[NUM_OF_EM_INFO];
+    kal_uint32 sim_selection;   //Accompanied with one option in Catcher_Version_Info_Enum (CATCHER_EM_MULTIPLE_SIM_ENABLE)
+#else   //#ifdef __EM_MODE__
+    //The reason we keep the old declaration here is that we don't want to change the order of tst_command_type
+    //MLT uses the flake database
+    kal_uint8 enable;
+#endif  //#ifdef __EM_MODE__
+} dhl_cmd_em_mode_config_struct;
+
+typedef struct
+{
+    kal_uint16 nCount;
+    kal_uint16 MsgIDs[1];
+} dhl_cmd_set_trap_msg_struct;
+
+typedef struct
+{
+    kal_uint8 token;
+    kal_uint8 command; //0: db_reset, 1:db_write, 2:db_read, 3:db_delete
+    //4: db_snap, 5:db_exist
+    kal_uint16 length;
+    kal_uint8 sim_num;
+    kal_uint8 rat_mode;
+    kal_uint8 buf[1]; // for write commmand address, this must be put in the last var.
+} dhl_cmd_ubdb_struct;
+
+typedef struct
+{
+    kal_uint8 token;
+    kal_uint8 command;
+    kal_uint16 length;
+} dhl_ind_ubdb_struct;
+
+//MSG_ID_TST_R8_DL_PKT_SINGLE_GPD_IND
+typedef struct
+{
+    kal_uint8 ref_count;
+    kal_uint16 msg_len;
+    kal_uint32 trace_id;
+    sap_type raw_data_sap;
+    kal_uint16 offset;
+} tst_r8_dl_pkt_single_gpd_ind_struct;
+
+typedef struct
+{
+    void  *m_Addr;
+    kal_uint16  m_Value;
+} dhl_2g_dsp_filter_setting;
+
+typedef struct
+{
+    kal_uint32  count;
+    dhl_2g_dsp_filter_setting *filter;
+} dhl_cmd_set_2g_dsp_filter_struct;
+
+typedef enum
+{
+    TST_GPD_LOG_GPD_TYPE = 0,
+    TST_GPD_LOG_BD_TYPE,
+    TST_GPD_LOG_RAW_TYPE,
+    TST_GPD_LOG_LAST_TYPE,
+} tst_gpd_log_type_t;
+
+typedef enum
+{
+    DHL_DRV_DETACH,
+    DHL_DRV_ATTACH,
+    DHL_DRV_INIT,
+} dhl_drv_state;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    DCL_HANDLE handle;
+    dhl_drv_state state;
+} dhl_driver_state_change_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    DCL_HANDLE handle;
+    tty_io_request_t *ior;
+} dhl_tty_rx_done_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+}
+tst_l2copro_filter_retrieval_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+}
+tst_l2copro_filter_save_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_bool location_state;
+} dhl_lbs_pos_ntf_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_int64 lat;
+    kal_int64 lng;
+    kal_int32 acc;
+} dhl_lbs_pos_ind_struct;
+
+typedef struct
+{
+    kal_uint32 count;
+} dhl_cmd_set_partial_prim_mod_filter_struct;
+
+typedef struct
+{
+    kal_uint32 count;
+} dhl_cmd_set_partial_prim_sap_filter_struct;
+
+typedef struct
+{
+    kal_uint32 count;
+} dhl_cmd_set_partial_ps_trc_filter_struct;
+
+typedef struct
+{
+    kal_uint32 count;
+} dhl_cmd_set_partial_l1_trc_filter_struct;
+
+typedef enum
+{
+    DHL_MUX_ID_MCU_CODE_BEGIN = 0, DHL_MUX_ID_MCU_CODE_TAIL = 2,
+    DHL_MUX_ID_DSP_CODE_BEGIN = 3, DHL_MUX_ID_DSP_CODE_TAIL = 127,
+    DHL_MUX_ID_HW_CODE_BEGIN = 128, DHL_MUX_ID_HW_CODE_TAIL = 255,
+    DHL_MUX_ID_END = 256,
+} dhl_mux_id_range;
+
+#define DHL_MUX_FILTER_LEN 32
+
+typedef enum
+{
+    DHL_MUX_ID_MCU = 0,
+    DHL_MUX_ID_ASM_SWTR = 1,
+    DHL_MUX_ID_MCU_MON = 2,
+    DHL_MUX_ID_DSP_INNER_1 = DHL_MUX_ID_DSP_CODE_BEGIN,
+    DHL_MUX_ID_DSP_INNER_2,
+    DHL_MUX_ID_DSP_BRP_1,
+    DHL_MUX_ID_DSP_BRP_2,
+    DHL_MUX_ID_DSP_FEC_1,
+    DHL_MUX_ID_DSP_FEC_2,
+    DHL_MUX_ID_DSP_SPEECH_1,
+    DHL_MUX_ID_DSP_SPEECH_2,
+    DHL_MUX_ID_DSP_SCQ0_1,
+    DHL_MUX_ID_DSP_SCQ0_2,
+    DHL_MUX_ID_DSP_SCQ1_1,
+    DHL_MUX_ID_DSP_SCQ1_2,
+    DHL_MUX_ID_DSP_RAKE_1,
+    DHL_MUX_ID_DSP_RAKE_2,
+
+    DHL_MUX_ID_DSP_CODE_END,
+    /*
+        // 91 DSP channel
+        DHL_MUX_ID_DSP_DFE_1 = DHL_MUX_ID_DSP_CODE_BEGIN,
+        DHL_MUX_ID_DSP_DFE_2,
+        DHL_MUX_ID_DSP_RAKE_1,
+        DHL_MUX_ID_DSP_RAKE_2,
+        DHL_MUX_ID_DSP_BRP_1,
+        DHL_MUX_ID_DSP_BRP_2,
+        DHL_MUX_ID_DSP_IMC_1,
+        DHL_MUX_ID_DSP_IMC_2,
+        DHL_MUX_ID_DSP_ICC_1,
+        DHL_MUX_ID_DSP_ICC_2,
+        DHL_MUX_ID_DSP_MPC_1,
+        DHL_MUX_ID_DSP_MPC_2,
+        DHL_MUX_ID_DSP_DFE1_1,
+        DHL_MUX_ID_DSP_DFE1_2,
+
+        DHL_MUX_ID_RESERVED_MD32_1, //Align MT6290 for backward compatible
+        DHL_MUX_ID_RESERVED_MD32_2,
+        DHL_MUX_ID_DSP_MDP_MPC,
+        DHL_MUX_ID_DSP_MDP_IMC,
+        DHL_MUX_ID_DSP_MDP_ICC,
+        DHL_MUX_ID_DSP_MDP_DFE1,
+        DHL_MUX_ID_DSP_CODE_END,
+    */
+
+    /* use DHL_MUX_ID_DSP_CODE_END as trace stats mux num, please also update DHL_MUXID_NUM if add new ID */
+
+    DHL_MUX_ID_HW_IRDBG = DHL_MUX_ID_HW_CODE_BEGIN,
+    DHL_MUX_ID_MCU_1 = 129, /* 130~135: Reserved for others MCU use in the feature */
+    DHL_MUX_ID_MCU_2,
+    DHL_MUX_ID_MCU_3,
+    DHL_MUX_ID_MCU_4,
+    DHL_MUX_ID_MCU_5,
+    DHL_MUX_ID_MCU_6,
+    DHL_MUX_ID_ASM_INFRA_SWTR = 136,/* 136~146: Reserved for others MCU ASM use in the feature */
+    DHL_MUX_ID_ASM_CORE_BEGIN = 137,
+    DHL_MUX_ID_ASM0_SWLA = DHL_MUX_ID_ASM_CORE_BEGIN,
+    DHL_MUX_ID_ASM1_SWLA = 138,
+    DHL_MUX_ID_ASM2_SWLA = 139,
+    DHL_MUX_ID_ASM3_SWLA = 140,
+    DHL_MUX_ID_LINUX_LOG = 147, // VOLTE log
+
+    DHL_MUX_MCU_ULSP = 150,
+    DHL_MUX_MCU_ULSP_ONDEMAND = 151,
+    DHL_MUX_DSP_ULSP = 152,
+    DHL_MUX_NR_DSP_ULSP = 154,
+    DHL_MUX_NR_DSP_ULSP_ONDEMAND = 155,
+    DHL_MUX_LTE_DSP_ULSP = 156,
+    DHL_MUX_LTE_DSP_ULSP_ONDEMAND = 157,
+    DHL_TRACE_STAT_MUX_SIZE,
+    DHL_MUX_ID_NO_MUX = 255
+} dhl_mux_id;
+
+/* last index for L1core : DHL_MUX_ID_MCU_SLAVE */
+//#define DHL_MUXID_NUM (DHL_MUX_ID_NO_MUX + 1)
+//#define DHL_STATS_MUX_SLAVE_ID (DHL_MUXID_NUM - 1)
+
+//ULSP Source ID to Core/TC ID mapping
+//Format: MUX_(MUX_ID)_SOURCEID_(SOURCE_ID)__CORE_(CORE_ID)_TC_(TCID)
+#if (CUR_GEN >= MD_GEN97)
+typedef enum
+{
+    MUX_150_SOURCEID_1__CORE_0_TC_0,
+    MUX_150_SOURCEID_2__CORE_0_TC_1,
+    MUX_150_SOURCEID_3__CORE_0_TC_2,
+    MUX_150_SOURCEID_4__CORE_0_TC_3,
+    MUX_150_SOURCEID_5__CORE_0_TC_4,
+    MUX_150_SOURCEID_6__CORE_0_TC_5,
+    MUX_150_SOURCEID_7__CORE_0_TC_6,
+    MUX_150_SOURCEID_8__CORE_0_TC_7,
+    MUX_150_SOURCEID_9__CORE_1_TC_0,
+    MUX_150_SOURCEID_10__CORE_1_TC_1,
+    MUX_150_SOURCEID_11__CORE_1_TC_2,
+    MUX_150_SOURCEID_12__CORE_1_TC_3,
+    MUX_150_SOURCEID_13__CORE_1_TC_4,
+    MUX_150_SOURCEID_14__CORE_1_TC_5,
+    MUX_150_SOURCEID_15__CORE_1_TC_6,
+    MUX_150_SOURCEID_16__CORE_1_TC_7,
+    MUX_150_SOURCEID_17__CORE_2_TC_0,
+    MUX_150_SOURCEID_18__CORE_2_TC_1,
+    MUX_150_SOURCEID_19__CORE_2_TC_2,
+    MUX_150_SOURCEID_20__CORE_2_TC_3,
+    MUX_150_SOURCEID_21__CORE_2_TC_4,
+    MUX_150_SOURCEID_22__CORE_2_TC_5,
+    MUX_150_SOURCEID_23__CORE_2_TC_6,
+    MUX_150_SOURCEID_24__CORE_2_TC_7,
+    MUX_150_SOURCEID_25__CORE_3_TC_0,
+    MUX_150_SOURCEID_26__CORE_3_TC_1,
+    MUX_150_SOURCEID_27__CORE_3_TC_2,
+    MUX_150_SOURCEID_28__CORE_3_TC_3,
+    MUX_150_SOURCEID_29__CORE_3_TC_4,
+    MUX_150_SOURCEID_30__CORE_3_TC_5,
+    MUX_150_SOURCEID_31__CORE_3_TC_6,
+    MUX_150_SOURCEID_32__CORE_3_TC_7,
+    MUX_150_SOURCEID_33__CORE_0_TC_0,
+    MUX_150_SOURCEID_34__CORE_0_TC_1,
+    MUX_150_SOURCEID_35__CORE_0_TC_2,
+    MUX_150_SOURCEID_36__CORE_0_TC_3,
+    MUX_150_SOURCEID_37__CORE_0_TC_4,
+    MUX_150_SOURCEID_38__CORE_0_TC_5,
+    MUX_150_SOURCEID_39__CORE_0_TC_6,
+    MUX_150_SOURCEID_40__CORE_0_TC_7,
+    MUX_150_SOURCEID_41__CORE_1_TC_0,
+    MUX_150_SOURCEID_42__CORE_1_TC_1,
+    MUX_150_SOURCEID_43__CORE_1_TC_2,
+    MUX_150_SOURCEID_44__CORE_1_TC_3,
+    MUX_150_SOURCEID_45__CORE_1_TC_4,
+    MUX_150_SOURCEID_46__CORE_1_TC_5,
+    MUX_150_SOURCEID_47__CORE_1_TC_6,
+    MUX_150_SOURCEID_48__CORE_1_TC_7,
+    MUX_150_SOURCEID_49__CORE_2_TC_0,
+    MUX_150_SOURCEID_50__CORE_2_TC_1,
+    MUX_150_SOURCEID_51__CORE_2_TC_2,
+    MUX_150_SOURCEID_52__CORE_2_TC_3,
+    MUX_150_SOURCEID_53__CORE_2_TC_4,
+    MUX_150_SOURCEID_54__CORE_2_TC_5,
+    MUX_150_SOURCEID_55__CORE_2_TC_6,
+    MUX_150_SOURCEID_56__CORE_2_TC_7,
+    MUX_150_SOURCEID_57__CORE_3_TC_0,
+    MUX_150_SOURCEID_58__CORE_3_TC_1,
+    MUX_150_SOURCEID_59__CORE_3_TC_2,
+    MUX_150_SOURCEID_60__CORE_3_TC_3,
+    MUX_150_SOURCEID_61__CORE_3_TC_4,
+    MUX_150_SOURCEID_62__CORE_3_TC_5,
+    MUX_150_SOURCEID_63__CORE_3_TC_6,
+    MUX_151_SOURCEID_1__CORE_0_TC_0,
+    MUX_151_SOURCEID_2__CORE_0_TC_1,
+    MUX_151_SOURCEID_3__CORE_0_TC_2,
+    MUX_151_SOURCEID_4__CORE_0_TC_3,
+    MUX_151_SOURCEID_5__CORE_0_TC_4,
+    MUX_151_SOURCEID_6__CORE_0_TC_5,
+    MUX_151_SOURCEID_7__CORE_0_TC_6,
+    MUX_151_SOURCEID_8__CORE_0_TC_7,
+    MUX_151_SOURCEID_9__CORE_1_TC_0,
+    MUX_151_SOURCEID_10__CORE_1_TC_1,
+    MUX_151_SOURCEID_11__CORE_1_TC_2,
+    MUX_151_SOURCEID_12__CORE_1_TC_3,
+    MUX_151_SOURCEID_13__CORE_1_TC_4,
+    MUX_151_SOURCEID_14__CORE_1_TC_5,
+    MUX_151_SOURCEID_15__CORE_1_TC_6,
+    MUX_151_SOURCEID_16__CORE_1_TC_7,
+    MUX_151_SOURCEID_17__CORE_2_TC_0,
+    MUX_151_SOURCEID_18__CORE_2_TC_1,
+    MUX_151_SOURCEID_19__CORE_2_TC_2,
+    MUX_151_SOURCEID_20__CORE_2_TC_3,
+    MUX_151_SOURCEID_21__CORE_2_TC_4,
+    MUX_151_SOURCEID_22__CORE_2_TC_5,
+    MUX_151_SOURCEID_23__CORE_2_TC_6,
+    MUX_151_SOURCEID_24__CORE_2_TC_7,
+    MUX_151_SOURCEID_25__CORE_3_TC_0,
+    MUX_151_SOURCEID_26__CORE_3_TC_1,
+    MUX_151_SOURCEID_27__CORE_3_TC_2,
+    MUX_151_SOURCEID_28__CORE_3_TC_3,
+    MUX_151_SOURCEID_29__CORE_3_TC_4,
+    MUX_151_SOURCEID_30__CORE_3_TC_5,
+    MUX_151_SOURCEID_31__CORE_3_TC_6,
+    MUX_151_SOURCEID_32__CORE_3_TC_7,
+    MUX_151_SOURCEID_33__CORE_0_TC_0,
+    MUX_151_SOURCEID_34__CORE_0_TC_1,
+    MUX_151_SOURCEID_35__CORE_0_TC_2,
+    MUX_151_SOURCEID_36__CORE_0_TC_3,
+    MUX_151_SOURCEID_37__CORE_0_TC_4,
+    MUX_151_SOURCEID_38__CORE_0_TC_5,
+    MUX_151_SOURCEID_39__CORE_0_TC_6,
+    MUX_151_SOURCEID_40__CORE_0_TC_7,
+    MUX_151_SOURCEID_41__CORE_1_TC_0,
+    MUX_151_SOURCEID_42__CORE_1_TC_1,
+    MUX_151_SOURCEID_43__CORE_1_TC_2,
+    MUX_151_SOURCEID_44__CORE_1_TC_3,
+    MUX_151_SOURCEID_45__CORE_1_TC_4,
+    MUX_151_SOURCEID_46__CORE_1_TC_5,
+    MUX_151_SOURCEID_47__CORE_1_TC_6,
+    MUX_151_SOURCEID_48__CORE_1_TC_7,
+    MUX_151_SOURCEID_49__CORE_2_TC_0,
+    MUX_151_SOURCEID_50__CORE_2_TC_1,
+    MUX_151_SOURCEID_51__CORE_2_TC_2,
+    MUX_151_SOURCEID_52__CORE_2_TC_3,
+    MUX_151_SOURCEID_53__CORE_2_TC_4,
+    MUX_151_SOURCEID_54__CORE_2_TC_5,
+    MUX_151_SOURCEID_55__CORE_2_TC_6,
+    MUX_151_SOURCEID_56__CORE_2_TC_7,
+    MUX_151_SOURCEID_57__CORE_3_TC_0,
+    MUX_151_SOURCEID_58__CORE_3_TC_1,
+    MUX_151_SOURCEID_59__CORE_3_TC_2,
+    MUX_151_SOURCEID_60__CORE_3_TC_3,
+    MUX_151_SOURCEID_61__CORE_3_TC_4,
+    MUX_151_SOURCEID_62__CORE_3_TC_5,
+    MUX_151_SOURCEID_63__CORE_3_TC_6
+} dhl_source_id_mapping_table;
+#else //(CUR_GEN >= MD_GEN97)
+typedef enum
+{
+    MUX_150_SOURCEID_1__CORE_0_TC_0,
+    MUX_150_SOURCEID_2__CORE_0_TC_1,
+    MUX_150_SOURCEID_3__CORE_0_TC_2,
+    MUX_150_SOURCEID_4__CORE_0_TC_3,
+    MUX_150_SOURCEID_5__CORE_1_TC_0,
+    MUX_150_SOURCEID_6__CORE_1_TC_1,
+    MUX_150_SOURCEID_7__CORE_1_TC_2,
+    MUX_150_SOURCEID_8__CORE_1_TC_3,
+    MUX_150_SOURCEID_9__CORE_2_TC_0,
+    MUX_150_SOURCEID_10__CORE_2_TC_1,
+    MUX_150_SOURCEID_11__CORE_2_TC_2,
+    MUX_150_SOURCEID_12__CORE_2_TC_3,
+    MUX_150_SOURCEID_17__CORE_0_TC_0,
+    MUX_150_SOURCEID_18__CORE_0_TC_1,
+    MUX_150_SOURCEID_19__CORE_0_TC_2,
+    MUX_150_SOURCEID_20__CORE_0_TC_3,
+    MUX_150_SOURCEID_21__CORE_1_TC_0,
+    MUX_150_SOURCEID_22__CORE_1_TC_1,
+    MUX_150_SOURCEID_23__CORE_1_TC_2,
+    MUX_150_SOURCEID_24__CORE_1_TC_3,
+    MUX_150_SOURCEID_25__CORE_2_TC_0,
+    MUX_150_SOURCEID_26__CORE_2_TC_1,
+    MUX_150_SOURCEID_27__CORE_2_TC_2,
+    MUX_150_SOURCEID_28__CORE_2_TC_3
+} dhl_source_id_mapping_table;
+#endif //(CUR_GEN >= MD_GEN97)
+
+#if (CUR_GEN >= MD_GEN97)
+//Format: MUX_(MUX_ID)_(L1/L2)_(START/END)_SOURCE_ID_(SOURCE_ID)
+typedef enum
+{
+    MUX_150_L1_START_SOURCE_ID_1,
+    MUX_150_L1_END_SOURCE_ID_32,
+    MUX_150_L2_START_SOURCE_ID_33,
+    MUX_150_L2_END_SOURCE_ID_63,
+    MUX_151_L1_START_SOURCE_ID_1,
+    MUX_151_L1_END_SOURCE_ID_32,
+    MUX_151_L2_START_SOURCE_ID_33,
+    MUX_151_L2_END_SOURCE_ID_63
+} dhl_ulsp_mcu_l1l2_source_id_range;
+#endif
+
+typedef struct
+{
+    kal_uint32 bytes_sent;
+    kal_uint32 last_update;
+} dhl_trace_stats;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint8 select[DHL_MUX_FILTER_LEN];
+    kal_uint8 value[DHL_MUX_FILTER_LEN];
+} dhl_cmd_set_dhl_mux_filter_struct;
+
+typedef enum
+{
+    DHL_PORT_NULL,
+    DHL_PORT_UART,
+    DHL_PORT_USB,
+    DHL_PORT_SP,
+    DHL_PORT_OTHER
+} DHL_PORT_SETTING;
+
+typedef struct
+{
+    kal_uint8 mod_id;
+    kal_uint32 filter_bmp_low;
+} dsp_log_filter_struct;
+
+typedef enum
+{
+    DSP_4G_NORMAL,
+    DSP_4G_ONDEMAND,
+    DSP_5G_NORMAL,
+    DSP_5G_ONDEMAND
+} dhl_dsp_filter_type;
+
+#define DSP_SRC_FILTER_CNT 256
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    dhl_dsp_filter_type type;
+    kal_uint8 src_id;
+    kal_uint16 mod_num;
+    dsp_log_filter_struct dsp_src_filter[DSP_SRC_FILTER_CNT];
+} dhl_cmd_set_dsp_filter_struct;
+
+typedef enum
+{
+    cgen_msg__MSG_ID_DHL_CMD_SET_DSP_FILTER,
+    cgen_src__MOD_DHL_READER,
+    cgen_dst__MOD_DHL_READER,
+} dhl_dsp_filter_struct_desc;
+
+//Generic memory dump definitions
+#if defined(GEN_FOR_PC)
+#define Define_TST_Mem_Dump_Type_Start() typedef enum {
+#define Define_TST_Mem_Dump_Type_Item(type, string, length) string##__size__##length,
+#define Define_TST_Mem_Dump_Type_End()   tst_mem_type_string_end} tst_mem_type_string_enum;
+#else
+#define Define_TST_Mem_Dump_Type_Start() typedef enum {
+#define Define_TST_Mem_Dump_Type_Item(type, string, length) type,
+#define Define_TST_Mem_Dump_Type_End()   tst_mem_type_end} tst_mem_type_enum;
+#endif
+
+typedef struct
+{
+    //do not change this structure, mini com is hard code to set
+    kal_uint32 cmd_flags;
+} dhl_cmd_3rd_party_tool_struct;
+
+typedef enum
+{
+    INIT_CMDS_RESEND_EXCEPTION_INFO = 0,
+    INIT_CMDS_MEMORY_DUMP_SWITCH,
+    INIT_CMDS_QUERY_SWLA_HEADER,
+    INIT_CMDS_QUERY_TARGET_VERSION,
+    INIT_CMDS_ECHO_SIM_MAPPING,
+    INIT_CMDS_QUERY_LOAD_VERSION,
+    INIT_CMDS_QUERY_CALIBRATION,
+    INIT_CMDS_QUERY_SWLA_INFO,
+    INIT_CMDS_QUERY_SWTR_HEADER,
+	INIT_CMDS_SET_MEMORY_AUTO_DUMP,
+    INIT_CMDS_MAX = 31,
+} dhl_init_cmd_set_enum_type;
+
+typedef enum
+{
+    DISCONNECT_CMDS_MEMORY_DUMP_SWITCH = 0,
+    DISCONNECT_CMDS_KEEP_LOGGING_SESSION,
+	DISCONNECT_CMDS_CLEAR_MEMORY_AUTO_DUMP,
+    DISCONNECT_CMDS_MAX = 31,
+} dhl_disconnect_cmd_set_enum_type;
+
+typedef struct
+{
+    kal_uint32 init_cmds;
+} dhl_cmd_elt_connect_struct;
+
+typedef struct
+{
+    kal_uint32 disconnect_cmds;
+} dhl_cmd_elt_disconnect_struct;
+
+typedef struct
+{
+    kal_uint32 token;
+    kal_uint32 data_len;
+    kal_uint8  data[1];
+} dhl_cmd_loop_back_struct;
+
+typedef struct
+{
+    kal_uint32 token;
+} dhl_cmd_loop_back_response_struct;
+
+#define DATABASE_SIGNATURE_MAGIC (0x24541605)
+#define FILTER_SIGNATURE_MAGIC (0x24541788)
+#define DATABASE_SIGNATURE_MAX_LENGTH (64)
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_bool enable;
+    kal_uint8 poll_period_level;
+    kal_uint8 block_size_level;
+} dhl_l2copro_log_dma_config_struct;
+typedef struct
+{
+    kal_uint32 magic;
+    kal_uint32 length;
+    kal_uint8 data[DATABASE_SIGNATURE_MAX_LENGTH];
+} dhl_cmd_check_database_signature_struct, dhl_cmd_check_filter_signature_struct;
+
+typedef enum
+{
+    QUERY_FAIL,
+    QUERY_CONTINUE,
+    QUERY_END
+} query_mem_range_result;
+
+typedef enum
+{
+    MEMORY_DUMP_TYPE_ALL,
+    MEMORY_DUMP_TYPE_SWLA,
+} DHL_DUMP_MEM_CHOICE;
+
+typedef enum
+{
+    DEFAULT_AUTO_TYPE,
+    USB_DUMP_TYPE,
+    SD_DUMP_TYPE,
+    META_DUMP_TYPE,
+} DHL_AUTO_MEMORY_DUMP_TYPE;
+
+typedef struct
+{
+    kal_uint32 fields;
+} dhl_cmd_query_ue_info_struct;
+
+typedef enum
+{
+    QUERY_UE_INFO_FIELD_MD_VERSION = 0,
+    QUERY_UE_INFO_FIELD_DB_SIGNATURE,
+    QUERY_UE_INFO_FIELD_MD_TIMESTAMP,
+    QUERY_UE_INFO_MAX = 31,
+} dhl_cmd_query_ue_info_field_mask;
+
+Define_TST_Mem_Dump_Type_Start()
+Define_TST_Mem_Dump_Type_Item(default_type, default, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_system_mem_type, sys_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_system_shm_mem_type, sys_shm_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_dsp_mem_type, dsp_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_bb_mem_type, bb_reg, 0xFFFFFFFF)
+// SWLA part, remember to add/remove core number for each generation!
+Define_TST_Mem_Dump_Type_Item(tst_core0_swla_mem_type, core0_swla, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_core1_swla_mem_type, core1_swla, 0xFFFFFFFF)
+#if SYS_MCU_NUM_CORE >= 3
+Define_TST_Mem_Dump_Type_Item(tst_core2_swla_mem_type, core2_swla, 0xFFFFFFFF)
+#endif
+#if SYS_MCU_NUM_CORE >= 4
+Define_TST_Mem_Dump_Type_Item(tst_core3_swla_mem_type, core3_swla, 0xFFFFFFFF)
+#endif
+Define_TST_Mem_Dump_Type_Item(tst_mcu_swtr_mem_type,   mcu_swtr, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_infra_swtr_mem_type, infra_swtr, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_brp_swla_mem_type, core0_swla, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_inner_swla_mem_type, core1_swla, 0xFFFFFFFF)
+#if !(CUR_GEN >= MD_GEN97)
+Define_TST_Mem_Dump_Type_Item(tst_fec_swla_mem_type, core0_swla, 0xFFFFFFFF)
+#endif
+Define_TST_Mem_Dump_Type_Item(tst_speech_swla_mem_type, core1_swla, 0xFFFFFFFF)
+#if (CUR_GEN >= MD_GEN97)
+Define_TST_Mem_Dump_Type_Item(tst_msonic_core0_swla_mem_type, msonic0_swla_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_msonic_core1_swla_mem_type, msonic1_swla_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(tst_vsonic_core0_swla_mem_type, vsonic0_swla_mem, 0xFFFFFFFF)
+#endif
+// For uSIP_SCQ16 and RAKE
+#if defined(__MTK_TARGET__) && !defined(__NO_DSP__)
+Define_TST_Mem_Dump_Type_Item(dhl_usip0_mem_type, usip0_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(dhl_usip1_mem_type, usip1_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(dhl_scq16_0_mem_type, scq16_0_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(dhl_scq16_1_mem_type, scq16_1_mem, 0xFFFFFFFF)
+#if (CUR_GEN >= MD_GEN97)
+Define_TST_Mem_Dump_Type_Item(dhl_scq16_2_mem_type, scq16_2_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(dhl_scq16_3_mem_type, scq16_3_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(dhl_msonic0_mem_type, msonic0_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(dhl_vsonic0_mem_type, vsonic0_mem, 0xFFFFFFFF)
+Define_TST_Mem_Dump_Type_Item(dhl_msonic0_phase2_mem_type, msonic0_phase2_mem, 0xFFFFFFFF)
+#endif
+Define_TST_Mem_Dump_Type_Item(dhl_rake_mem_type, rake_mem, 0xFFFFFFFF)
+#endif
+
+Define_TST_Mem_Dump_Type_Item(tst_vrf_mem_type, vrf_mem, 0xFFFFFFFF)
+
+#if defined(__AST_TL1_TDD__) && !defined(UNIT_TEST)
+Define_TST_Mem_Dump_Type_Item(tst_ast_mem_type, ast_mem, 0x400)
+#endif
+
+Define_TST_Mem_Dump_Type_End()
+
+/**
+ *  @brief:
+ *      E_DHL_SWLA_DUMP_FOR_ELT is used for telling ELT which memory dump type is SWLA.
+ *      the enum naming is 1 on 1 mapping with memory type:
+ *      for example:
+ *          Define_TST_Mem_Dump_Type_Item(tst_swla_mem_type, ""swla"", 0xFFFFFFFF)
+ *          Define_TST_Mem_Dump_Type_Item(dhl_slave_swla_mem_type, ""slave_swla"", 0xFFFFFFFF)
+ */
+#if defined(GEN_FOR_PC)
+typedef enum
+{
+    core0_swla,
+    core1_swla,
+#if SYS_MCU_NUM_CORE >= 3
+    core2_swla,
+#endif
+    mcu_swtr,
+    infra_swtr
+} E_DHL_SWLA_DUMP_FOR_ELT;
+#endif /* GEN_FOR_PC */
+
+#if defined(__DHL_MODULE__)
+typedef struct
+{
+    kal_uint8   token;
+    kal_uint8   reserved;
+    kal_uint16  chunk_size;
+    void        *address;
+    kal_uint32  length;
+    DHL_CUSTOM_MEM_TYPE     custom_mem_type;
+    kal_uint32  custom_option;
+} dhl_cmd_custom_read_memory_struct;
+
+typedef struct
+{
+    kal_uint8   token;
+    void  *address;
+    kal_uint32  length;
+    DHL_CUSTOM_MEM_TYPE     custom_mem_type;
+    kal_uint32  custom_option;
+} dhl_ind_custom_read_memory_report_struct;
+
+typedef struct
+{
+    void        *address;
+    kal_uint32  length;
+    DHL_CUSTOM_MEM_TYPE     custom_mem_type;
+    kal_uint32  custom_option;
+    kal_uint8   data[1];
+} dhl_cmd_custom_write_memory_struct;
+
+typedef enum
+{
+    data_channel,
+    monitor_channel,
+    ccb_meta_channel
+} dhl_channel_type;
+
+typedef enum
+{
+    /*
+    ELT MSC compare control buffer, need to ignore CCBU related control buffer allocate/release 
+    
+    Name as: [File Name]_FileType_Policy
+    1. [File Name]
+        file in critical path of CCBU
+            ex: dhl_cmd.c will be DHL_CMD
+    2. FileType
+        a. CPP means .cpp
+        b. C means .c
+    3. Policy 
+        a. LC: line compare
+        b. WFI : whole file ignore
+    */    
+    SIM_UART_CPP_LC,  // sim_uart.cpp use line compare
+    DHL_CMD_C_WFI,  // dhl_cmd.c use whole file ignore
+}dhl_ctrl_buf_user_in_ccbu_cmd;
+
+#endif
+
+#if defined(__TST_META_MODE_TRACE_ENABLE__)
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint8 enable;
+} dhl_meta_mode_log_enable_struct;
+#endif // __TST_META_MODE_TRACE_ENABLE__
+
+#define BUILTIN_FILTER_SCENARIO_NAME_MAX_LENGTH (256)
+typedef struct
+{
+    kal_char scenario_str[BUILTIN_FILTER_SCENARIO_NAME_MAX_LENGTH];
+}dhl_cmd_set_filter_by_scenario_struct;
+
+#if defined(__L5_SUPPORT__)
+//==
+typedef struct
+{
+    L5_LOCAL_PARA_HDR
+    kal_uint32 logMode; //! 0: None 1: Streaming 1: Wrapping
+} dhl_log_mode_ctrl_set_req_struct;
+
+typedef struct
+{
+    L5_LOCAL_PARA_HDR
+    kal_uint32 status; //!< 0: OK otherwise: failed
+} dhl_log_mode_ctrl_set_cnf_struct;
+
+typedef struct
+{
+    L5_LOCAL_PARA_HDR
+} dhl_log_mode_ctrl_get_req_struct;
+
+typedef struct
+{
+    L5_LOCAL_PARA_HDR
+    kal_uint32 logMode; //!< 0: None 1: Streaming 1: Wrapping
+} dhl_log_mode_ctrl_get_cnf_struct;
+//==
+typedef struct
+{
+    L5_LOCAL_PARA_HDR
+    kal_uint32 logLevel; //!< 0 ~ N
+} dhl_log_level_ctrl_set_req_struct;
+
+typedef struct
+{
+    L5_LOCAL_PARA_HDR
+    kal_uint32 status; //!< 0: OK otherwise: failed
+} dhl_log_level_ctrl_set_cnf_struct;
+typedef struct
+{
+    L5_LOCAL_PARA_HDR
+} dhl_log_level_ctrl_get_req_struct;
+
+typedef struct
+{
+    L5_LOCAL_PARA_HDR
+    kal_uint32 logLevel; //!< 0 ~ N
+} dhl_log_level_ctrl_get_cnf_struct;
+//==
+typedef struct
+{
+    L5_LOCAL_PARA_HDR
+    kal_uint32 enable; //!< 0:disable 1: enable
+} dhl_location_log_ctrl_set_req_struct;
+
+typedef struct
+{
+    L5_LOCAL_PARA_HDR
+    kal_uint32 status; //!< 0: OK otherwise: failed
+} dhl_location_log_ctrl_set_cnf_struct;
+typedef struct
+{
+    L5_LOCAL_PARA_HDR
+} dhl_location_log_ctrl_get_req_struct;
+
+typedef struct
+{
+    L5_LOCAL_PARA_HDR
+    kal_uint32 enable; //!< 0:disable 1: enable
+} dhl_location_log_ctrl_get_cnf_struct;
+//==
+typedef struct
+{
+    L5_LOCAL_PARA_HDR
+    kal_uint32 flush_interval; //!< 0~N (ms)£¬ <= default flush interval, will force set to default
+} dhl_log_flush_interval_set_req_struct;
+
+typedef struct
+{
+    L5_LOCAL_PARA_HDR
+    kal_uint32 status; //!< 0: OK otherwise: failed
+} dhl_log_flush_interval_set_cnf_struct;
+
+typedef struct
+{
+    L5_LOCAL_PARA_HDR
+} dhl_log_flush_interval_get_req_struct;
+
+typedef struct
+{
+    L5_LOCAL_PARA_HDR
+    kal_uint32 flush_interval; //!< default~N (ms)
+} dhl_log_flush_interval_get_cnf_struct;
+#endif
+#if defined(__TST_ON_AOS_PC__)
+#define DHL_GET_TIMESTAMP() tst_cur_timestamp
+#elif defined(__FMA_GOLOBAL_TIMER__) //  #if defined(__TST_ON_AOS_PC__)
+#define DHL_GET_TIMESTAMP() fma_get_glb_ts()
+#else // #elif defined(__FMA_GOLOBAL_TIMER__)
+#define DHL_GET_TIMESTAMP() kal_get_systicks()
+#endif // DHL_GET_TIMESTAMP
+#endif // #ifndef _DHL_DEF_H
diff --git a/mcu/interface/service/dhl/v2/dhl_dsp_def.h b/mcu/interface/service/dhl/v2/dhl_dsp_def.h
new file mode 100644
index 0000000..cd09f92
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dhl_dsp_def.h
@@ -0,0 +1,101 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file dhl_dsp_def.h
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 09 18 2020 guan-ren.chen
+ * [MOLY00327199] [Gen97/Gen98] Development
+ * DSP check register flag before filter update(SWRD).
+ *
+ * 09 14 2020 guan-ren.chen
+ * [MOLY00327199] [Gen97/Gen98] Development
+ * DSP check LS flag before update filter(SWRD).
+ *
+ * 01 17 2020 guan-ren.chen
+ * [MOLY00474969] [Logging] Round-Robin Exception Re-dump Log
+ * [Redump 2.0][SWRD] Round-Robin dump ULSP .
+ *
+ * 12 09 2019 yen-hsuan.lin
+ * [MOLY00327199] [Gen97] Development
+ * [MOLY00464641] Fix the dhl low power problem
+ * 	
+ * 	merger the Gen98 Fix into VMOLY trunk
+  ****************************************************************************/
+#ifndef _DHL_DSP_DEF_H_
+#define _DHL_DSP_DEF_H_
+
+#include "dsp_header_define_cxif_ulsp.h"
+typedef struct
+{
+    LOCAL_PARA_HDR
+    ulsp_info_t ulsp_info;
+} cxif_ulsp_info_t_debug_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    mcore_vcore_ulsp_info_t mcore_vcore_ulsp_info;
+} mcore_vcore_ulsp_info_t_debug_struct;
+
+/*---------------------------------------------------------------------------
+    Enum definition
+---------------------------------------------------------------------------*/
+
+#define DSP_CORE_ENUM_START 0
+typedef enum
+{
+    USIP0_INNER = DSP_CORE_ENUM_START,
+    USIP0_BRP,
+    USIP1_FEC,
+    USIP1_SPEECH,
+    RAKE,
+    SCQ16_0,
+    SCQ16_1,
+#if (CUR_GEN >= MD_GEN97)
+    SCQ16_2,
+    SCQ16_3,
+    MCORE0,
+    VCORE0,
+#endif  
+    DSP_CORE_COUNT,
+} dsp_core_enum;
+
+#endif
diff --git a/mcu/interface/service/dhl/v2/dhl_ebs_logging.h b/mcu/interface/service/dhl/v2/dhl_ebs_logging.h
new file mode 100644
index 0000000..abf5d1c
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dhl_ebs_logging.h
@@ -0,0 +1,165 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file dhl_ebs_logging.h
+ *
+ * Description:
+ * ------------
+ *   @brief 
+ *   DHL external buffer serivce (EBS) , only support under CCB logging
+ *   Provide CCB buffer(AP resource) for user (HW / SW both)
+ *   User put their own log on CCB buffer and maintain their owne read write ptr
+ *   DHL packet thier log as primitive log and move out
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 09 24 2019 yancy.chien
+ * [MOLY00442628] [MT6885][Petrus][NR][MP1][ML1S][MT8000A]Assert fail: dhl_list.h 305 0x235381fc 0x27f89db0 0x0 - 6IDLE
+ * Remove NRRC EBS solution.
+ *
+ * 05 02 2019 yancy.chien
+ * [MOLY00345863] [Gen97] RRC signal logging & inject
+ * interface part.
+ *
+ * 04 25 2019 yancy.chien
+ * [MOLY00401562] Decouple ICD from DHL on VMOLY trunk
+ * 	
+ * 	1. Dynamic CCB.
+ * 	2. Src Plug-in phase-in.
+ * 	3. Fix build error on Gen95
+ *
+ * 04 15 2019 yancy.chien
+ * [MOLY00331449] [Gen97] DHL logging development
+ * 	
+ * 	dynamic CCB.
+ *
+ * 01 31 2019 yancy.chien
+ * [MOLY00331449] [Gen97] DHL logging development
+ * LP_MON user id in EBS.
+ *
+ * 01 03 2019 yancy.chien
+ * [MOLY00331449] [Gen97] DHL logging development
+ * 	
+ * 	EBS deinit API for NRRC sharing in META mode as temp solution.
+ *
+ * 09 28 2018 yancy.chien
+ * [MOLY00345863] [Gen97] RRC signal logging & inject
+ * UPS mux header support over 64K
+ * UPS protocol phase-in
+ * EBS add NRRC_LOG type
+ * Custom ILM option remove no_log & wo_peer_buff
+ *
+ * 08 30 2018 yu-hsiang.peng
+ * [MOLY00347960] [MT6297] DHL Feature Enhance
+ * [EBS] rename & indirect mode in target
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_EBS_LOGGING_H_
+#define _DHL_EBS_LOGGING_H_
+
+#include "kal_general_types.h"
+#include "dhl_def.h"
+
+// enum
+typedef enum
+{
+    DHL_EBS_START       = 0,
+    DHL_EBS_LHIF_LOG    = DHL_EBS_START,
+    DHL_EBS_ASM_LOG,
+    DHL_EBS_LOWPOWER_MON_LOG,
+    DHL_EBS_DHL_TEST,
+    DHL_EBS_USER_NUM,
+    DHL_EBS_MAX_SUPPRT  = 7 //CCB limit
+} dhl_EBS_channel_type;
+
+typedef enum
+{
+    DHL_EBS_NOERROR              = 0,
+    //API errror code
+    DHL_EBS_NO_SUPPORT           = 1,
+    DHL_EBS_CALL_TOO_EARLY       = 2,
+    DHL_EBS_NO_INI_SERVERICE     = 3,
+    DHL_EBS_NO_REG_CB            = 5,
+    DHL_EBS_REG_CB_TWICE         = 6,
+
+    DHL_EBS_FILTER_NOT_OPEN      = 7,
+    DHL_EBS_CCB_BUFFER_NOT_READY = 8,
+    DHL_EBS_TOOL_NOT_CONNECT     = 9,
+    DHL_EBS_SEND_LEN_OVER_LIMIT  = 10,
+    //TX errror code
+    DHL_EBS_PARTIAL_TX           = 20,
+    //RX error code
+    DHL_EBS_READ_CONTINUE        = 30,
+    DHL_EBS_READ_END             = 31,
+    DHL_EBS_READ_NO_DATA         = 35,
+} DHL_EBS_ERROR_CODE;
+
+// structure
+typedef struct
+{
+    DHL_EBS_ERROR_CODE        error_code;
+    kal_uint32                          send_length;
+    // only work in DHL_EBS_PARTIAL_TX
+    // how many data put into TX channel
+    // it most  0 <=  and <= buf_len
+} dhl_EBS_send_result;
+
+
+
+// templete
+typedef void (*EBS_tx_done_cb)(dhl_EBS_channel_type type, kal_uint8 *sent_end);
+typedef DHL_EBS_ERROR_CODE(*EBS_read_cb)(dhl_EBS_channel_type type, kal_uint8 **address, kal_uint32 *len);
+
+// data
+#if defined(__DHL_EBS_LOGGING_MD_TEST__)
+kal_uint32   dhl_ebs_buffer[DHL_EBS_NUM][DHL_EBS_DEFAULT_BUF_SIZE];
+#endif //#if defined(__DHL_EBS_LOGGING_MD_TEST__)
+
+// function
+DHL_EBS_ERROR_CODE DHL_EBS_init(dhl_EBS_channel_type type, kal_uint32 **buf_addr, kal_uint32 *buff_size);
+DHL_EBS_ERROR_CODE DHL_EBS_deinit(dhl_EBS_channel_type type);
+
+DHL_EBS_ERROR_CODE DHL_EBS_register_tx_done_callback(dhl_EBS_channel_type type, EBS_tx_done_cb cb);
+DHL_EBS_ERROR_CODE DHL_EBS_register_read_callback(dhl_EBS_channel_type type, EBS_read_cb cb);
+dhl_EBS_send_result DHL_EBS_send_log_as_ilm(dhl_EBS_channel_type type, module_type src_mod, module_type dest_mod, msg_type msg_id, sap_type sap_id, kal_uint8 *local_para, kal_int32 local_para_len, kal_uint8 *buf_ptr, kal_int32 buf_len);
+void DHL_EBS_data_ready_2_flush(dhl_EBS_channel_type type);
+#endif //_DHL_EBS_LOGGING_H_
+
+
diff --git a/mcu/interface/service/dhl/v2/dhl_l1_trace_utmd.json b/mcu/interface/service/dhl/v2/dhl_l1_trace_utmd.json
new file mode 100644
index 0000000..4ec85f0
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dhl_l1_trace_utmd.json
@@ -0,0 +1,792 @@
+{
+  "_comment":"!!!Note!!! DHL time trace id is hard code by ELT, if add new trace, please add in the last and update ELT document",
+  "legacyParameters": {
+    "modemType": "dhl"
+  }, 
+  "module": "DHL_L1",
+  "startGen": "97", 
+  "endGen": "-",    
+  "stringTranslationDefs": [], 
+  "traceClassDefs": [
+    {
+      "L1_L2_TIME": {
+        "_comment": "filterDefaulValue is used in xl1sim, will be phased out later", 
+        "debugLevel": "Ultra-High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "L1L2_TIME","Force_Reserved"
+        ], 
+        "traceType": "Public"
+      }
+    },
+	{
+      "L1_L2_EX": {
+        "_comment": "filterDefaulValue is used in xl1sim, will be phased out later", 
+        "debugLevel": "Ultra-High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Exception"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    },	
+    {
+      "L1_L2_Debug": {
+        "_comment": "filterDefaulValue is used in xl1sim, will be phased out later", 
+        "debugLevel": "Ultra-High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Force_Debug"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    },
+    {
+      "ON_DEMAND_INFO": {
+        "_comment": "Use for print On-demand logging information", 
+        "debugLevel": "Ultra-Low", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "CoreDesign"
+      }
+    }, 
+    {
+      "L1_ULSP_DEBUG": {
+        "_comment": "Use for print On-demand logging debug information", 
+        "debugLevel": "Ultra-Low", 
+        "filterDefaultValue": "OFF", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "CoreDesign"
+      }
+    }, 
+    {
+      "ULSP_L1_TEST_LOG": {
+        "_comment": "Generate On-demand L1 test log", 
+        "debugLevel": "Ultra-Low", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "CoreDesign"
+      }
+    }, 
+    {
+      "ULSP_L2_TEST_LOG": {
+        "_comment": "Generate On-demand L2 test log", 
+        "debugLevel": "Ultra-Low", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "CoreDesign"
+      }
+    }
+  ], 
+  "traceDefs": [
+    {
+      "UMTS_3G_GEMINI_TIME": {
+        "format": "sim_idx=%b frame=%d ebit=%l bsfn=%d timestamp=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "UMTS_3G_TIME": {
+        "format": "frame=%d ebit=%l bsfn=%d timestamp=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "UMTS_2G_GEMINI_TIME": {
+        "format": "sim_idx=%b frame=%f ebit=%d timestamp=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "UMTS_2G_TIME": {
+        "format": "frame=%f ebit=%d timestamp=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "UMTS_2G_HANDOVER_TIME": {
+        "format": "frame=%f time=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "UMTS_3G_HANDOVER_TIME": {
+        "format": "frame=%f time=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME": {
+        "format": "phy_timer=%l sample=%d timestamp=%l sfn=%d", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME_2": {
+        "format": "phy_timer=%l sample=%d timestamp=%l sfn=%d _4g_time=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_L2_TIME": {
+        "dhlReserved": "force_l2", 
+        "format": "padding=%d timestamp=%l celltime=%l abstick=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_TRC_REDUMP": {
+        "dhlReserved": "ex_force_l1", 
+        "format": " !!!!!Redump L1 Trace at System Crash!!!!! ", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_TRC_FLUSH": {
+        "dhlReserved": "ex_force_l1", 
+        "format": " !!!!!Flush L1 Trace!!!!! ", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME_GFRC": {
+        "format": "phy_timer=%l sample=%d timestamp=%l sfn=%d", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME_MET_RTOS": {
+        "format": "rtos_time=%ul timestamp=%ul timestamp_H=%ul", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_HIGH_RESOLUTION_TIME": {
+        "format": "hs_time_msb=%d hs_time_lsb=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_LOW_RESOLUTION_TIME": {
+        "format": "ls_time=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_PERIODIC_TIME": {
+        "format": "periodic_time=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_INCREMENTAL_TIME": {
+        "format": "incremental_time=%b", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME_MET_WCLK": {
+        "format": "rtos_time=%ul timestamp=%ul timestamp_H=%ul WCLK=%ul", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "C2K_1X_TIME": {
+        "format": "[C2K][1x] Fn(Upper6)=%xb, Fn(Lower32)=%xl, Slot=%b, Echip=%xl, FRC=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "C2K_DO_TIME": {
+        "format": "[C2K][Do] Fn(Upper6)=%xb, Fn(Lower32)=%xl, Slot=%b, Echip=%xl, FRC=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME_GFRC_2": {
+        "format": "phy_time=%l, timestamp=%l, cell_time=%d, abs_time=%l:%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "NL1_TIME_TRACE": {
+        "format": "timestamp=%l nll_idx=%b abstime=%l cell_time=%d sfbd_stime=%l sfbd_frc=%l frc=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "hw_cond", 
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "L2_TRC_REDUMP": {
+        "dhlReserved": "ex_force_l2", 
+        "format": " !!!!!Redump L2 Trace at System Crash!!!!! ", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_TRC_FLUSH": {
+        "dhlReserved": "ex_force_l2", 
+        "format": " !!!!!Flush L2 Trace!!!!! ", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "UMTS_3G_GEMINI_TIME_OD": {
+        "format": "sim_idx=%b frame=%d ebit=%l bsfn=%d timestamp=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "UMTS_3G_TIME_OD": {
+        "format": "frame=%d ebit=%l bsfn=%d timestamp=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "UMTS_2G_GEMINI_TIME_OD": {
+        "format": "sim_idx=%b frame=%f ebit=%d timestamp=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "UMTS_2G_TIME_OD": {
+        "format": "frame=%f ebit=%d timestamp=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "UMTS_2G_HANDOVER_TIME_OD": {
+        "format": "frame=%f time=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "UMTS_3G_HANDOVER_TIME_OD": {
+        "format": "frame=%f time=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME_OD": {
+        "format": "phy_timer=%l sample=%d timestamp=%l sfn=%d", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME_2_OD": {
+        "format": "phy_timer=%l sample=%d timestamp=%l sfn=%d _4g_time=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_L2_TIME_OD": {
+        "dhlReserved": "force_l2", 
+        "format": "padding=%d timestamp=%l celltime=%l abstick=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand",
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME_GFRC_OD": {
+        "format": "phy_timer=%l sample=%d timestamp=%l sfn=%d", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME_MET_RTOS_OD": {
+        "format": "rtos_time=%ul timestamp=%ul timestamp_H=%ul", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_HIGH_RESOLUTION_TIME_OD": {
+        "format": "hs_time_msb=%d hs_time_lsb=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_LOW_RESOLUTION_TIME_OD": {
+        "format": "ls_time=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_PERIODIC_TIME_OD": {
+        "format": "periodic_time=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_INCREMENTAL_TIME_OD": {
+        "format": "incremental_time=%b", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME_MET_WCLK_OD": {
+        "format": "rtos_time=%ul timestamp=%ul timestamp_H=%ul WCLK=%ul", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "C2K_1X_TIME_OD": {
+        "format": "[C2K][1x] Fn(Upper6)=%xb, Fn(Lower32)=%xl, Slot=%b, Echip=%xl, FRC=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "C2K_DO_TIME_OD": {
+        "format": "[C2K][Do] Fn(Upper6)=%xb, Fn(Lower32)=%xl, Slot=%b, Echip=%xl, FRC=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "LTE_4G_TIME_GFRC_2_OD": {
+        "format": "phy_time=%l, timestamp=%l, cell_time=%d, abs_time=%l:%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "NL1_TIME_TRACE_OD": {
+        "format": "timestamp=%l nll_idx=%b abstime=%l cell_time=%d sfbd_stime=%l sfbd_frc=%l frc=%l", 
+        "traceClass": "L1_L2_TIME", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "L1_DHL_DEBUG_TRC1": {
+        "format": "DHL Debug Trace 1 variables v1=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_DHL_DEBUG_TRC2": {
+        "format": "DHL Debug Trace 2 variables v1=%l v2=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_DHL_DEBUG_TRC3": {
+        "format": "DHL Debug Trace 3 variables v1=%l v2=%l v3=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_DHL_DEBUG_TRC4": {
+        "format": "DHL Debug Trace 4 variables v1=%l v2=%l v3=%l v4=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_DHL_DEBUG_TRC5": {
+        "format": "DHL Debug Trace 5 variables v1=%l v2=%l v3=%l v4=%l v5=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_DHL_DEBUG_TRC6": {
+        "format": "DHL Debug Trace 6 variables v1=%l v2=%l v3=%l v4=%l v5=%l v6=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_DHL_DEBUG_TRC7": {
+        "format": "DHL Debug Trace 7 variables v1=%l v2=%l v3=%l v4=%l v5=%l v6=%l v7=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_DHL_DEBUG_TRC8": {
+        "format": "DHL Debug Trace 8 variables v1=%l v2=%l v3=%l v4=%l v5=%l v6=%l v7=%l v8=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_DHL_DEBUG_TRC1": {
+        "dhlReserved": "force_l2", 
+        "format": "DHL Debug Trace 1 variables v1=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_DHL_DEBUG_TRC2": {
+        "dhlReserved": "force_l2", 
+        "format": "DHL Debug Trace 2 variables v1=%l v2=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_DHL_DEBUG_TRC3": {
+        "dhlReserved": "force_l2", 
+        "format": "DHL Debug Trace 3 variables v1=%l v2=%l v3=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_DHL_DEBUG_TRC4": {
+        "dhlReserved": "force_l2", 
+        "format": "DHL Debug Trace 4 variables v1=%l v2=%l v3=%l v4=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_DHL_DEBUG_TRC5": {
+        "dhlReserved": "force_l2", 
+        "format": "DHL Debug Trace 5 variables v1=%l v2=%l v3=%l v4=%l v5=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_DHL_DEBUG_TRC6": {
+        "dhlReserved": "force_l2", 
+        "format": "DHL Debug Trace 6 variables v1=%l v2=%l v3=%l v4=%l v5=%l v6=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_DHL_DEBUG_TRC7": {
+        "dhlReserved": "force_l2", 
+        "format": "DHL Debug Trace 7 variables v1=%l v2=%l v3=%l v4=%l v5=%l v6=%l v7=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_DHL_DEBUG_TRC8": {
+        "dhlReserved": "force_l2", 
+        "format": "DHL Debug Trace 8 variables v1=%l v2=%l v3=%l v4=%l v5=%l v6=%l v7=%l v8=%l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_DEBUGL1_L1_WAKE_INFO": {
+        "format": "[DHL][HD][Time][L1] Debug wake up time = %l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_DEBUGL1_L2_WAKE_INFO": {
+        "dhlReserved": "force_l2", 
+        "format": "[DHL][HD][Time][L2] Debug wake up time = %l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_TRC_STOP_BEFORE_EE": {
+        "dhlReserved": "ex_force_l1", 
+        "format": " !!!!![WARNING] Logging was stopped before MD exception. Trace before MD exception is lost and redump is out-of-date.!!!!! ", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "error"
+      }
+    }, 
+    {
+      "L2_TRC_STOP_BEFORE_EE": {
+        "dhlReserved": "ex_force_l2", 
+        "format": " !!!!![WARNING] Logging was stopped before MD exception. Trace before MD exception is lost and redump is out-of-date.!!!!! ", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "error"
+      }
+    }, 
+    {
+      "DUMP_COND_L1_TRC_START": {
+        "dhlReserved": "ex_force_l1", 
+        "format": " !!!!! Start of Conditional L1 Trace !!!!! ", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DUMP_COND_L1_TRC_END": {
+        "dhlReserved": "ex_force_l1", 
+        "format": " !!!!! End of Conditional L1 Trace !!!!", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L1_TRC_REDUMP_END": {
+        "dhlReserved": "ex_force_l1", 
+        "format": " !!!!!Redump L1 Trace END!!!!! ", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "L2_TRC_REDUMP_END": {
+        "dhlReserved": "ex_force_l2", 
+        "format": " !!!!!Redump L2 Trace END!!!!! ", 
+        "traceClass": "L1_L2_EX", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_DEBUG_ULSP_DSP_LOCK": {
+        "format": "[DHL][ULSP] Debug lock dsp power %Mkal_bool at FRC %l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "DHL_DEBUG_ULSP_DSP_UNLOCK": {
+        "format": "[DHL][ULSP] Debug unlock dsp power at FRC %l", 
+        "traceClass": "L1_L2_Debug", 
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "ULSP_OD_DUMP_BOUNDARY_TRC": {
+        "format": "[ULSP][OD] ======== DUMP_BOUNDARY ========", 
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "warn"
+      }
+    }, 
+    {
+      "ULSP_TEST_LOG_OD_L1_1": {
+        "format": "[ULSP][OD] L1 TEST_LOG: %l", 
+        "traceClass": "ULSP_L1_TEST_LOG", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_TEST_LOG_OD_L2_1": {
+        "dhlReserved": "force_l2", 
+        "format": "[ULSP][OD] L2 TEST_LOG: %l", 
+        "traceClass": "ULSP_L2_TEST_LOG", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_RECORD_OPER_TRC": {
+        "format": "[ULSP][OD][RECORD] Ondemand Record channel: %Mon_demand_channel, Record time: %ul, emi_write_align_addr:%xl", 
+        "traceClass": "L1_ULSP_DEBUG", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_RECORD_INFO_TRC": {
+        "format": "[ULSP][OD][RECORD] OD ch: %Mon_demand_channel remain_size:%xl r_idx: %ud, e_idx: %ud, w_idx:%ud, (%xl, %xl, %xl) (%ul, %ul, %ul)", 
+        "traceClass": "L1_ULSP_DEBUG", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_DUMP_CHK_ADDR_TRC": {
+        "format": "[ULSP][OD][CHECK] Start_addr: %xl, End addr: %xl", 
+        "traceClass": "L1_ULSP_DEBUG", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_DUMP_CHK_ERROR_TRC": {
+        "format": "[ULSP][OD][CHECK] ERROR: Dump channel %Mon_demand_channel, Dump record tbl from %d to %d, EMI_addr: %xl, Expected num: %ul, Get num: %ul", 
+        "traceClass": "L1_ULSP_DEBUG", 
+        "traceHighlightOption": "error"
+      }
+    }, 
+    {
+      "ULSP_OD_DUMP_CHK_PTR": {
+        "format": "[ULSP][OD][CHECK] CUR_PTR: %xl, PKT_LEN: %l", 
+        "traceClass": "L1_ULSP_DEBUG", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_DUMP_CHK_SUCCESS_TRC": {
+        "format": "[ULSP][OD][CHECK] Check success record tbl from %d to %d", 
+        "traceClass": "L1_ULSP_DEBUG", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_SEND_RECTIFY_SYNC": {
+        "format": "[ULSP][OD] Send Rectify SYNC", 
+        "traceClass": "L1_ULSP_DEBUG", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_DUMP_HUB_TBL_IDX_TRC": {
+        "format": "[ULSP][OD][HUB] Dump channel: %Mon_demand_channel, Dump record tbl from %d to %d, mux_id=%l", 
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_DUMP_API_TRC": {
+        "format": "[ULSP][OD][API] Dump channel: %Mon_demand_channel, Ondemand dump scenario: %Mdhl_on_demand_dump_scenario, Dump result: %Mdhl_on_demand_error_code, Dump period: %ul, TS from %ul to %ul, Dump caller addr: %xl",
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_DUMP_API_INTERNAL_INFO_TRC": {
+        "format": "[ULSP][OD][API] Dump channel: %Mon_demand_channel, EMI from %xl to %xl, Dump record tbl from %d to %d, marking_dump_count: %l, LS usage = %ul", 
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_DUMP_API_WARN_TRC": {
+        "format": "[ULSP][OD][API][Nothing Dumped] Dump channel: %Mon_demand_channel, Ondemand dump scenario: %Mdhl_on_demand_dump_scenario, Dump result: %Mdhl_on_demand_error_code, Dump period: %ul, Dump caller addr: %xl, LS usage = %ul, LS logging path = %Mnv_dhl_ulsp_output_path",
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "ULSP_OD_DUMP_DONE_TRC": {
+        "format": "[ULSP][OD][Write_Done] Dump channel %Mon_demand_channel, start emi: %xl, end_emi: %xl, start_idx: %ud, end_idx: %ud", 
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_RECORD_TBL_FULL_TRC": {
+        "format": "[ULSP][OD][GPT] Record table is full: %Mon_demand_channel", 
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceHighlightOption": "warn"
+      }
+    },
+    {
+      "ULSP_L1_LOCK_OD_MSG": {
+        "format": "On-demand buffer exceed threshold, Discard", 
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceDataPath": "on_demand",
+        "traceHighlightOption": "warn"
+      }
+    },
+    {
+      "ULSP_L1_UNLOCK_OD_MSG": {
+        "format": "Discard Info %ul, %ul, %ul", 
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceDataPath": "on_demand",
+        "traceHighlightOption": "warn"
+      }
+    },
+    {
+      "ULSP_L2_LOCK_OD_MSG": {
+        "dhlReserved": "force_l2", 
+        "format": "On-demand buffer exceed threshold, Discard", 
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceDataPath": "on_demand",
+        "traceHighlightOption": "warn"
+      }
+    },
+    {
+      "ULSP_L2_UNLOCK_OD_MSG": {
+        "dhlReserved": "force_l2", 
+        "format": "Discard Info %ul, %ul, %ul", 
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceDataPath": "on_demand",
+        "traceHighlightOption": "warn"
+      }
+    }
+  ], 
+  "traceFamily": "L1"
+}
\ No newline at end of file
diff --git a/mcu/interface/service/dhl/v2/dhl_on_demand_logging_interface.h b/mcu/interface/service/dhl/v2/dhl_on_demand_logging_interface.h
new file mode 100644
index 0000000..d738cf6
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dhl_on_demand_logging_interface.h
@@ -0,0 +1,92 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+
+#ifndef __DHL_ON_DEMAND_LOGGING_INTERFACE_H__
+#define __DHL_ON_DEMAND_LOGGING_INTERFACE_H__
+
+#include "kal_general_types.h"
+
+typedef enum{
+    DHL_OD_NO_ERROR = 1,
+    DHL_OD_DUMP_PARTIAL_SUCCESSFUL,
+
+    DHL_OD_CHANNEL_NOT_SUPPORTED = -1,
+    DHL_OD_CHANNEL_IS_NOT_ENABLED = -2,
+    DHL_OD_DUMP_EXCEED_MAX_WAIT = -3,
+    DHL_OD_TIME_DIFF_TOO_SHORT = -4,
+    DHL_OD_SAME_WRITE_ALIGN_ADDR = -5,
+    DHL_OD_RECORD_TBL_FULL = -6,
+    DHL_OD_CHANNEL_IS_SIB_MODE = -7,
+    DHL_OD_CHANNEL_IS_ON_PLS_MODE = -8
+}dhl_on_demand_error_code;
+
+typedef enum{
+    DHL_OD_DUMP_SCENARIO_OD_INIT = 0,
+    DHL_OD_DUMP_SCENARIO_TEST,
+    DHL_OD_DUMP_SCENARIO_NR_RADIO_LINK_FAILURE,
+    DHL_OD_DUMP_SCENARIO_NR_MODEM_WARNING,
+    DHL_OD_DUMP_SCENARIO_NR_PAGING_SIB_MIB_CRC_NG,
+    DHL_OD_DUMP_SCENARIO_NR_SNR_RSRP_BIG_DROP,
+    DHL_OD_DUMP_SCENARIO_NR_SINR_RSRQ_BIG_DROP,
+    DHL_OD_DUMP_SCENARIO_NR_DL_HARQ_WITH_CUMULATE_CRC_NG,
+    DHL_OD_DUMP_SCENARIO_NR_UL_HARQ_RETX_OR_CUMULATE_NACK,
+    DHL_OD_DUMP_SCENARIO_LTE_RADIO_LINK_FAILURE,
+    DHL_OD_DUMP_SCENARIO_LTE_UL_HARQ_RETX_OR_CUMULATE_NACK,
+    DHL_OD_DUMP_SCENARIO_LTE_DL_HARQ_WITH_CUMULATE_CRC_NG,
+    DHL_OD_DUMP_SCENARIO_LTE_DRX_SLEEP_STATE_CHANGE,
+    DHL_OD_DUMP_SCENARIO_LTE_SINGL_UL_HARQ_AND_RETX,
+    DHL_OD_DUMP_SCENARIO_LTE_RACH_PAGING_SIB_MIB_CRC_NG,
+    DHL_OD_DUMP_SCENARIO_LTE_SNR_RSRP_BIG_DROP,
+    DHL_OD_DUMP_SCENARIO_LTE_MODEM_WARNING,
+    DHL_OD_DUMP_SCENARIO_LTE_SINR_RSRQ_BIG_DROP,
+    DHL_OD_DUMP_SCENARIO_DSP_LONG_DUMP,
+    DHL_OD_DUMP_SCENARIO_DSP_SHORT_DUMP,
+    DHL_OD_DUMP_SCENARIO_AT_CMD_TRIGGER,
+    DHL_OD_DUMP_SCENARIO_MAX
+}dhl_on_demand_dump_scenario;
+
+typedef enum{
+    DHL_OD_CHANNEL_INVALID = -1,
+    DHL_OD_CHANNEL_START = 0,
+    DHL_OD_3G_4G_DSP = DHL_OD_CHANNEL_START, 
+    DHL_OD_5G_DSP,
+    DHL_OD_MCU_L1L2, 
+    DHL_OD_CHANNEL_NUM
+}on_demand_channel;
+
+dhl_on_demand_error_code dhl_on_demand_dump(on_demand_channel ch_id, kal_uint32 dump_period, dhl_on_demand_dump_scenario scenario, kal_int32 max_wait_time);
+
+#endif //#ifndef __DHL_ON_DEMAND_LOGGING_INTERFACE_H__
\ No newline at end of file
diff --git a/mcu/interface/service/dhl/v2/dhl_plugin_interface.h b/mcu/interface/service/dhl/v2/dhl_plugin_interface.h
new file mode 100644
index 0000000..514bfb6
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dhl_plugin_interface.h
@@ -0,0 +1,154 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file dhl_plugin_interface.h
+ *
+ * Description:
+ * ------------
+ *   @brief 
+ *   DHL PLUG-IN interface
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 09 18 2020 chih-ting.yeh
+ * [MOLY00525394] [PMC] ICD built in filter
+ * 	
+ * 	[Patch Sync] ICD built-in filter
+ *
+ * 06 16 2020 lawrence.cheng
+ * [MOLY00526414] [Gen97][Fatal Error][DHL] DHL should not change msg_len of ilm to avoid impact on other ilm user.
+ * [NR15.R3.MP] fix the bug of accidental ilm msg_len_src_mod_id, and dest_mod_id modifications
+ *
+ * 04 15 2020 hk.yang
+ * [MOLY00426748] [VMOLY][PMC]DHL V2.0 ICD feature
+ * [NR15.R3] ICD control EM/OTA filter - header.
+ *
+ * 01 14 2020 yh.sung
+ * [MOLY00470593] [MP0.7 excluded][MT6885][Petrus][Alpha phone][MP1][SQC][SH][USIR][module_MM]Found user data in ELT Log
+ * 	
+ * 	.
+ *
+ * 05 23 2019 mojo.lai
+ * [MOLY00401562] Decouple ICD from DHL on VMOLY trunk
+ * 	
+ * 	Refine legacy OTA buffer format according to ICD committee's decision
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_PLUGIN_INTERFACE_H_
+#define _DHL_PLUGIN_INTERFACE_H_
+
+#include "kal_general_types.h"
+#include "dhl_trace.h"
+#include "dhl_def.h"
+
+//define
+#define DHL_PLUGIN_MAX_SUPPORT_USER_NUM    (0x4)
+
+// enum
+typedef enum
+{
+    DHL_PLUGIN_ELT_CH,
+    DHL_PLUGIN_MDM_CH,
+} DHL_PLUGIN_CH_TYPE;
+
+typedef enum
+{
+    DHL_PLUGIN_CB_EVENT_EM_LOGGER_API,   // ilm_struct*
+    DHL_PLUGIN_CB_EVENT_PEER_TRACE_API,  // dhl_plugin_cb_event_peer_trace_api_s
+    DHL_PLUGIN_CB_EVENT_RECV_COMMAND,    // dhl_plugin_cb_event_recv_command_s
+    DHL_PLUGIN_CB_EVENT_CH_STATE_CHANGE,
+    DHL_PLUGIN_CB_EVENT_RECV_COMMAND_UPDATE_EM_FILTER,
+    DHL_PLUGIN_CB_EVENT_SET_LOGGING_SCENARIO,
+} DHL_PLUGIN_CB_EVENT_TYPE;
+
+typedef enum
+{
+    DHL_PLUGIN_NO_ERROR,
+    DHL_PLUGIN_ERROR_NOT_READY,
+    DHL_PLUGIN_ERROR_FULL,
+    DHL_PLUGIN_ERROR_ALREADY_EXIST,
+    DHL_PLUGIN_ERROR_INVALID_DATA,
+} DHL_PLUGIN_ERROR_CODE;
+
+// structure
+
+typedef struct
+{
+    DHL_PLUGIN_CH_TYPE channel;
+    kal_uint8 *cmd_buf;
+    kal_uint32 cmd_len;
+} dhl_plugin_cb_event_recv_command_s;
+
+typedef struct{
+    kal_uint32 global_peer_msg_id;
+    kal_uint8* trace_header;
+    kal_uint32 trace_header_len;
+    kal_uint8* payload;
+    kal_uint32 payload_len;
+    kal_uint8* ext_data_no_peer;
+    kal_uint32 ext_data_no_peer_len;    
+    kal_uint8* peer;
+    kal_uint32 peer_len;
+} dhl_plugin_cb_event_peer_trace_api_s;
+
+typedef struct
+{
+    kal_int8 scenario_id;
+} dhl_plugin_cb_event_logging_scenario_s;
+/**
+ * API parameter for EM logging
+ */
+typedef struct
+{
+    DHL_PLUGIN_CH_TYPE channel_type; ///< output channel type @see DHL_PLUGIN_CB_EVENT_TYPE
+    dhl_primitive_header_struct* hdr; ///< EM message
+} dhl_plugin_cb_event_em_logger_api_arg_struct;
+typedef void(*dhl_plugin_event_callback)(DHL_PLUGIN_CB_EVENT_TYPE, void* arg, kal_uint32 arg_size);
+
+
+// function
+DHL_PLUGIN_ERROR_CODE dhl_plugin_register_user_cb(dhl_plugin_event_callback cb);
+
+kal_bool dhl_plugin_is_channel_enable(DHL_PLUGIN_CH_TYPE ch);
+DHL_PLUGIN_ERROR_CODE dhl_plugin_write(DHL_PLUGIN_CH_TYPE ch, trace_data_segment_desc desc_array[], kal_uint8 cnt);
+
+#endif //_DHL_PLUGIN_INTERFACE_H_
+
+
diff --git a/mcu/interface/service/dhl/v2/dhl_trace.h b/mcu/interface/service/dhl/v2/dhl_trace.h
new file mode 100644
index 0000000..3cbea78
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dhl_trace.h
@@ -0,0 +1,758 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file dhl_trace.h
+ *
+ * Description:
+ * ------------
+ *   @brief Public interface of PS trace logging API.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 01 14 2020 yh.sung
+ * [MOLY00470593] [MP0.7 excluded][MT6885][Petrus][Alpha phone][MP1][SQC][SH][USIR][module_MM]Found user data in ELT Log
+ * 	
+ * 	.
+ *
+ * 12 06 2019 wen-ting.cheah
+ * [MOLY00454404] [VMOLY] Remove legacy task
+ * Remove unused task
+ * 09 24 2019 yancy.chien
+ * [MOLY00442628] [MT6885][Petrus][NR][MP1][ML1S][MT8000A]Assert fail: dhl_list.h 305 0x235381fc 0x27f89db0 0x0 - 6IDLE
+ * Remove NRRC EBS solution.
+ *
+ * 09 18 2019 victoria.wang
+ * [MOLY00416922] DHL Legacy Wrapper migration and phase-out
+ * [Remove][DHL] phase out legacy wrapper API
+ *
+ * 06 13 2019 victoria.wang
+ * [MOLY00408490] USIR Feature
+ * [New][USIR][DHL] Add usir customsize masking function and enable USIR with modis
+ *
+ * 06 11 2019 sunwhy.kuo
+ * [MOLY00412952] patch empty flush MDM buffer API to VMOLY for further ESP key delay issue
+ * 	
+ * 	patch empty mon buffer flush API for ESP Key delay (need implement when MDM channel done)
+ *
+ * 05 16 2019 yancy.chien
+ * [MOLY00345863] [Gen97] RRC signal logging & inject
+ * 	
+ * 	Export MAX_TRACE_DATA_SEGMENT_CNT & MAX_ILM_TRACE_BYTES
+ *
+ * 05 16 2019 victoria.wang
+ * [MOLY00354132] [Gen 95][ERRC][SYS] Stored SIB C-struct debug trace
+ * [Add][DHL] print c structure logging API
+ *
+ * 05 02 2019 yancy.chien
+ * [MOLY00345863] [Gen97] RRC signal logging & inject
+ * interface part.
+ *
+ * 04 25 2019 yancy.chien
+ * [MOLY00401562] Decouple ICD from DHL on VMOLY trunk
+ * 	
+ * 	1. Dynamic CCB.
+ * 	2. Src Plug-in phase-in.
+ * 	3. Fix build error on Gen95
+ *
+ * 04 21 2019 yh.sung
+ * [MOLY00392990] [VMOLY][UTF] Phase 2 Landing
+ * [UTF][DHL] UTF Trace API - trace interface
+ *
+ * 01 30 2019 yu-hsiang.peng
+ * [MOLY00370849] [MT6297][Apollo][Sanity Fail][VMOLY][20181205][0200] 2G_Attach assert fail m12180.c 532
+ * [SEPT.DEV] support custom read done
+ *
+ * 01 25 2019 yu-hsiang.peng
+ * [MOLY00381457] [DHL 2.0] Common Feature Development
+ * [SEPT.DEV] support mipi custom read
+ *
+ * 12 04 2018 yancy.chien
+ * [MOLY00370246] [GEN97][DHL] META disconnect flow enhancement
+ * 	
+ * 	.
+ *
+ * 10 30 2018 yu-hsiang.peng
+ * [MOLY00347960] [MT6297] DHL Feature Enhance
+ * [Change Feature] Support AST logging - interface
+ *
+ * 09 28 2018 yancy.chien
+ * [MOLY00345863] [Gen97] RRC signal logging & inject
+ * UPS mux header support over 64K
+ * UPS protocol phase-in
+ * EBS add NRRC_LOG type
+ * Custom ILM option remove no_log & wo_peer_buff
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_TRACE_H
+#define _DHL_TRACE_H
+
+#if !defined(__DHL_MODULE__)
+#include "kal_trace.h"
+
+#define dhl_trace(...)
+#define dhl_internal_trace(...)
+#define dhl_brief_trace(...)
+#define dhl_peer_trace(...)
+#define dhl_raw_trace(...)
+#define dhl_print(...)
+#define dhl_print_string(...)
+#define dhl_print_system_trace(...)
+
+#define dhl_print_struct(...)
+#define dhl_debug_print(...)
+
+#define dhl_trace_impl(...)
+#define dhl_internal_trace_impl(...)
+#define dhl_print_impl(...)
+#define dhl_EM_logger(...)
+#define dhl_log_primitive6(...)
+
+#define dhl_print_meta_string(...)
+
+#define DHL_MAC_LOG_L2_PDU(pointer, length) do {\
+    } while(0)
+#define DHL_RLC_LOG_L2_PDU(pointer, length) do {\
+    } while(0)
+#define DHL_PDCP_LOG_L2_PDU(pointer, length) do {\
+    }while(0)
+
+#define DHL_MAC_CHECK_L2_PDU() do {\
+    }while(0)
+#define DHL_RLC_CHECK_L2_PDU() do {\
+    }while(0)
+#define DHL_PDCP_CHECK_L2_PDU() do {\
+    }while(0)
+#define dhl_get_md_time_info (0)
+#else
+
+#ifndef GEN_FOR_PC
+#include <stdio.h>
+#include <stdarg.h>
+#else
+typedef char *va_list;
+#endif
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+#if defined(__RVCT__)
+#pragma diag_suppress 870
+#endif /* __RVCT_ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(__DHL_MODULE__) && defined(__EM_MODE__) /* for ilm_struct type definition */
+#ifndef GEN_FOR_PC
+struct ilm_struct;
+extern void tst_EM_logger(struct ilm_struct *ilm_ptr);
+extern void dhl_EM_logger(struct ilm_struct *ilm_ptr);
+#endif
+#endif  //#if defined(__DHL_MODULE__) && defined(__EM_MODE__)
+
+#define MAX_MSG_NBR_IN_MODULE       20
+
+//Define Trace Macro for PS trace
+#if defined(GEN_FOR_PC) && !defined(GEN_FOR_CPARSER)
+#define BEGIN_TRACE_MAP(MOD)     START_MODULE_MSG MOD MAX_MSG_NBR_IN_MODULE
+#define BEGIN_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL) START_RANGE_MODULE_MSG MOD MAX_MSG_NBR_IN_MODULE MIN_VAL MAX_VAL
+#define TRC_MSG(MSG,STR)         MSG STR
+#define TRC_MSG_NEWLINE(MSG,STR,NUM)         MSG STR NUM
+#define END_TRACE_MAP(MOD)       END_MODULE_MSG
+#define END_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL)   MOD MIN_VAL MAX_VAL END_RANGE_MODULE_MSG
+#else //Define Trace Macro for PS trace
+#define BEGIN_TRACE_MAP(MOD)     enum MOD##_MSG_ENUM{\
+    MOD##_empty_string=MOD<<MAX_MSG_NBR_IN_MODULE,
+#define BEGIN_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL) enum MOD##_##MIN_VAL##_MSG_ENUM{\
+    MOD##_##MIN_VAL##_empty_string = (MOD<<MAX_MSG_NBR_IN_MODULE) + MIN_VAL - 1,
+#define TRC_MSG(MSG,STR)         MSG##__enum,
+#define TRC_MSG_NEWLINE(MSG,STR,NUM)         MSG##__enum, MSG##_NEWLINE_EXPAND__enum = MSG##__enum+NUM,
+#define  END_TRACE_MAP(MOD)      MOD##__end};
+#define  END_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL)  MOD##_##MIN_VAL##__end};
+#endif //Define Trace Macro for PS trace
+
+
+#if defined(__DHL_MODULE__) && !defined(__DHL_BRINUP_DUMMY_BUILD__)
+#define __DHL_TRACE_ENABLED__
+#endif  //#ifdef __DHL_MODULE__
+
+#ifndef __DHL_TRACE_ENABLED__
+#if defined(L1_SIM) && !defined (__UE_SIMULATOR__)
+#define __DHL_TRACE_ENABLED__
+#elif defined(KAL_ON_OSCAR) || defined(MCD_DLL_EXPORT)
+#define __DHL_TRACE_EMPTY_FUNCTION__
+#endif  //#if defined(KAL_ON_OSCAR) || defined(MCD_DLL_EXPORT)
+#endif
+
+typedef enum
+{
+    TRACE_FUNC,
+    TRACE_STATE,
+    TRACE_INFO,
+    TRACE_WARNING,
+    TRACE_ERROR,
+    TRACE_GROUP_1,
+    TRACE_GROUP_2,
+    TRACE_GROUP_3,
+    TRACE_GROUP_4,
+    TRACE_GROUP_5,
+    TRACE_GROUP_6,
+    TRACE_GROUP_7,
+    TRACE_GROUP_8,
+    TRACE_GROUP_9,
+    TRACE_GROUP_10,
+    TRACE_PEER
+} trace_class_enum;
+
+typedef enum
+{
+    DHL_CUSTOM_ILM_HEADER_ONLY,
+    DHL_CUSTOM_ILM_CPHY_MSG_CONTAINER,
+} e_custom_ilm_trace_option;
+
+typedef struct
+{
+    void*      data;
+    kal_uint32 len;
+} trace_data_segment_desc;
+
+
+#if defined (__DHL_TRACE_ENABLED__)
+
+#define DHL_USER_FLAG_NONE          (0x0)
+#define DHL_FLAG_EM                 (0x1)
+
+/* User API for querying trace started to output or not, contact: Shengfu Tsai */
+extern kal_bool dhl_is_trace_started();
+
+/* User API for querying USIR on to mask sensitive data or not */
+kal_bool dhl_mask_sensitive_trace_on();
+
+/* trace */
+#define DHL_ACCESS_LEVEL_1_ALL_USER             (0x01)
+#define DHL_ACCESS_LEVEL_4_MTK_INTERNAL         (0x04)
+#define DHL_ACCESS_LEVEL_5_MBJ_L1               (0x05)
+#define DHL_ACCESS_LEVEL_5_MTB_L1               (0x05)
+#define DHL_ACCESS_LEVEL_7_HQ_ONLY              (0x07)
+/* trace */
+extern void dhl_print(trace_class_enum trc_class, kal_uint32 user_flag, module_type mod_id, const char *fmt, ...);
+extern void dhl_print_string(trace_class_enum trc_class, kal_uint32 user_flag, module_type mod_id, const char *str);
+extern void meta_print_string(trace_class_enum trc_class, kal_uint32 user_flag, module_type mod_id, const char *str);
+#define dhl_print_system_trace(_c, _s) \
+    dhl_print_string((_c), DHL_USER_FLAG_NONE, 0, (_s));
+
+/* primitive */
+/**
+* \brief output internal message communication log if module's filter on. send by KAL service.
+* \param ilm_struct for internal message
+*/
+extern void dhl_log_primitive(ilm_struct *ilm);
+extern void dhl_log_primitive_custom(ilm_struct *ilm, e_custom_ilm_trace_option option);
+
+#define DHL_MAX_TRACE_DATA_SEGMENT_CNT (128)
+#define DHL_MAX_ILM_TRACE_BYTES        (512 * 1024)
+/*
+ * Pack the data_seg_array's data in ILM's peer part
+ * NOTE:
+ *      1. original peer_buf_ptr & peer_buf_len of ILM will be replaced
+ *      2. local_para_len can be controlled by partial logging, but peer_len CAN'T
+ *      3. ASSURE data_seg_cnt <= DHL_MAX_TRACE_DATA_SEGMENT_CNT
+ *      4. ASSURE total size of trace <= DHL_MAX_ILM_TRACE_SIZE
+ */
+extern void dhl_log_primitive_append_data_in_peer(ilm_struct *ilm, trace_data_segment_desc data_seg_array[], kal_uint32 data_seg_cnt);
+
+extern void dhl_FT_log_primitive(ilm_struct *ilm);
+
+/**
+* \brief output primitive C structure if module's filter on.
+* \param module's id
+* \param sap_type if need partial logging
+* \param msg_type for getting c structure that define in message structure definition
+* \param buf_len the size of c structure
+* \param buf pointer to the stucture data
+* \par Sample code
+* \code{.c}
+* dhl_string_struct buf; 
+* kal_uint32 buf_len = sizeof(dhl_string_struct);
+* dhl_log_primitive_struct(MOD_DHL, INVALID_SAP, MSG_ID_DHL_STRING, buf_len, &buf);
+* \endcode
+*/
+extern void dhl_log_primitive_struct(module_type src_mod, sap_type sap_id,  msg_type msg_id, kal_uint32 buf_len, void *buf);
+// API for META
+// Exported API for FT only, FT will call this API after send disconnect ACK to Tool, then DHL will drop all upcoming META traces to save power
+// NOTE: Not thread-safe
+extern void dhl_set_meta_tool_disconnected();
+
+extern void meta_print_system_trace(trace_class_enum trc_class, kal_uint32 user_flag, module_type mod_id, const kal_char *str);
+#define dhl_print_meta_string(_c, _s)  meta_print_system_trace((_c), DHL_USER_FLAG_NONE, 0, (_s))
+
+
+// Only available on MoDIS
+#ifdef UNIT_TEST
+#include "kal_public_defs.h"
+extern void _dhl_print_struct(module_type src, msg_type msg_id, int buf_len, void *buf);
+#define dhl_print_struct(_s,_m,_l,_b) _dhl_print_struct(_s,_m,_l,_b)
+#define dhl_debug_print(_c,_m,_f, ...) dhl_print(_c, DHL_USER_FLAG_NONE, _m, _f, __VA_ARGS__);
+#else
+#define dhl_print_struct(_s,_m,_l,_b)
+#define dhl_debug_print(_f, ...)
+#endif
+
+#define dhl_trace_impl(_t, _u, _msg, _mod, _argv, _arg_info) \
+    dhl_internal_trace_impl(_t, _u, DHL_ACCESS_LEVEL_1_ALL_USER, _msg, _mod, _argv, _arg_info)
+
+extern void dhl_internal_trace_impl(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint8 access_level, kal_uint32 msg_index, kal_uint32 module_id, const char *arg_type, va_list argument_info);
+extern void dhl_print_impl(trace_class_enum trc_class, kal_uint32 user_flag, module_type mod_id, const char *fmt, va_list argument_info);
+extern void dhl_raw_trace_impl(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 buf_len, const kal_uint8 *pData, kal_bool chk_filter);
+/**
+ * @brief this is intended as internal API implementation of DHL
+ * Do not use this directly. User must declare UTMD to use OTA traces.
+ * @param trc_class trace class ID to check filter
+ * @param global_peer_msg_id OTA message identifier for given OTA message
+ * @param raw_data_len length of given OTA message
+ * @param raw_data pointer to OTA message buffer
+ * @param trace_index trace ID of this OTA message
+ * @param module_id trace module ID for filter checking
+ * @param arg_type trace argumeargument for given trace
+ *  */
+extern void dhl_peer_trace_impl(kal_uint8 trc_class, kal_uint32 global_peer_msg_id, kal_uint32 raw_data_len, kal_uint8 *raw_data, kal_uint32 trace_index, kal_uint32 module_id, const char *arg_type, va_list argument_info);
+
+//typedef void (*TST_String_Inject_CB)(kal_uint32 index, kal_uint8 *pData);
+// External buffer logging via ILM
+typedef enum
+{
+    DHL_EXTERNAL_BUFFER_TYPE_BEGIN = 0,
+    DHL_EXTERNAL_BUFFER_L2COPRO_IP_HEADER_LOG,
+    DHL_EXTERNAL_BUFFER_TYPE_MAX
+} dhl_external_buffer_type;
+
+/*
+ * Parameter note:
+ * sent_end
+ *    the end of buffer address sent
+ *    may not align with the buffer end sent
+ *    (fragment should be handled by user)
+ */
+typedef void (*buffer_tx_done_cb)(dhl_external_buffer_type type, kal_uint8 *sent_end, kal_int32 sent_len);
+kal_bool register_buffer_tx_done_callback(dhl_external_buffer_type type, buffer_tx_done_cb cb);
+/*
+ * Parameter usage note:
+ * msg_id
+ *    MSG_ID_DHL_L2COPRO_DL_IP_HEADER_LOG
+ *    MSG_ID_DHL_L2COPRO_UL_IP_HEADER_LOG
+ * local_para
+ *    caller-free
+ * local_para_len
+ *    <= 64 bytes
+ */
+typedef struct
+{
+    kal_uint8 *buf_address;
+    kal_uint32 buf_len;
+} S_DHL_SEND_BODY;
+kal_bool dhl_send_ilm_log(dhl_external_buffer_type type, msg_type msg_id, kal_uint8 *local_para, kal_int32 local_para_len, S_DHL_SEND_BODY *p_send_body_array, kal_uint32 body_number);
+
+//for SIM Authentication APDU flush mdm buffer use , need implement in DHL v2
+void dhl_mon_trigger_flush_log();
+
+#ifdef TST_TRACE_COMPAT
+#define kal_print_string_trace kal_wap_trace  //alias kal_print_string_trace as kal_wap_trace
+extern void kal_wap_trace(module_type mod_id, trace_class_enum trc_class, const char *fmt, ...);
+extern void kal_bootup_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_prompt_trace(module_type, const kal_char *fmt, ...);
+extern void kal_trace_for_3rd_party(trace_class_enum, kal_uint32, const kal_char *, va_list);
+#endif
+//#define __DHL_LEGACY_TRACE_API_ENABLED__
+#if defined(__DHL_LEGACY_TRACE_API_ENABLED__)
+/*index trace & raw trace & peer trace*/
+/*dhl*/
+extern void dhl_trace(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const char *arg_type, ...);
+extern void dhl_internal_trace(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint8 access_level, kal_uint32 msg_index, const char *arg_type, ...);
+extern void dhl_brief_trace(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const char *arg_type, ...);
+extern void dhl_raw_trace(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 buf_len, const kal_uint8 *pData);
+extern void dhl_peer_trace(kal_uint32 global_peer_msg_id, kal_uint32 raw_data_len, kal_uint8 *raw_data, kal_uint32 trace_index, const char *arg_type, ...);
+/*kal*/
+#ifdef TST_TRACE_COMPAT
+#define kal_critical_trace kal_trace
+#define kal_critical_brief_trace kal_brief_trace
+#define kal_critical_assert_trace kal_assert_trace
+extern void kal_critical_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_critical_brief_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_critical_assert_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+#if !defined(_MSC_VER)
+#define kal_trace(trc_class, msg_index, ...) \
+    dhl_trace(trc_class, DHL_USER_FLAG_NONE, msg_index, ##__VA_ARGS__)
+#define kal_brief_trace(trc_class, msg_index, ...) \
+    dhl_brief_trace(trc_class, DHL_USER_FLAG_NONE, msg_index, ##__VA_ARGS__)
+//Target build
+extern kal_bool tst_is_PsTrc_open_and_pstrace_flag;  //For optimization, the AND flag of tst_is_PsTrc_open and tst_pstrace_flag
+extern void dhl_brief_trace_opt_helper(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const char *arg_type, ...);
+#define kal_brief_trace_macro(trc_class, msg_index, ...) do { \
+    if (tst_is_PsTrc_open_and_pstrace_flag) {\
+        dhl_brief_trace_opt_helper(trc_class, DHL_USER_FLAG_NONE, msg_index, ##__VA_ARGS__); \
+    } \
+    } while(0)
+#else
+extern void kal_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_brief_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+//PC build (MoDIS or MCDDLL)
+extern void kal_brief_trace_macro(trace_class_enum, kal_uint32, const kal_char *, ...);
+#endif // _MSC_VER
+extern void _kal_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void _kal_brief_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_lib_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+//extern void kal_assert_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+#define kal_assert_trace(trc_class, msg_index, ...) dhl_trace(trc_class, DHL_USER_FLAG_NONE, msg_index, ##__VA_ARGS__)
+extern void kal_buffer_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 buf_len, const kal_uint8 *pData);
+extern void kal_dev_trace(trace_class_enum trc_class, kal_uint32 msg_index, const char *arg_type, ...);
+#endif // TST_TRACE_COMPAT
+#endif //__DHL_LEGACY_TRACE_API_ENABLED__
+/**
+ * @brief get MD time info
+ * @returns the current time info (32-bit)
+ */
+kal_uint32 dhl_get_md_time_info(void);
+#else //__DHL_TRACE_ENABLED__
+#if defined(__DHL_TRACE_EMPTY_FUNCTION__)
+/*
+ * For non-target platform (PC simulator or MNT),
+ * we define trace-related functions as inline function to avoid compile error
+ * in VC++.
+ */
+
+static __inline void dhl_trace(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const char *arg_type, ...)
+{
+    return;
+}
+
+static __inline void dhl_internal_trace(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint8 access_level, kal_uint32 msg_index, const char *arg_type, ...)
+{
+    return;
+}
+
+static __inline void dhl_brief_trace(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const char *arg_type, ...)
+{
+    return;
+}
+
+static __inline void dhl_raw_trace(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 buf_len, const kal_uint8 *pData)
+{
+    return;
+}
+
+static __inline void dhl_print(trace_class_enum trc_class, kal_uint32 user_flag, module_type mod_id, const char *fmt, ...)
+{
+    return;
+}
+
+#define dhl_print_system_trace(_c, _s)
+#define dhl_print_struct(_s,_m,_l,_b)
+#define dhl_debug_print(_f, ...)
+
+static __inline void dhl_peer_trace(kal_uint32 global_peer_msg_id, kal_uint32 raw_data_len, kal_uint8 *raw_data, kal_uint32 trace_index, const char *arg_type, ...)
+{
+    return;
+}
+
+static __inline void dhl_trace_impl(trace_class_enum trc_class, kal_uint32 user_flag, kal_uint32 msg_index, const char *arg_type, va_list argument_info)
+{
+    return;
+}
+
+static __inline void dhl_print_impl(trace_class_enum trc_class, kal_uint32 user_flag, module_type mod_id, const char *fmt, va_list argument_info)
+{
+    return;
+}
+
+static __inline void kal_critical_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_critical_brief_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+static __inline void kal_critical_assert_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+
+static __inline void kal_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_brief_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_brief_trace_macro(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_trace_for_3rd_party(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, va_list argument_info)
+{
+    return ;
+}
+
+static __inline void kal_lib_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+static __inline void kal_assert_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+static __inline void kal_wap_trace(module_type mod_id, trace_class_enum trc_class, const char *fmt, ...)
+{
+    return ;
+}
+static __inline void kal_print_string_trace(module_type mod_id, trace_class_enum trc_class, const char *fmt, ...)
+{
+    return ;
+}
+
+static __inline void kal_buffer_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 buf_len, const kal_uint8 *pData)
+{
+    return;
+}
+
+static __inline void kal_dev_trace(trace_class_enum trc_class, kal_uint32 msg_index, const char *arg_type, ...)
+{
+    return;
+}
+
+static __inline void kal_bootup_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+#if !defined(__LTE_REMOVE_TEMPERAL__)
+static __inline void kal_prompt_trace(module_type mod_id, const kal_char *fmt, ...)
+{
+    return;
+}
+#endif /* end of !__LTE_REMOVE_TEMPERAL__ */
+#else // __DHL_TRACE_EMPTY_FUNCTION__
+//Define empty functions for Target SW
+#define dhl_trace(...)
+#define dhl_internal_trace(...)
+#define dhl_brief_trace(...)
+#define dhl_raw_trace(...)
+#define dhl_print(...)
+#define dhl_print_string(...)
+#define dhl_print_system_trace(...)
+
+#define dhl_print_struct(...)
+#define dhl_debug_print(...)
+#define dhl_peer_trace(...)
+
+#define dhl_trace_impl(...)
+#define dhl_print_impl(...)
+#define dhl_internal_trace_impl(...)
+
+#define kal_trace(...)
+#define kal_brief_trace(...)
+#define _kal_trace(...)
+#define _kal_brief_trace(...)
+#define kal_brief_trace_macro(...)
+#define kal_trace_for_3rd_party(...)
+#define kal_lib_trace(...)
+#define kal_assert_trace(...)
+#define kal_wap_trace(...)
+#define kal_print_string_trace(...)
+#define kal_buffer_trace(...)
+#define kal_dev_trace(...)
+#define kal_bootup_trace(...)
+#define kal_prompt_trace(...)
+#define kal_critical_trace(...)
+#define kal_critical_brief_trace(...)
+#define kal_critical_assert_trace(...)
+
+#define dhl_EM_logger(...)
+#define dhl_brief_trace_opt_helper(...)
+#endif
+#endif
+
+#define kal_sys_trace        tst_sys_trace
+#define kal_sys_init_trace   tst_sys_init_trace
+#define kal_sys_fatal_trace  tst_sysfatal_trace
+
+#if defined(__DHL_MODULE__)
+// TODO:  liberrc_mob_com.c & kal_msg_passing.c extern tst_log_primitive, ask them to remove!!
+extern void tst_log_primitive(ilm_struct *ilm_ptr);
+//#define tst_log_primitive(ilm)   dhl_log_primitive(ilm)
+
+// TODO: l1tst_fnc_l1rf.c 194 extern tst_sys_trace, ask them to remove!!
+extern void tst_sys_trace(kal_char *info);
+//#define tst_sys_trace(mesg)      dhl_print_system_trace(TRACE_INFO,mesg)
+
+// these APIs can be replaced by macro directlly
+#define tst_sysfatal_trace(mesg) dhl_print_system_trace(TRACE_ERROR, mesg)
+#define tst_sys_init_trace       tst_sys_trace
+
+
+extern kal_int32 tst_trace_check_ps_filter_off(trace_class_enum trc_class, kal_uint32 *module_id, kal_uint32 supportOption);
+
+#define kal_bootup_print tst_sys_init_trace
+#else
+#ifdef __DHL_TRACE_EMPTY_FUNCTION__
+#if !defined(__LTE_REMOVE_TEMPERAL__)
+static __inline void tst_sys_init_trace(const kal_char *info)
+{
+return ;
+}
+static __inline void tst_sys_trace(kal_char *info)
+{
+return ;
+}
+static __inline void tst_sysfatal_trace(kal_char *info)
+{
+return ;
+}
+static __inline kal_int32 tst_trace_check_ps_filter_off(trace_class_enum trc_class, kal_uint32 *module_id, kal_uint32 supportOption)
+{
+return ;
+}
+#endif /* end of !__LTE_REMOVE_TEMPERAL__ */
+#else
+#define tst_sys_init_trace(...)
+#define tst_sys_trace(...)
+#define tst_sysfatal_trace(...)
+#define tst_trace_check_ps_filter_off(...)
+#endif
+#endif  //#ifdef __DHL_MODULE__
+
+typedef void (*TST_VC_CallBack)(const kal_uint8 *pData, kal_uint32 nLen);
+typedef void (*TST_String_Inject_CB)(kal_uint32 index, kal_uint8 *pData);
+
+/*
+* tst_virtual_channel_id:
+* regiester new virtual channel here and remake tst
+*/
+typedef enum
+{
+    TVCI_GPS_LOGGING,
+    TVCI_DNT_L2COPRO_LOGGING,
+    TVCI_CATCHER_POLLING,
+    TVCI_GDB_COMM,
+    TVCI_AST_LOGGING,
+    TVCI_MINI_LOG,
+    TVCI_VM_LOGGING,
+    TVCI_BTT,
+    TVCI_LAST_ID
+}
+tst_virtual_channel_id;
+
+#define MAX_VC_RESPONSE_LEN (1023)
+
+kal_bool tst_vc_register_channel(tst_virtual_channel_id channel_id, TST_VC_CallBack fnCmd);
+kal_bool tst_vc_response(tst_virtual_channel_id channel_id, const kal_uint8 *pData, kal_uint16 len);
+void dhl_vc_send_ast_log(kal_uint8 * buf, kal_uint16 data_len);
+
+#define TVCI_CREATE_FILE 0x24540001
+#define TVCI_CLOSE_FILE 0x24540002
+
+kal_bool dhl_get_assert_bypass_buf(kal_char **buf, kal_uint32 *buf_size, kal_uint32 *buf_index);
+kal_bool dhl_ack_assert_bypass_buf(kal_char *buf, kal_uint32 message_size, kal_uint32 buf_index);
+
+void dhl_log_primitive6(module_type src_mod_id, module_type dest_mod_id, sap_type sap_id, msg_type msg_id, local_para_struct *local_para_ptr, peer_buff_struct *peer_buff_ptr);
+
+typedef enum
+{
+    DHL_CUSTOM_MEM_PMIC,
+    DHL_CUSTOM_MEM_MIPI,
+    DHL_CUSTOM_MEM_MAX
+} DHL_CUSTOM_MEM_TYPE;
+
+typedef void (*DHL_CUSTOM_READ_MEM_CALLBACK)(void *read_addr, kal_uint32 len, kal_uint32 option, void **read_buffer_addr, kal_uint32 *read_buffer_len);
+typedef void (*DHL_CUSTOM_READ_MEM_DONE_CALLBACK)(void *read_addr, kal_uint32 len, kal_uint32 option);
+typedef void (*DHL_CUSTOM_WRITE_MEM_CALLBACK)(void *write_addr, kal_uint32 len, kal_uint32 option, void *write_buffer_addr);
+
+kal_bool dhl_register_custom_mem_read(DHL_CUSTOM_MEM_TYPE mem_type, DHL_CUSTOM_READ_MEM_CALLBACK read_cb);
+kal_bool dhl_register_custom_mem_read_done(DHL_CUSTOM_MEM_TYPE mem_type, DHL_CUSTOM_READ_MEM_DONE_CALLBACK read_done_cb);
+kal_bool dhl_register_custom_mem_write(DHL_CUSTOM_MEM_TYPE mem_type, DHL_CUSTOM_WRITE_MEM_CALLBACK write_cb);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+typedef enum
+{
+    /* 0~7 reserve for L2 PDU */
+    /* should not over DHL_L2_PDU_TYPE_NUM */
+    DHL_L2_PDU_MAC_TYPE = 1,
+    DHL_L2_PDU_RLC_TYPE = 2,
+    DHL_L2_PDU_PDCP_TYPE = 3,
+    DHL_L2_PDU_RLC_PDU_TYPE = 4,
+} dhl_log_pdu_type;
+
+void dhl_log_pdu(dhl_log_pdu_type type, kal_uint8 *data, kal_uint32 length);
+void dhl_flush_pdu(dhl_log_pdu_type type);
+kal_bool dhl_check_pdu_filter(dhl_log_pdu_type type);
+
+#define DHL_MAC_CHECK_L2_PDU() dhl_check_pdu_filter(DHL_L2_PDU_MAC_TYPE)
+#define DHL_RLC_CHECK_L2_PDU() (dhl_check_pdu_filter(DHL_L2_PDU_RLC_TYPE) || dhl_check_pdu_filter(DHL_L2_PDU_RLC_PDU_TYPE))
+#define DHL_PDCP_CHECK_L2_PDU() dhl_check_pdu_filter(DHL_L2_PDU_PDCP_TYPE)
+
+#define DHL_MAC_LOG_L2_PDU(pointer, length) do {          \
+        if(DHL_MAC_CHECK_L2_PDU()) {       \
+            dhl_log_pdu(DHL_L2_PDU_MAC_TYPE, pointer, length);\
+        }                                                     \
+    } while(0)
+#define DHL_RLC_LOG_L2_PDU(pointer, length) do {          \
+        if(DHL_RLC_CHECK_L2_PDU()) {       \
+            dhl_log_pdu(DHL_L2_PDU_RLC_TYPE, pointer, length);\
+        }                                                     \
+    } while(0)
+#define DHL_PDCP_LOG_L2_PDU(pointer, length) do {          \
+        if(DHL_PDCP_CHECK_L2_PDU()) {       \
+            dhl_log_pdu(DHL_L2_PDU_PDCP_TYPE, pointer, length);\
+        }                                                      \
+    }while(0)
+
+#endif
+#endif /* _DHL_TRACE_H */
+
diff --git a/mcu/interface/service/dhl/v2/dhl_ulsp_hw_interface.h b/mcu/interface/service/dhl/v2/dhl_ulsp_hw_interface.h
new file mode 100644
index 0000000..f161ef0
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dhl_ulsp_hw_interface.h
@@ -0,0 +1,668 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file dhl_ulsp_hw_interface.h
+ *
+ * Description:
+ * ------------
+ *   @brief Interface of HW ULSP on real target.
+ *   @note This file will be include bu l1trc.h, please do not include this file directly.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 11 19 2019 guan-ren.chen
+ * [MOLY00460317] [Petrus][blocking] trace lost before assert in two log - ALPS04883010, ALPS04883323
+ * Disable L1/L2 ondemand input while over threshold.
+ *
+ * 04 16 2019 guan-ren.chen
+ * [MOLY00399588] [Gen97] Dormant flow
+ * Dormant flow. Struct access ULSP reg.
+ *
+ * 10 08 2018 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * On-demand logging porting.
+ *
+ * 08 30 2018 yu-hsiang.peng
+ * [MOLY00347960] [MT6297] DHL Feature Enhance
+ * [Exception] Support L1 L2 redump info in MODIS & Target
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_ULSP_HW_INTERFACE_H
+#define _DHL_ULSP_HW_INTERFACE_H
+
+#define ULSP_HEADER_SIZE (4)
+#define L1_TRACE_MAX_SIZE (32*4) //Max: Argnumber * 4 bytes/each
+#define TRC_BUFFER_SIZE (ULSP_HEADER_SIZE + L1_TRACE_MAX_SIZE)
+
+extern kal_int32 dhl_ulsp_l1_on_demand_force_stream;
+extern kal_int32 dhl_ulsp_l2_on_demand_force_stream;
+extern kal_bool dhl_od_l1l2_lock_input;
+extern kal_uint32 dhl_od_l1l2_drop_cnt; // This variable just roughly count the drop ondemand trace. Not using atomic protect to prevent HRT issue.
+extern kal_bool l1_trc_assure_lisr();
+void dhl_ulsp_mcu_packet_and_write_ex(kal_uint32 source_id, kal_uint8 *buffaddr, kal_uint32 length);
+void dhl_ulsp_mcu_write_ex(kal_uint8 *buffaddr, kal_uint32 length); 
+
+/********************************************
+* 6293 Default Macro Version
+* This will use local variable to catch user parameter
+* and use DI/EI to protect trace
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    if((FILTER_ARRAY[FILTER_ARRAY_INDEX] & FILTER_CLASS) != 0) {
+
+#define TRC_END_FILTER_CHECK_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    }
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1(cgen_local_var, var) kal_uint32 cgen_local_var = (kal_uint32)(var);
+#define TRC_PREPROCESS_DATA_SECTION2_L1(cgen_local_var, var)
+
+//fill data interval
+#define TRC_START_FILL_L1()  {\
+        kal_uint32 oldmask=0; \
+        kal_uint32 pb_data_reg_base_addr = ULSP_PB0_NORMAL_DATA_REG_ADDR; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask);
+
+#define TRC_END_FILL_L1()  \
+    DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1(cgen_local_var, var) ULSP_WRITE_F_16(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_32_FIRST_WRAPPER_L1(cgen_local_var, var) ULSP_WRITE_F_32(pb_data_reg_base_addr, cgen_local_var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1(cgen_local_var, var) ULSP_WRITE_M_32(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1(cgen_local_var, var) ULSP_WRITE_M_24(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1(cgen_local_var, var) ULSP_WRITE_M_16(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1(cgen_local_var, var) ULSP_WRITE_M_8(pb_data_reg_base_addr, cgen_local_var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1(cgen_local_var, var) ULSP_WRITE_L_32(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1(cgen_local_var, var) ULSP_WRITE_L_24(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1(cgen_local_var, var) ULSP_WRITE_L_16(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1(cgen_local_var, var) ULSP_WRITE_L_8(pb_data_reg_base_addr, cgen_local_var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1(cgen_local_var, var) ULSP_WRITE_S_32(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1(cgen_local_var, var) ULSP_WRITE_S_24(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1(cgen_local_var, var) ULSP_WRITE_S_16(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1(cgen_local_var, var) ULSP_WRITE_S_8(pb_data_reg_base_addr, cgen_local_var)
+
+//For L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    if((FILTER_ARRAY[FILTER_ARRAY_INDEX] & FILTER_CLASS) != 0) {
+
+#define TRC_END_FILTER_CHECK_L2( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    }
+
+//pre-process user data, assign user data to local var since if user use function(some will mask interrupt) as parameter will cause 1. interupt time too long 2. mask interrupt twice
+#define TRC_PREPROCESS_DATA_SECTION1_L2(cgen_local_var, var) kal_uint32 cgen_local_var = (kal_uint32)(var);
+#define TRC_PREPROCESS_DATA_SECTION2_L2(cgen_local_var, var)
+
+//fill data interval
+#define TRC_START_FILL_L2()  {\
+        kal_uint32 oldmask=0; \
+        kal_uint32 pb_data_reg_base_addr = ULSP_PB1_NORMAL_DATA_REG_ADDR; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask);
+
+#define TRC_END_FILL_L2()  \
+    DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2(cgen_local_var, var) ULSP_WRITE_F_16(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_32_FIRST_WRAPPER_L2(cgen_local_var, var) ULSP_WRITE_F_32(pb_data_reg_base_addr, cgen_local_var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2(cgen_local_var, var) ULSP_WRITE_M_32(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L2(cgen_local_var, var) ULSP_WRITE_M_24(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L2(cgen_local_var, var) ULSP_WRITE_M_16(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L2(cgen_local_var, var) ULSP_WRITE_M_8(pb_data_reg_base_addr, cgen_local_var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2(cgen_local_var, var) ULSP_WRITE_L_32(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2(cgen_local_var, var) ULSP_WRITE_L_24(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2(cgen_local_var, var) ULSP_WRITE_L_16(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2(cgen_local_var, var) ULSP_WRITE_L_8(pb_data_reg_base_addr, cgen_local_var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2(cgen_local_var, var) ULSP_WRITE_S_32(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2(cgen_local_var, var) ULSP_WRITE_S_24(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2(cgen_local_var, var) ULSP_WRITE_S_16(pb_data_reg_base_addr, cgen_local_var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2(cgen_local_var, var) ULSP_WRITE_S_8(pb_data_reg_base_addr, cgen_local_var)
+
+
+
+
+/********************************************
+* Only for 6293 Non-SMP Special User Version
+* This will  "NOT" use local variable to catch user parameter
+* and use SMP check fail let user assert to protect trace
+********************************************/
+//For L1 Non SMP trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_NON_SMP TRC_START_FILTER_CHECK_L1
+#define TRC_END_FILTER_CHECK_L1_NON_SMP TRC_END_FILTER_CHECK_L1
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP(cgen_local_var, var)
+#define TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP(cgen_local_var, var)
+
+//fill data interval
+#define TRC_START_FILL_L1_NON_SMP( ) \
+    l1_trc_assure_lisr(); \
+    { \
+        kal_uint32 pb_data_reg_base_addr = ULSP_PB0_NORMAL_DATA_REG_ADDR; \
+
+#define TRC_END_FILL_L1_NON_SMP( ) \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_NON_SMP(cgen_local_var, var) ULSP_WRITE_F_16(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_32_FIRST_WRAPPER_L1_NON_SMP(cgen_local_var, var) ULSP_WRITE_F_32(pb_data_reg_base_addr, var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_NON_SMP(cgen_local_var, var) ULSP_WRITE_M_32(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_NON_SMP(cgen_local_var, var) ULSP_WRITE_M_24(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_NON_SMP(cgen_local_var, var) ULSP_WRITE_M_16(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_NON_SMP(cgen_local_var, var) ULSP_WRITE_M_8(pb_data_reg_base_addr, var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_NON_SMP(cgen_local_var, var) ULSP_WRITE_L_32(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_NON_SMP(cgen_local_var, var) ULSP_WRITE_L_24(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_NON_SMP(cgen_local_var, var) ULSP_WRITE_L_16(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_NON_SMP(cgen_local_var, var) ULSP_WRITE_L_8(pb_data_reg_base_addr, var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_NON_SMP(cgen_local_var, var) ULSP_WRITE_S_32(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_NON_SMP(cgen_local_var, var) ULSP_WRITE_S_24(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_NON_SMP(cgen_local_var, var) ULSP_WRITE_S_16(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_NON_SMP(cgen_local_var, var) ULSP_WRITE_S_8(pb_data_reg_base_addr, var)
+
+//For L2 Non SMP trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2_NON_SMP TRC_START_FILTER_CHECK_L2
+#define TRC_END_FILTER_CHECK_L2_NON_SMP TRC_END_FILTER_CHECK_L2
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2_NON_SMP(cgen_local_var, var)
+#define TRC_PREPROCESS_DATA_SECTION2_L2_NON_SMP(cgen_local_var, var)
+
+//fill data interval
+#define TRC_START_FILL_L2_NON_SMP( ) \
+    l1_trc_assure_lisr(); \
+    { \
+        kal_uint32 pb_data_reg_base_addr = ULSP_PB1_NORMAL_DATA_REG_ADDR; \
+
+#define TRC_END_FILL_L2_NON_SMP( ) \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2_NON_SMP(cgen_local_var, var) ULSP_WRITE_F_16(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_32_FIRST_WRAPPER_L2_NON_SMP(cgen_local_var, var) ULSP_WRITE_F_32(pb_data_reg_base_addr, var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2_NON_SMP(cgen_local_var, var) ULSP_WRITE_M_32(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L2_NON_SMP(cgen_local_var, var) ULSP_WRITE_M_24(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L2_NON_SMP(cgen_local_var, var) ULSP_WRITE_M_16(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L2_NON_SMP(cgen_local_var, var) ULSP_WRITE_M_8(pb_data_reg_base_addr, var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2_NON_SMP(cgen_local_var, var) ULSP_WRITE_L_32(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2_NON_SMP(cgen_local_var, var) ULSP_WRITE_L_24(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2_NON_SMP(cgen_local_var, var) ULSP_WRITE_L_16(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2_NON_SMP(cgen_local_var, var) ULSP_WRITE_L_8(pb_data_reg_base_addr, var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2_NON_SMP(cgen_local_var, var) ULSP_WRITE_S_32(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2_NON_SMP(cgen_local_var, var) ULSP_WRITE_S_24(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2_NON_SMP(cgen_local_var, var) ULSP_WRITE_S_16(pb_data_reg_base_addr, var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2_NON_SMP(cgen_local_var, var) ULSP_WRITE_S_8(pb_data_reg_base_addr, var)
+/********************************************
+*(Hack Code)Only for 6293 "DHL" L2 Time
+*Only Support L1 .tmd File
+*   L1 tmd force print L2 trace
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_FORCE_L2 TRC_START_FILTER_CHECK_L2
+#define TRC_END_FILTER_CHECK_L1_FORCE_L2 TRC_END_FILTER_CHECK_L2
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_FORCE_L2 TRC_PREPROCESS_DATA_SECTION1_L2
+#define TRC_PREPROCESS_DATA_SECTION2_L1_FORCE_L2 TRC_PREPROCESS_DATA_SECTION2_L2
+
+//fill data interval
+#define TRC_START_FILL_L1_FORCE_L2 TRC_START_FILL_L2
+#define TRC_END_FILL_L1_FORCE_L2 TRC_END_FILL_L2
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_FIRST_WRAPPER_L2
+#define TRC_OUTPUT_32_FIRST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_32_FIRST_WRAPPER_L2
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_32_MID_WRAPPER_L2
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_24_MID_WRAPPER_L2
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_MID_WRAPPER_L2
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_8_MID_WRAPPER_L2
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_32_LAST_WRAPPER_L2
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_24_LAST_WRAPPER_L2
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_LAST_WRAPPER_L2
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_8_LAST_WRAPPER_L2
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_32_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_24_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_8_SINGLE_WRAPPER_L2
+
+/*********************************************
+* (Hack Code)Only for 6293 DHL Exception Direct TX Out
+* Only Support L1 .tmd File
+*   L1 tmd force print L1 EX trace
+*   L1 tmd force print L2 EX trace
+* Only Support Single Version
+*********************************************/
+//For EX L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_EX_FORCE_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+#define TRC_END_FILTER_CHECK_L1_EX_FORCE_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_PREPROCESS_DATA_SECTION2_L1_EX_FORCE_L1(cgen_local_var, var)
+
+//fill data interval
+#define TRC_START_FILL_L1_EX_FORCE_L1() \
+    if(INT_QueryExceptionStatus()) {
+
+#define TRC_END_FILL_L1_EX_FORCE_L1() \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_32_FIRST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var) \
+    if(INT_QueryExceptionStatus()) {\
+        kal_uint8 buffer[TRC_BUFFER_SIZE];\
+        kal_uint32 trace_len =0 ;\
+        UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L1_LOG );\
+        trace_len = UlspEncoderGetCurrentPacketSize();\
+        dhl_ulsp_mcu_write_ex( buffer, trace_len);\
+        UlspEncodeIdleSync(buffer,256,ULSP_ENC_L1_LOG );\
+        trace_len = UlspEncoderGetCurrentPacketSize();\
+        dhl_ulsp_mcu_write_ex( buffer, trace_len);\
+        *((kal_uint32*) buffer) = (kal_uint32)var;\
+        dhl_ulsp_mcu_packet_and_write_ex(ULSP_PB_L1_LOG_BASE_SOURCEID, buffer, 4);\
+    }
+    
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var) 
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var) \
+    if(INT_QueryExceptionStatus()) {\
+        kal_uint8 buffer[TRC_BUFFER_SIZE];\
+        kal_uint32 trace_len =0 ;\
+        UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L1_LOG );\
+        trace_len = UlspEncoderGetCurrentPacketSize();\
+        dhl_ulsp_mcu_write_ex( buffer, trace_len);\
+        UlspEncodeIdleSync(buffer,256,ULSP_ENC_L1_LOG );\
+        trace_len = UlspEncoderGetCurrentPacketSize();\
+        dhl_ulsp_mcu_write_ex( buffer, trace_len);\
+        *((kal_uint16*) buffer) = (kal_uint16)var;\
+        dhl_ulsp_mcu_packet_and_write_ex(ULSP_PB_L1_LOG_BASE_SOURCEID, buffer, 2);\
+    }
+    
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+
+//For EX L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_EX_FORCE_L2( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+#define TRC_END_FILTER_CHECK_L1_EX_FORCE_L2( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_PREPROCESS_DATA_SECTION2_L1_EX_FORCE_L2(cgen_local_var, var)
+
+//fill data interval
+#define TRC_START_FILL_L1_EX_FORCE_L2() \
+    if(INT_QueryExceptionStatus()) {
+
+#define TRC_END_FILL_L1_EX_FORCE_L2() \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_32_FIRST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var) \
+    if(INT_QueryExceptionStatus()) {\
+        kal_uint8 buffer[TRC_BUFFER_SIZE];\
+        kal_uint32 trace_len =0 ;\
+        UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L2_LOG );\
+        trace_len = UlspEncoderGetCurrentPacketSize();\
+        dhl_ulsp_mcu_write_ex( buffer, trace_len);\
+        UlspEncodeIdleSync(buffer,256,ULSP_ENC_L2_LOG );\
+        trace_len = UlspEncoderGetCurrentPacketSize();\
+        dhl_ulsp_mcu_write_ex( buffer, trace_len);\
+        *((kal_uint32*) buffer) = (kal_uint32)var;\
+        dhl_ulsp_mcu_packet_and_write_ex(ULSP_PB_L2_LOG_BASE_SOURCEID, buffer, 4);\
+    }
+    
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var) \
+    if(INT_QueryExceptionStatus()) {\
+        kal_uint8 buffer[TRC_BUFFER_SIZE];\
+        kal_uint32 trace_len =0 ;\
+        UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L2_LOG );\
+        trace_len = UlspEncoderGetCurrentPacketSize();\
+        dhl_ulsp_mcu_write_ex( buffer, trace_len);\
+        UlspEncodeIdleSync(buffer,256,ULSP_ENC_L2_LOG );\
+        trace_len = UlspEncoderGetCurrentPacketSize();\
+        dhl_ulsp_mcu_write_ex( buffer, trace_len);\
+        *((kal_uint16*) buffer) = (kal_uint16)var;\
+        dhl_ulsp_mcu_packet_and_write_ex(ULSP_PB_L2_LOG_BASE_SOURCEID, buffer, 2);\
+    }
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var) 
+
+/********************************************
+* 6297 ON_DEMAND Special User Version
+* This will use local variable to catch user parameter
+* and use DI/EI to protect trace
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_ON_DEMAND( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    if((FILTER_ARRAY[FILTER_ARRAY_INDEX] & FILTER_CLASS) != 0) { 
+
+#define TRC_END_FILTER_CHECK_L1_ON_DEMAND( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    }
+    
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_ON_DEMAND(cgen_local_var, var) kal_uint32 cgen_local_var = (kal_uint32)(var);
+#define TRC_PREPROCESS_DATA_SECTION2_L1_ON_DEMAND(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L1_ON_DEMAND()  {\
+        kal_uint32 oldmask=0; \
+        kal_uint32 pb_data_reg_base_addr; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        if(dhl_ulsp_l1_on_demand_force_stream){ \
+            pb_data_reg_base_addr = ULSP_PB0_NORMAL_DATA_REG_ADDR; \
+        }else{ \
+            pb_data_reg_base_addr = ULSP_PB0_ONDEMAND_DATA_REG_ADDR; \
+        }\
+        if(!dhl_od_l1l2_lock_input || pb_data_reg_base_addr == ULSP_PB0_NORMAL_DATA_REG_ADDR){
+
+#define TRC_END_FILL_L1_ON_DEMAND()  \
+        }else{\
+            dhl_od_l1l2_drop_cnt++;\
+        }\
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_16_FIRST_WRAPPER_L1
+#define TRC_OUTPUT_32_FIRST_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_32_FIRST_WRAPPER_L1
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_32_MID_WRAPPER_L1
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_24_MID_WRAPPER_L1
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_16_MID_WRAPPER_L1
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_8_MID_WRAPPER_L1
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_32_LAST_WRAPPER_L1
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_24_LAST_WRAPPER_L1
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_16_LAST_WRAPPER_L1
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_8_LAST_WRAPPER_L1
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_32_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_24_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_16_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_8_SINGLE_WRAPPER_L1
+
+//For L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2_ON_DEMAND( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    if((FILTER_ARRAY[FILTER_ARRAY_INDEX] & FILTER_CLASS) != 0) { 
+
+#define TRC_END_FILTER_CHECK_L2_ON_DEMAND( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    }
+    
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2_ON_DEMAND(cgen_local_var, var) kal_uint32 cgen_local_var = (kal_uint32)(var);
+#define TRC_PREPROCESS_DATA_SECTION2_L2_ON_DEMAND(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L2_ON_DEMAND()  {\
+        kal_uint32 oldmask=0; \
+        kal_uint32 pb_data_reg_base_addr; \
+        DHL_LOCK_CPU_INTERRUPT(oldmask); \
+        if(dhl_ulsp_l1_on_demand_force_stream){ \
+            pb_data_reg_base_addr = ULSP_PB1_NORMAL_DATA_REG_ADDR; \
+        }else{ \
+            pb_data_reg_base_addr = ULSP_PB1_ONDEMAND_DATA_REG_ADDR; \
+        }\
+        if(!dhl_od_l1l2_lock_input || pb_data_reg_base_addr == ULSP_PB1_NORMAL_DATA_REG_ADDR){
+
+#define TRC_END_FILL_L2_ON_DEMAND()  \
+        }else{\
+            dhl_od_l1l2_drop_cnt++;\
+        }\
+        DHL_UNLOCK_CPU_INTERRUPT(oldmask); \
+    }
+
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_16_FIRST_WRAPPER_L2
+#define TRC_OUTPUT_32_FIRST_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_32_FIRST_WRAPPER_L2
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_32_MID_WRAPPER_L2
+#define TRC_OUTPUT_24_MID_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_24_MID_WRAPPER_L2
+#define TRC_OUTPUT_16_MID_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_16_MID_WRAPPER_L2
+#define TRC_OUTPUT_8_MID_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_8_MID_WRAPPER_L2
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_32_LAST_WRAPPER_L2
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_24_LAST_WRAPPER_L2
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_16_LAST_WRAPPER_L2
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_8_LAST_WRAPPER_L2
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_32_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_24_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_16_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_8_SINGLE_WRAPPER_L2
+
+/********************************************
+* Only for 6297 Non-SMP ON_DEMAND Special User Version
+* This will  "NOT" use local variable to catch user parameter
+* and use SMP check fail let user assert to protect trace
+********************************************/
+//For L1 Non SMP trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_NON_SMP_ON_DEMAND TRC_START_FILTER_CHECK_L1_ON_DEMAND
+#define TRC_END_FILTER_CHECK_L1_NON_SMP_ON_DEMAND TRC_END_FILTER_CHECK_L1_ON_DEMAND
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) 
+#define TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP_ON_DEMAND(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L1_NON_SMP_ON_DEMAND( ) \
+    l1_trc_assure_lisr(); \
+    { \
+        kal_uint32 pb_data_reg_base_addr; \
+        if(dhl_ulsp_l1_on_demand_force_stream){ \
+            pb_data_reg_base_addr = ULSP_PB0_NORMAL_DATA_REG_ADDR; \
+        }else{ \
+            pb_data_reg_base_addr = ULSP_PB0_ONDEMAND_DATA_REG_ADDR; \
+        }\
+        if(!dhl_od_l1l2_lock_input || pb_data_reg_base_addr == ULSP_PB0_NORMAL_DATA_REG_ADDR){
+
+#define TRC_END_FILL_L1_NON_SMP_ON_DEMAND( ) \
+        }else{\
+            dhl_od_l1l2_drop_cnt++;\
+        }\
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_16_FIRST_WRAPPER_L1_NON_SMP
+#define TRC_OUTPUT_32_FIRST_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_32_FIRST_WRAPPER_L1_NON_SMP
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_32_MID_WRAPPER_L1_NON_SMP
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_24_MID_WRAPPER_L1_NON_SMP
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_16_MID_WRAPPER_L1_NON_SMP
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_8_MID_WRAPPER_L1_NON_SMP
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_32_LAST_WRAPPER_L1_NON_SMP
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_24_LAST_WRAPPER_L1_NON_SMP
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_16_LAST_WRAPPER_L1_NON_SMP
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_8_LAST_WRAPPER_L1_NON_SMP
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_32_SINGLE_WRAPPER_L1_NON_SMP
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_24_SINGLE_WRAPPER_L1_NON_SMP
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_16_SINGLE_WRAPPER_L1_NON_SMP
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_8_SINGLE_WRAPPER_L1_NON_SMP
+
+//For L2 Non SMP trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2_NON_SMP_ON_DEMAND TRC_START_FILTER_CHECK_L2_ON_DEMAND
+#define TRC_END_FILTER_CHECK_L2_NON_SMP_ON_DEMAND TRC_END_FILTER_CHECK_L2_ON_DEMAND
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) 
+#define TRC_PREPROCESS_DATA_SECTION2_L2_NON_SMP_ON_DEMAND(cgen_local_var, var) 
+
+//fill data interval
+#define TRC_START_FILL_L2_NON_SMP_ON_DEMAND( ) \
+    l1_trc_assure_lisr(); \
+    { \
+        kal_uint32 pb_data_reg_base_addr; \
+        if(dhl_ulsp_l1_on_demand_force_stream){ \
+            pb_data_reg_base_addr = ULSP_PB1_NORMAL_DATA_REG_ADDR; \
+        }else{ \
+            pb_data_reg_base_addr = ULSP_PB1_ONDEMAND_DATA_REG_ADDR; \
+        }\
+        if(!dhl_od_l1l2_lock_input || pb_data_reg_base_addr == ULSP_PB1_NORMAL_DATA_REG_ADDR){
+
+#define TRC_END_FILL_L2_NON_SMP_ON_DEMAND( ) \
+        }else{\
+            dhl_od_l1l2_drop_cnt++;\
+        }\
+    }
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_16_FIRST_WRAPPER_L2_NON_SMP
+#define TRC_OUTPUT_32_FIRST_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_32_FIRST_WRAPPER_L2_NON_SMP
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_32_MID_WRAPPER_L2_NON_SMP
+#define TRC_OUTPUT_24_MID_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_24_MID_WRAPPER_L2_NON_SMP
+#define TRC_OUTPUT_16_MID_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_16_MID_WRAPPER_L2_NON_SMP
+#define TRC_OUTPUT_8_MID_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_8_MID_WRAPPER_L2_NON_SMP
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_32_LAST_WRAPPER_L2_NON_SMP
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_24_LAST_WRAPPER_L2_NON_SMP
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_16_LAST_WRAPPER_L2_NON_SMP
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_8_LAST_WRAPPER_L2_NON_SMP
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_32_SINGLE_WRAPPER_L2_NON_SMP
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_24_SINGLE_WRAPPER_L2_NON_SMP
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_16_SINGLE_WRAPPER_L2_NON_SMP
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_8_SINGLE_WRAPPER_L2_NON_SMP
+
+
+/********************************************
+*(Hack Code)Only for 6293 "DHL" L2 Time
+*Only Support L1 .tmd File
+*   L1 tmd force print L2 trace
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_ON_DEMAND_FORCE_L2 TRC_START_FILTER_CHECK_L2_ON_DEMAND
+#define TRC_END_FILTER_CHECK_L1_ON_DEMAND_FORCE_L2 TRC_END_FILTER_CHECK_L2_ON_DEMAND
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_ON_DEMAND_FORCE_L2 TRC_PREPROCESS_DATA_SECTION1_L2_ON_DEMAND
+#define TRC_PREPROCESS_DATA_SECTION2_L1_ON_DEMAND_FORCE_L2 TRC_PREPROCESS_DATA_SECTION2_L2_ON_DEMAND
+
+//fill data interval
+#define TRC_START_FILL_L1_ON_DEMAND_FORCE_L2 TRC_START_FILL_L2_ON_DEMAND
+#define TRC_END_FILL_L1_ON_DEMAND_FORCE_L2 TRC_END_FILL_L2_ON_DEMAND
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_ON_DEMAND_FORCE_L2 TRC_OUTPUT_16_FIRST_WRAPPER_L2_ON_DEMAND
+#define TRC_OUTPUT_32_FIRST_WRAPPER_L1_ON_DEMAND_FORCE_L2 TRC_OUTPUT_32_FIRST_WRAPPER_L2_ON_DEMAND
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_ON_DEMAND_FORCE_L2 TRC_OUTPUT_32_MID_WRAPPER_L2_ON_DEMAND
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_ON_DEMAND_FORCE_L2 TRC_OUTPUT_24_MID_WRAPPER_L2_ON_DEMAND
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_ON_DEMAND_FORCE_L2 TRC_OUTPUT_16_MID_WRAPPER_L2_ON_DEMAND
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_ON_DEMAND_FORCE_L2 TRC_OUTPUT_8_MID_WRAPPER_L2_ON_DEMAND
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_ON_DEMAND_FORCE_L2 TRC_OUTPUT_32_LAST_WRAPPER_L2_ON_DEMAND
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_ON_DEMAND_FORCE_L2 TRC_OUTPUT_24_LAST_WRAPPER_L2_ON_DEMAND
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_ON_DEMAND_FORCE_L2 TRC_OUTPUT_16_LAST_WRAPPER_L2_ON_DEMAND
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_ON_DEMAND_FORCE_L2 TRC_OUTPUT_8_LAST_WRAPPER_L2_ON_DEMAND
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_ON_DEMAND_FORCE_L2 TRC_OUTPUT_32_SINGLE_WRAPPER_L2_ON_DEMAND
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_ON_DEMAND_FORCE_L2 TRC_OUTPUT_24_SINGLE_WRAPPER_L2_ON_DEMAND
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_ON_DEMAND_FORCE_L2 TRC_OUTPUT_16_SINGLE_WRAPPER_L2_ON_DEMAND
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_ON_DEMAND_FORCE_L2 TRC_OUTPUT_8_SINGLE_WRAPPER_L2_ON_DEMAND
+
+#endif
diff --git a/mcu/interface/service/dhl/v2/dhl_ulsp_l1_trace_utmd.json b/mcu/interface/service/dhl/v2/dhl_ulsp_l1_trace_utmd.json
new file mode 100755
index 0000000..de29d15
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dhl_ulsp_l1_trace_utmd.json
@@ -0,0 +1,179 @@
+{
+  "legacyParameters": {
+    "modemType": "dhl"
+  }, 
+  "module": "DHL_ULSP_L1", 
+  "stringTranslationDefs": [], 
+  "traceClassDefs": [
+    {
+      "ON_DEMAND_INFO": {
+        "_comment": "filterDefaulValue is used in xl1sim, will be phased out later", 
+        "debugLevel": "Ultra-Low", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "CoreDesign"
+      }
+    }, 
+    {
+      "L1_ULSP_DEBUG": {
+        "_comment": "filterDefaulValue is used in xl1sim, will be phased out later", 
+        "debugLevel": "Ultra-Low", 
+        "filterDefaultValue": "OFF", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "CoreDesign"
+      }
+    }, 
+    {
+      "ULSP_L1_TEST_LOG": {
+        "_comment": "filterDefaulValue is used in xl1sim, will be phased out later", 
+        "debugLevel": "Ultra-Low", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "CoreDesign"
+      }
+    }, 
+    {
+      "ULSP_L2_TEST_LOG": {
+        "_comment": "filterDefaulValue is used in xl1sim, will be phased out later", 
+        "debugLevel": "Ultra-Low", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "CoreDesign"
+      }
+    }
+  ], 
+  "traceDefs": [
+    {
+      "ULSP_OD_DUMP_BOUNDARY_TRC": {
+        "format": "[ULSP][OD] ======== DUMP_BOUNDARY ========", 
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "warn"
+      }
+    }, 
+    {
+      "ULSP_TEST_LOG_OD_L1_1": {
+        "format": "[ULSP][OD] L1 TEST_LOG: %l", 
+        "traceClass": "ULSP_L1_TEST_LOG", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_TEST_LOG_OD_L2_1": {
+        "dhlReserved": "force_l2", 
+        "format": "[ULSP][OD] L2 TEST_LOG: %l", 
+        "traceClass": "ULSP_L2_TEST_LOG", 
+        "traceDataPath": "on_demand", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_RECORD_OPER_TRC": {
+        "format": "[ULSP][OD][RECORD] Ondemand Record channel: %Mon_demand_channel, Record time: %ul, emi_write_align_addr:%xl", 
+        "traceClass": "L1_ULSP_DEBUG", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_RECORD_INFO_TRC": {
+        "format": "[ULSP][OD][RECORD] read_idx: %ud, write_idx: %ud, expired_idx:%ud, marking_dump_count:%l", 
+        "traceClass": "L1_ULSP_DEBUG", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_RECORD_DATA_TRC": {
+        "format": "[ULSP][OD][RECORD] flag: %xl, dump_scenario: %Mdhl_on_demand_dump_scenario, current_TS:%ul, write_align_addr:%xl", 
+        "traceClass": "L1_ULSP_DEBUG", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_DUMP_CHK_ADDR_TRC": {
+        "format": "[ULSP][OD][CHECK] Start_addr: %xl, End addr: %xl", 
+        "traceClass": "L1_ULSP_DEBUG", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_DUMP_CHK_ERROR_TRC": {
+        "format": "[ULSP][OD][CHECK] ERROR: Dump channel %Mon_demand_channel, Dump record tbl from %d to %d, EMI_addr: %xl, Expected num: %ul, Get num: %ul", 
+        "traceClass": "L1_ULSP_DEBUG", 
+        "traceHighlightOption": "error"
+      }
+    }, 
+    {
+      "ULSP_OD_DUMP_CHK_PTR": {
+        "format": "[ULSP][OD][CHECK] CUR_PTR: %xl, PKT_LEN: %l", 
+        "traceClass": "L1_ULSP_DEBUG", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_DUMP_CHK_SUCCESS_TRC": {
+        "format": "[ULSP][OD][CHECK] Check success record tbl from %d to %d", 
+        "traceClass": "L1_ULSP_DEBUG", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_SEND_IDLE_SYNC": {
+        "format": "[ULSP][OD] Send Idle SYNC", 
+        "traceClass": "L1_ULSP_DEBUG", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_DUMP_HUB_TBL_IDX_TRC": {
+        "format": "[ULSP][OD][HUB] Dump channel: %Mon_demand_channel, Dump record tbl from %d to %d, mux_id=%l", 
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_DUMP_API_TRC": {
+        "format": "[ULSP][OD][API] Dump channel: %Mon_demand_channel, Ondemand dump senerial: %Mdhl_on_demand_dump_scenario, Dump result: %Mdhl_on_demand_error_code, Dump period: %ul, Timestamp from %ul to %ul, EMI from %xl to %xl, Dump caller addr: %xl", 
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_DUMP_API_WARN_TRC": {
+        "format": "[ULSP][OD][API][Nothing Dumped] Dump channel: %Mon_demand_channel, Ondemand dump senerial: %Mdhl_on_demand_dump_scenario, Dump result: %Mdhl_on_demand_error_code, Dump period: %ul, Dump caller addr: %xl", 
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_DUMP_API_TBL_IDX_TRC": {
+        "format": "[ULSP][OD][API] Dump channel: %Mon_demand_channel, Dump record tbl from %d to %d, marking_dump_count: %l", 
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_DUMP_DONE_TRC": {
+        "format": "[ULSP][OD][Write_Done] Dump channel %Mon_demand_channel, start emi: %xl, end_emi: %xl, start_idx: %ud, end_idx: %ud", 
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "ULSP_OD_RECORD_TBL_FULL_TRC": {
+        "format": "[ULSP][OD][GPT] Record table is full: %Mdhl_ulsp_block_type", 
+        "traceClass": "ON_DEMAND_INFO", 
+        "traceHighlightOption": "warn"
+      }
+    }
+  ], 
+  "traceFamily": "L1"
+}
\ No newline at end of file
diff --git a/mcu/interface/service/dhl/v2/dhl_ulsp_swsim_interface.h b/mcu/interface/service/dhl/v2/dhl_ulsp_swsim_interface.h
new file mode 100644
index 0000000..e619619
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dhl_ulsp_swsim_interface.h
@@ -0,0 +1,713 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file dhl_ulsp_swsim_interface.h
+ *
+ * Description:
+ * ------------
+ *   @brief Interface of ULSP MCU SW simulator.
+ *   @note  This file will be include bu l1trc.h, please do not include this file directly.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 12 09 2019 yen-hsuan.lin
+ * [MOLY00327199] [Gen97] Development
+ * [MOLY00464641] Fix the dhl low power problem
+ * 	
+ * 	merger the Gen98 Fix into VMOLY trunk
+ *
+ * 04 16 2019 guan-ren.chen
+ * [MOLY00399588] [Gen97] Dormant flow
+ * Dormant flow. Struct access ULSP reg.
+ *
+ * 08 30 2018 yu-hsiang.peng
+ * [MOLY00347960] [MT6297] DHL Feature Enhance
+ * [Exception] Support L1 L2 redump info in MODIS & Target
+ *
+ ****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   dhl_ulsp_swsim_interface.h
+ *
+ * Project:
+ * --------
+ *   UMOLYA
+ *
+ * Description:
+ * ------------
+ *   This file will be include bu l1trc.h
+ *   The interface for HW ULSP(Real Target SW logging version)
+ *   Cannot include this file directly
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 12 09 2019 yen-hsuan.lin
+ * [MOLY00327199] [Gen97] Development
+ * [MOLY00464641] Fix the dhl low power problem
+ * 	
+ * 	merger the Gen98 Fix into VMOLY trunk
+ *
+ * 04 16 2019 guan-ren.chen
+ * [MOLY00399588] [Gen97] Dormant flow
+ * Dormant flow. Struct access ULSP reg.
+ *
+ * 08 30 2018 yu-hsiang.peng
+ * [MOLY00347960] [MT6297] DHL Feature Enhance
+ * [Exception] Support L1 L2 redump info in MODIS & Target
+ *
+ * 07 13 2018 yancy.chien
+ * [L1/L2] Function implementation.
+ * OA can build pass, but it's SWSIM version.
+ *
+ * 06 26 2018 kuo-wei.hung
+ * xL1SIM implementation - PS/L1 can decode on ELT.
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_ULSP_SWSIM_INTERFACE_H
+#define _DHL_ULSP_SWSIM_INTERFACE_H
+#include "ulsp_mcu_logging.h"
+
+#if defined(L1_SIM)
+extern kal_bool l1_trc_assure_lisr(const char *func, const char *file, int line);
+#else
+extern kal_bool l1_trc_assure_lisr();
+#endif
+
+#define ULSP_HEADER_SIZE (4)
+#define L1_TRACE_MAX_SIZE (32*4) //Max: Argnumber * 4 bytes/each
+#define TRC_BUFFER_SIZE (ULSP_HEADER_SIZE + L1_TRACE_MAX_SIZE)
+
+extern kal_bool ulsp_swsim_after_init;
+
+void dhl_src_ulsp_swsim_mcu_packet_and_write(kal_uint32 source_id, kal_uint8 *buffaddr, kal_uint32 length);
+void dhl_src_ulsp_swsim_mcu_packet_and_write_ex(kal_uint32 source_id, kal_uint8 *buffaddr, kal_uint32 length);
+void dhl_src_ulsp_swsim_mcu_write_ex(kal_uint8 *buffaddr, kal_uint32 length); 
+
+/********************************************
+* ULSP Macro for SWSIM
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    if( (FILTER_ARRAY[FILTER_ARRAY_INDEX] & FILTER_CLASS) != 0 ) { 
+
+#define TRC_END_FILTER_CHECK_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS) \
+    }
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1(cgen_local_var, var) 
+// Must put here otherwise VC will build error!!
+#define TRC_PREPROCESS_DATA_SECTION2_L1(cgen_local_var, var) kal_uint32 cgen_local_var = (kal_uint32)(var)
+
+//fill data interval
+#define TRC_START_FILL_L1()  { \
+        kal_uint8 buffer[TRC_BUFFER_SIZE]; \
+        kal_uint8 trace_len = 0
+/*n*/
+
+#define TRC_END_FILL_L1() \
+    dhl_src_ulsp_swsim_mcu_packet_and_write(ULSP_PB_L1_LOG_BASE_SOURCEID, buffer, trace_len); }
+
+//Implement layer
+//First
+#define TRC_OUTPUT_16_FIRST_L1(value) \
+    *( (kal_uint16*) &buffer[trace_len] ) = (kal_uint16) value; \
+    trace_len += 2;
+
+#define TRC_OUTPUT_32_FIRST_L1(value) \
+    *( (kal_uint32*) &buffer[trace_len] ) = (kal_uint32) value; \
+    trace_len += 4;
+
+//Middle
+#define TRC_OUTPUT_32_MID_L1(value) \
+    *( (kal_uint32*) &buffer[trace_len]) = (kal_uint32) value; \
+    trace_len += 4;
+#define TRC_OUTPUT_24_MID_L1(value) \
+    *(   (kal_uint16*) &buffer[trace_len]) = (kal_uint16) ((value) & 0x00FFFF); \
+    trace_len += 2; \
+    *(   (kal_uint8*) &buffer[trace_len]) = (kal_uint8) (((value) & 0x00FF0000) >> 16); \
+    trace_len += 1;
+#define TRC_OUTPUT_16_MID_L1(value) \
+    *( (kal_uint16*) &buffer[trace_len]) =(kal_uint16) value; \
+    trace_len += 2;
+#define TRC_OUTPUT_8_MID_L1(value) \
+    *( (kal_uint8*) &buffer[trace_len]) = (kal_uint8) value; \
+    trace_len += 1;
+
+//Last
+#define TRC_OUTPUT_32_LAST_L1(value) \
+    *( (kal_uint32*) &buffer[trace_len]) = (kal_uint32) value; \
+    trace_len += 4;
+#define TRC_OUTPUT_24_LAST_L1(value) \
+    *(   (kal_uint16*) &buffer[trace_len]) = (kal_uint16) ((value) & 0x00FFFF); \
+    trace_len += 2; \
+    *(   (kal_uint8*) &buffer[trace_len]) = (kal_uint8) (((value) & 0x00FF0000) >> 16); \
+    trace_len += 1;
+#define TRC_OUTPUT_16_LAST_L1(value) \
+    *( (kal_uint16*) &buffer[trace_len]) = (kal_uint16) value; \
+    trace_len += 2;
+#define TRC_OUTPUT_8_LAST_L1(value) \
+    *( (kal_uint8*) &buffer[trace_len]) = (kal_uint8) value; \
+    trace_len += 1;
+
+//Single
+#define TRC_OUTPUT_32_SINGLE_L1(value) \
+    *( (kal_uint32*) &buffer[trace_len]) = (kal_uint32) value; \
+    trace_len += 4;
+#define TRC_OUTPUT_24_SINGLE_L1(value) \
+    *(   (kal_uint16*) &buffer[trace_len]) = (kal_uint16) ((value) & 0x00FFFF); \
+    trace_len += 2; \
+    *(   (kal_uint8*) &buffer[trace_len]) = (kal_uint8) (((value) & 0x00FF0000) >> 16); \
+    trace_len += 1;
+#define TRC_OUTPUT_16_SINGLE_L1(value) \
+    *( (kal_uint16*) &buffer[trace_len]) = (kal_uint16) value; \
+    trace_len += 2;
+#define TRC_OUTPUT_8_SINGLE_L1(value) \
+    *(  (kal_uint8*) &buffer[trace_len]) = (kal_uint8) value; \
+    trace_len += 1;
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L1(cgen_local_var)
+#define TRC_OUTPUT_32_FIRST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_32_FIRST_L1(cgen_local_var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_32_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_24_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_16_MID_L1(cgen_local_var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_8_MID_L1(cgen_local_var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_32_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_24_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_16_LAST_L1(cgen_local_var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_8_LAST_L1(cgen_local_var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L1(cgen_local_var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L1(cgen_local_var)
+
+//For L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2 TRC_START_FILTER_CHECK_L1
+#define TRC_END_FILTER_CHECK_L2 TRC_END_FILTER_CHECK_L1
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2 TRC_PREPROCESS_DATA_SECTION1_L1
+#define TRC_PREPROCESS_DATA_SECTION2_L2 TRC_PREPROCESS_DATA_SECTION2_L1
+
+//fill data interval
+#define TRC_START_FILL_L2(){ \
+        kal_uint8 buffer[TRC_BUFFER_SIZE]; \
+        kal_uint8 trace_len = 0
+/*n*/
+
+#define TRC_END_FILL_L2() \
+        dhl_src_ulsp_swsim_mcu_packet_and_write(ULSP_PB_L2_LOG_BASE_SOURCEID, buffer, trace_len); }
+
+
+//Implement layer
+//First
+#define TRC_OUTPUT_16_FIRST_L2(value) \
+    *( (kal_uint16*) &buffer[trace_len]) = (kal_uint16) value; \
+    trace_len += 2;
+
+#define TRC_OUTPUT_32_FIRST_L2(value) \
+    *( (kal_uint32*) &buffer[trace_len]) = (kal_uint32) value; \
+    trace_len += 4;
+
+//Middle
+#define TRC_OUTPUT_32_MID_L2(value) \
+    *( (kal_uint32*) &buffer[trace_len] )= (kal_uint32) value; \
+    trace_len += 4;
+#define TRC_OUTPUT_24_MID_L2(value) \
+    *(   (kal_uint16*) &buffer[trace_len]) = (kal_uint16) ((value) & 0x00FFFF); \
+    trace_len += 2; \
+    *(   (kal_uint8*) &buffer[trace_len]) = (kal_uint8) (((value) & 0x00FF0000) >> 16); \
+    trace_len += 1;
+#define TRC_OUTPUT_16_MID_L2(value) \
+    *(  (kal_uint16*) &buffer[trace_len]) = (kal_uint16) value; \
+    trace_len += 2;
+#define TRC_OUTPUT_8_MID_L2(value) \
+    *(   (kal_uint8*) &buffer[trace_len]) = (kal_uint8) value; \
+    trace_len += 1;
+
+//Last
+#define TRC_OUTPUT_32_LAST_L2(value) \
+    *(  (kal_uint32*) &buffer[trace_len]) = (kal_uint32) value; \
+    trace_len += 4;
+#define TRC_OUTPUT_24_LAST_L2(value) \
+    *(   (kal_uint16*) &buffer[trace_len]) = (kal_uint16) ((value) & 0x00FFFF); \
+    trace_len += 2; \
+    *(   (kal_uint8*) &buffer[trace_len]) = (kal_uint8) (((value) & 0x00FF0000) >> 16); \
+    trace_len += 1;
+#define TRC_OUTPUT_16_LAST_L2(value) \
+    *(   (kal_uint16*) &buffer[trace_len]) = (kal_uint16) value; \
+    trace_len += 2;
+#define TRC_OUTPUT_8_LAST_L2(value)  \
+    *(  (kal_uint8*) &buffer[trace_len]) = (kal_uint8) value; \
+    trace_len += 1;
+
+//Single
+#define TRC_OUTPUT_32_SINGLE_L2(value) \
+    *(   (kal_uint32*) &buffer[trace_len]) = (kal_uint32) value; \
+    trace_len += 4;
+#define TRC_OUTPUT_24_SINGLE_L2(value) \
+    *(   (kal_uint16*) &buffer[trace_len]) = (kal_uint16) ((value) & 0x00FFFF); \
+    trace_len += 2; \
+    *(   (kal_uint8*) &buffer[trace_len]) = (kal_uint8) (((value) & 0x00FF0000) >> 16); \
+    trace_len += 1;
+#define TRC_OUTPUT_16_SINGLE_L2(value) \
+    *(   (kal_uint16*) &buffer[trace_len]) = (kal_uint16) value; \
+    trace_len += 2;
+
+#define TRC_OUTPUT_8_SINGLE_L2(value)  \
+    *(  (kal_uint8*) &buffer[trace_len]) = (kal_uint8) value; \
+    trace_len += 1;
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_16_FIRST_L2(cgen_local_var)
+#define TRC_OUTPUT_32_FIRST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_32_FIRST_L2(cgen_local_var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_32_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_24_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_16_MID_L2(cgen_local_var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_8_MID_L2(cgen_local_var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_32_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_24_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_16_LAST_L2(cgen_local_var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_8_LAST_L2(cgen_local_var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_32_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_24_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_16_SINGLE_L2(cgen_local_var)
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2(cgen_local_var, var) TRC_OUTPUT_8_SINGLE_L2(cgen_local_var)
+
+/********************************************
+* Only for 6293 Non-SMP Special User Version
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_NON_SMP TRC_START_FILTER_CHECK_L1
+#define TRC_END_FILTER_CHECK_L1_NON_SMP TRC_END_FILTER_CHECK_L1
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP TRC_PREPROCESS_DATA_SECTION1_L1
+#define TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP TRC_PREPROCESS_DATA_SECTION2_L1
+
+//fill data interval
+#if defined(L1_SIM)
+#define TRC_START_FILL_L1_NON_SMP( ) \
+    if(l1_trc_assure_lisr(__FUNCTION__, __FILE__, __LINE__)){ \
+        TRC_START_FILL_L1()
+
+#define TRC_END_FILL_L1_NON_SMP( ) \
+    TRC_END_FILL_L1(); \
+    }
+#else
+
+#define TRC_START_FILL_L1_NON_SMP TRC_START_FILL_L1
+#define TRC_END_FILL_L1_NON_SMP TRC_END_FILL_L1
+
+#endif
+
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_NON_SMP TRC_OUTPUT_16_FIRST_WRAPPER_L1
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_NON_SMP TRC_OUTPUT_32_MID_WRAPPER_L1
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_NON_SMP TRC_OUTPUT_24_MID_WRAPPER_L1
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_NON_SMP TRC_OUTPUT_16_MID_WRAPPER_L1
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_NON_SMP TRC_OUTPUT_8_MID_WRAPPER_L1
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_NON_SMP TRC_OUTPUT_32_LAST_WRAPPER_L1
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_NON_SMP TRC_OUTPUT_24_LAST_WRAPPER_L1
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_NON_SMP TRC_OUTPUT_16_LAST_WRAPPER_L1
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_NON_SMP TRC_OUTPUT_8_LAST_WRAPPER_L1
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_NON_SMP TRC_OUTPUT_32_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_NON_SMP TRC_OUTPUT_24_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_NON_SMP TRC_OUTPUT_16_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_NON_SMP TRC_OUTPUT_8_SINGLE_WRAPPER_L1
+
+//For L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2_NON_SMP TRC_START_FILTER_CHECK_L2
+#define TRC_END_FILTER_CHECK_L2_NON_SMP TRC_END_FILTER_CHECK_L2
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2_NON_SMP TRC_PREPROCESS_DATA_SECTION1_L2
+#define TRC_PREPROCESS_DATA_SECTION2_L2_NON_SMP TRC_PREPROCESS_DATA_SECTION2_L2
+
+//fill data interval
+#if defined(L1_SIM)
+
+#define TRC_START_FILL_L2_NON_SMP() TRC_START_FILL_L1_NON_SMP()
+#define TRC_END_FILL_L2_NON_SMP()   TRC_END_FILL_L1_NON_SMP()
+#else
+
+#define TRC_START_FILL_L2_NON_SMP TRC_START_FILL_L2
+#define TRC_END_FILL_L2_NON_SMP TRC_END_FILL_L2
+#endif
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2_NON_SMP TRC_OUTPUT_16_FIRST_WRAPPER_L2
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2_NON_SMP TRC_OUTPUT_32_MID_WRAPPER_L2
+#define TRC_OUTPUT_24_MID_WRAPPER_L2_NON_SMP TRC_OUTPUT_24_MID_WRAPPER_L2
+#define TRC_OUTPUT_16_MID_WRAPPER_L2_NON_SMP TRC_OUTPUT_16_MID_WRAPPER_L2
+#define TRC_OUTPUT_8_MID_WRAPPER_L2_NON_SMP TRC_OUTPUT_8_MID_WRAPPER_L2
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2_NON_SMP TRC_OUTPUT_32_LAST_WRAPPER_L2
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2_NON_SMP TRC_OUTPUT_24_LAST_WRAPPER_L2
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2_NON_SMP TRC_OUTPUT_16_LAST_WRAPPER_L2
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2_NON_SMP TRC_OUTPUT_8_LAST_WRAPPER_L2
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2_NON_SMP TRC_OUTPUT_32_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2_NON_SMP TRC_OUTPUT_24_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2_NON_SMP TRC_OUTPUT_16_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2_NON_SMP TRC_OUTPUT_8_SINGLE_WRAPPER_L2
+/********************************************
+*(Hack Code)Only for 6293 "DHL" L2 Time
+*Only Support L1 .tmd File
+*   L1 tmd force print L2 trace
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_FORCE_L2 TRC_START_FILTER_CHECK_L2
+#define TRC_END_FILTER_CHECK_L1_FORCE_L2 TRC_END_FILTER_CHECK_L2
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_FORCE_L2 TRC_PREPROCESS_DATA_SECTION1_L2
+#define TRC_PREPROCESS_DATA_SECTION2_L1_FORCE_L2 TRC_PREPROCESS_DATA_SECTION2_L2
+
+//fill data interval
+#define TRC_START_FILL_L1_FORCE_L2 TRC_START_FILL_L2
+#define TRC_END_FILL_L1_FORCE_L2 TRC_END_FILL_L2
+
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_FIRST_WRAPPER_L2
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_32_MID_WRAPPER_L2
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_24_MID_WRAPPER_L2
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_MID_WRAPPER_L2
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_8_MID_WRAPPER_L2
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_32_LAST_WRAPPER_L2
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_24_LAST_WRAPPER_L2
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_LAST_WRAPPER_L2
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_8_LAST_WRAPPER_L2
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_32_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_24_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_16_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_FORCE_L2 TRC_OUTPUT_8_SINGLE_WRAPPER_L2
+
+/*********************************************
+* (Hack Code)Only for 6293 DHL Exception Direct TX Out
+* Only Support L1 .tmd File
+*   L1 tmd force print L1 EX trace
+*   L1 tmd force print L2 EX trace
+* Only Support Single Version
+*********************************************/
+//For EX L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_EX_FORCE_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+#define TRC_END_FILTER_CHECK_L1_EX_FORCE_L1( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_PREPROCESS_DATA_SECTION2_L1_EX_FORCE_L1(cgen_local_var, var)
+
+//fill data interval
+#define TRC_START_FILL_L1_EX_FORCE_L1() 
+#define TRC_END_FILL_L1_EX_FORCE_L1() 
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var) \
+    if(INT_QueryExceptionStatus()) {\
+        kal_uint8 buffer[TRC_BUFFER_SIZE];\
+        kal_uint32 trace_len =0 ;\
+        UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L1_LOG );\
+        trace_len = UlspEncoderGetCurrentPacketSize();\
+        dhl_src_ulsp_swsim_mcu_write_ex( buffer, trace_len);\
+        UlspEncodeIdleSync(buffer,256,ULSP_ENC_L1_LOG );\
+        trace_len = UlspEncoderGetCurrentPacketSize();\
+        dhl_src_ulsp_swsim_mcu_write_ex( buffer, trace_len);\
+        *((kal_uint32*) buffer) = (kal_uint32)var;\
+        dhl_src_ulsp_swsim_mcu_packet_and_write_ex(ULSP_PB_L1_LOG_BASE_SOURCEID, buffer, 4);\
+    }
+
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var) 
+
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var) \
+    if(INT_QueryExceptionStatus()) {\
+        kal_uint8 buffer[TRC_BUFFER_SIZE];\
+        kal_uint32 trace_len =0 ;\
+        UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L1_LOG );\
+        trace_len = UlspEncoderGetCurrentPacketSize();\
+        dhl_src_ulsp_swsim_mcu_write_ex( buffer, trace_len);\
+        UlspEncodeIdleSync(buffer,256,ULSP_ENC_L1_LOG );\
+        trace_len = UlspEncoderGetCurrentPacketSize();\
+        dhl_src_ulsp_swsim_mcu_write_ex( buffer, trace_len);\
+        *((kal_uint16*) buffer) = (kal_uint16)var;\
+        dhl_src_ulsp_swsim_mcu_packet_and_write_ex(ULSP_PB_L1_LOG_BASE_SOURCEID, buffer, 2);\
+    }
+
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_EX_FORCE_L1(cgen_local_var, var) 
+
+//For EX L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_EX_FORCE_L2( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+#define TRC_END_FILTER_CHECK_L1_EX_FORCE_L2( FILTER_ARRAY, FILTER_ARRAY_INDEX, FILTER_CLASS)
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_PREPROCESS_DATA_SECTION2_L1_EX_FORCE_L2(cgen_local_var, var)
+
+//fill data interval
+#define TRC_START_FILL_L1_EX_FORCE_L2()
+#define TRC_END_FILL_L1_EX_FORCE_L2() 
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var)
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var) \
+    if(INT_QueryExceptionStatus()) {\
+        kal_uint8 buffer[TRC_BUFFER_SIZE];\
+        kal_uint32 trace_len =0 ;\
+        UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L2_LOG );\
+        trace_len = UlspEncoderGetCurrentPacketSize();\
+        dhl_src_ulsp_swsim_mcu_write_ex( buffer, trace_len);\
+        UlspEncodeIdleSync(buffer,256,ULSP_ENC_L2_LOG );\
+        trace_len = UlspEncoderGetCurrentPacketSize();\
+        dhl_src_ulsp_swsim_mcu_write_ex( buffer, trace_len);\
+        *((kal_uint32*) buffer) = (kal_uint32)var;\
+        dhl_src_ulsp_swsim_mcu_packet_and_write_ex(ULSP_PB_L2_LOG_BASE_SOURCEID, buffer, 4);\
+    }
+
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var) 
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var) \
+    if(INT_QueryExceptionStatus()) {\
+        kal_uint8 buffer[TRC_BUFFER_SIZE];\
+        kal_uint32 trace_len =0 ;\
+        UlspEncodeBoundarySync(buffer,256,ULSP_ENC_L2_LOG );\
+        trace_len = UlspEncoderGetCurrentPacketSize();\
+        dhl_src_ulsp_swsim_mcu_write_ex( buffer, trace_len);\
+        UlspEncodeIdleSync(buffer,256,ULSP_ENC_L2_LOG );\
+        trace_len = UlspEncoderGetCurrentPacketSize();\
+        dhl_src_ulsp_swsim_mcu_write_ex( buffer, trace_len);\
+        *((kal_uint16*) buffer) = (kal_uint16)var;\
+        dhl_src_ulsp_swsim_mcu_packet_and_write_ex(ULSP_PB_L2_LOG_BASE_SOURCEID, buffer, 2);\
+    }
+
+
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_EX_FORCE_L2(cgen_local_var, var) 
+
+/********************************************
+* Only for 6297 ON_DEMAND Special User Version
+********************************************/
+#if (CUR_GEN >= MD_GEN97)
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_ON_DEMAND TRC_START_FILTER_CHECK_L1
+#define TRC_END_FILTER_CHECK_L1_ON_DEMAND TRC_END_FILTER_CHECK_L1
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_ON_DEMAND TRC_PREPROCESS_DATA_SECTION1_L1
+#define TRC_PREPROCESS_DATA_SECTION2_L1_ON_DEMAND TRC_PREPROCESS_DATA_SECTION2_L1
+
+//fill data interval
+#define TRC_START_FILL_L1_ON_DEMAND TRC_START_FILL_L1
+
+#define TRC_END_FILL_L1_ON_DEMAND TRC_END_FILL_L1
+
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_16_FIRST_WRAPPER_L1
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_32_MID_WRAPPER_L1
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_24_MID_WRAPPER_L1
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_16_MID_WRAPPER_L1
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_8_MID_WRAPPER_L1
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_32_LAST_WRAPPER_L1
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_24_LAST_WRAPPER_L1
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_16_LAST_WRAPPER_L1
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_8_LAST_WRAPPER_L1
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_32_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_24_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_16_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_ON_DEMAND TRC_OUTPUT_8_SINGLE_WRAPPER_L1
+
+//For L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2_ON_DEMAND TRC_START_FILTER_CHECK_L2
+#define TRC_END_FILTER_CHECK_L2_ON_DEMAND TRC_END_FILTER_CHECK_L2
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2_ON_DEMAND TRC_PREPROCESS_DATA_SECTION1_L2
+#define TRC_PREPROCESS_DATA_SECTION2_L2_ON_DEMAND TRC_PREPROCESS_DATA_SECTION2_L2 
+
+//fill data interval
+#define TRC_START_FILL_L2_ON_DEMAND TRC_START_FILL_L2
+#define TRC_END_FILL_L2_ON_DEMAND TRC_END_FILL_L2
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_16_FIRST_WRAPPER_L2
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_32_MID_WRAPPER_L2
+#define TRC_OUTPUT_24_MID_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_24_MID_WRAPPER_L2
+#define TRC_OUTPUT_16_MID_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_16_MID_WRAPPER_L2
+#define TRC_OUTPUT_8_MID_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_8_MID_WRAPPER_L2
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_32_LAST_WRAPPER_L2
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_24_LAST_WRAPPER_L2
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_16_LAST_WRAPPER_L2
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_8_LAST_WRAPPER_L2
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_32_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_24_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_16_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2_ON_DEMAND TRC_OUTPUT_8_SINGLE_WRAPPER_L2
+
+/********************************************
+* Only for 6293 Non-SMP Special User Version
+********************************************/
+//For L1 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L1_NON_SMP_ON_DEMAND TRC_START_FILTER_CHECK_L1
+#define TRC_END_FILTER_CHECK_L1_NON_SMP_ON_DEMAND TRC_END_FILTER_CHECK_L1
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L1_NON_SMP_ON_DEMAND TRC_PREPROCESS_DATA_SECTION1_L1
+#define TRC_PREPROCESS_DATA_SECTION2_L1_NON_SMP_ON_DEMAND TRC_PREPROCESS_DATA_SECTION2_L1
+
+//fill data interval
+#define TRC_START_FILL_L1_NON_SMP_ON_DEMAND TRC_START_FILL_L1
+
+#define TRC_END_FILL_L1_NON_SMP_ON_DEMAND TRC_END_FILL_L1
+
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_16_FIRST_WRAPPER_L1
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_32_MID_WRAPPER_L1
+#define TRC_OUTPUT_24_MID_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_24_MID_WRAPPER_L1
+#define TRC_OUTPUT_16_MID_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_16_MID_WRAPPER_L1
+#define TRC_OUTPUT_8_MID_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_8_MID_WRAPPER_L1
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_32_LAST_WRAPPER_L1
+#define TRC_OUTPUT_24_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_24_LAST_WRAPPER_L1
+#define TRC_OUTPUT_16_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_16_LAST_WRAPPER_L1
+#define TRC_OUTPUT_8_LAST_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_8_LAST_WRAPPER_L1
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_32_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_24_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_16_SINGLE_WRAPPER_L1
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L1_NON_SMP_ON_DEMAND TRC_OUTPUT_8_SINGLE_WRAPPER_L1
+
+//For L2 trace
+//filter check interval
+#define TRC_START_FILTER_CHECK_L2_NON_SMP_ON_DEMAND TRC_START_FILTER_CHECK_L2
+#define TRC_END_FILTER_CHECK_L2_NON_SMP_ON_DEMAND TRC_END_FILTER_CHECK_L2
+
+//pre-process user data
+#define TRC_PREPROCESS_DATA_SECTION1_L2_NON_SMP_ON_DEMAND TRC_PREPROCESS_DATA_SECTION1_L2
+#define TRC_PREPROCESS_DATA_SECTION2_L2_NON_SMP_ON_DEMAND TRC_PREPROCESS_DATA_SECTION2_L2 
+
+//fill data interval
+#define TRC_START_FILL_L2_NON_SMP_ON_DEMAND TRC_START_FILL_L2
+#define TRC_END_FILL_L2_NON_SMP_ON_DEMAND TRC_END_FILL_L2
+
+//Wrapper layer
+//First
+#define TRC_OUTPUT_16_FIRST_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_16_FIRST_WRAPPER_L2
+//Middle
+#define TRC_OUTPUT_32_MID_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_32_MID_WRAPPER_L2
+#define TRC_OUTPUT_24_MID_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_24_MID_WRAPPER_L2
+#define TRC_OUTPUT_16_MID_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_16_MID_WRAPPER_L2
+#define TRC_OUTPUT_8_MID_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_8_MID_WRAPPER_L2
+//Last
+#define TRC_OUTPUT_32_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_32_LAST_WRAPPER_L2
+#define TRC_OUTPUT_24_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_24_LAST_WRAPPER_L2
+#define TRC_OUTPUT_16_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_16_LAST_WRAPPER_L2
+#define TRC_OUTPUT_8_LAST_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_8_LAST_WRAPPER_L2
+//Single
+#define TRC_OUTPUT_32_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_32_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_24_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_24_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_16_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_16_SINGLE_WRAPPER_L2
+#define TRC_OUTPUT_8_SINGLE_WRAPPER_L2_NON_SMP_ON_DEMAND TRC_OUTPUT_8_SINGLE_WRAPPER_L2
+
+#endif //#if (CUR_GEN >= MD_GEN97)
+
+#endif
+
diff --git a/mcu/interface/service/dhl/v2/dhl_unified_trace.h b/mcu/interface/service/dhl/v2/dhl_unified_trace.h
new file mode 100644
index 0000000..5a36af5
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dhl_unified_trace.h
@@ -0,0 +1,263 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file dhl_unified_trace.h
+ *
+ * Description:
+ * ------------
+ *   @brief Gen interface of unified trace logging API.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 07 12 2019 victoria.wang
+ * [MOLY00420732] [SMO][UTF][logging service][DHL] check number of trace API argument when build
+ * [DHL] add expand define for expand trace API first than check number of argument
+ *
+ * 03 22 2019 yh.sung
+ * [MOLY00392990] [VMOLY][UTF] Phase 2 Landing
+ * 	
+ * 	empty MD_TRC macro
+ *
+ * 03 22 2019 yh.sung
+ * [MOLY00392990] [VMOLY][UTF] Phase 2 Landing
+ * empty MD_TRC() macro for basic load usage
+ *
+ * 03 22 2019 victoria.wang
+ * [MOLY00392990] [VMOLY][UTF] Phase 2 Landing
+ * [Fix] for non-use trace
+ *
+ *
+ ****************************************************************************/
+
+#ifndef _DHL_UNIFIED_TRACE_H
+#define _DHL_UNIFIED_TRACE_H
+#ifndef GEN_FOR_PC
+#include <stdio.h>
+#include <stdarg.h>
+#else
+typedef char *va_list;
+#endif
+#if defined(__MAUI_BASIC__)
+#define MD_TRC(...)
+#else // #if defined(__MAUI_BASIC__)
+#include "dhl_trace.h"
+#include "L1Trc.h"
+
+typedef enum
+{
+    MAX_UNIFIED_TRACE_CLASS_BYTE = 8
+}E_UNIFIED_TRACE_CLASS;
+
+#define UNIFIED_API_PARAM_NONE 0
+#define UNIFIED_API_PARAM_GEN_VAL 1
+#define UNIFIED_API_PARAM_USER_EXTEND 2
+
+typedef enum
+{
+    UNIFIED_API_PARAM_TYPE_raw = UNIFIED_API_PARAM_NONE,
+    UNIFIED_API_PARAM_TYPE_sys= UNIFIED_API_PARAM_NONE,
+    UNIFIED_API_PARAM_TYPE_index = UNIFIED_API_PARAM_USER_EXTEND, //UNIFIED_API_PARAM_GEN_VAL,
+    UNIFIED_API_PARAM_TYPE_ota = UNIFIED_API_PARAM_USER_EXTEND, //UNIFIED_API_PARAM_GEN_VAL,
+    UNIFIED_API_PARAM_TYPE_string = UNIFIED_API_PARAM_USER_EXTEND    /* EX. #define MD_TRC_XXX(...) DHL_PSTRC_xxx(class, mod_id, msg_index, ##__VA_ARGS__)*/
+}E_UNIFIED_API_PARAM_TYPE;
+
+typedef enum
+{
+    UNIFIED_API_PARAM_NUM_index,
+    UNIFIED_API_PARAM_NUM_sys= 1,       /*fmt*/
+    UNIFIED_API_PARAM_NUM_string= 1,    /*str*/
+    UNIFIED_API_PARAM_NUM_raw= 2,      /*raw_data_len,pRaw_data*/
+    UNIFIED_API_PARAM_NUM_ota = 3       /*peer_msg_id,raw_data_len,pRaw_data*/
+}E_UNIFIED_API_PARAM_NUM;
+
+/* for expand trace API's user argument macro. */
+#define MD_TRC_EXPAND(x) x
+/*
+ * if there's only one argument, expands to nothing.  if there is more
+ * than one argument, expands to a comma followed by everything but
+ * the first argument.  only supports up to 128 arguments but can be
+ * trivially expanded.
+ */
+#if defined(__MTK_TARGET__)
+#define VA_ARG_FUNC(...) VA_ARG_HELPER(NUM_ARG(__VA_ARGS__), __VA_ARGS__)
+#define VA_ARG_HELPER(qty, ...) VA_ARG_HELPER2(qty, __VA_ARGS__)
+#define VA_ARG_HELPER2(qty, ...) VA_ARG_HELPER_##qty(__VA_ARGS__)
+#define VA_ARG_HELPER__ZERO(...)
+#define VA_ARG_HELPER__ONE(...) , __VA_ARGS__
+#define VA_ARG_HELPER_MORE_TRACE_ARGUMENTS(...) , __VA_ARGS__
+#define VA_ARG_HELPER_ONEORZERO_TRACE_ARGUMENT(...) VA_ARG_ONEORZERO_TRACE_ARGUMENT(CHECK_IS_EMPTY_ARG(__VA_ARGS__), __VA_ARGS__) 
+#define NUM_ARG(...) SELECT_SIZE( __VA_ARGS__ , \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, MORE_TRACE_ARGUMENTS, \
+                    MORE_TRACE_ARGUMENTS, ONEORZERO_TRACE_ARGUMENT)
+
+#define SELECT_SIZE(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17,\
+                    a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33,\
+                    a34, a35, a36, a37, a38, a39, a40, a41, a42, a43, a44, a45, a46, a47, a48, a49,\
+                    a50, a51, a52, a53, a54, a55, a56, a57, a58, a59, a60, a61, a62, a63, a64, a65,\
+                    a66, a67, a68, a69, a70, a71, a72, a73, a74, a75, a76, a77, a78, a79, a80, a81,\
+                    a82, a83, a84, a85, a86, a87, a88, a89, a90, a91, a92, a93, a94, a95, a96, a97,\
+                    a98, a99, a100, a101, a102, a103, a104, a105, a106, a107, a108, a109, a110, a111,\
+                    a112, a113, a114, a115, a116, a117, a118, a119, a120, a121, a122, a123, a124,\
+                    a125, a126, a127, a128, ...) a128
+#define VA_ARG_ONEORZERO_TRACE_ARGUMENT(qty, ...) VA_ARG_ONEORZERO_TRACE_ARGUMENT_DISPATCH(qty, __VA_ARGS__)
+#define VA_ARG_ONEORZERO_TRACE_ARGUMENT_DISPATCH(qty, ...) VA_ARG_HELPER__##qty(__VA_ARGS__)
+#define SELECT_3TH(a0, a1, a2, ...) a2
+#define _TRIGER_PARA_(...) RECHECK_PARENTHESSES_1 __VA_ARGS__ ()
+/*for remove user's parenthesses*/
+#define RECHECK_PARENTHESSES_1(...)  RECHECK_PARENTHESSES_2 __VA_ARGS__ ()
+#define RECHECK_PARENTHESSES_2(...)  RECHECK_PARENTHESSES_3 __VA_ARGS__ ()
+#define RECHECK_PARENTHESSES_3(...)  RECHECK_PARENTHESSES_4 __VA_ARGS__ ()
+#define RECHECK_PARENTHESSES_4(...)  RECHECK_PARENTHESSES_5 __VA_ARGS__ ()
+#define RECHECK_PARENTHESSES_5()     ,
+#define EMPTY_ARG_DISAPTCH(...) SELECT_3TH(__VA_ARGS__ , ZERO, ONE, ...)
+#define CHECK_IS_EMPTY_ARG(...) EMPTY_ARG_DISAPTCH(_TRIGER_PARA_ __VA_ARGS__ ())
+#else
+#define VA_ARG_FUNC(...) ,##__VA_ARGS__
+#endif
+/**
+* \param ... value follow trace format in trace definition to input value
+* \par Sample code
+* json file trace definition: HELLO_INDEX_TRACE
+* \code{.c}
+* kal_uint32 val1 = 1;
+* kal_uint32 val2 = 2;
+* MD_TRC_HELLO_INDEX_TRACE(val1, val2);
+*/
+//#define DHL_PSTRC_FUNC_ARG_index
+
+/**
+* \param raw_data_len is the size of the memory region
+* \param pRaw_data pointer th the address of memory region
+* \par Sample code
+* json file trace definition: HELLO_RAW_TRACE
+* \code{.c}
+* kal_uint32 valArray[5] = {1,2,3,4,5};
+* MD_TRC_HELLO_RAW_TRACE(5, valArray);
+*/
+#define DHL_PSTRC_FUNC_ARG_raw raw_data_len,pRaw_data
+
+/**
+* \param fmt is string of output log
+* \param ... parameter of string
+* \par Sample code
+* json file trace definition: HELLO_PRINT
+* \code{.c}
+* MD_TRC_HELLO_PRINT("hello %d,%d", 1,2);
+*/
+#define DHL_PSTRC_FUNC_ARG_string fmt
+
+/**
+* \param str is string of output log
+* \par Sample code
+* \code{.c}
+* MD_TRC_HELLO_SYS("hello trace");
+*/
+#define DHL_PSTRC_FUNC_ARG_sys str
+
+/**
+* \param peer_msg_id value follow prinitive structure format in prinitive definition to input value
+* \param raw_data_len prinitive structure size
+* \param pRaw_data pointer to data
+* \par Sample code
+* json file trace definition: HELLO_PEER_TRACE
+* \code{.c}
+* MD_TRC_HELLO_PEER_TRACE(peer_msg_id, raw_data_len, pRaw_data);
+*/
+#define DHL_PSTRC_FUNC_ARG_ota peer_msg_id,raw_data_len,pRaw_data
+
+#define DHL_PSTRC_index      _dhl_index_trace
+#define DHL_PSTRC_raw        _dhl_raw_trace
+#define DHL_PSTRC_string     _dhl_string_trace
+#define DHL_PSTRC_sys        _dhl_sys_trace
+#define DHL_PSTRC_ota        _dhl_ota_trace
+
+/* Unified Trace wrapper API */
+void _dhl_index_trace(kal_uint8 trc_class, module_type mod_id, kal_uint32 msg_index, const kal_char *arg_type, ...);
+void _dhl_index_trace_vl(kal_uint8 trc_class, module_type mod_id, kal_uint32 msg_index, const kal_char *arg_type, va_list arg_list);
+void _dhl_raw_trace(kal_uint8 trc_class, module_type mod_id, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 raw_data_len, const kal_uint8 *pRaw_data, ...);
+void _dhl_string_trace(kal_uint8 trc_class, module_type mod_id, kal_uint32 msg_index, const kal_char *arg_type, const char *fmt, ...);
+void _dhl_sys_trace(kal_uint8 trc_class, module_type mod_id, kal_uint32 msg_index, const kal_char *arg_type, const char *str, ...);
+void _dhl_ota_trace(kal_uint8 trc_class, module_type mod_id, kal_uint32 msg_index, const kal_char *arg_type, kal_uint32 peer_msg_id, kal_uint32 raw_data_len, kal_uint8 *pRaw_data, ...);
+
+#if defined(__DHL_LEGACY_TRACE_WRAPPER_TEST__)
+#define dhl_trace(trc_class, ...) _dhl_index_trace(trc_class, ##__VA_ARGS__)
+#define dhl_raw_trace(trc_class, ...) _dhl_raw_trace(trc_class, ##__VA_ARGS__)
+#define dhl_brief_trace(trc_class, ...) dhl_trace(trc_class, ##__VA_ARGS__)
+#define dhl_brief_trace_opt_helper(...) dhl_trace(__VA_ARGS__)
+#define dhl_internal_trace(trc_class, flag, level, msg_id, ...) dhl_trace(trc_class, flag, msg_id, ##__VA_ARGS__)
+#define dhl_peer_trace(...) _dhl_ota_trace(TRACE_PEER, 0, __VA_ARGS__)
+
+#define kal_trace(trc_class, ...) dhl_trace(trc_class, 0, ##__VA_ARGS__)
+#define kal_brief_trace(trc_class, ...) dhl_trace(trc_class, 0, ##__VA_ARGS__)
+#define kal_lib_trace(...) kal_trace(__VA_ARGS__)
+#define kal_assert_trace(...) kal_trace(__VA_ARGS__)
+#define kal_dev_trace(...) kal_trace(__VA_ARGS__)
+#define kal_buffer_trace(trc_class, msg_index, ...) _dhl_raw_trace(trc_class, 0, msg_index, ##__VA_ARGS__)
+extern kal_bool tst_is_PsTrc_open_and_pstrace_flag;  //For optimization, the AND flag of tst_is_PsTrc_open and tst_pstrace_flag
+#define kal_brief_trace_macro(trc_class, msg_index, ...) do { \
+    if (tst_is_PsTrc_open_and_pstrace_flag) {\
+        dhl_brief_trace_opt_helper(trc_class, DHL_USER_FLAG_NONE, msg_index, ##__VA_ARGS__); \
+    } \
+    } while(0)
+#define _kal_trace(...) kal_trace(__VA_ARGS__)
+#define _kal_brief_trace(...) kal_trace(__VA_ARGS__)
+
+#endif //(__DHL_LEGACY_TRACE_WRAPPER_TEST__)
+
+#define MD_TRC(TRACE_NAME, ...) MD_TRC_##TRACE_NAME(__VA_ARGS__)
+#endif // #if !defined(__MAUI_BASIC__)
+#endif /* _DHL_UNIFIED_TRACE_H */
+
diff --git a/mcu/interface/service/dhl/v2/dsp_logging.h b/mcu/interface/service/dhl/v2/dsp_logging.h
new file mode 100644
index 0000000..c3caf85
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dsp_logging.h
@@ -0,0 +1,235 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file dsp_logging.h
+ *
+ * Description:
+ * ------------
+ *   @brief Interface of DSP logging handler.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 09 18 2020 guan-ren.chen
+ * [MOLY00327199] [Gen97/Gen98] Development
+ * DSP check register flag before filter update(SWRD).
+ *
+ * 09 14 2020 guan-ren.chen
+ * [MOLY00327199] [Gen97/Gen98] Development
+ * DSP check LS flag before update filter(SWRD).
+ *
+ * 04 09 2020 yen-hsuan.lin
+ * [MOLY00508510] [OK项目]PLS模式抓log需要和dump机制解耦
+ * decouple the logging and memory dump(SWRD)
+ *
+ * 03 31 2020 yen-hsuan.lin
+ * [MOLY00508510] [OK项目]PLS模式抓log需要和dump机制解耦
+ * 03 16 2020 kaijiun.yeo
+ * [MOLY00504503] Customer can adjust buffer allocation by customer filter
+ * 	
+ * 03 31 2020 kaijiun.yeo
+ * [MOLY00507931] Overwritable memorydump setting from AP (memory dump 2.0 phase 2)
+ * Add function prototype in dsp_logging.h
+ * 	decople log and memory dump(SW)
+ *
+ * 03 31 2020 kaijiun.yeo
+ * [MOLY00507931] Overwritable memorydump setting from AP (memory dump 2.0 phase 2)
+ * Add function prototype in dsp_logging.h
+ * 	[Customer can adjust buffer allocation by customer filter]
+ * 	Logging Buffer Reallocation - add function prototype in dsp_logging.h
+ *
+ * 01 17 2020 guan-ren.chen
+ * [MOLY00474969] [Logging] Round-Robin Exception Re-dump Log
+ * [Redump 2.0][SWRD] Round-Robin dump ULSP .
+ *
+ * 12 09 2019 yen-hsuan.lin
+ * [MOLY00327199] [Gen97] Development
+ * [MOLY00464641] Fix the dhl low power problem
+ * 	
+ * 	merger the Gen98 Fix into VMOLY trunk
+ *
+ * 11 21 2019 guan-ren.chen
+ * [MOLY00460317] [Petrus][blocking] trace lost before assert in two log - ALPS04883010, ALPS04883323
+ * Change trace name and fix wrong function prototype.
+ *
+ * 09 23 2019 yen-hsuan.lin
+ * [MOLY00327199] [Gen97] Development
+ * Fix the set dsp filter flow for rake
+ *
+ * 09 21 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * 1. ULSP DSP refactory SWRD.
+ * 	2. Remove SW pull power when PB is not empty
+ * 	3. Move DSP ST log definition file from HWRD to MPD
+ *
+ * 09 18 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * 1. ULSP DSP refactory SWRD.
+ * 	2. Remove SW pull power when PB is not empty
+ * 	3. Move DSP ST log definition file from HWRD to MPD
+ *
+ * 09 06 2019 yen-hsuan.lin
+ * [MOLY00437389] Porting Built in filter
+ * 	
+ * 	Add built in function
+ *
+ * 09 03 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * Fix pull DSP power when DSP first enter dormant.
+ *
+ * 08 19 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * ULSP DSP UT.
+ *
+ * 08 08 2019 guan-ren.chen
+ * [MOLY00427332] [MT6297][Apollo][Overnight][LegacyRAT][CHT][TPE][VMOLY][20190730]assert fail:dhl_ulsp.c
+ * LS abort fail SW workaround for SCQ16 (WHQA_00039659).
+ *
+ * 07 11 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * Fix DSP filter wrong size.
+ *
+ * 05 30 2019 mojo.lai
+ * [MOLY00401562] Decouple ICD from DHL on VMOLY trunk
+ * 	
+ * 	Save DSP filter to NVRAM
+ *
+ * 04 25 2019 yancy.chien
+ * [MOLY00401562] Decouple ICD from DHL on VMOLY trunk
+ * 	
+ * 	1. Dynamic CCB.
+ * 	2. Src Plug-in phase-in.
+ * 	3. Fix build error on Gen95
+ *
+ * 04 16 2019 guan-ren.chen
+ * [MOLY00399588] [Gen97] Dormant flow
+ * Dormant flow. Struct access ULSP reg.
+ *
+ * 03 13 2019 guan-ren.chen
+ * [MOLY00391128] [Gen97] Develop for logging service
+ * Change print PS ex log location.
+ * 	Combine ULSP print ex log and print redump log function.
+ *
+ * 01 03 2019 mojo.lai
+ * [MOLY00376312] Save PB abort and flush status to CXIF
+ * 	
+ * 	.
+ *
+ * 10 31 2018 mojo.lai
+ * [MOLY00361962] Set DSP Filter
+ * 	
+ * 	.
+ *
+ ****************************************************************************/
+
+#ifndef _DSP_LOGGING_H
+#define _DSP_LOGGING_H
+
+#if defined(__MAUI_BASIC__)
+#define Dsp_Logging_Init()
+#else
+#if defined(__MTK_TARGET__)
+#include "dhl_def.h"
+#include "kal_public_defs.h"
+#include "kal_public_api.h"
+#include "kal_internal_def.h"
+#include "dhl_trace.h"
+
+#include "dsp_header_define_cuif_inner_brp.h"
+#include "dsp_header_define_cuif_fec_wbrp.h"
+#include "dsp_header_define_cuif_speech.h"
+#include "dsp_header_define_cmif.h"
+#include "dhl_nvram_def.h"
+#if (CUR_GEN >= MD_GEN97)
+#include "dsp_header_define_csif_memory.h"
+#endif
+
+#include "dhl_dsp_def.h"
+
+#if (CUR_GEN >= MD_GEN97)
+#define DSP_LTE_CORE_COUNT (SCQ16_3 + 1)
+#else
+#define DSP_LTE_CORE_COUNT (SCQ16_1 + 1)
+#endif
+
+extern dhl_cmd_set_dsp_filter_struct dsp_filter[NVRAM_EF_DHL_DSP_FILTER_V2_TOTAL + 1]; // 1-based
+
+/*---------------------------------------------------------------------------
+    Funtion prototype
+---------------------------------------------------------------------------*/
+void Dsp_Logging_Init();
+void Dsp_Logging_Init_By_Core(kal_uint8 core);
+void Dsp_set_filter_all_off();
+void Dsp_Load_Builtin_Filters(kal_int8 scenario_id);
+void Dsp_Set_Filter(dhl_cmd_set_dsp_filter_struct *dsp_filter_from_elt, kal_bool is_save_filter);
+void Dsp_Set_Filter_Imp();
+void Dsp_Set_RAKE_Filter();
+void Dsp_Backup_Clear_All_Filter();
+void Dsp_Restore_Filter();
+kal_bool Dsp_is_dsp_filter_all_off();
+
+void* Get_Cxif_Address(dsp_core_enum core);
+void Save_Filter_To_Cxif(kal_uint8 core);
+void Print_Filter_Setting(dhl_cmd_set_dsp_filter_struct *filter_setting);
+void Dsp_Test_Filter(kal_uint8 core);
+kal_uint8 Check_Dsp_Abort_Timeout();
+void PrintDSPDebugTrace();
+kal_bool Support_CXIF();
+kal_uint8 Check_4G_Dsp_Abort_Timeout();
+kal_uint8 Check_5G_Dsp_Abort_Timeout();
+char* get_core_name(dsp_core_enum core);
+kal_bool Get_Dsp_src_id(dsp_core_enum core_enum, kal_uint8* src_id);
+kal_bool Get_Dsp_Core_Enum(dhl_dsp_filter_type filter_type, kal_uint8 src_id, dsp_core_enum* core_enum);
+kal_bool Get_DSP_Core_NVRAM_Index(dsp_core_enum core_enum, kal_uint32* index);
+void dsp_ut_set_ut_case(kal_uint32 dsp_core_bit_mask, ulsp_ut_case ut_case, kal_uint32 para);
+void dsp_ut_wait_ut_case_finish(kal_uint32 dsp_core_bit_mask);
+void dsp_ut_notify_dsp(kal_uint32 dsp_core_bit_mask);
+void dhl_activate_dsp(kal_uint32 module_id, kal_bool first_activate);
+void dhl_deactivate_dsp(kal_uint32 module_id);
+void dsp_ut_init();
+void dsp_backup_filter_update_flag();
+void dsp_restore_filter_update_flag();
+void dsp_set_filter_update_flag(dsp_core_enum core);
+
+
+void dhl_ulsp_reset_vcore_l1(kal_uint32 ch_id);
+void dhl_ulsp_reset_scq16_pb_l1(kal_uint32 ch_id);
+
+#endif // __MTK_TARGET__
+#endif // __MAUI_BASIC__
+#endif // _DSP_LOGGING_H
diff --git a/mcu/interface/service/dhl/v2/dspsys_statistics.h b/mcu/interface/service/dhl/v2/dspsys_statistics.h
new file mode 100644
index 0000000..7dd96dd
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/dspsys_statistics.h
@@ -0,0 +1,104 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   dspsys_statistics.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   This file provides the DSP system statistics definition
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *       Apply A style.
+ *
+ * 04 27 2017 yancy.chien
+ * [MOLY00242548] [DHL] Build warning removal
+ *     Apply A style.
+ *
+ * 05 07 2014 eason.lai
+ * [MOLY00064969] [DHL]expand tab to 4 spaces to have better typesettings
+ * .
+ *
+ * 11 07 2012 ken.liu
+ * [MOLY00005322] TATAKA merge to MOLY
+ * dhl module check-in.
+ ****************************************************************************/
+
+#ifndef __DSPSYS_STATISTICS_H__
+#define __DSPSYS_STATISTICS_H__
+
+//#include "stack_buff_pool.h"
+//#include "ctrl_buff_pool.h"
+#include "sysconf_statistics.h"
+/*RHR*/
+#include "kal_general_types.h"
+/*RHR*/
+
+/* The defines for dspsys_stat_status */
+enum
+{
+    DSPSYS_STATS_NONE,
+    DSPSYS_STATS_UPDATE,
+    DSPSYS_STATS_END
+};
+
+/* The structure for dsp sysytem statistics record */
+typedef struct dspsys_stat_t
+{
+    kal_uint16 stack_stats_status;                                    /* Statistics record status */
+    kal_uint8  dspsys_stat[DSPSYS_STAT_DATA_LEN - sizeof(kal_uint16)]; /* keep the total length to be  DSPSYSY_STAT_DATA_LEN*/
+} dspsys_stat_structure;
+
+
+extern kal_bool get_dspsys_stat(void *dspsys_stat_data);
+extern void init_dspsys_stat(void);
+
+
+#endif /* __DSPSYS_STATISTICS_H__ */
+
diff --git a/mcu/interface/service/dhl/v2/kal_trace.h b/mcu/interface/service/dhl/v2/kal_trace.h
new file mode 100644
index 0000000..b10d9dc
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/kal_trace.h
@@ -0,0 +1,699 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2005
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file kal_trace.h
+ *
+ * Description:
+ * ------------
+ *   @brief Interface of KAL trace. TODO: should phase-out.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 09 18 2019 victoria.wang
+ * [MOLY00416922] DHL Legacy Wrapper migration and phase-out
+ * [Remove][DHL] phase out legacy wrapper API
+ *
+ * 04 21 2019 yh.sung
+ * [MOLY00392990] [VMOLY][UTF] Phase 2 Landing
+ * [UTF][DHL] UTF Trace API - trace interface
+ *
+ * 01 25 2019 yu-hsiang.peng
+ * [MOLY00381457] [DHL 2.0] Common Feature Development
+ * [SEPT.DEV] support mipi custom read
+ *
+ ****************************************************************************/
+
+#ifndef _KAL_TRACE_H
+#define _KAL_TRACE_H
+
+#include "dhl_unified_trace.h"
+#if defined(__DHL_MODULE__)
+#else
+
+#include <stdarg.h>
+#ifndef GEN_FOR_PC
+#include <stdio.h>
+#endif
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+#if defined(__MTK_TARGET__) && !defined(__GNUC__)
+#pragma diag_suppress 870
+#endif  //#ifdef __MTK_TARGET__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(__TST_MODULE__) && defined(__EM_MODE__) /* for ilm_struct type definition */
+#ifndef GEN_FOR_PC
+struct ilm_struct;
+extern void tst_EM_logger(struct ilm_struct *ilm_ptr);
+#if defined(__DHL_MODULE__)
+extern void dhl_EM_logger(struct ilm_struct *ilm_ptr);
+#endif
+#endif
+#endif  //#if defined(__TST_MODULE__) && defined(__EM_MODE__)
+
+#if !defined(__DHL_MODULE__)
+#define dhl_trace(...)
+#define dhl_internal_trace(...)
+#define dhl_brief_trace(...)
+#define dhl_peer_trace(...)
+#define dhl_raw_trace(...)
+#define dhl_print(...)
+#define dhl_print_string(...)
+#define dhl_print_system_trace(...)
+
+#define dhl_print_struct(...)
+#define dhl_debug_print(...)
+
+#define dhl_trace_impl(...)
+#define dhl_internal_trace_impl(...)
+#define dhl_print_impl(...)
+#define dhl_EM_logger(...)
+#endif //#if !defined(__DHL_MODULE__)
+
+#define MAX_MSG_NBR_IN_MODULE       20
+#define ADDITIONAL_BUFFER_FOR_MUX   45
+#define DEFAULT_RS232_FRAME_SIZE    5                 /* STX, LenHi, LenLo, Type, Checksum*/
+#define SAP_LOCAL_PARA_FILTER       0x02
+#define SAP_PEER_BUFF_FILTER        0x04
+
+#define STX_OCTET                   0x55
+#define LOGGED_PRIMITIVE_TYPE       0x60
+#define PS_TRACE_INDEX_TRACE_TYPE   0x61
+#define PS_PROMPT_TRACE_TYPE        0x62
+#define CONTROL_COMMAND_TYPE        0x63
+#define INJECT_PRIMITIVE_TYPE       0x64
+#define SYS_TRACE_TYPE              0x65
+
+//Define Trace Macro for PS trace
+#if defined(GEN_FOR_PC) && !defined(GEN_FOR_CPARSER)
+#define BEGIN_TRACE_MAP(MOD)     START_MODULE_MSG MOD MAX_MSG_NBR_IN_MODULE
+#define BEGIN_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL) START_RANGE_MODULE_MSG MOD MAX_MSG_NBR_IN_MODULE MIN_VAL MAX_VAL
+#define TRC_MSG(MSG,STR)         MSG STR
+#define TRC_MSG_NEWLINE(MSG,STR,NUM)         MSG STR NUM
+#define END_TRACE_MAP(MOD)       END_MODULE_MSG
+#define END_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL)   MOD MIN_VAL MAX_VAL END_RANGE_MODULE_MSG
+#else //Define Trace Macro for PS trace
+#define BEGIN_TRACE_MAP(MOD)     enum MOD##_MSG_ENUM{\
+    MOD##_empty_string=MOD<<MAX_MSG_NBR_IN_MODULE,
+#define BEGIN_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL) enum MOD##_##MIN_VAL##_MSG_ENUM{\
+    MOD##_##MIN_VAL##_empty_string = (MOD<<MAX_MSG_NBR_IN_MODULE) + MIN_VAL - 1,
+#define TRC_MSG(MSG,STR)         MSG##__enum,
+#define TRC_MSG_NEWLINE(MSG,STR,NUM)         MSG##__enum, MSG##_NEWLINE_EXPAND__enum = MSG##__enum+NUM,
+#define  END_TRACE_MAP(MOD)      MOD##__end};
+#define  END_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL)  MOD##_##MIN_VAL##__end};
+#endif //Define Trace Macro for PS trace
+
+
+//Decide which path should enter
+#ifdef __TST_MODULE__
+#if !defined(__FUE__) && !defined(__UBL__)
+#if !defined(MODULE_TRACE_OFF)
+#define __TST_TRACE_ENABLED__
+#elif defined(__TST_CRITICAL_TRACE_LEVEL__) //__PRIORITY_TRACING_ENABLED__ should be disabled in MoDIS      
+#define __TST_CRITICAL_TRACE_ENABLED__
+#endif  //!defined(MODULE_TRACE_OFF) && 
+#endif
+#endif  //#ifdef __TST_MODULE__
+
+#ifndef __TST_TRACE_ENABLED__
+#if defined(KAL_ON_OSCAR) || defined(MCD_DLL_EXPORT) || defined(L1_SIM)
+#define __TST_TRACE_EMPTY_FUNCTION__
+
+#if defined(__TST_CRITICAL_TRACE_ENABLED__)
+#undef __TST_CRITICAL_TRACE_ENABLED__
+#endif  //__TST_CRITICAL_TRACE_ENABLED__
+#endif  //#if defined(KAL_ON_OSCAR) || defined(MCD_DLL_EXPORT) || defined(L1_SIM)
+#endif
+
+
+#if !defined(__TST_CRITICAL_TRACE_ENABLED__) || defined(GEN_FOR_PC)
+typedef enum
+{
+    TRACE_FUNC,
+    TRACE_STATE,
+    TRACE_INFO,
+    TRACE_WARNING,
+    TRACE_ERROR,
+    TRACE_GROUP_1,
+    TRACE_GROUP_2,
+    TRACE_GROUP_3,
+    TRACE_GROUP_4,
+    TRACE_GROUP_5,
+    TRACE_GROUP_6,
+    TRACE_GROUP_7,
+    TRACE_GROUP_8,
+    TRACE_GROUP_9,
+    TRACE_GROUP_10,
+    TRACE_PEER
+} trace_class_enum;
+
+
+typedef enum
+{
+    DHL_CUSTOM_MEM_PMIC,
+    DHL_CUSTOM_MEM_MIPI,
+    DHL_CUSTOM_MEM_MAX
+} DHL_CUSTOM_MEM_TYPE;
+
+#else   //__TST_CRITICAL_TRACE_ENABLED__
+typedef unsigned char trace_class_enum;
+#endif  //__TST_CRITICAL_TRACE_ENABLED__
+
+
+#if defined(__TST_TRACE_ENABLED__)
+#define kal_print_string_trace kal_wap_trace  //alias kal_print_string_trace as kal_wap_trace
+//#define kal_critical_trace kal_trace
+//#define kal_critical_brief_trace kal_brief_trace
+//#define kal_critical_assert_trace kal_assert_trace
+extern void kal_critical_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_critical_brief_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_critical_assert_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+
+/*******************************************************************************
+* <GROUP Functions>
+*
+* FUNCTION
+*  kal_trace
+* DESCRIPTION
+*  This function is used to output the pre-defined trace to PC.
+*  The engineers SHOULD define their own traces before using this function.
+*  If a trace is defined as ��Today is %d-$d-%d��, kal_trace simply sends the trace ID and the content of %d to PC.
+*  That will reduce the communication traffic. In the chapter 2, we will introduce how to ass a new trace.
+*
+*
+* Property:
+*��    ��Message Compression�� type API
+*��    Cannot be invoked in LISR/HISR context.
+*��    Can send up to 128 bytes parameters
+*��    Suggested to use this API for most of the scenario.
+*
+* PARAMETERS
+*  trc_class: [IN] The trace class of this trace. Each module has 15 classes to category.
+*  msg_index: [IN] Message index. This part will be handled by tool.
+*  arg_type:  [IN] This part will be handled by tool.
+*  ...: [IN] Parameters to log
+* RETURNS
+*  NONE
+* NOTE
+*
+******************************************************************************/
+extern void kal_trace_for_3rd_party(trace_class_enum, kal_uint32, const kal_char *, va_list);
+extern void kal_lib_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_assert_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_wap_trace(module_type mod_id, trace_class_enum trc_class, const char *fmt, ...);
+extern void kal_buffer_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 buf_len, const kal_uint8 *pData);
+extern void kal_dev_trace(trace_class_enum trc_class, kal_uint32 msg_index, const char *arg_type, ...);
+extern void kal_bootup_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_brief_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+
+#define __TST_OPTIMIZATION_FOR_SPEED__ //Default enable in MOLY 
+
+#ifdef __TST_OPTIMIZATION_FOR_SPEED__  //Optimization, kal_brief_trace_macro definition
+
+#if !defined(_MSC_VER)
+
+//Target build
+extern kal_bool tst_is_PsTrc_open_and_pstrace_flag;  //For optimization, the AND flag of tst_is_PsTrc_open and tst_pstrace_flag
+extern void kal_brief_trace_opt_helper(trace_class_enum trc_class, kal_uint32 msg_index, const char *arg_type, ...);
+
+#define kal_brief_trace_macro(trc_class, msg_index,...) do{\
+    if(tst_is_PsTrc_open_and_pstrace_flag){\
+        kal_brief_trace_opt_helper(trc_class, msg_index, ##__VA_ARGS__);\
+    }\
+    }while(0)
+
+#else
+
+//PC build (MoDIS or MCDDLL)
+extern void kal_trace_macro(trace_class_enum, kal_uint32, const kal_char *, ...);
+
+#endif
+
+#else //__TST_OPTIMIZATION_FOR_SPEED__
+
+#if !defined(_MSC_VER)
+
+//Target build
+#define kal_brief_trace_macro(...)     kal_brief_trace(__VA_ARGS__)
+
+#else
+
+//PC build (MoDIS or MCDDLL)
+extern void kal_trace_macro(trace_class_enum, kal_uint32, const kal_char *, ...);
+
+#endif
+
+#endif //__TST_OPTIMIZATION_FOR_SPEED__
+
+
+#else //__TST_TRACE_ENABLED__
+#if defined(__TST_TRACE_EMPTY_FUNCTION__)
+/*
+* For non-target platform (PC simulator or MNT),
+* we define trace-related functions as inline function to avoid compile error
+* in VC++.
+*/
+
+static __inline void kal_critical_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_critical_brief_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+static __inline void kal_critical_assert_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_brief_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_trace_for_3rd_party(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, va_list argument_info)
+{
+    return ;
+}
+
+static __inline void kal_lib_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+static __inline void kal_assert_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+static __inline void kal_wap_trace(module_type mod_id, trace_class_enum trc_class, const char *fmt, ...)
+{
+    return ;
+}
+static __inline void kal_print_string_trace(module_type mod_id, trace_class_enum trc_class, const char *fmt, ...)
+{
+    return ;
+}
+
+static __inline void kal_buffer_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 buf_len, const kal_uint8 *pData)
+{
+    return;
+}
+
+static __inline void kal_dev_trace(trace_class_enum trc_class, kal_uint32 msg_index, const char *arg_type, ...)
+{
+    return;
+}
+
+static __inline void kal_bootup_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+static __inline void kal_brief_trace_macro(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
+{
+    return ;
+}
+
+#elif defined(__TST_CRITICAL_TRACE_ENABLED__)
+//Support partial tracing API enable
+extern void kal_critical_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_critical_brief_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+extern void kal_critical_assert_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
+
+#define kal_trace(...)
+#define kal_brief_trace(...)
+#define kal_trace_for_3rd_party(...)
+#define kal_lib_trace(...)
+#define kal_assert_trace(...)
+#define kal_wap_trace(...)
+#define kal_print_string_trace(...)
+#define kal_buffer_trace(...)
+#define kal_dev_trace(...)
+#define kal_bootup_trace(...)
+#define kal_brief_trace_macro(...)
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 0
+
+#define TRACE_FUNC 0
+#define TRACE_STATE 1
+#define TRACE_INFO 2
+#define TRACE_WARNING 3
+#define TRACE_ERROR 4
+#define TRACE_GROUP_1 5
+#define TRACE_GROUP_2 6
+#define TRACE_GROUP_3 7
+#define TRACE_GROUP_4 8
+#define TRACE_GROUP_5 9
+#define TRACE_GROUP_6 10
+#define TRACE_GROUP_7 11
+#define TRACE_GROUP_8 12
+#define TRACE_GROUP_9 13
+#define TRACE_GROUP_10 14
+#define TRACE_PEER 15
+
+#undef kal_trace
+#undef kal_brief_trace
+
+#define _kal_trace(trace_class_enum, ...) kal_critical_trace_##trace_class_enum(trace_class_enum, __VA_ARGS__)
+#define _kal_brief_trace(trace_class_enum, ...) kal_critical_brief_trace_##trace_class_enum(trace_class_enum, __VA_ARGS__)
+
+#define kal_trace(trace_class_enum, ...) _kal_trace(trace_class_enum, __VA_ARGS__)
+#define kal_brief_trace(trace_class_enum, ...) _kal_brief_trace(trace_class_enum, __VA_ARGS__)
+#define kal_brief_trace_macro(trace_class_enum, ...) _kal_brief_trace(trace_class_enum, __VA_ARGS__)
+
+//#define kal_assert_trace_(trace_class_enum, ...) kal_critical_assert_trace_##trace_class_enum(__VA_ARGS__)
+
+//declare the empty defined
+#define kal_critical_trace_0(...)
+#define kal_critical_trace_1(...)
+#define kal_critical_trace_2(...)
+#define kal_critical_trace_3(...)
+#define kal_critical_trace_5(...)
+#define kal_critical_trace_6(...)
+#define kal_critical_trace_7(...)
+#define kal_critical_trace_8(...)
+#define kal_critical_trace_9(...)
+#define kal_critical_trace_10(...)
+#define kal_critical_trace_11(...)
+#define kal_critical_trace_12(...)
+#define kal_critical_trace_13(...)
+#define kal_critical_trace_14(...)
+#define kal_critical_trace_15(...)
+
+#define kal_critical_brief_trace_0(...)
+#define kal_critical_brief_trace_1(...)
+#define kal_critical_brief_trace_2(...)
+#define kal_critical_brief_trace_3(...)
+#define kal_critical_brief_trace_5(...)
+#define kal_critical_brief_trace_6(...)
+#define kal_critical_brief_trace_7(...)
+#define kal_critical_brief_trace_8(...)
+#define kal_critical_brief_trace_9(...)
+#define kal_critical_brief_trace_10(...)
+#define kal_critical_brief_trace_11(...)
+#define kal_critical_brief_trace_12(...)
+#define kal_critical_brief_trace_13(...)
+#define kal_critical_brief_trace_14(...)
+#define kal_critical_brief_trace_15(...)
+
+//ignore the known issues, wrap logging APIs in other APIs
+#define kal_critical_trace_trc_class(...)
+#define kal_critical_brief_trace_trc_class(...)
+
+//define ERROR --> 4
+#define kal_critical_trace_4 kal_critical_trace
+#define kal_critical_brief_trace_4 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 1
+//define WARNING 3
+#undef kal_critical_trace_3
+#undef kal_critical_brief_trace_3
+#define kal_critical_trace_3 kal_critical_trace
+#define kal_critical_brief_trace_3 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 2
+//define TRACE_STATE 1
+#undef kal_critical_trace_1
+#undef kal_critical_brief_trace_1
+#define kal_critical_trace_1 kal_critical_trace
+#define kal_critical_brief_trace_1 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 3
+//define TRACE_INFO 2
+#undef kal_critical_trace_2
+#undef kal_critical_brief_trace_2
+#define kal_critical_trace_2 kal_critical_trace
+#define kal_critical_brief_trace_2 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 4
+//#define TRACE_PEER 15
+#undef kal_critical_trace_15
+#undef kal_critical_brief_trace_15
+#define kal_critical_trace_15 kal_critical_trace
+#define kal_critical_brief_trace_15 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 5
+//#define TRACE_GROUP_1 5
+#undef kal_critical_trace_5
+#undef kal_critical_brief_trace_5
+#define kal_critical_trace_5 kal_critical_trace
+#define kal_critical_brief_trace_5 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 6
+//#define TRACE_GROUP_2 6
+#undef kal_critical_trace_6
+#undef kal_critical_brief_trace_6
+#define kal_critical_trace_6 kal_critical_trace
+#define kal_critical_brief_trace_6 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 7
+//#define TRACE_GROUP_3 7
+#undef kal_critical_trace_7
+#undef kal_critical_brief_trace_7
+#define kal_critical_trace_7 kal_critical_trace
+#define kal_critical_brief_trace_7 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 8
+//#define TRACE_GROUP_4 8
+#undef kal_critical_trace_8
+#undef kal_critical_brief_trace_8
+#define kal_critical_trace_8 kal_critical_trace
+#define kal_critical_brief_trace_8 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 9
+//#define TRACE_GROUP_5 9
+#undef kal_critical_trace_9
+#undef kal_critical_brief_trace_9
+#define kal_critical_trace_9 kal_critical_trace
+#define kal_critical_brief_trace_9 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 10
+//#define TRACE_GROUP_6 10
+#undef kal_critical_trace_10
+#undef kal_critical_brief_trace_10
+#define kal_critical_trace_10 kal_critical_trace
+#define kal_critical_brief_trace_10 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 11
+//#define TRACE_GROUP_7 11
+#undef kal_critical_trace_11
+#undef kal_critical_brief_trace_11
+#define kal_critical_trace_11 kal_critical_trace
+#define kal_critical_brief_trace_11 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 12
+//#define TRACE_GROUP_8 12
+#undef kal_critical_trace_12
+#undef kal_critical_brief_trace_12
+#define kal_critical_trace_12 kal_critical_trace
+#define kal_critical_brief_trace_12 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 13
+//#define TRACE_GROUP_9 13
+#undef kal_critical_trace_13
+#undef kal_critical_brief_trace_13
+#define kal_critical_trace_13 kal_critical_trace
+#define kal_critical_brief_trace_13 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 14
+//#define TRACE_GROUP_10 14
+#undef kal_critical_trace_14
+#undef kal_critical_brief_trace_14
+#define kal_critical_trace_14 kal_critical_trace
+#define kal_critical_brief_trace_14 kal_critical_brief_trace
+#endif
+
+#if __TST_CRITICAL_TRACE_LEVEL__ > 15
+//#define TRACE_FUNC 0
+#undef kal_critical_trace_0
+#undef kal_critical_brief_trace_0
+#define kal_critical_trace_0 kal_critical_trace
+#define kal_critical_brief_trace_0 kal_critical_brief_trace
+#endif
+
+#else  // #if defined(__TST_TRACE_EMPTY_FUNCTION__)
+//Define empty functions for Target SW
+#define kal_trace(...)
+#define kal_brief_trace(...)
+#define kal_trace_for_3rd_party(...)
+#define kal_lib_trace(...)
+#define kal_assert_trace(...)
+#define kal_wap_trace(...)
+#define kal_print_string_trace(...)
+#define kal_buffer_trace(...)
+#define kal_dev_trace(...)
+#define kal_bootup_trace(...)
+#define kal_critical_trace(...)
+#define kal_critical_brief_trace(...)
+#define kal_critical_assert_trace(...)
+#define kal_brief_trace_macro(...)
+#endif   // #if defined(__TST_TRACE_EMPTY_FUNCTION__)
+#endif  //__TST_TRACE_ENABLED__
+
+#define kal_sys_trace        tst_sys_trace
+#define kal_sys_init_trace   tst_sys_init_trace
+#define kal_sys_fatal_trace  tst_sysfatal_trace
+
+#ifdef __TST_MODULE__
+/*******************************************************************************
+* <GROUP Functions>
+*
+* FUNCTION
+*  kal_prompt_trace
+* DESCRIPTION
+*  It's a printf-like function which outputs log to Catcher Tool.
+*  Property:
+*  The message is sent in plaintext
+*��    Cannot be invoked in LISR context.
+*��    Can send up to 128 bytes logs
+*��    This API can only be used in customer side to reduce the impact of ROM size increase.
+*��    Heavy resource consumption.
+*��      a.Caller��s RO-DATA
+*��        b. Logging Bandwidth
+*
+* PARAMETERS
+*  mod_id: [IN] Module id
+*  fmt: [IN] The format string. Please refer to print function of C standard library.
+* RETURNS
+*  NONE
+* NOTE
+*
+******************************************************************************/
+extern void kal_prompt_trace(module_type mod_id, const kal_char *fmt, ...);
+extern void tst_sys_init_trace(const kal_char *info);
+extern void tst_sys_trace(kal_char *info);
+extern void tst_sysfatal_trace(kal_char *info);
+extern kal_int32 tst_trace_check_ps_filter_off(trace_class_enum trc_class, kal_uint32 *module_id, kal_uint32 supportOption);
+
+#define kal_bootup_print tst_sys_init_trace
+#else
+#ifdef __TST_TRACE_EMPTY_FUNCTION__
+static __inline void kal_prompt_trace(module_type mod_id, const kal_char *fmt, ...)
+{
+    return ;
+}
+static __inline void tst_sys_init_trace(const kal_char *info)
+{
+    return ;
+}
+static __inline void tst_sys_trace(kal_char *info)
+{
+    return ;
+}
+static __inline void tst_sysfatal_trace(kal_char *info)
+{
+    return ;
+}
+static __inline kal_int32 tst_trace_check_ps_filter_off(trace_class_enum trc_class, kal_uint32 *module_id, kal_uint32 supportOption)
+{
+    return 0;
+}
+#else
+#define kal_prompt_trace(...)
+#define tst_sys_init_trace(...)
+#define tst_sys_trace(...)
+#define tst_sysfatal_trace(...)
+#define tst_trace_check_ps_filter_off(...)
+#endif
+#endif  //#ifdef __TST_MODULE__
+
+typedef void (*TST_VC_CallBack)(const kal_uint8 *pData, kal_uint32 nLen);
+typedef void (*TST_String_Inject_CB)(kal_uint32 index, kal_uint8 *pData);
+
+/*
+* tst_virtual_channel_id:
+* regiester new virtual channel here and remake tst
+*/
+typedef enum
+{
+    TVCI_GPS_LOGGING,
+    TVCI_DNT_L2COPRO_LOGGING,
+    TVCI_CATCHER_POLLING,
+    TVCI_GDB_COMM,
+    TVCI_AST_LOGGING,
+    TVCI_MINI_LOG,
+    TVCI_VM_LOGGING,
+    TVCI_BTT,
+    TVCI_LAST_ID
+}
+tst_virtual_channel_id;
+
+#define MAX_VC_RESPONSE_LEN (1023)
+
+kal_bool tst_vc_register_channel(tst_virtual_channel_id channel_id, TST_VC_CallBack fnCmd);
+kal_bool tst_vc_response(tst_virtual_channel_id channel_id, const kal_uint8 *pData, kal_uint16 len);
+
+#define TVCI_CREATE_FILE 0x24540001
+#define TVCI_CLOSE_FILE 0x24540002
+
+kal_bool tst_save_assert_bypass_trace(kal_char *info);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __LTE_RAT__ */
+
+#endif /* _KAL_TRACE_H */
+
diff --git a/mcu/interface/service/dhl/v2/tst.h b/mcu/interface/service/dhl/v2/tst.h
new file mode 100644
index 0000000..1890220
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/tst.h
@@ -0,0 +1,102 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file tst.h
+ *
+ * Description:
+ * ------------
+ *   @brief TST legacy interface.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 05 03 2019 guan-ren.chen
+ * [MOLY00400853] [Gen97] Logging service enhancement
+ * ULSP to SIB path implement.
+ *
+ * 04 21 2019 yh.sung
+ * [MOLY00392990] [VMOLY][UTF] Phase 2 Landing
+ * [UTF][DHL] UTF Trace API - trace interface
+ *
+ ****************************************************************************/
+
+#ifndef _TST_H
+#define _TST_H
+
+/********************/
+/* Constant definition */
+/********************/
+#if defined(__LTE_RAT__) || defined(__UMTS_RAT__)
+#define TST_L1TRC_FILTER_NUM 50
+#else
+#define TST_L1TRC_FILTER_NUM 40
+#endif  //TST_L1TRC_FILTER_NUM definition
+
+//For world phone projects, we need to have common nvram lid size for both td and fd
+//So, we define the maximal number for both of them
+
+//Willie: We need to consider about NVRAM checksum size (2 byte)
+#define NVRAM_CHECKSUM_SIZE (2)
+#define NVRAM_PEER_BUF_HEADER_SIZE (8)
+#if defined(__LTE_RAT__) || defined(__UMTS_RAT__) || defined(__GSM_RAT__)
+#define NVRAM_EF_TST_FILTER_ALLOCATE_SIZE  (32768-NVRAM_CHECKSUM_SIZE-NVRAM_PEER_BUF_HEADER_SIZE)
+#define NVRAM_EF_DHL_FILTER_ALLOCATE_SIZE  (32768-NVRAM_CHECKSUM_SIZE-NVRAM_PEER_BUF_HEADER_SIZE)
+#define NVRAM_EF_DSP_FILTER_ALLOCATE_SIZE  (4096-NVRAM_CHECKSUM_SIZE-NVRAM_PEER_BUF_HEADER_SIZE)
+#else
+#define NVRAM_EF_TST_FILTER_ALLOCATE_SIZE  (2048-NVRAM_CHECKSUM_SIZE)
+#define NVRAM_EF_DHL_FILTER_ALLOCATE_SIZE  (2048-NVRAM_CHECKSUM_SIZE)
+#define NVRAM_EF_DSP_FILTER_ALLOCATE_SIZE  (2048-NVRAM_CHECKSUM_SIZE)
+#endif
+
+#define NVRAM_EF_DHL_INITIAL_CFG_ALLOCATE_SIZE 512
+
+extern void tst_init_filters(char *src, unsigned short len);
+extern void tst_save_filter_to_nvram(void);
+
+typedef struct
+{
+    kal_bool spare_logging_enabled;
+    kal_bool usb_dma_logging_enable;
+    kal_bool malmo_disable;
+    kal_bool dnt_enable;    //only effective if __TST_LMU_LOGGING__ is not defined
+    kal_uint8 meta_mode_trace_enable; //0: disable, 1: relay, 2: save to file
+}
+tst_config_struct_t;
+
+#endif /* _TST_H */
+
diff --git a/mcu/interface/service/dhl/v2/tst_Catcher_version.h b/mcu/interface/service/dhl/v2/tst_Catcher_version.h
new file mode 100644
index 0000000..d8fce0d
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/tst_Catcher_version.h
@@ -0,0 +1,367 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file tst_Catcher_version.h
+ *
+ * Description:
+ * ------------
+ *   @brief Version info used by host tool (ELT/Catcher).
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 03 27 2020 guan-ren.chen
+ * [MOLY00503220] [MT6873][Margaux][Q0][MP2][SQC]for RD check in log filter change notification
+ * 	
+ * 	Add source id information to ULSP structure on CXIF for ELT to check filter update use.
+ *
+ * 03 16 2020 yancy.chien
+ * [MOLY00467612] [DHL] Log Scrambling
+ * SWRD part.
+ *
+ * 03 05 2020 guan-ren.chen
+ * [MOLY00503220] [MT6873][Margaux][Q0][MP2][SQC]for RD check in log filter change notification
+ * Add filter update trace (SWRD).
+ *
+ * 01 06 2020 wen-ting.cheah
+ * [MOLY00467612] [DHL] Log Scrambling
+ * VIVO Log Security Trace Scrambling Feature
+ *
+ * 12 09 2019 yen-hsuan.lin
+ * [MOLY00327199] [Gen97] Development
+ * [MOLY00464641] Fix the dhl low power problem
+ * 	
+ * 	merger the Gen98 Fix into VMOLY trunk
+ *
+ * 04 21 2019 yh.sung
+ * [MOLY00392990] [VMOLY][UTF] Phase 2 Landing
+ * [UTF][DHL] UTF Trace API - trace interface
+ *
+ * 12 03 2018 yancy.chien
+ * [MOLY00366513] [NotTarget] Resetm partial success
+ * ELT force update version.
+ *
+ * 11 20 2018 mojo.lai
+ * [MOLY00365695] Support setting DSP filter
+ * 	
+ * 	.
+ *
+ * 11 01 2018 yancy.chien
+ * [MOLY00331449] [Gen97] DHL logging development
+ * remove useless compiler option.
+ *
+ * 09 28 2018 yancy.chien
+ * [MOLY00345863] [Gen97] RRC signal logging & inject
+ * UPS mux header support over 64K
+ * UPS protocol phase-in
+ * EBS add NRRC_LOG type
+ * Custom ILM option remove no_log & wo_peer_buff
+ *
+ ****************************************************************************/
+
+#ifndef __TST_CATCHER_VERSION_H__
+#define __TST_CATCHER_VERSION_H__
+
+#if defined (L1_SIM)
+#if (defined(__MTK_TARGET__) && !defined(__MAUI_BASIC__))
+#define __MAUI_SOFTWARE_TRACER__
+#endif
+#else
+#include "swtr.h"   // for __MAUI_SOFTWARE_TRACER__ definition
+#include "us_timer.h"   // for __HW_US_TIMER_SUPPORT__ definition
+#endif
+
+#if defined(GEN_FOR_PC)
+
+//This structure is for Catcher usage only
+//Catcher owners should update these enum if they would like keep some information into the database.
+
+#include "global_def.h"
+
+typedef enum
+{
+    Catcher_Info_Enum_Begin,
+    //Please add content here
+
+    //Common indications
+    CATCHER_NEW_DESCR_INFO_STRUCT,
+    CATCHER_TST_END_REDUMP_TRACE,
+    CATCHER_DB_ON_MD_ARM,
+
+    //General Optional indications
+#if defined(__UMTS_RAT__)
+    CATCHER_L1_TIMESTAMP,                  // support timestamp packed in all L1 frames
+#endif  //#if defined(__UMTS_RAT__)
+
+    CATCHER_STATISTICS_STRING_REPLACING,   // support Statistics and FLC string replacing
+
+#ifdef __EM_MODE__
+    CATCHER_ENGINEERING_MODE_INDEPENDENT_UPDATE,
+#endif  //#ifdef __EM_MODE__
+
+
+#if defined(MTK_SLEEP_ENABLE)
+#if defined(__EGPRS_MODE__)||defined(__SMART_PHONE_MODEM__)||defined(__UMTS_RAT__)
+    FORCE_CATCHER_XON,
+#endif  //#if defined(__EGPRS_MODE__)||defined(__SMART_PHONE_MODEM__)||defined(__UMTS_RAT__)
+#endif  //#if defined(MTK_SLEEP_ENABLE)  
+
+#if defined(__UMTS_RAT__)
+    CATCHER_UL1_TIMESTAMP,                  // support RTOS_TimeStamp in UL1 Time Trace
+#else
+    CATCHER_L1_TIMESTAMP_SIM1,
+#endif  //#if defined(__UMTS_RAT__)  
+
+
+#if defined(__MAUI_SOFTWARE_TRACER__)
+    CATCHER_SW_TRACER_ENABLE,
+#else   //#if defined(__MAUI_SOFTWARE_TRACER__)
+    CATCHER_SW_TRACER_DISABLE,
+#endif  //#if defined(__MAUI_SOFTWARE_TRACER__)
+
+    //MTK Internal Optional indications
+#if defined(__MTK_TARGET__) && !defined(__MAUI_BASIC__)
+    CATCHER_SWLA_SWTR_DYNAMIC_ENABLE,
+
+#if defined(__HW_US_TIMER_SUPPORT__)
+    CATCHER_SWLA_NEW_CLOCK_ENABLE,
+#endif  //#if defined(__HW_US_TIMER_SUPPORT__)
+    CATCHER_SWLA_SWTR_DYNAMIC_DISABLE,
+    CATCHER_SWLA_EMI_QUERY_ENABLE,
+
+#endif  //#if defined(__MTK_TARGET__) && !defined(__MAUI_BASIC__)
+#if defined(__DSP_FCORE4__) && !defined(UNIT_TEST)
+    CATCHER_FCORE_MEMORY_DUMP_ENABLE,
+#endif  //#if defined(MT6270A)
+    CATCHER_R5R6_CPHY_CONTAINER_STRUCT,
+    CATCHER_GDI_LAYER_BYTES_PER_PIXEL_INFO,
+#if defined(__AST_TL1_TDD__) && !defined(UNIT_TEST)
+    CATCHER_AST_MEMORY_DUMP_ENABLE,
+#endif  //#if defined(__AST_TL1_TDD__) && !defined(UNIT_TEST) 
+
+#if defined( __UMTS_TDD128_MODE__)
+    CATCHER_DB_FOR_TDD,
+#endif  //#if defined( __UMTS_TDD128_MODE__)
+
+#if defined(__AST_TL1_TDD__)
+    CATCHER_AST_FAST_MEMORY_DUMP,
+#endif  //#if defined(__AST_TL1_TDD__)
+
+    CATCHER_EM_MULTIPLE_SIM_ENABLE,
+    CATCHER_SIM_READ_MULTIPLE_SIM_ENABLE,
+    CATCHER_PS_NO_FN, //Indicate PS log won't send out FNs.
+
+#if defined(__SMART_PHONE_MODEM__)
+    CATCHER_PS_NO_CHECK_SUM_ENABLED, //Support 0x58 and 0x59
+    CATCHER_L1_NO_CHECK_SUM_ENABLED, //Support 0xA6
+#endif
+
+#if defined(__LTE_RAT__)
+#if defined(__GSM_RAT__) || defined(__UMTS_RAT__)
+    LTE_MM,
+#else
+    LTE_SM,
+#endif
+#else
+    GSM_UMTS,
+#endif
+
+#if !defined(__UE_SIMULATOR__) && !defined(UNIT_TEST)
+#endif
+
+
+#if defined (__MAUI_SOFTWARE_TRACER__)
+    CATCHER_SWTR_NEW_TIME_SCALE,  // change SWTR time scale from 1/16 to 1/1024
+#endif
+
+    Catcher_Info_Enum_End
+} Catcher_Version_Info_Enum;
+
+typedef enum
+{
+    SWLA_Clock_Origin_Wrap = 5000,
+    SWLA_Clock_Origin_Rate = 1083000,   //1.083MHZ
+#ifdef MT6268
+    SWLA_Clock_Rate = 3250000,   //3.25MHZ
+    SWLA_Clock_Wrap = 0x0FFFFFFF,
+#else
+    SWLA_Clock_Rate = 1000000,   //1MHZ
+    SWLA_Clock_Wrap = 0xFFFFFFFF,
+#endif
+#if defined(OS_TICK_PERIOD_US)
+    SWLA_TimeStamp_Ratio = OS_TICK_PERIOD_US,
+#else
+    SWLA_TimeStamp_Ratio = 4615,  // For LMU-based SWLA to convert us to frame
+#endif
+    SWLA_CLOCK_END
+} Catcher_SWLA_Clock;
+
+#ifdef NUM_OF_SIM
+#define CATCHER_NUM_OF_SIM NUM_OF_SIM
+#undef NUM_OF_SIM
+#endif  //NUM_OF_SIM
+
+//workaround
+#if defined(__GEMINI__) && !defined(GEMINI_PLUS)
+#define GEMINI_PLUS 2
+#endif  //GEMINI_PLUS
+
+typedef enum
+{
+    NUM_OF_GSM_SIM = MAX_GSM_NUM,
+#if defined(__UMTS_RAT__)
+    NUM_OF_UMTS_SIM = MAX_UMTS_NUM,
+#else
+    NUM_OF_UMTS_SIM = 0,
+#endif
+#if defined(__LTE_RAT__)
+    NUM_OF_LTE_SIM = MAX_LTE_NUM,
+#else
+    NUM_OF_LTE_SIM = 0,
+#endif
+    NUM_OF_SIM = MAX_SIM_NUM,
+}
+sim_info_enum;
+
+#ifdef CATCHER_NUM_OF_SIM
+#define NUM_OF_SIM CATCHER_NUM_OF_SIM
+#endif  //NUM_OF_SIM
+
+//Catcher version checking
+typedef enum
+{
+    v3_1105_00
+}
+catcher_min_version;
+
+typedef enum
+{
+#if defined(__FLAVOR_L1S_L1DISABLE__)
+    TIMESTAMP_PRECISION = 1000,
+    PERIODIC_TIMESTAMP_PRECISION = 1000,
+    LOW_RES_TIMESTAMP_PRECISION = 1000,
+    HIGH_RES_TIMESTAMP_PRECISION = 1000,
+#else
+    TIMESTAMP_PRECISION = 64,
+    PERIODIC_TIMESTAMP_PRECISION = 64,
+    LOW_RES_TIMESTAMP_PRECISION = 64,
+#if defined(L1_SIM) && !defined (__UE_SIMULATOR__)
+    HIGH_RES_TIMESTAMP_PRECISION = 64,
+#else
+    HIGH_RES_TIMESTAMP_PRECISION = 1,
+#endif
+#endif
+} ETimeStampPrecisionUS;
+
+typedef enum
+{
+    PS_11A
+#if defined(__AST_TL1_TDD__) || defined(__UMTS_TDD128_MODE__)
+    , TDD_11A
+#endif
+}
+catcher_default_filter_info;
+
+//For ELT version checking
+typedef enum
+{
+    V2_2003_0
+} elt_min_version;
+
+#define MULTI_DB_MASTER_ID (0)
+#define MULTI_DB_SLAVE_ID (1)
+typedef enum
+{
+    MULTI_DB_MASTER = MULTI_DB_MASTER_ID,
+} dhl_multiple_db_type;
+
+typedef enum
+{
+    PCORE_DATABASE
+} dhl_multiple_db_desc;
+
+typedef enum
+{
+#if (CUR_GEN >= MD_GEN97)
+    DHL_MDB_VIEW_TYPE_5G_MD    // Enable UPS MUX
+
+#else	// Gen93/95
+
+#if defined(__USE_ULSP__) || defined(__USE_ULSP_SW_SIMULATOR__) //ULSP HW logging
+    DHL_MDB_VIEW_TYPE_LTE_ULS_PLUS
+#else   // Legacy SW logging
+    DHL_MDB_VIEW_TYPE_LTE_ADVANCED__PLUS   //add L1 Trace(PCORE), Sys trace(L1CORE), PS Integrated (L1CORE)
+#endif  //defined(__USE_ULSP__) || defined(__USE_ULSP_SW_SIMULATOR__)
+
+#endif	// (CUR_GEN >= MD_GEN97)
+} dhl_multiple_db_view_mapping_type;
+
+#if (CUR_GEN >= MD_GEN97)
+
+typedef enum
+{
+    /* V_MAJORVERSION_MINORVERSION */
+    V_5_0     /*5 means 5G platform*/
+} ulsp_protocol_version;
+
+#endif  // (CUR_GEN >= MD_GEN97)
+
+typedef enum
+{
+    V_1_1
+} filter_info_log_version;
+
+// Enable UPS trace & command
+typedef enum
+{
+    /* V_MAJORVERSION_MINORVERSION */
+    V_1_0
+} ups_protocol_version;
+
+typedef enum
+{
+    NO_PH_MSG_ID_TST_R8_DL_PKT_SINGLE_GPD_IND,
+    NO_PH_MSG_ID_DHL_L2COPRO_DL_IP_HEADER_LOG,
+    NO_PH_MSG_ID_DHL_L2COPRO_UL_IP_HEADER_LOG,
+    NO_PH_MSG_ID_DHL_ICD_TUNNELING
+}
+dhl_no_peer_header_msg_id_enum;
+
+#endif //#if defined(GEN_FOR_PC) 
+
+#endif //__TST_CATCHER_VERSION_H__
diff --git a/mcu/interface/service/dhl/v2/tst_catcher_diagonsis_info.h b/mcu/interface/service/dhl/v2/tst_catcher_diagonsis_info.h
new file mode 100644
index 0000000..e022aed
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/tst_catcher_diagonsis_info.h
@@ -0,0 +1,273 @@
+/*******************************************************************************
+*  Modification Notice:
+*  --------------------------
+*  This software is modified by MediaTek Inc. and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2005
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file tst_catcher_diagonsis_info.h
+ *
+ * Description:
+ * ------------
+ *   @brief 
+ *   This file contains the exception handle diagnosis Info of Catcher.
+ *   With this file, catcher can detect the memory dump failure cause and find the proper owner.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 09 19 2019 yen-hsuan.lin
+ * [MOLY00441296] Gen97 development for VMOLY
+ * Fix the DHL error handle owner table
+ *
+ * 03 07 2019 yen-hsuan.lin
+ * [MOLY00389323] Update the USB and comport Owner for BEE mechanism
+ * Update the USB and comport owner
+ *
+ * 01 14 2019 yu-hsiang.peng
+ * [MOLY00378748] [MT6297] [DSP] [Exception] Rename sonic dump file name
+ * 	
+ * 	[SEPT.DEV] [Change Feature] support vsonic/ msonic - interface
+ *
+ * 10 11 2018 yu-hsiang.peng
+ * [MOLY00356840] [Gen97][MCU][DSP]SWLA memory dump feature
+ * [MemDump] Support 97 SWLA
+ *
+ ****************************************************************************/
+
+#ifndef __TST_CATCHER_DIAGONOSIS_INFO_H__
+#define __TST_CATCHER_DIAGONOSIS_INFO_H__
+
+
+#if defined(GEN_FOR_PC)
+
+typedef enum
+{
+    //Format: CATCHER_EXC_MODULES_[Function],
+    //Format: CATCHER_EXC_OWNER_[Function]_[Owner Fist Name]_[Owner Last Name]  = CATCHER_EXC_MODULES_[Function],
+    
+    // update to VMOLY TRUNK by yu-hsiang peng 2019/09/16 survey
+    CATCHER_EXC_MODULES_UARTUSB,
+#if defined(__DHL_SP_LOGGING_SUPPORT__)
+#if defined(__FPGA__) // FPGA stage, the AP is bach and the exception flow is need to fine tune.
+    CATCHER_EXC_OWNER_CCCI_DHL_1stLine = CATCHER_EXC_MODULES_UARTUSB, //owners should be up-to-date
+#else
+    CATCHER_EXC_OWNER_CCCI_DHL_1stLine = CATCHER_EXC_MODULES_UARTUSB, //owners should be up-to-date
+#endif
+#else
+    CATCHER_EXC_OWNER_USB_Zhiqiang_Yu = CATCHER_EXC_MODULES_UARTUSB, //owners should be up-to-date
+    CATCHER_EXC_OWNER_UART_Yao_Xue = CATCHER_EXC_MODULES_UARTUSB, //owners should be up-to-date
+#endif
+
+    CATCHER_EXC_MODULES_COMPORT,
+#if defined(__DHL_SP_LOGGING_SUPPORT__)
+    CATCHER_EXC_OWNER_COMPORT_Chihhao_Chen = CATCHER_EXC_MODULES_COMPORT, //owners should be up-to-date
+#else
+    CATCHER_EXC_OWNER_COMPORT_Sherry_Zhang = CATCHER_EXC_MODULES_COMPORT, //owners should be up-to-date
+#endif
+    CATCHER_EXC_MODULES_WATCHDOG,
+    CATCHER_EXC_OWNER_WATCHDOG_Owen_Ho = CATCHER_EXC_MODULES_WATCHDOG, //owners should be up-to-date
+    CATCHER_EXC_MODULES_CCCI,
+    CATCHER_EXC_OWNER_CCCI_Actory_Ou = CATCHER_EXC_MODULES_CCCI, //owners should be up-to-date
+    CATCHER_EXC_MODULES_FLC,
+    CATCHER_EXC_OWNER_FLC_TC_Chang = CATCHER_EXC_MODULES_FLC, //owners should be up-to-date
+    CATCHER_EXC_MODULES_FLASH,
+    CATCHER_EXC_OWNER_FLASH_Tangping_Jiang = CATCHER_EXC_MODULES_FLASH, //owners should be up-to-date
+    CATCHER_EXC_MODULES_FS,
+    CATCHER_EXC_OWNER_FS_Tangping_Jiang = CATCHER_EXC_MODULES_FS, //owners should be up-to-date
+    CATCHER_EXC_MODULES_NVRAM,
+    CATCHER_EXC_OWNER_NVRAM_Yaoyong_Ju = CATCHER_EXC_MODULES_NVRAM, //owners should be up-to-date
+    CATCHER_EXC_MODULES_SS,
+    CATCHER_EXC_OWNER_ExceptionHandle_Kari_Suvanto = CATCHER_EXC_MODULES_SS, //owners should be up-to-date
+    CATCHER_EXC_MODULES_TIMER,
+    CATCHER_EXC_OWNER_ExceptionHandle_CheWei_Chang = CATCHER_EXC_MODULES_TIMER, //owners should be up-to-date
+    CATCHER_EXC_MODULES_TOPSM,
+    CATCHER_EXC_OWNER_ExceptionHandle_CheWei_Chang = CATCHER_EXC_MODULES_TOPSM, //owners should be up-to-date
+    
+    CATCHER_EXC_MODULES_USIP,
+    CATCHER_EXC_OWNER_USIP_Woody_Kuo = CATCHER_EXC_MODULES_USIP, //owners should be up-to-date
+    CATCHER_EXC_MODULES_MD32,
+    CATCHER_EXC_OWNER_MD32_Woody_Kuo = CATCHER_EXC_MODULES_MD32, //owners should be up-to-date
+    CATCHER_EXC_MODULES_SCQ,
+    CATCHER_EXC_OWNER_SCQ_Woody_Kuo = CATCHER_EXC_MODULES_SCQ, //owners should be up-to-date
+    CATCHER_EXC_MODULES_SONIC,
+    CATCHER_EXC_OWNER_SONIC_Carl_Kao = CATCHER_EXC_MODULES_SONIC, //owners should be up-to-date
+    
+    CATCHER_EXC_MODULES_DHL,
+    CATCHER_EXC_OWNER_DHL_DHL_1stLine = CATCHER_EXC_MODULES_DHL, //owners should be up-to-date
+}
+catcher_exception_handler_owner_list_t;
+
+typedef enum
+{
+    //format OWNER____[trace name]
+    //____ can't be shown in the trace name
+    // update to VMOLY TRUNK by yu-hsiang peng 2019/09/16 survey
+    OWNER____TST_EX_MSG_NESTED_EX_DETECTED                      = CATCHER_EXC_MODULES_SS,
+    OWNER____TST_EX_MSG_DUMP_SST_LOG_START                      = CATCHER_EXC_MODULES_SS,
+    OWNER____TST_EX_MSG_DUMP_SST_LOG_END                        = CATCHER_EXC_MODULES_DHL,
+    OWNER____TST_EX_MSG_REDUMP_PS_BUF_START                     = CATCHER_EXC_MODULES_DHL,
+    OWNER____TST_EX_MSG_REDUMP_PS_BUF_END                       = CATCHER_EXC_MODULES_DHL,
+
+    OWNER____SST_EXC_WATCHDOG_RESET_ENTER                    = CATCHER_EXC_MODULES_WATCHDOG,
+    OWNER____SST_EXC_WATCHDOG_RESET_EXIT                     = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_WATCHDOG_DISABLE_ENTER                  = CATCHER_EXC_MODULES_WATCHDOG,
+    OWNER____SST_EXC_WATCHDOG_DISABLE_EXIT                   = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_OPEN_LOGGING_PORT_ENTER                 = CATCHER_EXC_MODULES_DHL,
+    OWNER____SST_EXC_OPEN_LOGGING_PORT_EXIT                  = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_UST_GET_TIME_ENTER                      = CATCHER_EXC_MODULES_TIMER,
+    OWNER____SST_EXC_UST_GET_TIME_EXIT                       = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_USC_GET_TIME_ENTER                      = CATCHER_EXC_MODULES_TIMER,
+    OWNER____SST_EXC_USC_GET_TIME_EXIT                       = CATCHER_EXC_MODULES_SS,
+    //OWNER____SST_EXC_NOTIFY_DSP_ENTER                        = CATCHER_EXC_MODULES_CORESONIC_DSP,
+    //OWNER____SST_EXC_NOTIFY_DSP_EXIT                         = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_CCCI_HANDSHAKING_ENTER                  = CATCHER_EXC_MODULES_CCCI,
+    OWNER____SST_EXC_CCCI_HANDSHAKING_EXIT                   = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_TOPSM_ENABLE_FRC_ENTER                  = CATCHER_EXC_MODULES_TOPSM,
+    OWNER____SST_EXC_TOPSM_ENABLE_FRC_EXIT                   = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_RESET_HARDWARE_ENTER                    = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_RESET_HARDWARE_EXIT                     = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_INIT_EXCEPTION_RECORD_ENTER             = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_INIT_EXCEPTION_RECORD_EXIT              = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_VFP_REGISTER_DUMP_ENTER                 = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_VFP_REGISTER_DUMP_EXIT                  = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_CLEAR_PENDING_LOG_ENTER                 = CATCHER_EXC_MODULES_DHL,
+    OWNER____SST_EXC_CLEAR_PENDING_LOG_EXIT                  = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_OUTPUT_EXC_MSG_ENTER                    = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_OUTPUT_EXC_MSG_EXIT                     = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_INVOKE_SST_ENGINE_ENTER                 = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_INVOKE_SST_ENGINE_EXIT                  = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_OUTPUT_EXCEPTION_RECORD_ENTER           = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_OUTPUT_EXCEPTION_RECORD_EXIT            = CATCHER_EXC_MODULES_SS,
+    //OWNER____SST_EXC_SWLA_PRINT_LOWRAM_ENTER                 = CATCHER_EXC_MODULES_SWLA,
+    //OWNER____SST_EXC_SWLA_PRINT_LOWRAM_EXIT                  = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_PASS_CCCI_EXCINFO_ENTER                 = CATCHER_EXC_MODULES_CCCI,
+    OWNER____SST_EXC_PASS_CCCI_EXCINFO_EXIT                  = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_FLC_DEBUG_INFO_ENTER                    = CATCHER_EXC_MODULES_FLC,
+    OWNER____SST_EXC_FLC_DEBUG_INFO_EXIT                     = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_INIT_FDD_TABLE_ENTER                    = CATCHER_EXC_MODULES_FLASH,
+    OWNER____SST_EXC_INIT_FDD_TABLE_EXIT                     = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_SAVE_EXCEPTION_RECORD_ENTER             = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_SAVE_EXCEPTION_RECORD_EXIT              = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_FS_UNLOCK_ALL_ENTER                     = CATCHER_EXC_MODULES_FS,
+    OWNER____SST_EXC_FS_UNLOCK_ALL_EXIT                      = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_FS_SHUTDOWN_ENTER                       = CATCHER_EXC_MODULES_FS,
+    OWNER____SST_EXC_FS_SHUTDOWN_EXIT                        = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_NVRAM_WRITE_EXC_ENTER                   = CATCHER_EXC_MODULES_NVRAM,
+    OWNER____SST_EXC_NVRAM_WRITE_EXC_EXIT                    = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_TST_DUMP2FILE_ENTER                     = CATCHER_EXC_MODULES_DHL,
+    OWNER____SST_EXC_TST_DUMP2FILE_EXIT                      = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_DUMP_USB_DEBUG_DATA_ENTER               = CATCHER_EXC_MODULES_UARTUSB,
+    OWNER____SST_EXC_DUMP_USB_DEBUG_DATA_EXIT                = CATCHER_EXC_MODULES_SS,
+
+    OWNER____SST_EXC_RESET_EXCSP_ENTER                      = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_RESET_EXCSP_EXIT                       = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_MINILOG_DUMP_ENTER                     = CATCHER_EXC_MODULES_DHL,
+    OWNER____SST_EXC_MINILOG_DUMP_EXIT                      = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_CLEAN_RES_PROT_ENTER                   = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_CLEAN_RES_PROT_EXIT                    = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_UNGUARD_STACKSPACE_ENTER               = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_UNGUARD_STACKSPACE_EXIT                = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_INIT_DUMP_ENTER                        = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_INIT_DUMP_EXIT                         = CATCHER_EXC_MODULES_SS,
+    //OWNER____SST_EXC_CORESONIC_DSP_DUMP_DEBUGINFO_ENTER     = CATCHER_EXC_MODULES_CORESONIC_DSP,
+    //OWNER____SST_EXC_CORESONIC_DSP_DUMP_DEBUGINFO_EXIT      = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_OUTPUT_USIP_CADEFA_ENTER               = CATCHER_EXC_MODULES_USIP, 
+    OWNER____SST_EXC_OUTPUT_USIP_CADEFA_EXIT                = CATCHER_EXC_MODULES_SS, 
+    OWNER____SST_EXC_OUTPUT_MD32_CADEFA_ENTER               = CATCHER_EXC_MODULES_MD32, 
+    OWNER____SST_EXC_OUTPUT_MD32_CADEFA_EXIT                = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_OUTPUT_SCQ_CADEFA_ENTER                = CATCHER_EXC_MODULES_SCQ, 
+    OWNER____SST_EXC_OUTPUT_SCQ_CADEFA_EXIT                 = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_OUTPUT_SONIC_CADEFA_ENTER              = CATCHER_EXC_MODULES_SONIC,
+    OWNER____SST_EXC_OUTPUT_SONIC_CADEFA_EXIT               = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_OUTPUT_USIP_EXCEPTION_RECORD_ENTER     = CATCHER_EXC_MODULES_USIP,
+    OWNER____SST_EXC_OUTPUT_USIP_EXCEPTION_RECORD_EXIT      = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_OUTPUT_MD32_EXCEPTION_RECORD_ENTER     = CATCHER_EXC_MODULES_MD32,
+    OWNER____SST_EXC_OUTPUT_MD32_EXCEPTION_RECORD_EXIT      = CATCHER_EXC_MODULES_SS,
+    OWNER____SST_EXC_OUTPUT_SONIC_EXCEPTION_RECORD_ENTER    = CATCHER_EXC_MODULES_SONIC,
+    OWNER____SST_EXC_OUTPUT_SONIC_EXCEPTION_RECORD_EXIT     = CATCHER_EXC_MODULES_SS,
+    
+    OWNER____SST_EXC_HANDOVER2TST                                       = CATCHER_EXC_MODULES_DHL,
+}
+catcher_exception_handler_owner_mapping_t;
+
+typedef enum
+{
+    // update to VMOLY TRUNK by yu-hsiang peng 2018/09/28 survey
+    // update to VMOLY TRUNK by woody kuo 2019/09/02 require
+    sys_mem___SS_1stLine,
+    slave_sys_mem___SS_1stLine,
+    bb_reg___Kari_Suvanto,
+
+    core0_swla_sla_mem___IanGF_Huang,
+    core1_swla_sla_mem___IanGF_Huang,
+    core2_swla_sla_mem___IanGF_Huang,
+    core3_swla_sla_mem___IanGF_Huang,
+    
+    usip_brp_swla_mem___IanGF_Huang,
+    usip_inner_swla_mem___IanGF_Huang,
+    usip_fec_swla_mem___IanGF_Huang,
+    usip_speech_swla_mem___IanGF_Huang,
+    
+    msonic0_swla_mem___IanGF_Huang,
+    msonic1_swla_mem___IanGF_Huang,
+    vsonic0_swla_mem___IanGF_Huang,
+    
+    mcu_sla_mem___IanGF_Huang,
+    infra_sla_mem___IanGF_Huang,
+
+    usip0_mem___Woody_Kuo,
+    usip1_mem___Woody_Kuo, 
+
+    scq16_0_mem___Woody_Kuo,
+    scq16_1_mem___Woody_Kuo,
+    scq16_2_mem___Woody_Kuo,
+    scq16_3_mem___Woody_Kuo,
+
+    msonic0_mem___Carl_Kao,
+    vsonic0_mem___Carl_Kao,
+    sonic_debug_mem___Carl_Kao,
+    
+    dsp_mem___Umesh_Donta,
+
+    ast_mem___Cruze_Yu,
+
+    md32_mem___Woody_Kuo,
+    rake_mem___Woody_Kuo,
+    vrf_mem___Woody_Kuo,
+} catcher_BEE_failed_readmem_owner;
+
+#endif //#if defined(GEN_FOR_PC) 
+
+#endif //__TST_CATCHER_DIAGONOSIS_INFO_H__
diff --git a/mcu/interface/service/dhl/v2/tst_def.h b/mcu/interface/service/dhl/v2/tst_def.h
new file mode 100644
index 0000000..7ae734c
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/tst_def.h
@@ -0,0 +1,57 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file tst_def.h
+ *
+ * Description:
+ * ------------
+ *   @brief Dummy header for compat with legacy TST.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ ****************************************************************************/
+
+#ifndef _TST_DEF_H
+#define _TST_DEF_H
+
+#if defined (__DHL_MODULE__)
+#include "dhl_def.h"
+#endif
+
+#endif
diff --git a/mcu/interface/service/dhl/v2/tst_ex_handler_trc.h b/mcu/interface/service/dhl/v2/tst_ex_handler_trc.h
new file mode 100644
index 0000000..6031382
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/tst_ex_handler_trc.h
@@ -0,0 +1,85 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file tst_ex_handler_trc.h
+ *
+ * Description:
+ * ------------
+ *   @brief Definition of the index trace of TST exception handler.
+ *   @note This file is included by SST\include\SST_trc.h
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ ****************************************************************************/
+
+TRC_MSG(TST_EX_MSG_DUMP_UART_RING_BUFFER_START, "[EXC][COMMON] Dump UART ring buffer data start (port:%MDCL_DEV_T)!")
+TRC_MSG(TST_EX_MSG_DUMP_UART_RING_BUFFER_END, "[EXC][COMMON] Dump UART ring buffer data end (port:%MDCL_DEV_T)!")
+TRC_MSG(TST_EX_MSG_DISABLE_LGA_BUF_UNDER_SS_START, "[EXC][COMMON] Disable Lga buffer start!")
+TRC_MSG(TST_EX_MSG_DISABLE_LGA_BUF_UNDER_SS_END, "[EXC][COMMON] Disable Lga buffer end!")
+TRC_MSG(TST_EX_MSG_CLEAN_UART_UNDER_SS_START, "[EXC][COMMON] Clean up UART channel start (port:%MDCL_DEV_T)!")
+TRC_MSG(TST_EX_MSG_CLEAN_UART_UNDER_SS_END, "[EXC][COMMON] Clean up UART channel end (port:%MDCL_DEV_T)!")
+TRC_MSG(TST_EX_MSG_DUMP_PS_BUF_START, "[EXC][COMMON] Dump PS Buf start!")
+TRC_MSG(TST_EX_MSG_DUMP_PS_BUF_END, "[EXC][COMMON] Dump PS Buf end!")
+TRC_MSG(TST_EX_MSG_DISABLE_LGA_BUF_START, "[EXC][ELT] Disable Lga buffer start!")
+TRC_MSG(TST_EX_MSG_DISABLE_LGA_BUF_END, "[EXC][ELT] Disable Lga buffer end!")
+TRC_MSG(TST_EX_MSG_REOPEN_PORT_START, "[EXC][ELT] Reopen logging ports start!")
+TRC_MSG(TST_EX_MSG_REOPEN_PORT_END, "[EXC][ELT] Reopen logging ports end!")
+TRC_MSG(TST_EX_MSG_OPEN_PORT_START, "[EXC][ELT] open logging ports start! (Port:%MDCL_DEV_T)")
+TRC_MSG(TST_EX_MSG_OPEN_PORT_END, "[EXC][ELT] open logging ports end! (Port:%MDCL_DEV_T)")
+TRC_MSG(TST_EX_MSG_CLEAN_UART_START, "[EXC][ELT] Clean up UART channel start! (Port:%MDCL_DEV_T)")
+TRC_MSG(TST_EX_MSG_CLEAN_UART_END, "[EXC][ELT] Clean up UART channel end! (Port:%MDCL_DEV_T)")
+TRC_MSG(TST_EX_MSG_CLOSE_PORT_START, "[EXC][ELT] close logging ports start! (Port:%MDCL_DEV_T)")
+TRC_MSG(TST_EX_MSG_CLOSE_PORT_END, "[EXC][ELT] close logging ports end! (Port:%MDCL_DEV_T)")
+TRC_MSG(TST_EX_MSG_CHANGE_L1_PORT, "[EXC][ELT] Change L1 logging port from %MDCL_DEV_T to %MDCL_DEV_T !")
+TRC_MSG(TST_EX_MSG_NESTED_EX_DETECTED, "[EXC][ELT] Detect nested exception! (times:%d)")
+TRC_MSG(TST_EX_MSG_DUMP_SST_LOG_START, "[EXC][ELT] Redump exception log start!")
+TRC_MSG(TST_EX_MSG_DUMP_SST_LOG_END, "[EXC][ELT] Redump exception log end!")
+TRC_MSG(TST_EX_MSG_DRV_EX_HANDLER_START, "[EXC][ELT] Drv ex handler start!")
+TRC_MSG(TST_EX_MSG_DRV_EX_HANDLER_END, "[EXC][ELT] Drv ex handler end!")
+TRC_MSG(TST_EX_MSG_DUMP_LGA_BUF_START, "[EXC][ELT] Dump Lga buffer start!")
+TRC_MSG(TST_EX_MSG_DUMP_LGA_BUF_END, "[EXC][ELT] Dump Lga buffer end!")
+TRC_MSG(TST_EX_MSG_REDUMP_PS_BUF_START, "[EXC][ELT] Redump PS buffer start!")
+TRC_MSG(TST_EX_MSG_REDUMP_PS_BUF_END, "[EXC][ELT] Redump PS buffer end!")
+TRC_MSG(TST_EX_MSG_REDUMP_L1_BUF_START, "[EXC][ELT] Redump L1 buffer start!")
+TRC_MSG(TST_EX_MSG_REDUMP_L1_BUF_END, "[EXC][ELT] Redump L1 buffer end!")
+TRC_MSG(TST_EX_MSG_GET_ELT_CMD, "[EXC][ELT] Get one PC exception command:%Mdhl_command_type !")
+TRC_MSG(TST_EX_MSG_GET_ELT_CMD_CHECKSUM_ERROR, "[EXC][ELT] Get one PC exception command:%Mdhl_command_type, but the checksum is incorrect! Expected checksum: %x, Got checksum: %x")
+TRC_MSG(TST_EX_MSG_QUERY_MEMORY_DEUMP_INFO, "[EXC][ELT] Query %MDHL_MEM_TYPE(type) to dump, result = %d!")
+TRC_MSG(TST_EX_MSG_DUMP_MEMORY_DETAIL_INFO, "[EXC][ELT] Start dump %MDHL_MEM_TYPE(type) 0X%x(address) 0X%x(length)!")
+TRC_MSG(TST_EX_MSG_QUERY_SWLA_DETAIL_INFO, "[EXC][ELT] Query SWLA dump  0X%x(address) 0X%x(length) 0X%x(ptr)!")
diff --git a/mcu/interface/service/dhl/v2/tst_hal_internal_wrapper_defs.h b/mcu/interface/service/dhl/v2/tst_hal_internal_wrapper_defs.h
new file mode 100644
index 0000000..b4aeda9
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/tst_hal_internal_wrapper_defs.h
@@ -0,0 +1,60 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file tst_hal_internal_wrapper_defs.h
+ *
+ * Description:
+ * ------------
+ *   @brief Dummy header for compat with legacy TST.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ ****************************************************************************/
+
+#ifndef __TST_HAL_INTERNAL_WRAPPER_DEFS_H__
+#define __TST_HAL_INTERNAL_WRAPPER_DEFS_H__
+
+#include "kal_public_api.h"
+#include "dcl.h"
+
+kal_bool tst_hal_USBDL_Is_USB_Download_Mode(void);
+kal_bool tst_hal_USB_Meta_Mode(DCL_CTRL_CMD dcl_cmd);
+kal_bool tst_hal_USBDL_Is_USB_Fast_Meta_Mode(void);
+
+#endif
diff --git a/mcu/interface/service/dhl/v2/tst_lmu_hw.h b/mcu/interface/service/dhl/v2/tst_lmu_hw.h
new file mode 100644
index 0000000..b6b4f9b
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/tst_lmu_hw.h
@@ -0,0 +1,74 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file tst_lmu_hw.h
+ *
+ * Description:
+ * ------------
+ *   @brief Dummy driver for LMU HW. TODO: phase-out.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ ****************************************************************************/
+
+#ifndef __TST_LMU_HW_H__
+#define __TST_LMU_HW_H__
+
+#if defined(__TST_LMU_LOGGING__) || defined(USE_DNT_LOGGING)
+#error "LMU is not avaiable"
+#else //#if defined(__TST_LMU_LOGGING__) || defined(USE_DNT_LOGGING)
+
+#define LMU_Write_CSM_Addr_TS(reg_num, value)
+#define LMU_Write_Short_Ary(ptr, ptr_length)
+#define LMU_Write_Short_Word(word_data)
+
+#define LMU_Write_Task_CSM(thread_id)
+#if !defined(__FCORE__) || !defined(_LANGUAGE_ASM)
+#define LMU_Write_ISR_CSM(isr_id)
+#define LMU_Write_ISR_END_CSM(isr_id)
+#define LMU_Write_ISR_END_RESUME_CSM(marker)
+#else
+#define LMU_Write_ISR_CSM(pReg, dReg)
+#define LMU_Write_ISR_END_CSM(pReg, dReg)
+#define LMU_Write_ISR_END_RESUME_CSM(pReg, dReg)
+#endif
+
+#endif  //#if defined(__TST_LMU_LOGGING__) || defined(USE_DNT_LOGGING)
+#endif  //#ifndef __TST_LMU_HW_H__ 
+
diff --git a/mcu/interface/service/dhl/v2/tst_sap.h b/mcu/interface/service/dhl/v2/tst_sap.h
new file mode 100644
index 0000000..0a053b8
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/tst_sap.h
@@ -0,0 +1,69 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file tst_sap.h
+ *
+ * Description:
+ * ------------
+ *   @brief TST legacy interface.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ ****************************************************************************/
+
+#ifndef _TST_SAP_H
+#define _TST_SAP_H
+
+#include "kal_general_types.h"
+
+typedef struct
+{
+    kal_uint8   ref_count;
+    kal_uint16   param_len;
+    kal_uint8   index;
+#if defined(__UE_SIMULATOR__)
+    kal_uint8   string[256];
+#else
+    kal_uint8   string[128];
+#endif
+}
+tst_module_string_inject_struct;
+
+#endif /* _TST_SAP_H */
+
diff --git a/mcu/interface/service/dhl/v2/ulsp_interface.h b/mcu/interface/service/dhl/v2/ulsp_interface.h
new file mode 100644
index 0000000..bc70b54
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/ulsp_interface.h
@@ -0,0 +1,62 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file ulsp_interface.h
+ *
+ * Description:
+ * ------------
+ *   @brief Public interface for dormant flow.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ ****************************************************************************/
+
+#ifndef _ULSP_INTERFACE_H_
+#define _ULSP_INTERFACE_H_
+
+#include "kal_general_types.h"
+
+void ulsp_mcu_backup();
+void ulsp_mcu_restore();
+kal_bool ulsp_check_lock_sleep();
+
+
+#endif //_ULSP_INTERFACE_H_
+
+
diff --git a/mcu/interface/service/dhl/v2/ulsp_mcu_logging.h b/mcu/interface/service/dhl/v2/ulsp_mcu_logging.h
new file mode 100644
index 0000000..7cec951
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/ulsp_mcu_logging.h
@@ -0,0 +1,1105 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file ulsp_mcu_logging.h
+ *
+ * Description:
+ * ------------
+ *   @brief Interface of ULS+ MCU side HW control level.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 12 25 2019 yancy.chien
+ * [MOLY00465015] [DHL] Disable the control channel message when log stopped
+ * Skip access ULSP register in DHL UT.
+ *
+ * 12 09 2019 yen-hsuan.lin
+ * [MOLY00327199] [Gen97] Development
+ * [MOLY00464641] Fix the dhl low power problem
+ * 	
+ * 	merger the Gen98 Fix into VMOLY trunk
+ *
+ * 08 08 2019 guan-ren.chen
+ * [MOLY00427332] [MT6297][Apollo][Overnight][LegacyRAT][CHT][TPE][VMOLY][20190730]assert fail:dhl_ulsp.c
+ * LS abort fail SW workaround for SCQ16 (WHQA_00039659).
+ *
+ * 07 31 2019 guan-ren.chen
+ * [MOLY00420032] [HCR][Top Issue][MT6297][Apollo][MP1][SQC][Dongle][HQ][MTBF][Lab][Ericsson][ErrorTimes:6][1][core0,vpe0,tc0(vpe0)]Assert fail: dhl_ulsp.c 688 0x2 0x0 0x0 - 0IDLE
+ * LS abort fail SW workaround (WHQA_00039659).
+ *
+ * 06 21 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * Rename ulsp_log_pb_dbg_info.
+ *
+ * 06 10 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * Change ASSERT in dormant flow to DEBUG_ASSERT and add abort fail message.
+ *
+ * 05 08 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * Fix Gen95 build error on dhl v2.
+ *
+ * 04 16 2019 guan-ren.chen
+ * [MOLY00399588] [Gen97] Dormant flow
+ * Dormant flow. Struct access ULSP reg.
+ *
+ * 03 13 2019 guan-ren.chen
+ * [MOLY00391128] [Gen97] Develop for logging service
+ * Change print PS ex log location.
+ *  Combine ULSP print ex log and print redump log function.
+ *
+ * 01 23 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * On-demand corresponding change for SEPT.DEV.
+ *
+ * 10 08 2018 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * On-demand logging porting.
+ *
+ * 10 08 2018 mojo.lai
+ * [MOLY00357279] DSP logging patch
+ *  
+ *  Redump dsp log after exception
+ *
+ ****************************************************************************/
+
+#ifndef _ULSP_MCU_LOGGING_H_
+#define _ULSP_MCU_LOGGING_H_
+
+#include "kal_general_types.h"
+
+#if defined(__USE_ULSP__) || defined(__USE_ULSP_SW_SIMULATOR__)
+
+#define ULSP_FRC_ADDR 0xA00D0800
+#define ULSP_FRC_DATA 0xF2CC0001
+
+#define ULSP_RECTIFY_SYNC_PATTERN  (0x6F646D64)
+#define ULSP_IDLE_SYNC_PATTERN     (0x24823466)
+#define ULSP_BOUNDARY_SYNC_PATTERN (0x24546293)
+
+#define ULSP_FIXED_SYNC_PATTERN (0x7997)
+
+#if (CUR_GEN >= MD_GEN97)
+#define ULSP_PB_SOURCE_ID_NULL (0)
+
+#define ULSP_PB_L1_LOG_BASE_SOURCEID  (0x01) //normal
+#define ULSP_PB_L2_LOG_BASE_SOURCEID  (0x21)
+#define ULSP_PB_L1_LOG_ONDEMAND_BASE_SOURCEID (0x41)
+#define ULSP_PB_L2_LOG_ONDEMAND_BASE_SOURCEID (0x61)
+#else
+#define ULSP_PB_L1_LOG_BASE_SOURCEID  (1) //normal only
+#define ULSP_PB_L2_LOG_BASE_SOURCEID  (17)
+#define ULSP_PB_L1_LOG_ONDEMAND_BASE_SOURCEID (0x0) // 93 95 no support on-demand
+#define ULSP_PB_L2_LOG_ONDEMAND_BASE_SOURCEID (0x0)
+#endif
+#if(MD_GEN98)
+#define ULSP_PB_L1_SETTING_SOURCEID ULSP_PB_L1_LOG_BASE_SOURCEID
+#define ULSP_PB_L2_SETTING_SOURCEID ULSP_PB_L2_LOG_BASE_SOURCEID
+#define ULSP_PB_L1_ONDEMAND_SETTING_SOURCEID ULSP_PB_L1_LOG_ONDEMAND_BASE_SOURCEID
+#define ULSP_PB_L2_ONDEMAND_SETTING_SOURCEID ULSP_PB_L2_LOG_ONDEMAND_BASE_SOURCEID
+#else
+#define ULSP_PB_L1_SETTING_SOURCEID ((ULSP_PB_L1_LOG_ONDEMAND_BASE_SOURCEID&0xFF) <<8 | (ULSP_PB_L1_LOG_BASE_SOURCEID &0xFF))
+#define ULSP_PB_L2_SETTING_SOURCEID ((ULSP_PB_L2_LOG_ONDEMAND_BASE_SOURCEID&0xFF) <<8 | (ULSP_PB_L2_LOG_BASE_SOURCEID &0xFF))
+#endif
+#define ULSP_PB_DSP_LOG_BASE_SOURCEID (1)
+
+// LTE
+#define ULSP_PB_DSP_INNER_LOG_BASE_SOURCEID (1)
+#define ULSP_PB_DSP_BRP_LOG_BASE_SOURCEID (2)
+#define ULSP_PB_DSP_FEC_LOG_BASE_SOURCEID (3)
+#define ULSP_PB_DSP_SPEECH_LOG_BASE_SOURCEID (4)
+#define ULSP_PB_DSP_SCQ16_0_LOG_BASE_SOURCEID (5)
+#define ULSP_PB_DSP_SCQ16_1_LOG_BASE_SOURCEID (6)
+#define ULSP_PB_DSP_RAKE_LOG_BASE_SOURCEID (7)
+#define ULSP_PB_DSP_SCQ16_2_LOG_BASE_SOURCEID (8)
+#define ULSP_PB_DSP_SCQ16_3_LOG_BASE_SOURCEID (9)
+
+// NR
+#define ULSP_PB_SOURCE_ID_MCORE0_TH0 (1)
+#define ULSP_PB_SOURCE_ID_MCORE0_TH1 (2)
+#define ULSP_PB_SOURCE_ID_MCORE0_TH2 (3)
+#define ULSP_PB_SOURCE_ID_MCORE0_TH3 (4)
+#define ULSP_PB_SOURCE_ID_MCORE1_TH0 (5)
+#define ULSP_PB_SOURCE_ID_MCORE1_TH1 (6)
+#define ULSP_PB_SOURCE_ID_MCORE1_TH2 (7)
+#define ULSP_PB_SOURCE_ID_MCORE1_TH3 (8)
+#define ULSP_PB_SOURCE_ID_VCORE0_TH0 (9)
+#define ULSP_PB_SOURCE_ID_VCORE0_TH1 (10)
+#define ULSP_PB_SOURCE_ID_VCORE0_TH2 (11)
+#define ULSP_PB_SOURCE_ID_VCORE0_TH3 (12)
+#define ULSP_PB_SOURCE_ID_VCORE1_TH0 (13)
+#define ULSP_PB_SOURCE_ID_VCORE1_TH1 (14)
+#define ULSP_PB_SOURCE_ID_VCORE1_TH2 (15)
+#define ULSP_PB_SOURCE_ID_VCORE1_TH3 (16)
+
+
+#if defined (__MTK_TARGET__)
+#include "boot.h"
+
+/*
+ | base addresses
+ */
+#if(MD_GEN98)
+#define ULSP_PB0_BASE_ADDR (GCR_CUSTOM_ADDR+0x8000)
+#define ULSP_PB1_BASE_ADDR (GCR_CUSTOM_ADDR+0xA000)
+#define ULSP_PB2_BASE_ADDR (GCR_CUSTOM_ADDR+0xC000)
+#define ULSP_PB3_BASE_ADDR (GCR_CUSTOM_ADDR+0xE000)
+#else     
+#define ULSP_PB0_BASE_ADDR (GCR_CUSTOM_ADDR+0xC000)
+#define ULSP_PB1_BASE_ADDR (GCR_CUSTOM_ADDR+0xC100)
+#endif
+#define ULSP_VCORE_L1_RESET_ADDR (0xA50C68DC)
+
+#define ULSP_VCORE_PB_BASE_ADDR    (0xA50C6800)
+#define ULSP_SCQ16_0_PB_BASE_ADDR  (0xABE08000)
+#define ULSP_SCQ16_1_PB_BASE_ADDR  (0xABF08000)
+#define ULSP_SCQ16_2_PB_BASE_ADDR  (0xAC008000)
+#define ULSP_SCQ16_3_PB_BASE_ADDR  (0xAC108000)
+#if (CUR_GEN >= MD_GEN97)
+
+#if(MD_GEN98)
+#define ULSP_PB2_NORMAL_DATA_REG_ADDR ULSP_PB2_BASE_ADDR
+#define ULSP_PB3_NORMAL_DATA_REG_ADDR ULSP_PB3_BASE_ADDR
+#define ULSP_PB0_NORMAL_DATA_REG_ADDR ULSP_PB0_BASE_ADDR
+#define ULSP_PB0_ONDEMAND_DATA_REG_ADDR ULSP_PB2_NORMAL_DATA_REG_ADDR
+#define ULSP_PB1_NORMAL_DATA_REG_ADDR ULSP_PB1_BASE_ADDR
+#define ULSP_PB1_ONDEMAND_DATA_REG_ADDR ULSP_PB3_NORMAL_DATA_REG_ADDR
+#else
+#define ULSP_PB0_NORMAL_DATA_REG_ADDR ULSP_PB0_BASE_ADDR
+#define ULSP_PB0_ONDEMAND_DATA_REG_ADDR (ULSP_PB0_BASE_ADDR+sizeof(ulsp_pb_data_reg))
+#define ULSP_PB1_NORMAL_DATA_REG_ADDR ULSP_PB1_BASE_ADDR
+#define ULSP_PB1_ONDEMAND_DATA_REG_ADDR (ULSP_PB1_BASE_ADDR+sizeof(ulsp_pb_data_reg))
+#endif
+typedef struct{
+    kal_uint32 DATA_F_8;
+    kal_uint32 DATA_F_16;
+    kal_uint32 DATA_F_24;
+    kal_uint32 DATA_F_32;
+    kal_uint32 DATA_M_8;
+    kal_uint32 DATA_M_16;
+    kal_uint32 DATA_M_24;
+    kal_uint32 DATA_M_32;
+    kal_uint32 DATA_L_8;
+    kal_uint32 DATA_L_16;
+    kal_uint32 DATA_L_24;
+    kal_uint32 DATA_L_32;
+    kal_uint32 DATA_S_8;
+    kal_uint32 DATA_S_16;
+    kal_uint32 DATA_S_24;
+    kal_uint32 DATA_S_32;
+    kal_uint32 FRC_16;
+    kal_uint32 FRC_32;
+    kal_uint32 FRC_40;
+    kal_uint32 SYNC;
+}ulsp_pb_data_reg;
+
+typedef struct{
+    ulsp_pb_data_reg NORMAL_DATA_REG;
+    ulsp_pb_data_reg ONDEMAND_DATA_REG;
+    kal_uint32 SYNC_FIXED_NORMAL;
+    kal_uint32 SYNC_FIXED_ONDEMAND;
+    kal_uint32 ULSP_PAD_1;
+    kal_uint32 ULSP_PAD_2;
+    /* PB_CON_LOCK_MARKER */
+    kal_uint32 CON_LOCK_MARKER;
+    /* PB_CON_BEFORE_START */
+    kal_uint32 CLK_DIS:1;
+    kal_uint32 START:1;
+    kal_uint32 RESET:1;
+    kal_uint32 AUTO_TEST_EN:1;
+    kal_uint32 INCR_TEST_EN:1;
+    kal_uint32 HW_PWR_PROTECT_MODE_EN:1;
+    kal_uint32 PB_CON_BEFORE_START_PAD0:2;
+    kal_uint32 PB_PRIORITY:3;
+    kal_uint32 PB_CON_BEFORE_START_PAD1:1;
+    kal_uint32 ULTRA_HIGH_PRIORITY:1;
+    kal_uint32 PB_CON_BEFORE_START_PAD2:1;
+    kal_uint32 BUF_UNLOCK_THS:2;
+    kal_uint32 SOURCE_ID_NORMAL:7;
+    kal_uint32 PB_CON_BEFORE_START_PAD3:1;
+    kal_uint32 SOURCE_ID_ONDEMAND:7;
+    kal_uint32 PB_CON_BEFORE_START_PAD4:1;
+    /* PB_RUN_TIME_MANAGE */
+    kal_uint32 RESUME_AFTER_ABORT:1;
+    kal_uint32 RESUME_AFTER_FLUSH:1;
+    kal_uint32 ABORT:1;
+    kal_uint32 FLUSH:1;
+    kal_uint32 DISABLE_OUTPUT:1;
+    kal_uint32 DISABLE_INPUT:1;
+    kal_uint32 PB_RUN_TIME_MANAGE_PAD0:26;
+    /* PB_STATUS */
+    kal_uint32 ABORT_DONE:1;
+    kal_uint32 FLUSH_DONE:1;
+    kal_uint32 BUF_FULL:1;
+    kal_uint32 BUF_LOCK:1;
+    kal_uint32 LOCAL_ABORT_DONE:1;
+    kal_uint32 LOCAL_FLUSH_DONE:1;
+    kal_uint32 L1_FLUSH_DONE:1;
+    kal_uint32 PB_STATUS_PAD0:1;
+    kal_uint32 BUF_SIZE:2;
+    kal_uint32 PB_STATUS_PAD1:2;
+    kal_uint32 FSM_STATE:3;
+    kal_uint32 PB_STATUS_PAD2:1;
+    kal_uint32 BUF_MAX_USED_SPACE:6;
+    kal_uint32 PB_STATUS_PAD3:2;
+    kal_uint32 BUF_USED_SPACE:6;
+    kal_uint32 PB_STATUS_PAD4:2;
+    /* OVERFLOW_STA */
+    kal_uint32 OVF_DATA_NUM_NORMAL:8;
+    kal_uint32 OVF_PACKET_NUM_NORMAL:8;
+    kal_uint32 OVF_DATA_NUM_ONDEMAND:8;
+    kal_uint32 OVF_PACKET_NUM_ONDEMAND:8;
+    /* OVERFLOW_STA_CLR */
+    kal_uint32 OVF_DATA_NUM_NORMAL_CLEAR:1;
+    kal_uint32 OVF_PACKET_NUM_NORMAL_CLEAR:1;
+    kal_uint32 OVF_DATA_NUM_ONDEMAND_CLEAR:1;
+    kal_uint32 OVF_PACKET_NUM_ONDEMAND_CLEAR:1;
+    kal_uint32 PB_OVERFLOW_STA_CLR_PAD0:28;
+    /* BUF_DBG_READ_PTR */
+    kal_uint32 BUF_DBG_READ_PTR:6;
+    kal_uint32 PB_BUF_DBG_READ_PTR_PAD0:26;
+    /* BUF_DBG_READ_DATA */
+    kal_uint32 BUF_DBG_READ_DATA;
+    /* BUF_DATA_WRITE_PTR */
+    kal_uint32 BUF_DATA_WRITE_PTR:6;
+    kal_uint32 PB_BUF_DATA_WRITE_PTR_PAD0:26;
+    /* PB_DBG_INFO */
+    kal_uint32 DEBUG_FLAG_SEL:3;
+    kal_uint32 PB_DBG_INFO_PAD0:13;
+    kal_uint32 DEBUG_FLAG:16;
+    /* L1_DEBUG_INFO */
+    kal_uint32 L1_DEBUG_FLAG_SEL:3;
+    kal_uint32 L1_DEBUG_INFO_PAD0:13;
+    kal_uint32 L1_DEBUG_FLAG:16;
+    /* L1_SW_RESET */
+    kal_uint32 L1_SW_RESET:1;
+    kal_uint32 L1_SW_RESET_PAD0:31;
+    /* STALL_CORE_EN */
+    kal_uint32 STALL_CORE_EN:1;
+    kal_uint32 PB_STALL_CORE_EN_PAD0:31;
+    /* CORE_SOURCE_ID_BASE */
+    kal_uint32 CORE_SOURCE_ID_BASE;
+    kal_uint32 ULSP_PAD_3;
+    kal_uint32 ULSP_PAD_4;
+    /* READ_FRC_EN */
+    kal_uint32 READ_FRC_EN:1;
+    kal_uint32 PB_READ_FRC_EN_PAD0:31;
+    /* READ_FRC_READY */
+    kal_uint32 READ_FRC_READY:1;
+    kal_uint32 PB_READ_FRC_READY_PAD0:31;
+    /* READ_FRC_VAL_MSB32 */
+    kal_uint32 READ_FRC_VAL_MSB32;
+    /* READ_FRC_VAL_LSB32 */    
+    kal_uint32 READ_FRC_VAL_LSB32;
+#if(MD_GEN98)
+    /* AtOMIC_WRITE_OFFSET */    
+    kal_uint32 AtOMIC_WRITE_OFFSET:13;
+    kal_uint32 AtOMIC_WRITE_OFFSET_DEFAULT:19;
+    /* AtOMIC_WRITE_OFFSET_BUF_DATA_0*/    
+    kal_uint32 AtOMIC_WRITE_OFFSET_BUF_DATA_0;
+    /* AtOMIC_WRITE_OFFSET_BUF_DATA_1*/    
+    kal_uint32 AtOMIC_WRITE_OFFSET_BUF_DATA_1;
+    /* AtOMIC_WRITE_OFFSET_BUF_DATA_RESET*/
+    kal_uint32 AtOMIC_WRITE_OFFSET_BUF_DATA_RESET;
+    /* AtOMIC_WRITE_OFFSET_BUF_DATA_STATUS*/
+    kal_uint32 AtOMIC_WRITE_OFFSET_BUF_DATA_STATUS;
+#endif
+}ulsp_pb_reg;
+
+#else //(CUR_GEN >= MD_GEN97)
+
+#define ULSP_PB0_NORMAL_DATA_REG_ADDR ULSP_PB0_BASE_ADDR
+#define ULSP_PB1_NORMAL_DATA_REG_ADDR ULSP_PB1_BASE_ADDR
+
+//Ondemand logging not support on Gen95, all ondemand logging send to normal path
+#define ULSP_PB0_ONDEMAND_DATA_REG_ADDR ULSP_PB0_NORMAL_DATA_REG_ADDR
+#define ULSP_PB1_ONDEMAND_DATA_REG_ADDR ULSP_PB1_NORMAL_DATA_REG_ADDR
+
+typedef struct{
+    kal_uint32 DATA_F_8;
+    kal_uint32 DATA_F_16;
+    kal_uint32 DATA_F_24;
+    kal_uint32 DATA_F_32;
+    kal_uint32 DATA_M_8;
+    kal_uint32 DATA_M_16;
+    kal_uint32 DATA_M_24;
+    kal_uint32 DATA_M_32;
+    kal_uint32 DATA_L_8;
+    kal_uint32 DATA_L_16;
+    kal_uint32 DATA_L_24;
+    kal_uint32 DATA_L_32;
+    kal_uint32 DATA_S_8;
+    kal_uint32 DATA_S_16;
+    kal_uint32 DATA_S_24;
+    kal_uint32 DATA_S_32;
+    kal_uint32 DATA_F_TS_8;
+    kal_uint32 DATA_F_TS_16;
+    kal_uint32 DATA_F_TS_24;
+    kal_uint32 DATA_F_TS_32;
+    kal_uint32 DATA_S_TS_8;
+    kal_uint32 DATA_S_TS_16;
+    kal_uint32 DATA_S_TS_24;
+    kal_uint32 DATA_S_TS_32;
+    kal_uint32 SYNC;
+    kal_uint32 FRC_40;
+}ulsp_pb_data_reg;
+
+typedef struct{
+    ulsp_pb_data_reg NORMAL_DATA_REG;
+    kal_uint32 ULSP_PAD_1;
+    kal_uint32 ULSP_PAD_2;
+    /* PB_CON_LOCK_MARKER */
+    kal_uint32 CON_LOCK_MARKER;
+    /* PB_CON_BEFORE_START */
+    kal_uint32 CLK_DIS:1;
+    kal_uint32 START:1;
+    kal_uint32 RESET:1;
+    kal_uint32 AUTO_TEST_EN:1;
+    kal_uint32 INCR_TEST_EN:1;
+    kal_uint32 PB_CON_BEFORE_START_PAD0:3;
+    kal_uint32 PB_PRIORITY:3;
+    kal_uint32 PB_CON_BEFORE_START_PAD1:1;
+    kal_uint32 ULTRA_HIGH_PRIORITY:1;
+    kal_uint32 PB_CON_BEFORE_START_PAD2:3;
+    kal_uint32 SOURCE_ID:5;
+    kal_uint32 PB_CON_BEFORE_START_PAD3:3;
+    kal_uint32 BUF_UNLOCK_THS:2;
+    kal_uint32 PB_CON_BEFORE_START_PAD4:6;
+    /* PB_RUN_TIME_MANAGE */
+    kal_uint32 RESUME_AFTER_ABORT:1;
+    kal_uint32 RESUME_AFTER_FLUSH:1;
+    kal_uint32 ABORT:1;
+    kal_uint32 FLUSH:1;
+    kal_uint32 DISABLE_OUTPUT:1;
+    kal_uint32 DISABLE_INPUT:1;
+    kal_uint32 PB_RUN_TIME_MANAGE_PAD0:26;
+    /* PB_STATUS */
+    kal_uint32 ABORT_DONE:1;
+    kal_uint32 FLUSH_DONE:1;
+    kal_uint32 BUF_FULL:1;
+    kal_uint32 BUF_LOCK:1;
+    kal_uint32 LOCAL_ABORT_DONE:1;
+    kal_uint32 LOCAL_FLUSH_DONE:1;
+    kal_uint32 L1_FLUSH_DONE:1;
+    kal_uint32 PB_STATUS_PAD0:1;
+    kal_uint32 BUF_SIZE:2;
+    kal_uint32 PB_STATUS_PAD1:2;
+    kal_uint32 FSM_STATE:3;
+    kal_uint32 PB_STATUS_PAD2:1;
+    kal_uint32 BUF_MAX_USED_SPACE:6;
+    kal_uint32 PB_STATUS_PAD3:2;
+    kal_uint32 BUF_USED_SPACE:6;
+    kal_uint32 PB_STATUS_PAD4:2;
+    /* OVERFLOW_STA */
+    kal_uint32 OVF_DATA_NUM:12;
+    kal_uint32 PB_OVERFLOW_STA_PAD0:4;
+    kal_uint32 OVF_PACKET_NUM:8;
+    kal_uint32 PB_OVERFLOW_STA_PAD1:8;
+    /* OVERFLOW_STA_CLR */
+    kal_uint32 OVF_DATA_NUM_CLEAR:1;
+    kal_uint32 OVF_PACKET_NUM_CLEAR:1;
+    kal_uint32 PB_OVERFLOW_STA_CLR_PAD0:30;
+    /* BUF_DBG_READ_PTR */
+    kal_uint32 BUF_DBG_READ_PTR:6;
+    kal_uint32 PB_BUF_DBG_READ_PTR_PAD0:26;
+    /* BUF_DBG_READ_DATA */
+    kal_uint32 BUF_DBG_READ_DATA;
+    /* BUF_DATA_WRITE_PTR */
+    kal_uint32 BUF_DATA_WRITE_PTR:6;
+    kal_uint32 PB_BUF_DATA_WRITE_PTR_PAD0:26;
+    /* PB_DBG_INFO */
+    kal_uint32 DEBUG_FLAG_SEL:3;
+    kal_uint32 PB_DBG_INFO_PAD0:13;
+    kal_uint32 DEBUG_FLAG:16;
+    kal_uint32 ULSP_PAD_3;
+    kal_uint32 ULSP_PAD_4;
+    /* READ_FRC_EN */
+    kal_uint32 READ_FRC_EN:1;
+    kal_uint32 PB_READ_FRC_EN_PAD0:31;
+    /* READ_FRC_READY */
+    kal_uint32 READ_FRC_READY:1;
+    kal_uint32 PB_READ_FRC_READY_PAD0:31;
+    /* READ_FRC_VAL_MSB32 */
+    kal_uint32 READ_FRC_VAL_MSB32;
+    /* READ_FRC_VAL_LSB32 */
+    kal_uint32 READ_FRC_VAL_LSB32;
+    /* STALL_CORE_EN */ 
+    kal_uint32 STALL_CORE_EN:1;
+    kal_uint32 PB_STALL_CORE_EN_PAD0:31;
+    kal_uint32 ULSP_PAD_5;
+    kal_uint32 ULSP_PAD_6;
+    kal_uint32 ULSP_PAD_7;
+    /* L1_DEBUG_INFO */
+    kal_uint32 L1_DEBUG_FLAG_SEL:3;
+    kal_uint32 L1_DEBUG_INFO_PAD0:13;
+    kal_uint32 L1_DEBUG_FLAG:16;
+    kal_uint32 ULSP_PAD_8;
+    kal_uint32 ULSP_PAD_9;
+    /* L1_SW_RESET */
+    kal_uint32 L1_SW_RESET:1;
+    kal_uint32 L1_SW_RESET_PAD0:31;
+    /* CORE_SOURCE_ID_BASE */
+    kal_uint32 CORE_SOURCE_ID_BASE:5;
+    kal_uint32 CORE_SOURCE_ID_BASE_PAD0:27;
+}ulsp_pb_reg;
+
+#endif //(CUR_GEN >= MD_GEN97)
+#define ULSP_CON_LOCK_MARKER (0xACCE)
+#define ULSP_CON_LOCK_MARKER_DISABLE (0xDDDD)
+/*---------------------------------------------------------------------------
+ | @macro ULSP_READ
+ | @brief Read the contents of a ULSP register.
+ |
+ | @param[in] ulsp_reg - name of ULSP Register to read.
+ |
+ | @return kal_uint32 data read from the specified ULS register.
+ |
+ ---------------------------------------------------------------------------*/
+#if !defined(__DHL_STANDALONE_TEST__)
+#define ULSP_READ(pb_base, reg)       (((volatile ulsp_pb_reg *)pb_base)->reg)
+#else
+#define ULSP_READ(pb_base, reg)       (0)
+#endif
+/*---------------------------------------------------------------------------
+ | @macro ULSP_WRITE
+ | @brief Write a 32bit data to the specified ULSP register.
+ |
+ | @param[in] ulsp_reg - Name of the ULS Register to be updated.
+ | @param[in] data    - 32 bit data word.
+ |
+ ---------------------------------------------------------------------------*/
+#if !defined(__DHL_STANDALONE_TEST__)
+#define ULSP_WRITE(pb_base, reg, data) do{ \
+        volatile ulsp_pb_reg *ulsp_reg = (ulsp_pb_reg *)pb_base; \
+        ulsp_reg->reg = data; \
+        kal_uint32 lock = ulsp_reg->reg; \
+        (void)(lock); \
+    } while(0)
+
+#define ULSP_WRITE_DATA(pb_data_reg_base, reg, data)       ((volatile ulsp_pb_data_reg *)pb_data_reg_base)->reg = (kal_uint32)data
+
+#else
+// bypass ULSP register access in DHL UT
+#define ULSP_WRITE(pb_base, reg, data) do{ \
+        NOT_IMPLEMENT_WARNING_NO_RET(); \
+    } while(0)
+
+#define ULSP_WRITE_DATA(pb_data_reg_base, reg, data) do{ \
+        NOT_IMPLEMENT_WARNING_NO_RET(); \
+    } while(0)
+#endif
+
+/*---------------------------------------------------------------------------
+    PB0 SYNC_FIXED and LOCK_MARKER register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB0_SYNC_FIXED_NORMAL()                  ULSP_READ(ULSP_PB0_BASE_ADDR, SYNC_FIXED_NORMAL)
+#define ULSP_READ_PB0_SYNC_FIXED_ONDEMAND()                ULSP_READ(ULSP_PB0_BASE_ADDR, SYNC_FIXED_ONDEMAND)
+#define ULSP_READ_PB0_LOCK_MARKER()                        ULSP_READ(ULSP_PB0_BASE_ADDR, CON_LOCK_MARKER)
+
+#define ULSP_WRITE_PB0_SYNC_FIXED_NORMAL(val)              ULSP_WRITE(ULSP_PB0_BASE_ADDR, SYNC_FIXED_NORMAL, val)
+#define ULSP_WRITE_PB0_SYNC_FIXED_ONDEMAND(val)            ULSP_WRITE(ULSP_PB0_BASE_ADDR, SYNC_FIXED_ONDEMAND, val)
+#define ULSP_WRITE_PB0_CON_LOCK_MARKER(val)                ULSP_WRITE(ULSP_PB0_BASE_ADDR, CON_LOCK_MARKER, val)
+
+/*---------------------------------------------------------------------------
+    PB0_CON_BEFORE_START register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB0_CLK_DIS()                            ULSP_READ(ULSP_PB0_BASE_ADDR, CLK_DIS)
+#define ULSP_READ_PB0_START()                              ULSP_READ(ULSP_PB0_BASE_ADDR, START)
+#define ULSP_READ_PB0_RESET()                              ULSP_READ(ULSP_PB0_BASE_ADDR, RESET)
+#define ULSP_READ_PB0_AUTO_TEST_EN()                       ULSP_READ(ULSP_PB0_BASE_ADDR, AUTO_TEST_EN)
+#define ULSP_READ_PB0_INCR_TEST_EN()                       ULSP_READ(ULSP_PB0_BASE_ADDR, INCR_TEST_EN)
+#define ULSP_READ_PB0_HW_PWR_PROTECT_MODE_EN()             ULSP_READ(ULSP_PB0_BASE_ADDR, HW_PWR_PROTECT_MODE_EN)
+#define ULSP_READ_PB0_PB_PRIORITY()                        ULSP_READ(ULSP_PB0_BASE_ADDR, PB_PRIORITY)
+#define ULSP_READ_PB0_ULTRA_HIGH_PRIORITY()                ULSP_READ(ULSP_PB0_BASE_ADDR, ULTRA_HIGH_PRIORITY)
+#define ULSP_READ_PB0_BUF_UNLOCK_THS()                     ULSP_READ(ULSP_PB0_BASE_ADDR, BUF_UNLOCK_THS)
+
+#define ULSP_WRITE_PB0_CLK_DIS(val)                        ULSP_WRITE(ULSP_PB0_BASE_ADDR, CLK_DIS, val)
+#define ULSP_WRITE_PB0_START(val)                          ULSP_WRITE(ULSP_PB0_BASE_ADDR, START, val)
+#define ULSP_WRITE_PB0_RESET(val)                          ULSP_WRITE(ULSP_PB0_BASE_ADDR, RESET, val)
+#define ULSP_WRITE_PB0_AUTO_TEST_EN(val)                   ULSP_WRITE(ULSP_PB0_BASE_ADDR, AUTO_TEST_EN, val)
+#define ULSP_WRITE_PB0_INCR_TEST_EN(val)                   ULSP_WRITE(ULSP_PB0_BASE_ADDR, INCR_TEST_EN, val)
+#define ULSP_WRITE_PB0_HW_PWR_PROTECT_MODE_EN(val)         ULSP_WRITE(ULSP_PB0_BASE_ADDR, HW_PWR_PROTECT_MODE_EN, val)
+#define ULSP_WRITE_PB0_PB_PRIORITY(val)                    ULSP_WRITE(ULSP_PB0_BASE_ADDR, PB_PRIORITY, val)
+#define ULSP_WRITE_PB0_ULTRA_HIGH_PRIORITY(val)            ULSP_WRITE(ULSP_PB0_BASE_ADDR, ULTRA_HIGH_PRIORITY, val)
+#define ULSP_WRITE_PB0_BUF_UNLOCK_THS(val)                 ULSP_WRITE(ULSP_PB0_BASE_ADDR, BUF_UNLOCK_THS, val)
+
+/*---------------------------------------------------------------------------
+    PB0_RUN_TIME_MANAGE register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB0_RESUME_AFTER_ABORT()                 ULSP_READ(ULSP_PB0_BASE_ADDR, RESUME_AFTER_ABORT)
+#define ULSP_READ_PB0_RESUME_AFTER_FLUSH()                 ULSP_READ(ULSP_PB0_BASE_ADDR, RESUME_AFTER_FLUSH)
+#define ULSP_READ_PB0_ABORT()                              ULSP_READ(ULSP_PB0_BASE_ADDR, ABORT)
+#define ULSP_READ_PB0_FLUSH()                              ULSP_READ(ULSP_PB0_BASE_ADDR, FLUSH)
+#define ULSP_READ_PB0_DISABLE_OUTPUT()                     ULSP_READ(ULSP_PB0_BASE_ADDR, DISABLE_OUTPUT)
+#define ULSP_READ_PB0_DISABLE_IUTPUT()                     ULSP_READ(ULSP_PB0_BASE_ADDR, DISABLE_IUTPUT)
+
+#define ULSP_WRITE_PB0_RESUME_AFTER_ABORT(val)             ULSP_WRITE(ULSP_PB0_BASE_ADDR, RESUME_AFTER_ABORT, val)
+#define ULSP_WRITE_PB0_RESUME_AFTER_FLUSH(val)             ULSP_WRITE(ULSP_PB0_BASE_ADDR, RESUME_AFTER_FLUSH, val)
+#define ULSP_WRITE_PB0_ABORT(val)                          ULSP_WRITE(ULSP_PB0_BASE_ADDR, ABORT, val)
+#define ULSP_WRITE_PB0_FLUSH(val)                          ULSP_WRITE(ULSP_PB0_BASE_ADDR, FLUSH, val)
+#define ULSP_WRITE_PB0_DISABLE_OUTPUT(val)                 ULSP_WRITE(ULSP_PB0_BASE_ADDR, DISABLE_OUTPUT, val)
+#define ULSP_WRITE_PB0_DISABLE_INPUT(val)                  ULSP_WRITE(ULSP_PB0_BASE_ADDR, DISABLE_INPUT, val)
+
+/*---------------------------------------------------------------------------
+    PB0_STATUS register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB0_ABORT_DONE()                         ULSP_READ(ULSP_PB0_BASE_ADDR, ABORT_DONE)
+#define ULSP_READ_PB0_FLUSH_DONE()                         ULSP_READ(ULSP_PB0_BASE_ADDR, FLUSH_DONE)
+#define ULSP_READ_PB0_BUF_FULL()                           ULSP_READ(ULSP_PB0_BASE_ADDR, BUF_FULL)
+#define ULSP_READ_PB0_BUF_LOCK()                           ULSP_READ(ULSP_PB0_BASE_ADDR, BUF_LOCK)
+#define ULSP_READ_PB0_LOCAL_ABORT_DONE()                   ULSP_READ(ULSP_PB0_BASE_ADDR, LOCAL_ABORT_DONE)
+#define ULSP_READ_PB0_LOCAL_FLUSH_DONE()                   ULSP_READ(ULSP_PB0_BASE_ADDR, LOCAL_FLUSH_DONE)
+#define ULSP_READ_PB0_L1_FLUSH_DONE()                      ULSP_READ(ULSP_PB0_BASE_ADDR, L1_FLUSH_DONE)
+#define ULSP_READ_PB0_BUF_SIZE()                           ULSP_READ(ULSP_PB0_BASE_ADDR, BUF_SIZE)
+#define ULSP_READ_PB0_FSM_STATE()                          ULSP_READ(ULSP_PB0_BASE_ADDR, FSM_STATE)
+#define ULSP_READ_PB0_BUF_MAX_USED_SPACE()                 ULSP_READ(ULSP_PB0_BASE_ADDR, BUF_MAX_USED_SPACE)
+#define ULSP_READ_PB0_BUF_USED_SPACE()                     ULSP_READ(ULSP_PB0_BASE_ADDR, BUF_USED_SPACE)
+
+/*---------------------------------------------------------------------------
+    PB0_OVERFLOW_STA register fields
+---------------------------------------------------------------------------*/
+// For Gen93, Gen95
+#define ULSP_READ_PB0_OVF_DATA_NUM()                       ULSP_READ(ULSP_PB0_BASE_ADDR, OVF_DATA_NUM)
+#define ULSP_READ_PB0_OVF_PACKET_NUM()                     ULSP_READ(ULSP_PB0_BASE_ADDR, OVF_PACKET_NUM)
+// For Gen97
+#define ULSP_READ_PB0_OVF_DATA_NUM_NORMAL()                ULSP_READ(ULSP_PB0_BASE_ADDR, OVF_DATA_NUM_NORMAL)
+#define ULSP_READ_PB0_OVF_PACKET_NUM_NORMAL()              ULSP_READ(ULSP_PB0_BASE_ADDR, OVF_PACKET_NUM_NORMAL)
+#define ULSP_READ_PB0_OVF_DATA_NUM_ONDEMAND()              ULSP_READ(ULSP_PB0_BASE_ADDR, OVF_DATA_NUM_ONDEMAND)
+#define ULSP_READ_PB0_OVF_PACKET_NUM_ONDEMAND()            ULSP_READ(ULSP_PB0_BASE_ADDR, OVF_PACKET_NUM_ONDEMAND)
+
+/*---------------------------------------------------------------------------
+    PB0_OVERFLOW_STA_CLR register fields
+---------------------------------------------------------------------------*/
+// For Gen93, Gen95
+#define ULSP_READ_PB0_OVF_DATA_NUM_CLEAR()                 ULSP_READ(ULSP_PB0_BASE_ADDR, OVF_DATA_NUM_CLEAR)
+#define ULSP_READ_PB0_OVF_PACKET_NUM_CLEAR()               ULSP_READ(ULSP_PB0_BASE_ADDR, OVF_PACKET_NUM_CLEAR)
+// For Gen97
+#define ULSP_READ_PB0_OVF_DATA_NUM_NORMAL_CLEAR()          ULSP_READ(ULSP_PB0_BASE_ADDR, OVF_DATA_NUM_NORMAL_CLEAR)
+#define ULSP_READ_PB0_OVF_PACKET_NUM_NORMAL_CLEAR()        ULSP_READ(ULSP_PB0_BASE_ADDR, OVF_PACKET_NUM_NORMAL_CLEAR)
+#define ULSP_READ_PB0_OVF_DATA_NUM_ONDEMAND_CLEAR()        ULSP_READ(ULSP_PB0_BASE_ADDR, OVF_DATA_NUM_ONDEMAND_CLEAR)
+#define ULSP_READ_PB0_OVF_PACKET_NUM_ONDEMAND_CLEAR()      ULSP_READ(ULSP_PB0_BASE_ADDR, OVF_PACKET_NUM_ONDEMAND_CLEAR)
+
+// For Gen93, Gen95
+#define ULSP_WRITE_PB0_OVF_DATA_NUM_CLEAR(val)             ULSP_WRITE(ULSP_PB0_BASE_ADDR, OVF_DATA_NUM_CLEAR, val)
+#define ULSP_WRITE_PB0_OVF_PACKET_NUM_CLEAR(val)           ULSP_WRITE(ULSP_PB0_BASE_ADDR, OVF_PACKET_NUM_CLEAR, val)
+// For Gen97
+#define ULSP_WRITE_PB0_OVF_DATA_NUM_NORMAL_CLEAR(val)      ULSP_WRITE(ULSP_PB0_BASE_ADDR, OVF_DATA_NUM_NORMAL_CLEAR, val)
+#define ULSP_WRITE_PB0_OVF_PACKET_NUM_NORMAL_CLEAR(val)    ULSP_WRITE(ULSP_PB0_BASE_ADDR, OVF_PACKET_NUM_NORMAL_CLEAR, val)
+#define ULSP_WRITE_PB0_OVF_DATA_NUM_ONDEMAND_CLEAR(val)    ULSP_WRITE(ULSP_PB0_BASE_ADDR, OVF_DATA_NUM_ONDEMAND_CLEAR, val)
+#define ULSP_WRITE_PB0_OVF_PACKET_NUM_ONDEMAND_CLEAR(val)  ULSP_WRITE(ULSP_PB0_BASE_ADDR, OVF_PACKET_NUM_ONDEMAND_CLEAR, val)
+
+/*---------------------------------------------------------------------------
+    PB0_CORE_SOURCE_ID_BASE register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB0_CORE_SOURCE_ID_BASE()                ULSP_READ(ULSP_PB0_BASE_ADDR, CORE_SOURCE_ID_BASE)
+
+#define ULSP_WRITE_PB0_CORE_SOURCE_ID_BASE(val)            ULSP_WRITE(ULSP_PB0_BASE_ADDR, CORE_SOURCE_ID_BASE, val)
+
+/*---------------------------------------------------------------------------
+    PB1 SYNC_FIXED and LOCK_MARKER register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB1_SYNC_FIXED_NORMAL()                  ULSP_READ(ULSP_PB1_BASE_ADDR, SYNC_FIXED_NORMAL)
+#define ULSP_READ_PB1_SYNC_FIXED_ONDEMAND()                ULSP_READ(ULSP_PB1_BASE_ADDR, SYNC_FIXED_ONDEMAND)
+#define ULSP_READ_PB1_LOCK_MARKER()                        ULSP_READ(ULSP_PB1_BASE_ADDR, CON_LOCK_MARKER)
+
+#define ULSP_WRITE_PB1_SYNC_FIXED_NORMAL(val)              ULSP_WRITE(ULSP_PB1_BASE_ADDR, SYNC_FIXED_NORMAL, val)
+#define ULSP_WRITE_PB1_SYNC_FIXED_ONDEMAND(val)            ULSP_WRITE(ULSP_PB1_BASE_ADDR, SYNC_FIXED_ONDEMAND, val)
+#define ULSP_WRITE_PB1_CON_LOCK_MARKER(val)                ULSP_WRITE(ULSP_PB1_BASE_ADDR, CON_LOCK_MARKER, val)
+
+/*---------------------------------------------------------------------------
+    PB1_CON_BEFORE_START register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB1_CLK_DIS()                            ULSP_READ(ULSP_PB1_BASE_ADDR, CLK_DIS)
+#define ULSP_READ_PB1_START()                              ULSP_READ(ULSP_PB1_BASE_ADDR, START)
+#define ULSP_READ_PB1_RESET()                              ULSP_READ(ULSP_PB1_BASE_ADDR, RESET)
+#define ULSP_READ_PB1_AUTO_TEST_EN()                       ULSP_READ(ULSP_PB1_BASE_ADDR, AUTO_TEST_EN)
+#define ULSP_READ_PB1_INCR_TEST_EN()                       ULSP_READ(ULSP_PB1_BASE_ADDR, INCR_TEST_EN)
+#define ULSP_READ_PB1_HW_PWR_PROTECT_MODE_EN()             ULSP_READ(ULSP_PB1_BASE_ADDR, HW_PWR_PROTECT_MODE_EN)
+#define ULSP_READ_PB1_PB_PRIORITY()                        ULSP_READ(ULSP_PB1_BASE_ADDR, PB_PRIORITY)
+#define ULSP_READ_PB1_ULTRA_HIGH_PRIORITY()                ULSP_READ(ULSP_PB1_BASE_ADDR, ULTRA_HIGH_PRIORITY)
+#define ULSP_READ_PB1_BUF_UNLOCK_THS()                     ULSP_READ(ULSP_PB1_BASE_ADDR, BUF_UNLOCK_THS)
+
+#define ULSP_WRITE_PB1_CLK_DIS(val)                        ULSP_WRITE(ULSP_PB1_BASE_ADDR, CLK_DIS, val)
+#define ULSP_WRITE_PB1_START(val)                          ULSP_WRITE(ULSP_PB1_BASE_ADDR, START, val)
+#define ULSP_WRITE_PB1_RESET(val)                          ULSP_WRITE(ULSP_PB1_BASE_ADDR, RESET, val)
+#define ULSP_WRITE_PB1_AUTO_TEST_EN(val)                   ULSP_WRITE(ULSP_PB1_BASE_ADDR, AUTO_TEST_EN, val)
+#define ULSP_WRITE_PB1_INCR_TEST_EN(val)                   ULSP_WRITE(ULSP_PB1_BASE_ADDR, INCR_TEST_EN, val)
+#define ULSP_WRITE_PB1_HW_PWR_PROTECT_MODE_EN(val)         ULSP_WRITE(ULSP_PB1_BASE_ADDR, HW_PWR_PROTECT_MODE_EN, val)
+#define ULSP_WRITE_PB1_PB_PRIORITY(val)                    ULSP_WRITE(ULSP_PB1_BASE_ADDR, PB_PRIORITY, val)
+#define ULSP_WRITE_PB1_ULTRA_HIGH_PRIORITY(val)            ULSP_WRITE(ULSP_PB1_BASE_ADDR, ULTRA_HIGH_PRIORITY, val)
+#define ULSP_WRITE_PB1_BUF_UNLOCK_THS(val)                 ULSP_WRITE(ULSP_PB1_BASE_ADDR, BUF_UNLOCK_THS, val)
+
+/*---------------------------------------------------------------------------
+    PB1_RUN_TIME_MANAGE register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB1_RESUME_AFTER_ABORT()                 ULSP_READ(ULSP_PB1_BASE_ADDR, RESUME_AFTER_ABORT)
+#define ULSP_READ_PB1_RESUME_AFTER_FLUSH()                 ULSP_READ(ULSP_PB1_BASE_ADDR, RESUME_AFTER_FLUSH)
+#define ULSP_READ_PB1_ABORT()                              ULSP_READ(ULSP_PB1_BASE_ADDR, ABORT)
+#define ULSP_READ_PB1_FLUSH()                              ULSP_READ(ULSP_PB1_BASE_ADDR, FLUSH)
+#define ULSP_READ_PB1_DISABLE_OUTPUT()                     ULSP_READ(ULSP_PB1_BASE_ADDR, DISABLE_OUTPUT)
+#define ULSP_READ_PB1_DISABLE_IUTPUT()                     ULSP_READ(ULSP_PB1_BASE_ADDR, DISABLE_IUTPUT)
+
+#define ULSP_WRITE_PB1_RESUME_AFTER_ABORT(val)             ULSP_WRITE(ULSP_PB1_BASE_ADDR, RESUME_AFTER_ABORT, val)
+#define ULSP_WRITE_PB1_RESUME_AFTER_FLUSH(val)             ULSP_WRITE(ULSP_PB1_BASE_ADDR, RESUME_AFTER_FLUSH, val)
+#define ULSP_WRITE_PB1_ABORT(val)                          ULSP_WRITE(ULSP_PB1_BASE_ADDR, ABORT, val)
+#define ULSP_WRITE_PB1_FLUSH(val)                          ULSP_WRITE(ULSP_PB1_BASE_ADDR, FLUSH, val)
+#define ULSP_WRITE_PB1_DISABLE_OUTPUT(val)                 ULSP_WRITE(ULSP_PB1_BASE_ADDR, DISABLE_OUTPUT, val)
+#define ULSP_WRITE_PB1_DISABLE_INPUT(val)                  ULSP_WRITE(ULSP_PB1_BASE_ADDR, DISABLE_INPUT, val)
+
+/*---------------------------------------------------------------------------
+    PB1_STATUS register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB1_ABORT_DONE()                         ULSP_READ(ULSP_PB1_BASE_ADDR, ABORT_DONE)
+#define ULSP_READ_PB1_FLUSH_DONE()                         ULSP_READ(ULSP_PB1_BASE_ADDR, FLUSH_DONE)
+#define ULSP_READ_PB1_BUF_FULL()                           ULSP_READ(ULSP_PB1_BASE_ADDR, BUF_FULL)
+#define ULSP_READ_PB1_BUF_LOCK()                           ULSP_READ(ULSP_PB1_BASE_ADDR, BUF_LOCK)
+#define ULSP_READ_PB1_LOCAL_ABORT_DONE()                   ULSP_READ(ULSP_PB1_BASE_ADDR, LOCAL_ABORT_DONE)
+#define ULSP_READ_PB1_LOCAL_FLUSH_DONE()                   ULSP_READ(ULSP_PB1_BASE_ADDR, LOCAL_FLUSH_DONE)
+#define ULSP_READ_PB1_L1_FLUSH_DONE()                      ULSP_READ(ULSP_PB1_BASE_ADDR, L1_FLUSH_DONE)
+#define ULSP_READ_PB1_BUF_SIZE()                           ULSP_READ(ULSP_PB1_BASE_ADDR, BUF_SIZE)
+#define ULSP_READ_PB1_FSM_STATE()                          ULSP_READ(ULSP_PB1_BASE_ADDR, FSM_STATE)
+#define ULSP_READ_PB1_BUF_MAX_USED_SPACE()                 ULSP_READ(ULSP_PB1_BASE_ADDR, BUF_MAX_USED_SPACE)
+#define ULSP_READ_PB1_BUF_USED_SPACE()                     ULSP_READ(ULSP_PB1_BASE_ADDR, BUF_USED_SPACE)
+
+/*---------------------------------------------------------------------------
+    PB1_OVERFLOW_STA register fields
+---------------------------------------------------------------------------*/
+
+// For Gen93, Gen95
+#define ULSP_READ_PB1_OVF_DATA_NUM()                       ULSP_READ(ULSP_PB1_BASE_ADDR, OVF_DATA_NUM)
+#define ULSP_READ_PB1_OVF_PACKET_NUM()                     ULSP_READ(ULSP_PB1_BASE_ADDR, OVF_PACKET_NUM)
+// For Gen97
+#define ULSP_READ_PB1_OVF_DATA_NUM_NORMAL()                ULSP_READ(ULSP_PB1_BASE_ADDR, OVF_DATA_NUM_NORMAL)
+#define ULSP_READ_PB1_OVF_PACKET_NUM_NORMAL()              ULSP_READ(ULSP_PB1_BASE_ADDR, OVF_PACKET_NUM_NORMAL)
+#define ULSP_READ_PB1_OVF_DATA_NUM_ONDEMAND()              ULSP_READ(ULSP_PB1_BASE_ADDR, OVF_DATA_NUM_ONDEMAND)
+#define ULSP_READ_PB1_OVF_PACKET_NUM_ONDEMAND()            ULSP_READ(ULSP_PB1_BASE_ADDR, OVF_PACKET_NUM_ONDEMAND)
+
+/*---------------------------------------------------------------------------
+    PB1_OVERFLOW_STA_CLR register fields
+---------------------------------------------------------------------------*/
+// For Gen93, Gen95
+#define ULSP_READ_PB1_OVF_DATA_NUM_CLEAR()                 ULSP_READ(ULSP_PB1_BASE_ADDR, OVF_DATA_NUM_CLEAR)
+#define ULSP_READ_PB1_OVF_PACKET_NUM_CLEAR()               ULSP_READ(ULSP_PB1_BASE_ADDR, OVF_PACKET_NUM_CLEAR)
+// For Gen97
+#define ULSP_READ_PB1_OVF_DATA_NUM_NORMAL_CLEAR()          ULSP_READ(ULSP_PB1_BASE_ADDR, OVF_DATA_NUM_NORMAL_CLEAR)
+#define ULSP_READ_PB1_OVF_PACKET_NUM_NORMAL_CLEAR()        ULSP_READ(ULSP_PB1_BASE_ADDR, OVF_PACKET_NUM_NORMAL_CLEAR)
+#define ULSP_READ_PB1_OVF_DATA_NUM_ONDEMAND_CLEAR()        ULSP_READ(ULSP_PB1_BASE_ADDR, OVF_DATA_NUM_ONDEMAND_CLEAR)
+#define ULSP_READ_PB1_OVF_PACKET_NUM_ONDEMAND_CLEAR()      ULSP_READ(ULSP_PB1_BASE_ADDR, OVF_PACKET_NUM_ONDEMAND_CLEAR)
+
+// For Gen93, Gen95
+#define ULSP_WRITE_PB1_OVF_DATA_NUM_CLEAR(val)             ULSP_WRITE(ULSP_PB1_BASE_ADDR, OVF_DATA_NUM_CLEAR, val)
+#define ULSP_WRITE_PB1_OVF_PACKET_NUM_CLEAR(val)           ULSP_WRITE(ULSP_PB1_BASE_ADDR, OVF_PACKET_NUM_CLEAR, val)
+// For Gen97
+#define ULSP_WRITE_PB1_OVF_DATA_NUM_NORMAL_CLEAR(val)      ULSP_WRITE(ULSP_PB1_BASE_ADDR, OVF_DATA_NUM_NORMAL_CLEAR, val)
+#define ULSP_WRITE_PB1_OVF_PACKET_NUM_NORMAL_CLEAR(val)    ULSP_WRITE(ULSP_PB1_BASE_ADDR, OVF_PACKET_NUM_NORMAL_CLEAR, val)
+#define ULSP_WRITE_PB1_OVF_DATA_NUM_ONDEMAND_CLEAR(val)    ULSP_WRITE(ULSP_PB1_BASE_ADDR, OVF_DATA_NUM_ONDEMAND_CLEAR, val)
+#define ULSP_WRITE_PB1_OVF_PACKET_NUM_ONDEMAND_CLEAR(val)  ULSP_WRITE(ULSP_PB1_BASE_ADDR, OVF_PACKET_NUM_ONDEMAND_CLEAR, val)
+
+/*---------------------------------------------------------------------------
+    PB1_CORE_SOURCE_ID_BASE register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB1_CORE_SOURCE_ID_BASE()                ULSP_READ(ULSP_PB1_BASE_ADDR, CORE_SOURCE_ID_BASE)
+
+#define ULSP_WRITE_PB1_CORE_SOURCE_ID_BASE(val)            ULSP_WRITE(ULSP_PB1_BASE_ADDR, CORE_SOURCE_ID_BASE, val)
+
+#if(MD_GEN98)
+/*---------------------------------------------------------------------------
+    PB2 SYNC_FIXED and LOCK_MARKER register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB2_SYNC_FIXED_NORMAL()                  ULSP_READ(ULSP_PB2_BASE_ADDR, SYNC_FIXED_NORMAL)
+#define ULSP_READ_PB2_SYNC_FIXED_ONDEMAND()                ULSP_READ(ULSP_PB2_BASE_ADDR, SYNC_FIXED_ONDEMAND)
+#define ULSP_READ_PB2_LOCK_MARKER()                        ULSP_READ(ULSP_PB2_BASE_ADDR, CON_LOCK_MARKER)
+
+#define ULSP_WRITE_PB2_SYNC_FIXED_NORMAL(val)              ULSP_WRITE(ULSP_PB2_BASE_ADDR, SYNC_FIXED_NORMAL, val)
+#define ULSP_WRITE_PB2_SYNC_FIXED_ONDEMAND(val)            ULSP_WRITE(ULSP_PB2_BASE_ADDR, SYNC_FIXED_ONDEMAND, val)
+#define ULSP_WRITE_PB2_CON_LOCK_MARKER(val)                ULSP_WRITE(ULSP_PB2_BASE_ADDR, CON_LOCK_MARKER, val)
+
+/*---------------------------------------------------------------------------
+    PB2_CON_BEFORE_START register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB2_CLK_DIS()                            ULSP_READ(ULSP_PB2_BASE_ADDR, CLK_DIS)
+#define ULSP_READ_PB2_START()                              ULSP_READ(ULSP_PB2_BASE_ADDR, START)
+#define ULSP_READ_PB2_RESET()                              ULSP_READ(ULSP_PB2_BASE_ADDR, RESET)
+#define ULSP_READ_PB2_AUTO_TEST_EN()                       ULSP_READ(ULSP_PB2_BASE_ADDR, AUTO_TEST_EN)
+#define ULSP_READ_PB2_INCR_TEST_EN()                       ULSP_READ(ULSP_PB2_BASE_ADDR, INCR_TEST_EN)
+#define ULSP_READ_PB2_HW_PWR_PROTECT_MODE_EN()             ULSP_READ(ULSP_PB2_BASE_ADDR, HW_PWR_PROTECT_MODE_EN)
+#define ULSP_READ_PB2_PB_PRIORITY()                        ULSP_READ(ULSP_PB2_BASE_ADDR, PB_PRIORITY)
+#define ULSP_READ_PB2_ULTRA_HIGH_PRIORITY()                ULSP_READ(ULSP_PB2_BASE_ADDR, ULTRA_HIGH_PRIORITY)
+#define ULSP_READ_PB2_BUF_UNLOCK_THS()                     ULSP_READ(ULSP_PB2_BASE_ADDR, BUF_UNLOCK_THS)
+
+#define ULSP_WRITE_PB2_CLK_DIS(val)                        ULSP_WRITE(ULSP_PB2_BASE_ADDR, CLK_DIS, val)
+#define ULSP_WRITE_PB2_START(val)                          ULSP_WRITE(ULSP_PB2_BASE_ADDR, START, val)
+#define ULSP_WRITE_PB2_RESET(val)                          ULSP_WRITE(ULSP_PB2_BASE_ADDR, RESET, val)
+#define ULSP_WRITE_PB2_AUTO_TEST_EN(val)                   ULSP_WRITE(ULSP_PB2_BASE_ADDR, AUTO_TEST_EN, val)
+#define ULSP_WRITE_PB2_INCR_TEST_EN(val)                   ULSP_WRITE(ULSP_PB2_BASE_ADDR, INCR_TEST_EN, val)
+#define ULSP_WRITE_PB2_HW_PWR_PROTECT_MODE_EN(val)         ULSP_WRITE(ULSP_PB2_BASE_ADDR, HW_PWR_PROTECT_MODE_EN, val)
+#define ULSP_WRITE_PB2_PB_PRIORITY(val)                    ULSP_WRITE(ULSP_PB2_BASE_ADDR, PB_PRIORITY, val)
+#define ULSP_WRITE_PB2_ULTRA_HIGH_PRIORITY(val)            ULSP_WRITE(ULSP_PB2_BASE_ADDR, ULTRA_HIGH_PRIORITY, val)
+#define ULSP_WRITE_PB2_BUF_UNLOCK_THS(val)                 ULSP_WRITE(ULSP_PB2_BASE_ADDR, BUF_UNLOCK_THS, val)
+
+/*---------------------------------------------------------------------------
+    PB2_RUN_TIME_MANAGE register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB2_RESUME_AFTER_ABORT()                 ULSP_READ(ULSP_PB2_BASE_ADDR, RESUME_AFTER_ABORT)
+#define ULSP_READ_PB2_RESUME_AFTER_FLUSH()                 ULSP_READ(ULSP_PB2_BASE_ADDR, RESUME_AFTER_FLUSH)
+#define ULSP_READ_PB2_ABORT()                              ULSP_READ(ULSP_PB2_BASE_ADDR, ABORT)
+#define ULSP_READ_PB2_FLUSH()                              ULSP_READ(ULSP_PB2_BASE_ADDR, FLUSH)
+#define ULSP_READ_PB2_DISABLE_OUTPUT()                     ULSP_READ(ULSP_PB2_BASE_ADDR, DISABLE_OUTPUT)
+#define ULSP_READ_PB2_DISABLE_IUTPUT()                     ULSP_READ(ULSP_PB2_BASE_ADDR, DISABLE_IUTPUT)
+
+#define ULSP_WRITE_PB2_RESUME_AFTER_ABORT(val)             ULSP_WRITE(ULSP_PB2_BASE_ADDR, RESUME_AFTER_ABORT, val)
+#define ULSP_WRITE_PB2_RESUME_AFTER_FLUSH(val)             ULSP_WRITE(ULSP_PB2_BASE_ADDR, RESUME_AFTER_FLUSH, val)
+#define ULSP_WRITE_PB2_ABORT(val)                          ULSP_WRITE(ULSP_PB2_BASE_ADDR, ABORT, val)
+#define ULSP_WRITE_PB2_FLUSH(val)                          ULSP_WRITE(ULSP_PB2_BASE_ADDR, FLUSH, val)
+#define ULSP_WRITE_PB2_DISABLE_OUTPUT(val)                 ULSP_WRITE(ULSP_PB2_BASE_ADDR, DISABLE_OUTPUT, val)
+#define ULSP_WRITE_PB2_DISABLE_INPUT(val)                  ULSP_WRITE(ULSP_PB2_BASE_ADDR, DISABLE_INPUT, val)
+
+/*---------------------------------------------------------------------------
+    PB2_STATUS register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB2_ABORT_DONE()                         ULSP_READ(ULSP_PB2_BASE_ADDR, ABORT_DONE)
+#define ULSP_READ_PB2_FLUSH_DONE()                         ULSP_READ(ULSP_PB2_BASE_ADDR, FLUSH_DONE)
+#define ULSP_READ_PB2_BUF_FULL()                           ULSP_READ(ULSP_PB2_BASE_ADDR, BUF_FULL)
+#define ULSP_READ_PB2_BUF_LOCK()                           ULSP_READ(ULSP_PB2_BASE_ADDR, BUF_LOCK)
+#define ULSP_READ_PB2_LOCAL_ABORT_DONE()                   ULSP_READ(ULSP_PB2_BASE_ADDR, LOCAL_ABORT_DONE)
+#define ULSP_READ_PB2_LOCAL_FLUSH_DONE()                   ULSP_READ(ULSP_PB2_BASE_ADDR, LOCAL_FLUSH_DONE)
+#define ULSP_READ_PB2_L1_FLUSH_DONE()                      ULSP_READ(ULSP_PB2_BASE_ADDR, L1_FLUSH_DONE)
+#define ULSP_READ_PB2_BUF_SIZE()                           ULSP_READ(ULSP_PB2_BASE_ADDR, BUF_SIZE)
+#define ULSP_READ_PB2_FSM_STATE()                          ULSP_READ(ULSP_PB2_BASE_ADDR, FSM_STATE)
+#define ULSP_READ_PB2_BUF_MAX_USED_SPACE()                 ULSP_READ(ULSP_PB2_BASE_ADDR, BUF_MAX_USED_SPACE)
+#define ULSP_READ_PB2_BUF_USED_SPACE()                     ULSP_READ(ULSP_PB2_BASE_ADDR, BUF_USED_SPACE)
+
+/*---------------------------------------------------------------------------
+    PB2_OVERFLOW_STA register fields
+---------------------------------------------------------------------------*/
+// For Gen97
+#define ULSP_READ_PB2_OVF_DATA_NUM_NORMAL()                ULSP_READ(ULSP_PB2_BASE_ADDR, OVF_DATA_NUM_NORMAL)
+#define ULSP_READ_PB2_OVF_PACKET_NUM_NORMAL()              ULSP_READ(ULSP_PB2_BASE_ADDR, OVF_PACKET_NUM_NORMAL)
+#define ULSP_READ_PB2_OVF_DATA_NUM_ONDEMAND()              ULSP_READ(ULSP_PB2_BASE_ADDR, OVF_DATA_NUM_ONDEMAND)
+#define ULSP_READ_PB2_OVF_PACKET_NUM_ONDEMAND()            ULSP_READ(ULSP_PB2_BASE_ADDR, OVF_PACKET_NUM_ONDEMAND)
+
+/*---------------------------------------------------------------------------
+    PB2_OVERFLOW_STA_CLR register fields
+---------------------------------------------------------------------------*/
+// For Gen97
+#define ULSP_READ_PB2_OVF_DATA_NUM_NORMAL_CLEAR()          ULSP_READ(ULSP_PB2_BASE_ADDR, OVF_DATA_NUM_NORMAL_CLEAR)
+#define ULSP_READ_PB2_OVF_PACKET_NUM_NORMAL_CLEAR()        ULSP_READ(ULSP_PB2_BASE_ADDR, OVF_PACKET_NUM_NORMAL_CLEAR)
+#define ULSP_READ_PB2_OVF_DATA_NUM_ONDEMAND_CLEAR()        ULSP_READ(ULSP_PB2_BASE_ADDR, OVF_DATA_NUM_ONDEMAND_CLEAR)
+#define ULSP_READ_PB2_OVF_PACKET_NUM_ONDEMAND_CLEAR()      ULSP_READ(ULSP_PB2_BASE_ADDR, OVF_PACKET_NUM_ONDEMAND_CLEAR)
+
+// For Gen97
+#define ULSP_WRITE_PB2_OVF_DATA_NUM_NORMAL_CLEAR(val)      ULSP_WRITE(ULSP_PB2_BASE_ADDR, OVF_DATA_NUM_NORMAL_CLEAR, val)
+#define ULSP_WRITE_PB2_OVF_PACKET_NUM_NORMAL_CLEAR(val)    ULSP_WRITE(ULSP_PB2_BASE_ADDR, OVF_PACKET_NUM_NORMAL_CLEAR, val)
+#define ULSP_WRITE_PB2_OVF_DATA_NUM_ONDEMAND_CLEAR(val)    ULSP_WRITE(ULSP_PB2_BASE_ADDR, OVF_DATA_NUM_ONDEMAND_CLEAR, val)
+#define ULSP_WRITE_PB2_OVF_PACKET_NUM_ONDEMAND_CLEAR(val)  ULSP_WRITE(ULSP_PB2_BASE_ADDR, OVF_PACKET_NUM_ONDEMAND_CLEAR, val)
+
+/*---------------------------------------------------------------------------
+    PB2_CORE_SOURCE_ID_BASE register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB2_CORE_SOURCE_ID_BASE()                ULSP_READ(ULSP_PB2_BASE_ADDR, CORE_SOURCE_ID_BASE)
+
+#define ULSP_WRITE_PB2_CORE_SOURCE_ID_BASE(val)            ULSP_WRITE(ULSP_PB2_BASE_ADDR, CORE_SOURCE_ID_BASE, val)
+
+/*---------------------------------------------------------------------------
+    PB3 SYNC_FIXED and LOCK_MARKER register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB3_SYNC_FIXED_NORMAL()                  ULSP_READ(ULSP_PB3_BASE_ADDR, SYNC_FIXED_NORMAL)
+#define ULSP_READ_PB3_SYNC_FIXED_ONDEMAND()                ULSP_READ(ULSP_PB3_BASE_ADDR, SYNC_FIXED_ONDEMAND)
+#define ULSP_READ_PB3_LOCK_MARKER()                        ULSP_READ(ULSP_PB3_BASE_ADDR, CON_LOCK_MARKER)
+
+#define ULSP_WRITE_PB3_SYNC_FIXED_NORMAL(val)              ULSP_WRITE(ULSP_PB3_BASE_ADDR, SYNC_FIXED_NORMAL, val)
+#define ULSP_WRITE_PB3_SYNC_FIXED_ONDEMAND(val)            ULSP_WRITE(ULSP_PB3_BASE_ADDR, SYNC_FIXED_ONDEMAND, val)
+#define ULSP_WRITE_PB3_CON_LOCK_MARKER(val)                ULSP_WRITE(ULSP_PB3_BASE_ADDR, CON_LOCK_MARKER, val)
+
+/*---------------------------------------------------------------------------
+    PB3_CON_BEFORE_START register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB3_CLK_DIS()                            ULSP_READ(ULSP_PB3_BASE_ADDR, CLK_DIS)
+#define ULSP_READ_PB3_START()                              ULSP_READ(ULSP_PB3_BASE_ADDR, START)
+#define ULSP_READ_PB3_RESET()                              ULSP_READ(ULSP_PB3_BASE_ADDR, RESET)
+#define ULSP_READ_PB3_AUTO_TEST_EN()                       ULSP_READ(ULSP_PB3_BASE_ADDR, AUTO_TEST_EN)
+#define ULSP_READ_PB3_INCR_TEST_EN()                       ULSP_READ(ULSP_PB3_BASE_ADDR, INCR_TEST_EN)
+#define ULSP_READ_PB3_HW_PWR_PROTECT_MODE_EN()             ULSP_READ(ULSP_PB3_BASE_ADDR, HW_PWR_PROTECT_MODE_EN)
+#define ULSP_READ_PB3_PB_PRIORITY()                        ULSP_READ(ULSP_PB3_BASE_ADDR, PB_PRIORITY)
+#define ULSP_READ_PB3_ULTRA_HIGH_PRIORITY()                ULSP_READ(ULSP_PB3_BASE_ADDR, ULTRA_HIGH_PRIORITY)
+#define ULSP_READ_PB3_BUF_UNLOCK_THS()                     ULSP_READ(ULSP_PB3_BASE_ADDR, BUF_UNLOCK_THS)
+
+#define ULSP_WRITE_PB3_CLK_DIS(val)                        ULSP_WRITE(ULSP_PB3_BASE_ADDR, CLK_DIS, val)
+#define ULSP_WRITE_PB3_START(val)                          ULSP_WRITE(ULSP_PB3_BASE_ADDR, START, val)
+#define ULSP_WRITE_PB3_RESET(val)                          ULSP_WRITE(ULSP_PB3_BASE_ADDR, RESET, val)
+#define ULSP_WRITE_PB3_AUTO_TEST_EN(val)                   ULSP_WRITE(ULSP_PB3_BASE_ADDR, AUTO_TEST_EN, val)
+#define ULSP_WRITE_PB3_INCR_TEST_EN(val)                   ULSP_WRITE(ULSP_PB3_BASE_ADDR, INCR_TEST_EN, val)
+#define ULSP_WRITE_PB3_HW_PWR_PROTECT_MODE_EN(val)         ULSP_WRITE(ULSP_PB3_BASE_ADDR, HW_PWR_PROTECT_MODE_EN, val)
+#define ULSP_WRITE_PB3_PB_PRIORITY(val)                    ULSP_WRITE(ULSP_PB3_BASE_ADDR, PB_PRIORITY, val)
+#define ULSP_WRITE_PB3_ULTRA_HIGH_PRIORITY(val)            ULSP_WRITE(ULSP_PB3_BASE_ADDR, ULTRA_HIGH_PRIORITY, val)
+#define ULSP_WRITE_PB3_BUF_UNLOCK_THS(val)                 ULSP_WRITE(ULSP_PB3_BASE_ADDR, BUF_UNLOCK_THS, val)
+
+/*---------------------------------------------------------------------------
+    PB3_RUN_TIME_MANAGE register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB3_RESUME_AFTER_ABORT()                 ULSP_READ(ULSP_PB3_BASE_ADDR, RESUME_AFTER_ABORT)
+#define ULSP_READ_PB3_RESUME_AFTER_FLUSH()                 ULSP_READ(ULSP_PB3_BASE_ADDR, RESUME_AFTER_FLUSH)
+#define ULSP_READ_PB3_ABORT()                              ULSP_READ(ULSP_PB3_BASE_ADDR, ABORT)
+#define ULSP_READ_PB3_FLUSH()                              ULSP_READ(ULSP_PB3_BASE_ADDR, FLUSH)
+#define ULSP_READ_PB3_DISABLE_OUTPUT()                     ULSP_READ(ULSP_PB3_BASE_ADDR, DISABLE_OUTPUT)
+#define ULSP_READ_PB3_DISABLE_IUTPUT()                     ULSP_READ(ULSP_PB3_BASE_ADDR, DISABLE_IUTPUT)
+
+#define ULSP_WRITE_PB3_RESUME_AFTER_ABORT(val)             ULSP_WRITE(ULSP_PB3_BASE_ADDR, RESUME_AFTER_ABORT, val)
+#define ULSP_WRITE_PB3_RESUME_AFTER_FLUSH(val)             ULSP_WRITE(ULSP_PB3_BASE_ADDR, RESUME_AFTER_FLUSH, val)
+#define ULSP_WRITE_PB3_ABORT(val)                          ULSP_WRITE(ULSP_PB3_BASE_ADDR, ABORT, val)
+#define ULSP_WRITE_PB3_FLUSH(val)                          ULSP_WRITE(ULSP_PB3_BASE_ADDR, FLUSH, val)
+#define ULSP_WRITE_PB3_DISABLE_OUTPUT(val)                 ULSP_WRITE(ULSP_PB3_BASE_ADDR, DISABLE_OUTPUT, val)
+#define ULSP_WRITE_PB3_DISABLE_INPUT(val)                  ULSP_WRITE(ULSP_PB3_BASE_ADDR, DISABLE_INPUT, val)
+
+/*---------------------------------------------------------------------------
+    PB3_STATUS register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB3_ABORT_DONE()                         ULSP_READ(ULSP_PB3_BASE_ADDR, ABORT_DONE)
+#define ULSP_READ_PB3_FLUSH_DONE()                         ULSP_READ(ULSP_PB3_BASE_ADDR, FLUSH_DONE)
+#define ULSP_READ_PB3_BUF_FULL()                           ULSP_READ(ULSP_PB3_BASE_ADDR, BUF_FULL)
+#define ULSP_READ_PB3_BUF_LOCK()                           ULSP_READ(ULSP_PB3_BASE_ADDR, BUF_LOCK)
+#define ULSP_READ_PB3_LOCAL_ABORT_DONE()                   ULSP_READ(ULSP_PB3_BASE_ADDR, LOCAL_ABORT_DONE)
+#define ULSP_READ_PB3_LOCAL_FLUSH_DONE()                   ULSP_READ(ULSP_PB3_BASE_ADDR, LOCAL_FLUSH_DONE)
+#define ULSP_READ_PB3_L1_FLUSH_DONE()                      ULSP_READ(ULSP_PB3_BASE_ADDR, L1_FLUSH_DONE)
+#define ULSP_READ_PB3_BUF_SIZE()                           ULSP_READ(ULSP_PB3_BASE_ADDR, BUF_SIZE)
+#define ULSP_READ_PB3_FSM_STATE()                          ULSP_READ(ULSP_PB3_BASE_ADDR, FSM_STATE)
+#define ULSP_READ_PB3_BUF_MAX_USED_SPACE()                 ULSP_READ(ULSP_PB3_BASE_ADDR, BUF_MAX_USED_SPACE)
+#define ULSP_READ_PB3_BUF_USED_SPACE()                     ULSP_READ(ULSP_PB3_BASE_ADDR, BUF_USED_SPACE)
+
+/*---------------------------------------------------------------------------
+    PB3_OVERFLOW_STA register fields
+---------------------------------------------------------------------------*/
+// For Gen97
+#define ULSP_READ_PB3_OVF_DATA_NUM_NORMAL()                ULSP_READ(ULSP_PB3_BASE_ADDR, OVF_DATA_NUM_NORMAL)
+#define ULSP_READ_PB3_OVF_PACKET_NUM_NORMAL()              ULSP_READ(ULSP_PB3_BASE_ADDR, OVF_PACKET_NUM_NORMAL)
+#define ULSP_READ_PB3_OVF_DATA_NUM_ONDEMAND()              ULSP_READ(ULSP_PB3_BASE_ADDR, OVF_DATA_NUM_ONDEMAND)
+#define ULSP_READ_PB3_OVF_PACKET_NUM_ONDEMAND()            ULSP_READ(ULSP_PB3_BASE_ADDR, OVF_PACKET_NUM_ONDEMAND)
+
+/*---------------------------------------------------------------------------
+    PB3_OVERFLOW_STA_CLR register fields
+---------------------------------------------------------------------------*/
+// For Gen97
+#define ULSP_READ_PB3_OVF_DATA_NUM_NORMAL_CLEAR()          ULSP_READ(ULSP_PB3_BASE_ADDR, OVF_DATA_NUM_NORMAL_CLEAR)
+#define ULSP_READ_PB3_OVF_PACKET_NUM_NORMAL_CLEAR()        ULSP_READ(ULSP_PB3_BASE_ADDR, OVF_PACKET_NUM_NORMAL_CLEAR)
+#define ULSP_READ_PB3_OVF_DATA_NUM_ONDEMAND_CLEAR()        ULSP_READ(ULSP_PB3_BASE_ADDR, OVF_DATA_NUM_ONDEMAND_CLEAR)
+#define ULSP_READ_PB3_OVF_PACKET_NUM_ONDEMAND_CLEAR()      ULSP_READ(ULSP_PB3_BASE_ADDR, OVF_PACKET_NUM_ONDEMAND_CLEAR)
+
+// For Gen97
+#define ULSP_WRITE_PB3_OVF_DATA_NUM_NORMAL_CLEAR(val)      ULSP_WRITE(ULSP_PB3_BASE_ADDR, OVF_DATA_NUM_NORMAL_CLEAR, val)
+#define ULSP_WRITE_PB3_OVF_PACKET_NUM_NORMAL_CLEAR(val)    ULSP_WRITE(ULSP_PB3_BASE_ADDR, OVF_PACKET_NUM_NORMAL_CLEAR, val)
+#define ULSP_WRITE_PB3_OVF_DATA_NUM_ONDEMAND_CLEAR(val)    ULSP_WRITE(ULSP_PB3_BASE_ADDR, OVF_DATA_NUM_ONDEMAND_CLEAR, val)
+#define ULSP_WRITE_PB3_OVF_PACKET_NUM_ONDEMAND_CLEAR(val)  ULSP_WRITE(ULSP_PB3_BASE_ADDR, OVF_PACKET_NUM_ONDEMAND_CLEAR, val)
+
+/*---------------------------------------------------------------------------
+    PB3_CORE_SOURCE_ID_BASE register fields
+---------------------------------------------------------------------------*/
+#define ULSP_READ_PB3_CORE_SOURCE_ID_BASE()                ULSP_READ(ULSP_PB3_BASE_ADDR, CORE_SOURCE_ID_BASE)
+
+#define ULSP_WRITE_PB3_CORE_SOURCE_ID_BASE(val)            ULSP_WRITE(ULSP_PB3_BASE_ADDR, CORE_SOURCE_ID_BASE, val)
+#endif
+/*---------------------------------------------------------------------------
+ * Separate a wrapper layer between ULS+ and DHL
+ ---------------------------------------------------------------------------*/
+
+#define ULSP_WRITE_F_32(ulsp_pb_data_reg_base, value)  ULSP_WRITE_DATA(ulsp_pb_data_reg_base, DATA_F_32, value)
+#define ULSP_WRITE_F_24(ulsp_pb_data_reg_base, value)  ULSP_WRITE_DATA(ulsp_pb_data_reg_base, DATA_F_24, value)
+#define ULSP_WRITE_F_16(ulsp_pb_data_reg_base, value)  ULSP_WRITE_DATA(ulsp_pb_data_reg_base, DATA_F_16, value)
+#define ULSP_WRITE_F_8(ulsp_pb_data_reg_base, value)   ULSP_WRITE_DATA(ulsp_pb_data_reg_base, DATA_F_8, value)
+
+#define ULSP_WRITE_M_32(ulsp_pb_data_reg_base, value)  ULSP_WRITE_DATA(ulsp_pb_data_reg_base, DATA_M_32, value)
+#define ULSP_WRITE_M_24(ulsp_pb_data_reg_base, value)  ULSP_WRITE_DATA(ulsp_pb_data_reg_base, DATA_M_24, value)
+#define ULSP_WRITE_M_16(ulsp_pb_data_reg_base, value)  ULSP_WRITE_DATA(ulsp_pb_data_reg_base, DATA_M_16, value)
+#define ULSP_WRITE_M_8(ulsp_pb_data_reg_base, value)   ULSP_WRITE_DATA(ulsp_pb_data_reg_base, DATA_M_8, value)
+
+#define ULSP_WRITE_L_32(ulsp_pb_data_reg_base, value)  ULSP_WRITE_DATA(ulsp_pb_data_reg_base, DATA_L_32, value)
+#define ULSP_WRITE_L_24(ulsp_pb_data_reg_base, value)  ULSP_WRITE_DATA(ulsp_pb_data_reg_base, DATA_L_24, value)
+#define ULSP_WRITE_L_16(ulsp_pb_data_reg_base, value)  ULSP_WRITE_DATA(ulsp_pb_data_reg_base, DATA_L_16, value)
+#define ULSP_WRITE_L_8(ulsp_pb_data_reg_base, value)   ULSP_WRITE_DATA(ulsp_pb_data_reg_base, DATA_L_8, value)
+
+#define ULSP_WRITE_S_32(ulsp_pb_data_reg_base, value)  ULSP_WRITE_DATA(ulsp_pb_data_reg_base, DATA_S_32, value)
+#define ULSP_WRITE_S_24(ulsp_pb_data_reg_base, value)  ULSP_WRITE_DATA(ulsp_pb_data_reg_base, DATA_S_24, value)
+#define ULSP_WRITE_S_16(ulsp_pb_data_reg_base, value)  ULSP_WRITE_DATA(ulsp_pb_data_reg_base, DATA_S_16, value)
+#define ULSP_WRITE_S_8(ulsp_pb_data_reg_base, value)   ULSP_WRITE_DATA(ulsp_pb_data_reg_base, DATA_S_8, value)
+
+#define ULSP_WRITE_SYNC(ulsp_pb_data_reg_base, value)  ULSP_WRITE_DATA(ulsp_pb_data_reg_base, SYNC, value)
+#define ULSP_WRITE_FRC(ulsp_pb_data_reg_base, value)   ULSP_WRITE_DATA(ulsp_pb_data_reg_base, FRC, value)
+#endif
+
+/*---------------------------------------------------------------------------
+    ULSP SW Encoder
+---------------------------------------------------------------------------*/
+typedef enum
+{
+    ULSP_ENC_FIRST,
+    ULSP_ENC_MIDDLE,
+    ULSP_ENC_LAST,
+    ULSP_ENC_SINGLE
+} ULSP_Encoder_Message_Type;
+
+typedef enum
+{
+    ULSP_ENC_L1_LOG,
+    ULSP_ENC_L2_LOG,
+    ULSP_ENC_4G_DSP_START,
+    ULSP_ENC_DSP_INNER_LOG,
+    ULSP_ENC_DSP_BRP_LOG,
+    ULSP_ENC_DSP_FEC_LOG,
+    ULSP_ENC_DSP_SPEECH_LOG,
+    ULSP_ENC_DSP_SCQ16_0_LOG,
+    ULSP_ENC_DSP_SCQ16_1_LOG,    
+    ULSP_ENC_DSP_RAKE_LOG,
+    ULSP_ENC_DSP_SCQ16_2_LOG,
+    ULSP_ENC_DSP_SCQ16_3_LOG,
+    ULSP_ENC_4G_DSP_END,
+    ULSP_ENC_5G_DSP_START,
+    ULSP_ENC_DSP_MCORE0_TH0_LOG,   
+    ULSP_ENC_DSP_MCORE0_TH1_LOG, 
+    ULSP_ENC_DSP_MCORE0_TH2_LOG,     
+    ULSP_ENC_DSP_MCORE0_TH3_LOG,      
+    ULSP_ENC_DSP_MCORE1_TH0_LOG,   
+    ULSP_ENC_DSP_MCORE1_TH1_LOG, 
+    ULSP_ENC_DSP_MCORE1_TH2_LOG,     
+    ULSP_ENC_DSP_MCORE1_TH3_LOG,  
+    ULSP_ENC_DSP_VCORE0_TH0_LOG,   
+    ULSP_ENC_DSP_VCORE0_TH1_LOG, 
+    ULSP_ENC_DSP_VCORE0_TH2_LOG,     
+    ULSP_ENC_DSP_VCORE0_TH3_LOG,      
+    ULSP_ENC_DSP_VCORE1_TH0_LOG,   
+    ULSP_ENC_DSP_VCORE1_TH1_LOG, 
+    ULSP_ENC_DSP_VCORE1_TH2_LOG,     
+    ULSP_ENC_DSP_VCORE1_TH3_LOG,      
+    ULSP_ENC_5G_DSP_END,
+    ULSP_ENC_NULL
+} ULSP_Encoder_Log_Type;
+
+typedef enum
+{
+    ULSP_ENC_MSG_SIZE_8 = 1,
+    ULSP_ENC_MSG_SIZE_16 = 2,
+    ULSP_ENC_MSG_SIZE_24 = 3,
+    ULSP_ENC_MSG_SIZE_32 = 4
+} ULSP_Encoder_Log_Size;
+
+typedef enum
+{
+    ULSP_ENC_PACKET_TYPE_DROP = 0,
+    ULSP_ENC_PACKET_TYPE_COMPLETE_PKT,
+    ULSP_ENC_PACKET_TYPE_INCOMPLETE_PKT_F,
+    ULSP_ENC_PACKET_TYPE_INCOMPLETE_PKT_M_ONLY,
+    ULSP_ENC_PACKET_TYPE_INCOMPLETE_PKT_L,
+    ULSP_ENC_PACKET_TYPE_SYNC,
+    ULSP_ENC_PACKET_TYPE_GLOBAL_TS
+} ULSP_Encoder_Packet_Type;
+
+typedef struct
+{
+    kal_uint8 packet_type: 3;
+    kal_uint8 source_id:   5;
+} ulsp_header1;
+
+#if (CUR_GEN >= MD_GEN97)
+typedef struct
+{
+    kal_uint8 packet_length: 6;
+    kal_uint8 source_id_h:   2;
+} ulsp_header2;
+
+#else
+typedef struct
+{
+    kal_uint8 packet_length: 7;
+    kal_uint8 timestamp: 1;
+} ulsp_header2;
+
+#endif
+
+extern unsigned int g_ulsp_encoder_curr_len;
+extern char g_ulsp_encoder_error;
+
+void ulsp_encode_header(ULSP_Encoder_Log_Type log_type, kal_uint8 *buf, kal_uint32 length);
+
+void UlspEncodeMessage(kal_uint8 *buf, kal_uint32 max_length,
+                       ULSP_Encoder_Message_Type msg_type,
+                       ULSP_Encoder_Log_Size msg_size,
+                       ULSP_Encoder_Log_Type log_type,
+                       kal_uint32 value);
+
+void UlspEncodeRectifySync(kal_uint8 *buf, kal_uint32 max_length,
+                        ULSP_Encoder_Log_Type log_type);
+
+void UlspEncodeIdleSync(kal_uint8 *buf, kal_uint32 max_length,
+                        ULSP_Encoder_Log_Type log_type);
+
+void UlspEncodeBoundarySync(kal_uint8 *buf, kal_uint32 max_length, ULSP_Encoder_Log_Type log_type);
+
+void UlspEncodeSync(kal_uint8 *buf, kal_uint32 max_length,
+                    ULSP_Encoder_Log_Type log_type, kal_uint32 value);
+
+int UlspEncoderGetCurrentPacketSize();
+int UlspEncoderSourceIdHelper(ULSP_Encoder_Log_Type log_type);
+
+/*---------------------------------------------------------------------------
+    End of ULSP SW Encoder
+---------------------------------------------------------------------------*/
+void set_up_PB0_before_conf_reg();
+void set_up_PB0_after_conf_reg();
+void set_up_PB1_before_conf_reg();
+void set_up_PB1_after_conf_reg();
+
+void UlspMcuLoggingInit();
+
+void send_boundary_SYNC();
+void send_idle_SYNC();
+
+void dhl_ulsp_PB_flush();
+void dhl_ulsp_PB_abort();
+void dhl_ulsp_PB_resume();
+
+void ulsp_save_pb_dbg_info();
+void ulsp_print_pb_dbg_info();
+
+void flush_sync_in_l1_channel();
+
+#endif // #if defined(__USE_ULSP__)
+
+
+
+#endif //_ULSP_MCU_LOGGING_H_
+
+
diff --git a/mcu/interface/service/dhl/v2/ulsp_mod_function.h b/mcu/interface/service/dhl/v2/ulsp_mod_function.h
new file mode 100644
index 0000000..4fdd946
--- /dev/null
+++ b/mcu/interface/service/dhl/v2/ulsp_mod_function.h
@@ -0,0 +1,129 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2012
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * Filename:
+ * ---------
+ *   @file ulsp_mod_function.h
+ *
+ * Description:
+ * ------------
+ *   @brief Implementation of Integrating log sequence, uls+ hw control, TX out.
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 12 06 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * Fix wrong function prototoype.
+ *
+ * 07 19 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * 	
+ * 	Fix MT6885 build error.
+ *
+ * 05 08 2019 guan-ren.chen
+ * [MOLY00327199] [Gen97] Development
+ * Fix Gen95 build error on dhl v2.
+ *
+ ****************************************************************************/
+
+#ifndef _ULSP_MOD_FUNCTION_H_
+#define _ULSP_MOD_FUNCTION_H_
+
+#include "kal_general_types.h"
+#include "dhl_def.h"
+
+#if defined(__USE_ULSP__) && defined(__MTK_TARGET__)
+#include "logseq_drv.h"
+#endif
+
+#if defined(__MTK_TARGET__)
+#if defined(__USE_ULSP__)
+
+void dhl_ulsp_disable_input();
+void dhl_ulsp_enable_input();
+void dhl_ulsp_config_PB_input_by_filter();
+
+
+void dhl_ulsp_init_ex_dump_region(void);
+void dhl_trigger_hd_flush_ulsp_mcu_event(void);
+void dhl_trigger_hd_flush_ulsp_dsp_event(void);
+// Callback functions register to LS
+void dhl_ulsp_ls_full_cb(LS_CH_ID id);
+void dhl_ulsp_ls_ex_flush_cb(LS_CH_ID id, kal_uint32 address, kal_uint32 length);
+void dhl_ulsp_ls_abort_timeout_cb(LS_CH_ID ch_id);
+
+void dhl_ulsp_get_and_ouput_buffer(kal_uint8 ls_ch_id, module_type ownerid);
+void dhl_ulsp_send_buffer_sync(module_type ownerid, dhl_mux_id mux_id, kal_uint8 *buffer, kal_uint32 length);
+void dhl_ulsp_force_ls_trigger_flush();
+void dhl_ulsp_set_ls_stream_mode();
+void dhl_ulsp_set_ls_PLS_mode();
+void dhl_ulsp_recycle_LS_buffer(kal_uint8 ls_ch_id);
+#if defined(__DHL_SP_LOGGING_SUPPORT__) && defined(__MTK_TARGET__) && defined(__DHL_CCB_LOGGING_SUPPORT__)
+typedef enum{
+    CCB_ULSP_MCU = 0,
+    CCB_ULSP_DSP,
+    CCB_ULSP_EBS_1,
+    CCB_ULSP_EBS_START = CCB_ULSP_EBS_1,
+    CCB_ULSP_EBS_2,
+    CCB_ULSP_EBS_3,
+    CCB_ULSP_EBS_4,
+    CCB_ULSP_EBS_5,
+    CCB_ULSP_EBS_6,
+    CCB_ULSP_EBS_7,
+    CCB_ULSP_EBS_END = CCB_ULSP_EBS_7,
+    CCB_ULSP_NUM
+} CCB_ULSP_TYPE;
+kal_bool dhl_ccb_is_dsp_lockQ_empty();
+
+
+void dhl_ulsp_CCB_send_buffer(module_type ownerid, dhl_mux_id mux_id, kal_uint8 *buffer, kal_uint32 length);
+void dhl_ulsp_CCB_tx_done(kal_uint16 muxid,  CCB_ULSP_TYPE type, kal_uint32 *buf_addr, kal_uint32 length);
+void dhl_ulsp_CCB_page_release(CCB_ULSP_TYPE type);
+#endif //defined(__DHL_SP_LOGGING_SUPPORT__) && defined(__MTK_TARGET__) && defined(__DHL_CCB_LOGGING_SUPPORT__)
+
+#endif // #if defined(__USE_ULSP__)
+#endif //#if defined(__MTK_TARGET__)
+void ulsp_mcu_backup();
+void ulsp_mcu_restore();
+kal_bool ulsp_check_lock_sleep();
+void dhl_ulsp_disable_input();
+void dhl_ulsp_enable_input();
+void dhl_ulsp_config_PB_input_by_filter();
+
+#endif //_ULSP_MCU_LOGGING_H_
+
+