@ -0,0 +1,4 @@ | |||
#define-conf skyeye.json | |||
#load-binary c5416_core_0 timer.out | |||
#init-ok | |||
run-pyfile demotst.py |
@ -0,0 +1,16 @@ | |||
test_num,device_name,reg_name,offset,alter_value,expect_value | |||
testcase1_(core_0_uart_0),core_0_uart_0,RBR,0x0,0xFFFFF,0x0 | |||
testcase2_(core_0_uart_0),core_0_uart_0,THR,0x0,0xFFFFF,0x0 | |||
testcase3_(core_0_uart_0),core_0_uart_0,IER,0x2,0xFFFFF,0xffff | |||
testcase4_(core_0_uart_0),core_0_uart_0,FCR,0x4,0xFFFFF,0x1 | |||
testcase5_(core_0_uart_0),core_0_uart_0,IIR,0x4,0xFFFFF,0x1 | |||
testcase6_(core_0_uart_0),core_0_uart_0,LCR,0x6,0xFFFFF,0xffff | |||
testcase7_(core_0_uart_0),core_0_uart_0,MCR,0x8,0xFFFFF,0xffff | |||
testcase8_(core_0_uart_0),core_0_uart_0,LSR,0xa,0xFFFFF,0xffff | |||
testcase9_(core_0_uart_0),core_0_uart_0,SCR,0xe,0xFFFFF,0xffff | |||
testcase10_(core_0_uart_0),core_0_uart_0,DLL,0x10,0xFFFFF,0xffff | |||
testcase11_(core_0_uart_0),core_0_uart_0,DLH,0x12,0xFFFFF,0xffff | |||
testcase12_(core_0_uart_0),core_0_uart_0,PWREMU_MGMT,0x18,0xFFFFF,0xffff | |||
testcase1_(core_0_timer_0),core_0_timer_0,tim,0x0,0xFFFFF,0xffff | |||
testcase2_(core_0_timer_0),core_0_timer_0,prd,0x4,0xFFFFF,0x0 | |||
testcase3_(core_0_timer_0),core_0_timer_0,tcr,0x8,0xFFFFF,0x0 |
@ -0,0 +1,31 @@ | |||
a=[('core_0_uart_0', 0, 'RBR'), ('core_0_uart_0', 18, 'DLH'), ('core_0_uart_0', 16, 'DLL'), ('core_0_uart_0', 10, 'LSR'), ('core_0_uart_0', 4, 'IIR'), ('core_0_uart_0', 6, 'LCR'), ('core_0_uart_0', 0, 'THR'), ('core_0_uart_0', 4, 'FCR'), ('core_0_uart_0', 2, 'IER'), ('core_0_uart_0', 8, 'MCR'), ('core_0_uart_0', 14, 'SCR'), ('core_0_uart_0', 24, 'PWREMU_MGMT'), ('core_0_timer_0', 0, 'tim'), ('core_0_timer_0', 8, 'tcr'), ('core_0_timer_0', 4, 'prd')] | |||
def sort_list(a): | |||
for i in range(len(a)): | |||
for j in range(i+1,len(a)): | |||
if a[i][0] == a[j][0]: | |||
if a[i][1]>a[j][1]: | |||
a[i],a[j] = a[j],a[i] | |||
res=[] | |||
res1=[] | |||
for i in a: | |||
i=list(i) | |||
res.append(i) | |||
[res1.append(res[i][0]) for i in range(len(res)) if res[i][0] not in res1] | |||
for i in res1: | |||
a=1 | |||
for k in res: | |||
if i in k: | |||
testcasenum="testcase{}_({})".format(str(a),i) | |||
k.insert(0,testcasenum) | |||
a+=1 | |||
return res | |||
b=sort_list(a) | |||
print(b) | |||
for i in b: | |||
print(i) |
@ -0,0 +1,40 @@ | |||
import os | |||
from telnetlib import PRAGMA_HEARTBEAT, SE | |||
import sys | |||
from se import * | |||
import se_system as ss | |||
from ctypes import * | |||
from deal import * | |||
json_name="skyeye.json" | |||
binary_params=("c5416_core_0","timer.out") | |||
run_to_time=("c5416_core_0",10) | |||
reg_data=[] | |||
def func(): | |||
SE_define_conf(json_name) | |||
SE_load_binary(*binary_params) | |||
SE_init_ok() | |||
SE_run() | |||
dev_list=SE_get_simulation_device_info() | |||
SE_run_to_time(*run_to_time) | |||
read_params_list= deal_params(dev_list,SE_get_registers) | |||
for i in read_params_list: | |||
c=SE_read_dword(i[1],i[2]) | |||
reg_value=list((i[0],i[1],i[3],i[2])) | |||
reg_value.append(c) | |||
reg_value[3]=hex(eval(str(reg_value[3]))) | |||
reg_data.append(reg_value) | |||
output_value_csv(reg_data) | |||
reg_params_list=read_csv() | |||
test_res=[] | |||
try: | |||
for i in reg_params_list: | |||
test_res.append(SE_Test_regs_read_wirte(*i)) | |||
out_put_test_reslut(test_res) | |||
except Exception as ep: | |||
print("please add test data") | |||
SE_Quit() | |||
SE_Quit() | |||
func() |
@ -0,0 +1,102 @@ | |||
{ | |||
"c5416_0":{ | |||
"base":"mach", | |||
"class":"c5416", | |||
"c5416_core_0": { | |||
"base": "cpu", | |||
"class": "c54x_core", | |||
"memory_space": ["iface", "memory_space_0"] | |||
}, | |||
"memory_space_0":{ | |||
"base": "device", | |||
"class": "memory_space", | |||
"memory_space" :[ | |||
[1, "iface", "core_0_ram0", "0x0", "0x24"], | |||
[2, "iface", "core_0_timer_0", "0x24", "0x3"], | |||
[3, "iface", "core_0_ram1", "0x27", "0x2c00"], | |||
[4, "iface", "core_0_ram2", "0x8000", "0x4000"], | |||
[5, "iface", "core_0_ram3", "0x4000", "0x4000"], | |||
[6, "iface", "core_0_vector", "0xff80", "0x0080"], | |||
[7, "iface", "core_0_uart_0", "0xd000", "0x20"] | |||
] | |||
}, | |||
"core_0_image0":{ | |||
"base": "device", | |||
"class": "image", | |||
"size": ["uinteger", "0x2800"] | |||
}, | |||
"core_0_ram0": { | |||
"base": "device", | |||
"class": "ram16", | |||
"memory_space": ["iface", "core_0_image0"] | |||
}, | |||
"core_0_image1":{ | |||
"base": "device", | |||
"class": "image", | |||
"size": ["uinteger", "0x5800"] | |||
}, | |||
"core_0_ram1": { | |||
"base": "device", | |||
"class": "ram16", | |||
"memory_space": ["iface", "core_0_image1"] | |||
}, | |||
"core_0_image2":{ | |||
"base": "device", | |||
"class": "image", | |||
"size": ["uinteger", "0x8000"] | |||
}, | |||
"core_0_ram2": { | |||
"base": "device", | |||
"class": "ram16", | |||
"memory_space": ["iface", "core_0_image2"] | |||
}, | |||
"core_0_image3":{ | |||
"base": "device", | |||
"class": "image", | |||
"size": ["uinteger", "0x8000"] | |||
}, | |||
"core_0_ram3": { | |||
"base": "device", | |||
"class": "ram16", | |||
"memory_space": ["iface", "core_0_image3"] | |||
}, | |||
"core_0_image4":{ | |||
"base": "device", | |||
"class": "image", | |||
"size": ["uinteger", "0x100"] | |||
}, | |||
"core_0_vector": { | |||
"base": "device", | |||
"class": "ram16", | |||
"memory_space": ["iface", "core_0_image4"] | |||
}, | |||
"core_0_uart_file" :{ | |||
"base": "device", | |||
"class": "uart_file", | |||
"filename":["string", "uart_log.txt"] | |||
}, | |||
"core_0_uart_0" :{ | |||
"base": "device", | |||
"class": "c5510_uart", | |||
"uart_file_intf":["iface", "core_0_uart_file"], | |||
"skyeye_uart_intf":["iface", "core_0_uart_term0"] | |||
}, | |||
"core_0_timer_0" :{ | |||
"base": "device", | |||
"class": "c541x_timer", | |||
"int_number": ["uinteger", "0x3"], | |||
"core_signal_intf":["iface", "c5416_core_0"] | |||
}, | |||
"core_0_uart_term0":{ | |||
"base":"device", | |||
"class": "uart_term" | |||
} | |||
} | |||
} |
@ -0,0 +1,16 @@ | |||
tst_num,device_name,reg_name,offset,init_value,alter_value,expect_value,actual_value,test_result | |||
testcase1_(core_0_uart_0),core_0_uart_0,RBR,0x0,0x0,0xfffff,0x0,0x0,true | |||
testcase2_(core_0_uart_0),core_0_uart_0,THR,0x0,0x0,0xfffff,0x0,0x0,true | |||
testcase3_(core_0_uart_0),core_0_uart_0,IER,0x2,0x0,0xfffff,0xffff,0xffff,true | |||
testcase4_(core_0_uart_0),core_0_uart_0,FCR,0x4,0x1,0xfffff,0x1,0x1,true | |||
testcase5_(core_0_uart_0),core_0_uart_0,IIR,0x4,0x1,0xfffff,0x1,0x1,true | |||
testcase6_(core_0_uart_0),core_0_uart_0,LCR,0x6,0x0,0xfffff,0xffff,0xffff,true | |||
testcase7_(core_0_uart_0),core_0_uart_0,MCR,0x8,0x0,0xfffff,0xffff,0xffff,true | |||
testcase8_(core_0_uart_0),core_0_uart_0,LSR,0xa,0x20,0xfffff,0xffff,0xffff,true | |||
testcase9_(core_0_uart_0),core_0_uart_0,SCR,0xe,0x0,0xfffff,0xffff,0xffff,true | |||
testcase10_(core_0_uart_0),core_0_uart_0,DLL,0x10,0x0,0xfffff,0xffff,0xffff,true | |||
testcase11_(core_0_uart_0),core_0_uart_0,DLH,0x12,0x0,0xfffff,0xffff,0xffff,true | |||
testcase12_(core_0_uart_0),core_0_uart_0,PWREMU_MGMT,0x18,0x0,0xfffff,0xffff,0xffff,true | |||
testcase1_(core_0_timer_0),core_0_timer_0,tim,0x0,0x345,0xfffff,0xffff,0xffff,true | |||
testcase2_(core_0_timer_0),core_0_timer_0,prd,0x4,0x0,0xfffff,0x0,0x0,true | |||
testcase3_(core_0_timer_0),core_0_timer_0,tcr,0x8,0x0,0xfffff,0x0,0x0,true |
@ -0,0 +1,4 @@ | |||
-z -q -c -m"./Debug/timer.out" -o"./Debug/timer.out" -x -i"D:/CCStudio_v3.3/C5400/xdais/lib" -i"D:/CCStudio_v3.3/C5400/csl/lib" -i"D:/CCStudio_v3.3/bios_5_31_02/packages/ti/bios/lib" -i"D:/CCStudio_v3.3/bios_5_31_02/packages/ti/rtdx/lib/c5400" -i"D:/CCStudio_v3.3/C5400/cgtools/lib" -l"csl5416x.lib" -l"rts500EXT.lib" | |||
"D:\CCStudio_v3.3\examples\dsk5416\csl\timer\timer1\Debug\timer.obj" | |||
"D:\CCStudio_v3.3\examples\dsk5416\csl\timer\timer1\Debug\uart.obj" | |||
"D:\CCStudio_v3.3\examples\dsk5416\csl\timer\timer1\timer.cmd" |
@ -0,0 +1,8 @@ | |||
----------------------------- timer.pjt - Debug ----------------------------- | |||
[timer.c] "D:\CCStudio_v3.3\C5400\cgtools\bin\cl500" -g -k -q -fr"./Debug" -d"_DEBUG" -d"CHIP_5416" -mf -v548 -@"Debug.lkf" "timer.c" | |||
[Linking...] "D:\CCStudio_v3.3\C5400\cgtools\bin\cl500" -@"Debug.lkf" | |||
<Linking> | |||
Build Complete, | |||
0 Errors, 0 Warnings, 0 Remarks. |
@ -0,0 +1,839 @@ | |||
;*************************************************************** | |||
;* TMS320C54x C/C++ Codegen PC v4.1.0 * | |||
;* Date/Time created: Fri May 06 17:19:30 2016 * | |||
;*************************************************************** | |||
.compiler_opts --mem_model:code=far --mem_model:data=flat --quiet --silicon_version=548 | |||
.mmregs | |||
FP .set AR7 | |||
.c_mode | |||
DW$CU .dwtag DW_TAG_compile_unit | |||
.dwattr DW$CU, DW_AT_name("timer.c") | |||
.dwattr DW$CU, DW_AT_producer("TMS320C54x C/C++ Codegen PC v4.1.0 Copyright (c) 1996-2005 Texas Instruments Incorporated") | |||
.dwattr DW$CU, DW_AT_stmt_list(0x00) | |||
.dwattr DW$CU, DW_AT_TI_VERSION(0x01) | |||
;************************************************************** | |||
;* CINIT RECORDS * | |||
;************************************************************** | |||
.sect ".cinit" | |||
.align 1 | |||
.field IR_1,16 | |||
.field _myTConfig+0,16 | |||
.field 3104,16 ; _myTConfig._tcr @ 0 | |||
.field 2048,16 ; _myTConfig._prd @ 16 | |||
IR_1: .set 2 | |||
.sect ".cinit" | |||
.align 1 | |||
.field 1,16 | |||
.field _timer_int_cnt+0,16 | |||
.field 0,16 ; _timer_int_cnt @ 0 | |||
DW$1 .dwtag DW_TAG_subprogram, DW_AT_name("IRQ_clear"), DW_AT_symbol_name("_IRQ_clear") | |||
.dwattr DW$1, DW_AT_declaration(0x01) | |||
.dwattr DW$1, DW_AT_external(0x01) | |||
DW$2 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$19) | |||
.dwendtag DW$1 | |||
DW$3 .dwtag DW_TAG_subprogram, DW_AT_name("IRQ_enable"), DW_AT_symbol_name("_IRQ_enable") | |||
.dwattr DW$3, DW_AT_type(*DW$T$10) | |||
.dwattr DW$3, DW_AT_declaration(0x01) | |||
.dwattr DW$3, DW_AT_external(0x01) | |||
DW$4 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$19) | |||
.dwendtag DW$3 | |||
DW$5 .dwtag DW_TAG_subprogram, DW_AT_name("IRQ_globalDisable"), DW_AT_symbol_name("_IRQ_globalDisable") | |||
.dwattr DW$5, DW_AT_type(*DW$T$10) | |||
.dwattr DW$5, DW_AT_declaration(0x01) | |||
.dwattr DW$5, DW_AT_external(0x01) | |||
DW$6 .dwtag DW_TAG_subprogram, DW_AT_name("IRQ_globalEnable"), DW_AT_symbol_name("_IRQ_globalEnable") | |||
.dwattr DW$6, DW_AT_type(*DW$T$10) | |||
.dwattr DW$6, DW_AT_declaration(0x01) | |||
.dwattr DW$6, DW_AT_external(0x01) | |||
DW$7 .dwtag DW_TAG_subprogram, DW_AT_name("IRQ_globalRestore"), DW_AT_symbol_name("_IRQ_globalRestore") | |||
.dwattr DW$7, DW_AT_declaration(0x01) | |||
.dwattr DW$7, DW_AT_external(0x01) | |||
DW$8 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$10) | |||
.dwendtag DW$7 | |||
DW$9 .dwtag DW_TAG_subprogram, DW_AT_name("IRQ_plug"), DW_AT_symbol_name("_IRQ_plug") | |||
.dwattr DW$9, DW_AT_declaration(0x01) | |||
.dwattr DW$9, DW_AT_external(0x01) | |||
DW$10 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$19) | |||
DW$11 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$28) | |||
.dwendtag DW$9 | |||
DW$12 .dwtag DW_TAG_subprogram, DW_AT_name("CSL_init"), DW_AT_symbol_name("_CSL_init") | |||
.dwattr DW$12, DW_AT_declaration(0x01) | |||
.dwattr DW$12, DW_AT_external(0x01) | |||
DW$13 .dwtag DW_TAG_subprogram, DW_AT_name("TIMER_open"), DW_AT_symbol_name("_TIMER_open") | |||
.dwattr DW$13, DW_AT_type(*DW$T$32) | |||
.dwattr DW$13, DW_AT_declaration(0x01) | |||
.dwattr DW$13, DW_AT_external(0x01) | |||
DW$14 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$10) | |||
DW$15 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$19) | |||
.dwendtag DW$13 | |||
DW$16 .dwtag DW_TAG_subprogram, DW_AT_name("TIMER_close"), DW_AT_symbol_name("_TIMER_close") | |||
.dwattr DW$16, DW_AT_declaration(0x01) | |||
.dwattr DW$16, DW_AT_external(0x01) | |||
DW$17 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$32) | |||
.dwendtag DW$16 | |||
DW$18 .dwtag DW_TAG_subprogram, DW_AT_name("TIMER_getEventId"), DW_AT_symbol_name("_TIMER_getEventId") | |||
.dwattr DW$18, DW_AT_type(*DW$T$19) | |||
.dwattr DW$18, DW_AT_declaration(0x01) | |||
.dwattr DW$18, DW_AT_external(0x01) | |||
DW$19 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$32) | |||
.dwendtag DW$18 | |||
DW$20 .dwtag DW_TAG_subprogram, DW_AT_name("TIMER_start"), DW_AT_symbol_name("_TIMER_start") | |||
.dwattr DW$20, DW_AT_declaration(0x01) | |||
.dwattr DW$20, DW_AT_external(0x01) | |||
DW$21 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$32) | |||
.dwendtag DW$20 | |||
DW$22 .dwtag DW_TAG_subprogram, DW_AT_name("TIMER_stop"), DW_AT_symbol_name("_TIMER_stop") | |||
.dwattr DW$22, DW_AT_declaration(0x01) | |||
.dwattr DW$22, DW_AT_external(0x01) | |||
DW$23 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$32) | |||
.dwendtag DW$22 | |||
DW$24 .dwtag DW_TAG_subprogram, DW_AT_name("TIMER_config"), DW_AT_symbol_name("_TIMER_config") | |||
.dwattr DW$24, DW_AT_declaration(0x01) | |||
.dwattr DW$24, DW_AT_external(0x01) | |||
DW$25 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$32) | |||
DW$26 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$36) | |||
.dwendtag DW$24 | |||
DW$27 .dwtag DW_TAG_subprogram, DW_AT_name("uart_puts"), DW_AT_symbol_name("_uart_puts") | |||
.dwattr DW$27, DW_AT_declaration(0x01) | |||
.dwattr DW$27, DW_AT_external(0x01) | |||
DW$28 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$41) | |||
.dwendtag DW$27 | |||
.global _myTConfig | |||
.bss _myTConfig,2,0,0 | |||
DW$29 .dwtag DW_TAG_variable, DW_AT_name("myTConfig"), DW_AT_symbol_name("_myTConfig") | |||
.dwattr DW$29, DW_AT_location[DW_OP_addr _myTConfig] | |||
.dwattr DW$29, DW_AT_type(*DW$T$35) | |||
.dwattr DW$29, DW_AT_external(0x01) | |||
.global _mhTimer | |||
.bss _mhTimer,1,0,0 | |||
DW$30 .dwtag DW_TAG_variable, DW_AT_name("mhTimer"), DW_AT_symbol_name("_mhTimer") | |||
.dwattr DW$30, DW_AT_location[DW_OP_addr _mhTimer] | |||
.dwattr DW$30, DW_AT_type(*DW$T$32) | |||
.dwattr DW$30, DW_AT_external(0x01) | |||
.global _timer_int_cnt | |||
.bss _timer_int_cnt,1,0,0 | |||
DW$31 .dwtag DW_TAG_variable, DW_AT_name("timer_int_cnt"), DW_AT_symbol_name("_timer_int_cnt") | |||
.dwattr DW$31, DW_AT_location[DW_OP_addr _timer_int_cnt] | |||
.dwattr DW$31, DW_AT_type(*DW$T$47) | |||
.dwattr DW$31, DW_AT_external(0x01) | |||
; D:\CCStudio_v3.3\C5400\cgtools\bin\acp500.exe --keep_unneeded_types -q -D_DEBUG -DCHIP_5416 -ID:/CCStudio_v3.3/C5400/xdais/include -ID:/CCStudio_v3.3/C5400/csl/include -ID:/CCStudio_v3.3/bios_5_31_02/packages/ti/bios/include -ID:/CCStudio_v3.3/bios_5_31_02/packages/ti/rtdx/include/c5400 -ID:/CCStudio_v3.3/C5400/cgtools/include --mem_model:code=far --mem_model:data=flat -m --i_output_file C:\Users\jiachao\AppData\Local\Temp\TI8762 --template_info_file C:\Users\jiachao\AppData\Local\Temp\TI8766 | |||
.sect ".text" | |||
.global _main | |||
DW$32 .dwtag DW_TAG_subprogram, DW_AT_name("main"), DW_AT_symbol_name("_main") | |||
.dwattr DW$32, DW_AT_low_pc(_main) | |||
.dwattr DW$32, DW_AT_high_pc(0x00) | |||
.dwattr DW$32, DW_AT_begin_file("timer.c") | |||
.dwattr DW$32, DW_AT_begin_line(0x31) | |||
.dwattr DW$32, DW_AT_begin_column(0x06) | |||
.dwpsn "timer.c",49,13 | |||
.dwfde DW$CIE | |||
;*************************************************************** | |||
;* FUNCTION DEF: _main * | |||
;*************************************************************** | |||
_main: | |||
.dwcfa 0x0e, 2 | |||
.dwcfa 0x80, 34, 2 | |||
.dwpsn "timer.c",51,3 | |||
FCALLD #_uart_puts ; |51| | |||
LD #SL1,A | |||
; call occurs [#_uart_puts] ; |51| | |||
.dwpsn "timer.c",54,3 | |||
FCALL #_CSL_init ; |54| | |||
; call occurs [#_CSL_init] ; |54| | |||
.dwpsn "timer.c",56,3 | |||
FCALL #_taskFunc ; |56| | |||
; call occurs [#_taskFunc] ; |56| | |||
.dwpsn "timer.c",57,9 | |||
L1: | |||
DW$L$_main$2$B: | |||
B L1 ; |57| | |||
; branch occurs ; |57| | |||
DW$L$_main$2$E: | |||
DW$33 .dwtag DW_TAG_loop | |||
.dwattr DW$33, DW_AT_name("D:\CCStudio_v3.3\examples\dsk5416\csl\timer\timer1\timer.asm:L1:1:1462526370") | |||
.dwattr DW$33, DW_AT_begin_file("timer.c") | |||
.dwattr DW$33, DW_AT_begin_line(0x39) | |||
.dwattr DW$33, DW_AT_end_line(0x39) | |||
DW$34 .dwtag DW_TAG_loop_range | |||
.dwattr DW$34, DW_AT_low_pc(DW$L$_main$2$B) | |||
.dwattr DW$34, DW_AT_high_pc(DW$L$_main$2$E) | |||
.dwendtag DW$33 | |||
.dwattr DW$32, DW_AT_end_file("timer.c") | |||
.dwattr DW$32, DW_AT_end_line(0x3a) | |||
.dwattr DW$32, DW_AT_end_column(0x01) | |||
.dwendentry | |||
.dwendtag DW$32 | |||
.sect ".text" | |||
.global _taskFunc | |||
DW$35 .dwtag DW_TAG_subprogram, DW_AT_name("taskFunc"), DW_AT_symbol_name("_taskFunc") | |||
.dwattr DW$35, DW_AT_low_pc(_taskFunc) | |||
.dwattr DW$35, DW_AT_high_pc(0x00) | |||
.dwattr DW$35, DW_AT_begin_file("timer.c") | |||
.dwattr DW$35, DW_AT_begin_line(0x3d) | |||
.dwattr DW$35, DW_AT_begin_column(0x06) | |||
.dwpsn "timer.c",61,21 | |||
.dwfde DW$CIE | |||
;*************************************************************** | |||
;* FUNCTION DEF: _taskFunc * | |||
;*************************************************************** | |||
_taskFunc: | |||
.dwcfa 0x0e, 2 | |||
.dwcfa 0x80, 34, 2 | |||
PSHM AR1 | |||
.dwcfa 0x0e, 3 | |||
.dwcfa 0x80, 10, 3 | |||
FRAME #-5 | |||
NOP | |||
.dwcfa 0x0e, 8 | |||
DW$36 .dwtag DW_TAG_variable, DW_AT_name("eventId"), DW_AT_symbol_name("_eventId") | |||
.dwattr DW$36, DW_AT_type(*DW$T$19) | |||
.dwattr DW$36, DW_AT_location[DW_OP_breg17 2] | |||
DW$37 .dwtag DW_TAG_variable, DW_AT_name("old_intm"), DW_AT_symbol_name("_old_intm") | |||
.dwattr DW$37, DW_AT_type(*DW$T$10) | |||
.dwattr DW$37, DW_AT_location[DW_OP_breg17 3] | |||
DW$38 .dwtag DW_TAG_variable, DW_AT_name("err"), DW_AT_symbol_name("_err") | |||
.dwattr DW$38, DW_AT_type(*DW$T$19) | |||
.dwattr DW$38, DW_AT_location[DW_OP_breg17 4] | |||
.dwpsn "timer.c",65,10 | |||
ST #0,*SP(4) ; |65| | |||
.dwpsn "timer.c",68,3 | |||
FCALLD #_uart_puts ; |68| | |||
LD #SL2,A | |||
; call occurs [#_uart_puts] ; |68| | |||
.dwpsn "timer.c",72,3 | |||
FCALL #_IRQ_globalDisable ; |72| | |||
; call occurs [#_IRQ_globalDisable] ; |72| | |||
STL A,*SP(3) | |||
.dwpsn "timer.c",76,3 | |||
ST #1,*SP(0) ; |76| | |||
FCALLD #_TIMER_open ; |76| | |||
NOP | |||
LD #0,A | |||
; call occurs [#_TIMER_open] ; |76| | |||
STL A,*(_mhTimer) | |||
.dwpsn "timer.c",80,3 | |||
ST #_myTConfig,*SP(0) ; |80| | |||
FCALL #_TIMER_config ; |80| | |||
; call occurs [#_TIMER_config] ; |80| | |||
.dwpsn "timer.c",83,3 | |||
LD *(_mhTimer),A | |||
FCALL #_TIMER_getEventId ; |83| | |||
; call occurs [#_TIMER_getEventId] ; |83| | |||
STL A,*SP(2) | |||
.dwpsn "timer.c",86,3 | |||
FCALL #_IRQ_clear ; |86| | |||
; call occurs [#_IRQ_clear] ; |86| | |||
.dwpsn "timer.c",89,3 | |||
LDX #_timerIsr,16,A ; |89| | |||
OR #_timerIsr,A,A ; |89| | |||
DST A,*SP(0) ; |89| | |||
LD *SP(2),A | |||
FCALL #_IRQ_plug ; |89| | |||
; call occurs [#_IRQ_plug] ; |89| | |||
.dwpsn "timer.c",92,3 | |||
LD *SP(2),A | |||
FCALL #_IRQ_enable ; |92| | |||
; call occurs [#_IRQ_enable] ; |92| | |||
.dwpsn "timer.c",95,3 | |||
FCALL #_IRQ_globalEnable ; |95| | |||
; call occurs [#_IRQ_globalEnable] ; |95| | |||
.dwpsn "timer.c",98,3 | |||
LD *(_mhTimer),A | |||
FCALL #_TIMER_start ; |98| | |||
; call occurs [#_TIMER_start] ; |98| | |||
.dwpsn "timer.c",101,9 | |||
MVDM *(_timer_int_cnt),AR1 | |||
STM #20,AR0 | |||
CMPR 1,AR1 ; |101| | |||
BC L3,NTC ; |101| | |||
; branchcc occurs ; |101| | |||
L2: | |||
DW$L$_taskFunc$2$B: | |||
MVDM *(_timer_int_cnt),AR1 | |||
NOP | |||
CMPR 1,AR1 ; |101| | |||
BC L2,TC ; |101| | |||
; branchcc occurs ; |101| | |||
DW$L$_taskFunc$2$E: | |||
L3: | |||
.dwpsn "timer.c",104,3 | |||
LD *(_mhTimer),A | |||
FCALL #_TIMER_close ; |104| | |||
; call occurs [#_TIMER_close] ; |104| | |||
.dwpsn "timer.c",107,3 | |||
LD *SP(3),A | |||
FCALL #_IRQ_globalRestore ; |107| | |||
; call occurs [#_IRQ_globalRestore] ; |107| | |||
.dwpsn "timer.c",109,4 | |||
MVDM *(_timer_int_cnt),AR1 | |||
STM #20,AR0 | |||
CMPR 1,AR1 ; |109| | |||
BC L4,NTC ; |109| | |||
; branchcc occurs ; |109| | |||
.dwpsn "timer.c",110,7 | |||
ADDM #1,*SP(4) ; |110| | |||
L4: | |||
.dwpsn "timer.c",114,4 | |||
LD *SP(4),A ; |114| | |||
BC L5,AEQ ; |114| | |||
; branchcc occurs ; |114| | |||
.dwpsn "timer.c",115,6 | |||
FCALLD #_uart_puts ; |115| | |||
LD #SL3,A | |||
; call occurs [#_uart_puts] ; |115| | |||
B L6 ; |115| | |||
; branch occurs ; |115| | |||
L5: | |||
.dwpsn "timer.c",117,6 | |||
FCALLD #_uart_puts ; |117| | |||
LD #SL4,A | |||
; call occurs [#_uart_puts] ; |117| | |||
L6: | |||
.dwpsn "timer.c",119,4 | |||
FCALLD #_uart_puts ; |119| | |||
LD #SL5,A | |||
; call occurs [#_uart_puts] ; |119| | |||
.dwpsn "timer.c",120,1 | |||
FRAME #5 | |||
.dwcfa 0x0e, 3 | |||
POPM AR1 | |||
.dwcfa 0xc0, 10 | |||
.dwcfa 0x0e, 2 | |||
NOP | |||
NOP | |||
FRET | |||
; return occurs | |||
DW$39 .dwtag DW_TAG_loop | |||
.dwattr DW$39, DW_AT_name("D:\CCStudio_v3.3\examples\dsk5416\csl\timer\timer1\timer.asm:L2:1:1462526370") | |||
.dwattr DW$39, DW_AT_begin_file("timer.c") | |||
.dwattr DW$39, DW_AT_begin_line(0x65) | |||
.dwattr DW$39, DW_AT_end_line(0x65) | |||
DW$40 .dwtag DW_TAG_loop_range | |||
.dwattr DW$40, DW_AT_low_pc(DW$L$_taskFunc$2$B) | |||
.dwattr DW$40, DW_AT_high_pc(DW$L$_taskFunc$2$E) | |||
.dwendtag DW$39 | |||
.dwattr DW$35, DW_AT_end_file("timer.c") | |||
.dwattr DW$35, DW_AT_end_line(0x78) | |||
.dwattr DW$35, DW_AT_end_column(0x01) | |||
.dwendentry | |||
.dwendtag DW$35 | |||
.sect ".text" | |||
.global _timerIsr | |||
DW$41 .dwtag DW_TAG_subprogram, DW_AT_name("timerIsr"), DW_AT_symbol_name("_timerIsr") | |||
.dwattr DW$41, DW_AT_low_pc(_timerIsr) | |||
.dwattr DW$41, DW_AT_high_pc(0x00) | |||
.dwattr DW$41, DW_AT_begin_file("timer.c") | |||
.dwattr DW$41, DW_AT_begin_line(0x7d) | |||
.dwattr DW$41, DW_AT_begin_column(0x10) | |||
.dwpsn "timer.c",125,31 | |||
.dwfde DW$CIE | |||
;*************************************************************** | |||
;* FUNCTION DEF: _timerIsr * | |||
;*************************************************************** | |||
_timerIsr: | |||
NOP | |||
.dwcfa 0x0e, 2 | |||
.dwcfa 0x80, 34, 2 | |||
PSHM AL | |||
.dwcfa 0x0e, 3 | |||
.dwcfa 0x80, 0, 3 | |||
PSHM AH | |||
.dwcfa 0x0e, 4 | |||
.dwcfa 0x80, 1, 4 | |||
PSHM AG | |||
.dwcfa 0x0e, 5 | |||
.dwcfa 0x80, 2, 5 | |||
PSHM BL | |||
.dwcfa 0x0e, 6 | |||
.dwcfa 0x80, 6, 6 | |||
PSHM BH | |||
.dwcfa 0x0e, 7 | |||
.dwcfa 0x80, 7, 7 | |||
PSHM BG | |||
.dwcfa 0x0e, 8 | |||
.dwcfa 0x80, 8, 8 | |||
PSHM AR0 | |||
.dwcfa 0x0e, 9 | |||
.dwcfa 0x80, 9, 9 | |||
PSHM AR1 | |||
.dwcfa 0x0e, 10 | |||
.dwcfa 0x80, 10, 10 | |||
PSHM AR2 | |||
.dwcfa 0x0e, 11 | |||
.dwcfa 0x80, 11, 11 | |||
PSHM AR3 | |||
.dwcfa 0x0e, 12 | |||
.dwcfa 0x80, 12, 12 | |||
PSHM AR4 | |||
.dwcfa 0x0e, 13 | |||
.dwcfa 0x80, 13, 13 | |||
PSHM AR5 | |||
.dwcfa 0x0e, 14 | |||
.dwcfa 0x80, 14, 14 | |||
PSHM AR6 | |||
.dwcfa 0x0e, 15 | |||
.dwcfa 0x80, 15, 15 | |||
PSHM AR7 | |||
.dwcfa 0x0e, 16 | |||
.dwcfa 0x80, 16, 16 | |||
PSHM FP | |||
.dwcfa 0x0e, 17 | |||
.dwcfa 0x80, 18, 17 | |||
PSHM BK | |||
.dwcfa 0x0e, 18 | |||
.dwcfa 0x80, 19, 18 | |||
PSHM T | |||
.dwcfa 0x0e, 19 | |||
.dwcfa 0x80, 20, 19 | |||
PSHM ST0 | |||
.dwcfa 0x0e, 20 | |||
.dwcfa 0x80, 23, 20 | |||
PSHM ST1 | |||
NOP | |||
.dwcfa 0x0e, 21 | |||
.dwcfa 0x80, 24, 21 | |||
PSHM BRC | |||
.dwcfa 0x0e, 22 | |||
.dwcfa 0x80, 25, 22 | |||
PSHM PMST | |||
NOP | |||
.dwcfa 0x0e, 23 | |||
.dwcfa 0x80, 29, 23 | |||
PSHM RSA | |||
.dwcfa 0x0e, 24 | |||
.dwcfa 0x80, 30, 24 | |||
PSHM REA | |||
.dwcfa 0x0e, 25 | |||
.dwcfa 0x80, 31, 25 | |||
ANDM #32063,*(ST1) | |||
ORM #16384,*(ST1) | |||
ANDM #-4,*(PMST) | |||
LDM SP,A | |||
ANDM #-2,*(SP) | |||
NOP | |||
NOP | |||
PSHM AL | |||
FRAME #-1 | |||
.dwcfa 0x0e, 25 | |||
.dwpsn "timer.c",126,4 | |||
LD *(_mhTimer),A | |||
FCALL #_TIMER_stop ; |126| | |||
; call occurs [#_TIMER_stop] ; |126| | |||
.dwpsn "timer.c",127,4 | |||
ADDM #1,*(_timer_int_cnt) ; |127| | |||
.dwpsn "timer.c",128,4 | |||
MVDM *(_timer_int_cnt),AR1 | |||
STM #20,AR0 | |||
CMPR 1,AR1 ; |128| | |||
BC L7,NTC ; |128| | |||
; branchcc occurs ; |128| | |||
.dwpsn "timer.c",129,6 | |||
LD *(_mhTimer),A | |||
FCALL #_TIMER_start ; |129| | |||
; call occurs [#_TIMER_start] ; |129| | |||
L7: | |||
.dwpsn "timer.c",132,4 | |||
FCALLD #_uart_puts ; |132| | |||
LD #SL6,A | |||
; call occurs [#_uart_puts] ; |132| | |||
.dwpsn "timer.c",133,1 | |||
FRAME #1 | |||
.dwcfa 0x0e, 25 | |||
POPM SP | |||
NOP | |||
POPM REA | |||
.dwcfa 0xc0, 31 | |||
.dwcfa 0x0e, 24 | |||
POPM RSA | |||
.dwcfa 0xc0, 30 | |||
.dwcfa 0x0e, 23 | |||
POPM PMST | |||
NOP | |||
.dwcfa 0xc0, 29 | |||
.dwcfa 0x0e, 22 | |||
POPM BRC | |||
.dwcfa 0xc0, 25 | |||
.dwcfa 0x0e, 21 | |||
POPM ST1 | |||
NOP | |||
.dwcfa 0xc0, 24 | |||
.dwcfa 0x0e, 20 | |||
POPM ST0 | |||
.dwcfa 0xc0, 23 | |||
.dwcfa 0x0e, 19 | |||
POPM T | |||
.dwcfa 0xc0, 20 | |||
.dwcfa 0x0e, 18 | |||
POPM BK | |||
.dwcfa 0xc0, 19 | |||
.dwcfa 0x0e, 17 | |||
POPM FP | |||
.dwcfa 0xc0, 18 | |||
.dwcfa 0x0e, 16 | |||
POPM AR7 | |||
.dwcfa 0xc0, 16 | |||
.dwcfa 0x0e, 15 | |||
POPM AR6 | |||
.dwcfa 0xc0, 15 | |||
.dwcfa 0x0e, 14 | |||
POPM AR5 | |||
.dwcfa 0xc0, 14 | |||
.dwcfa 0x0e, 13 | |||
POPM AR4 | |||
.dwcfa 0xc0, 13 | |||
.dwcfa 0x0e, 12 | |||
POPM AR3 | |||
.dwcfa 0xc0, 12 | |||
.dwcfa 0x0e, 11 | |||
POPM AR2 | |||
.dwcfa 0xc0, 11 | |||
.dwcfa 0x0e, 10 | |||
POPM AR1 | |||
.dwcfa 0xc0, 10 | |||
.dwcfa 0x0e, 9 | |||
POPM AR0 | |||
.dwcfa 0xc0, 9 | |||
.dwcfa 0x0e, 8 | |||
POPM BG | |||
.dwcfa 0xc0, 8 | |||
.dwcfa 0x0e, 7 | |||
POPM BH | |||
.dwcfa 0xc0, 7 | |||
.dwcfa 0x0e, 6 | |||
POPM BL | |||
.dwcfa 0xc0, 6 | |||
.dwcfa 0x0e, 5 | |||
POPM AG | |||
.dwcfa 0xc0, 2 | |||
.dwcfa 0x0e, 4 | |||
POPM AH | |||
.dwcfa 0xc0, 1 | |||
.dwcfa 0x0e, 3 | |||
POPM AL | |||
.dwcfa 0xc0, 0 | |||
.dwcfa 0x0e, 2 | |||
NOP | |||
NOP | |||
FRETE | |||
; branch occurs | |||
.dwattr DW$41, DW_AT_end_file("timer.c") | |||
.dwattr DW$41, DW_AT_end_line(0x85) | |||
.dwattr DW$41, DW_AT_end_column(0x01) | |||
.dwendentry | |||
.dwendtag DW$41 | |||
;*************************************************************** | |||
;* STRINGS * | |||
;*************************************************************** | |||
.sect ".const" | |||
SL1: .string "C5416 Timer Test Start...",10,0 | |||
SL2: .string "<TIMER>",10,0 | |||
SL3: .string "TEST FAILED",10,0 | |||
SL4: .string "TEST PASSED",10,0 | |||
SL5: .string "<DONE>",10,0 | |||
SL6: .string "Entry Timer Isr function...",10,0 | |||
;*************************************************************** | |||
;* UNDEFINED EXTERNAL REFERENCES * | |||
;*************************************************************** | |||
.global _IRQ_clear | |||
.global _IRQ_enable | |||
.global _IRQ_globalDisable | |||
.global _IRQ_globalEnable | |||
.global _IRQ_globalRestore | |||
.global _IRQ_plug | |||
.global _CSL_init | |||
.global _TIMER_open | |||
.global _TIMER_close | |||
.global _TIMER_getEventId | |||
.global _TIMER_start | |||
.global _TIMER_stop | |||
.global _TIMER_config | |||
.global _uart_puts | |||
;*************************************************************** | |||
;* TYPE INFORMATION * | |||
;*************************************************************** | |||
DW$T$22 .dwtag DW_TAG_subroutine_type | |||
.dwattr DW$T$22, DW_AT_language(DW_LANG_C) | |||
DW$42 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$19) | |||
.dwendtag DW$T$22 | |||
DW$T$24 .dwtag DW_TAG_subroutine_type | |||
.dwattr DW$T$24, DW_AT_language(DW_LANG_C) | |||
DW$43 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$10) | |||
.dwendtag DW$T$24 | |||
DW$T$26 .dwtag DW_TAG_subroutine_type | |||
.dwattr DW$T$26, DW_AT_language(DW_LANG_C) | |||
DW$T$28 .dwtag DW_TAG_typedef, DW_AT_name("IRQ_IsrPtr"), DW_AT_type(*DW$T$27) | |||
.dwattr DW$T$28, DW_AT_language(DW_LANG_C) | |||
DW$T$29 .dwtag DW_TAG_subroutine_type | |||
.dwattr DW$T$29, DW_AT_language(DW_LANG_C) | |||
DW$44 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$19) | |||
DW$45 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$28) | |||
.dwendtag DW$T$29 | |||
DW$T$33 .dwtag DW_TAG_subroutine_type | |||
.dwattr DW$T$33, DW_AT_language(DW_LANG_C) | |||
DW$46 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$32) | |||
.dwendtag DW$T$33 | |||
DW$T$37 .dwtag DW_TAG_subroutine_type | |||
.dwattr DW$T$37, DW_AT_language(DW_LANG_C) | |||
DW$47 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$32) | |||
DW$48 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$36) | |||
.dwendtag DW$T$37 | |||
DW$T$42 .dwtag DW_TAG_subroutine_type | |||
.dwattr DW$T$42, DW_AT_language(DW_LANG_C) | |||
DW$49 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$41) | |||
.dwendtag DW$T$42 | |||
DW$T$44 .dwtag DW_TAG_subroutine_type | |||
.dwattr DW$T$44, DW_AT_language(DW_LANG_C) | |||
DW$T$19 .dwtag DW_TAG_typedef, DW_AT_name("Uint16"), DW_AT_type(*DW$T$9) | |||
.dwattr DW$T$19, DW_AT_language(DW_LANG_C) | |||
DW$T$45 .dwtag DW_TAG_subroutine_type, DW_AT_type(*DW$T$19) | |||
.dwattr DW$T$45, DW_AT_language(DW_LANG_C) | |||
DW$50 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$32) | |||
.dwendtag DW$T$45 | |||
DW$T$47 .dwtag DW_TAG_volatile_type | |||
.dwattr DW$T$47, DW_AT_type(*DW$T$19) | |||
DW$T$10 .dwtag DW_TAG_base_type, DW_AT_name("int") | |||
.dwattr DW$T$10, DW_AT_encoding(DW_ATE_signed) | |||
.dwattr DW$T$10, DW_AT_byte_size(0x01) | |||
DW$T$48 .dwtag DW_TAG_subroutine_type, DW_AT_type(*DW$T$10) | |||
.dwattr DW$T$48, DW_AT_language(DW_LANG_C) | |||
DW$51 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$19) | |||
.dwendtag DW$T$48 | |||
DW$T$50 .dwtag DW_TAG_subroutine_type, DW_AT_type(*DW$T$10) | |||
.dwattr DW$T$50, DW_AT_language(DW_LANG_C) | |||
DW$T$32 .dwtag DW_TAG_typedef, DW_AT_name("TIMER_Handle"), DW_AT_type(*DW$T$31) | |||
.dwattr DW$T$32, DW_AT_language(DW_LANG_C) | |||
DW$T$52 .dwtag DW_TAG_subroutine_type, DW_AT_type(*DW$T$32) | |||
.dwattr DW$T$52, DW_AT_language(DW_LANG_C) | |||
DW$52 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$10) | |||
DW$53 .dwtag DW_TAG_formal_parameter, DW_AT_type(*DW$T$19) | |||
.dwendtag DW$T$52 | |||
DW$T$35 .dwtag DW_TAG_typedef, DW_AT_name("TIMER_Config"), DW_AT_type(*DW$T$21) | |||
.dwattr DW$T$35, DW_AT_language(DW_LANG_C) | |||
DW$T$36 .dwtag DW_TAG_pointer_type, DW_AT_type(*DW$T$35) | |||
.dwattr DW$T$36, DW_AT_address_class(0x10) | |||
DW$T$41 .dwtag DW_TAG_pointer_type, DW_AT_type(*DW$T$40) | |||
.dwattr DW$T$41, DW_AT_address_class(0x10) | |||
DW$T$27 .dwtag DW_TAG_pointer_type, DW_AT_type(*DW$T$26) | |||
.dwattr DW$T$27, DW_AT_address_class(0x20) | |||
DW$T$9 .dwtag DW_TAG_base_type, DW_AT_name("unsigned short") | |||
.dwattr DW$T$9, DW_AT_encoding(DW_ATE_unsigned) | |||
.dwattr DW$T$9, DW_AT_byte_size(0x01) | |||
DW$T$31 .dwtag DW_TAG_pointer_type, DW_AT_type(*DW$T$20) | |||
.dwattr DW$T$31, DW_AT_address_class(0x10) | |||
DW$T$21 .dwtag DW_TAG_structure_type | |||
.dwattr DW$T$21, DW_AT_byte_size(0x02) | |||
DW$54 .dwtag DW_TAG_member, DW_AT_type(*DW$T$19) | |||
.dwattr DW$54, DW_AT_name("tcr"), DW_AT_symbol_name("_tcr") | |||
.dwattr DW$54, DW_AT_data_member_location[DW_OP_plus_uconst 0x0] | |||
.dwattr DW$54, DW_AT_accessibility(DW_ACCESS_public) | |||
DW$55 .dwtag DW_TAG_member, DW_AT_type(*DW$T$19) | |||
.dwattr DW$55, DW_AT_name("prd"), DW_AT_symbol_name("_prd") | |||
.dwattr DW$55, DW_AT_data_member_location[DW_OP_plus_uconst 0x1] | |||
.dwattr DW$55, DW_AT_accessibility(DW_ACCESS_public) | |||
.dwendtag DW$T$21 | |||
DW$T$40 .dwtag DW_TAG_const_type | |||
.dwattr DW$T$40, DW_AT_type(*DW$T$39) | |||
DW$T$20 .dwtag DW_TAG_structure_type | |||
.dwattr DW$T$20, DW_AT_byte_size(0x01) | |||
DW$56 .dwtag DW_TAG_member, DW_AT_type(*DW$T$19) | |||
.dwattr DW$56, DW_AT_name("Private"), DW_AT_symbol_name("_Private") | |||
.dwattr DW$56, DW_AT_data_member_location[DW_OP_plus_uconst 0x0] | |||
.dwattr DW$56, DW_AT_accessibility(DW_ACCESS_public) | |||
.dwendtag DW$T$20 | |||
DW$T$39 .dwtag DW_TAG_base_type, DW_AT_name("signed char") | |||
.dwattr DW$T$39, DW_AT_encoding(DW_ATE_signed_char) | |||
.dwattr DW$T$39, DW_AT_byte_size(0x01) | |||
.dwattr DW$32, DW_AT_external(0x01) | |||
.dwattr DW$35, DW_AT_external(0x01) | |||
.dwattr DW$41, DW_AT_external(0x01) | |||
.dwattr DW$CU, DW_AT_language(DW_LANG_C) | |||
;*************************************************************** | |||
;* DWARF CIE ENTRIES * | |||
;*************************************************************** | |||
DW$CIE .dwcie 1, 34 | |||
.dwcfa 0x0c, 17, 0 | |||
.dwcfa 0x07, 0 | |||
.dwcfa 0x07, 1 | |||
.dwcfa 0x07, 2 | |||
.dwcfa 0x07, 3 | |||
.dwcfa 0x07, 4 | |||
.dwcfa 0x07, 5 | |||
.dwcfa 0x07, 6 | |||
.dwcfa 0x07, 7 | |||
.dwcfa 0x07, 8 | |||
.dwcfa 0x07, 9 | |||
.dwcfa 0x08, 10 | |||
.dwcfa 0x07, 11 | |||
.dwcfa 0x07, 12 | |||
.dwcfa 0x07, 13 | |||
.dwcfa 0x07, 14 | |||
.dwcfa 0x08, 15 | |||
.dwcfa 0x08, 16 | |||
.dwcfa 0x07, 17 | |||
.dwcfa 0x07, 18 | |||
.dwcfa 0x07, 19 | |||
.dwcfa 0x07, 20 | |||
.dwcfa 0x07, 21 | |||
.dwcfa 0x07, 22 | |||
.dwcfa 0x07, 23 | |||
.dwcfa 0x07, 24 | |||
.dwcfa 0x07, 25 | |||
.dwcfa 0x07, 26 | |||
.dwcfa 0x07, 27 | |||
.dwcfa 0x07, 28 | |||
.dwcfa 0x07, 29 | |||
.dwcfa 0x07, 30 | |||
.dwcfa 0x07, 31 | |||
.dwcfa 0x07, 32 | |||
.dwcfa 0x07, 33 | |||
.dwcfa 0x07, 34 | |||
;*************************************************************** | |||
;* DWARF REGISTER MAP * | |||
;*************************************************************** | |||
DW$57 .dwtag DW_TAG_assign_register, DW_AT_name("A") | |||
.dwattr DW$57, DW_AT_location[DW_OP_reg0] | |||
DW$58 .dwtag DW_TAG_assign_register, DW_AT_name("AH") | |||
.dwattr DW$58, DW_AT_location[DW_OP_reg1] | |||
DW$59 .dwtag DW_TAG_assign_register, DW_AT_name("AG") | |||
.dwattr DW$59, DW_AT_location[DW_OP_reg2] | |||
DW$60 .dwtag DW_TAG_assign_register, DW_AT_name("") | |||
.dwattr DW$60, DW_AT_location[DW_OP_reg3] | |||
DW$61 .dwtag DW_TAG_assign_register, DW_AT_name("") | |||
.dwattr DW$61, DW_AT_location[DW_OP_reg4] | |||
DW$62 .dwtag DW_TAG_assign_register, DW_AT_name("") | |||
.dwattr DW$62, DW_AT_location[DW_OP_reg5] | |||
DW$63 .dwtag DW_TAG_assign_register, DW_AT_name("B") | |||
.dwattr DW$63, DW_AT_location[DW_OP_reg6] | |||
DW$64 .dwtag DW_TAG_assign_register, DW_AT_name("BH") | |||
.dwattr DW$64, DW_AT_location[DW_OP_reg7] | |||
DW$65 .dwtag DW_TAG_assign_register, DW_AT_name("BG") | |||
.dwattr DW$65, DW_AT_location[DW_OP_reg8] | |||
DW$66 .dwtag DW_TAG_assign_register, DW_AT_name("AR0") | |||
.dwattr DW$66, DW_AT_location[DW_OP_reg9] | |||
DW$67 .dwtag DW_TAG_assign_register, DW_AT_name("AR1") | |||
.dwattr DW$67, DW_AT_location[DW_OP_reg10] | |||
DW$68 .dwtag DW_TAG_assign_register, DW_AT_name("AR2") | |||
.dwattr DW$68, DW_AT_location[DW_OP_reg11] | |||
DW$69 .dwtag DW_TAG_assign_register, DW_AT_name("AR3") | |||
.dwattr DW$69, DW_AT_location[DW_OP_reg12] | |||
DW$70 .dwtag DW_TAG_assign_register, DW_AT_name("AR4") | |||
.dwattr DW$70, DW_AT_location[DW_OP_reg13] | |||
DW$71 .dwtag DW_TAG_assign_register, DW_AT_name("AR5") | |||
.dwattr DW$71, DW_AT_location[DW_OP_reg14] | |||
DW$72 .dwtag DW_TAG_assign_register, DW_AT_name("AR6") | |||
.dwattr DW$72, DW_AT_location[DW_OP_reg15] | |||
DW$73 .dwtag DW_TAG_assign_register, DW_AT_name("AR7") | |||
.dwattr DW$73, DW_AT_location[DW_OP_reg16] | |||
DW$74 .dwtag DW_TAG_assign_register, DW_AT_name("SP") | |||
.dwattr DW$74, DW_AT_location[DW_OP_reg17] | |||
DW$75 .dwtag DW_TAG_assign_register, DW_AT_name("FP") | |||
.dwattr DW$75, DW_AT_location[DW_OP_reg18] | |||
DW$76 .dwtag DW_TAG_assign_register, DW_AT_name("BK") | |||
.dwattr DW$76, DW_AT_location[DW_OP_reg19] | |||
DW$77 .dwtag DW_TAG_assign_register, DW_AT_name("T") | |||
.dwattr DW$77, DW_AT_location[DW_OP_reg20] | |||
DW$78 .dwtag DW_TAG_assign_register, DW_AT_name("ASM") | |||
.dwattr DW$78, DW_AT_location[DW_OP_reg21] | |||
DW$79 .dwtag DW_TAG_assign_register, DW_AT_name("SXM") | |||
.dwattr DW$79, DW_AT_location[DW_OP_reg22] | |||
DW$80 .dwtag DW_TAG_assign_register, DW_AT_name("ST0") | |||
.dwattr DW$80, DW_AT_location[DW_OP_reg23] | |||
DW$81 .dwtag DW_TAG_assign_register, DW_AT_name("ST1") | |||
.dwattr DW$81, DW_AT_location[DW_OP_reg24] | |||
DW$82 .dwtag DW_TAG_assign_register, DW_AT_name("BRC") | |||
.dwattr DW$82, DW_AT_location[DW_OP_reg25] | |||
DW$83 .dwtag DW_TAG_assign_register, DW_AT_name("TC") | |||
.dwattr DW$83, DW_AT_location[DW_OP_reg26] | |||
DW$84 .dwtag DW_TAG_assign_register, DW_AT_name("PC") | |||
.dwattr DW$84, DW_AT_location[DW_OP_reg27] | |||
DW$85 .dwtag DW_TAG_assign_register, DW_AT_name("DB") | |||
.dwattr DW$85, DW_AT_location[DW_OP_reg28] | |||
DW$86 .dwtag DW_TAG_assign_register, DW_AT_name("PMST") | |||
.dwattr DW$86, DW_AT_location[DW_OP_reg29] | |||
DW$87 .dwtag DW_TAG_assign_register, DW_AT_name("RSA") | |||
.dwattr DW$87, DW_AT_location[DW_OP_reg30] | |||
DW$88 .dwtag DW_TAG_assign_register, DW_AT_name("REA") | |||
.dwattr DW$88, DW_AT_location[DW_OP_reg31] | |||
DW$89 .dwtag DW_TAG_assign_register, DW_AT_name("OVM") | |||
.dwattr DW$89, DW_AT_location[DW_OP_regx 0x20] | |||
DW$90 .dwtag DW_TAG_assign_register, DW_AT_name("FRCT") | |||
.dwattr DW$90, DW_AT_location[DW_OP_regx 0x21] | |||
DW$91 .dwtag DW_TAG_assign_register, DW_AT_name("CIE_RETA") | |||
.dwattr DW$91, DW_AT_location[DW_OP_regx 0x22] | |||
.dwendtag DW$CU | |||
@ -0,0 +1,136 @@ | |||
/* | |||
* Copyright 2002 by Texas Instruments Incorporated. | |||
* All rights reserved. Property of Texas Instruments Incorporated. | |||
* Restricted rights to use, duplicate or disclose this code are | |||
* granted through contract. | |||
* | |||
*/ | |||
/* "@(#) DSP/BIOS 4.80.188 12-06-02 (bios,dsk5416-a11)" */ | |||
/******************************************************************************\ | |||
* Copyright (C) 2000 Texas Instruments Incorporated. | |||
* All Rights Reserved | |||
*------------------------------------------------------------------------------ | |||
* FILENAME...... timer.c | |||
* DATE CREATED.. 01/11/2000 | |||
* LAST MODIFIED. 12/29/2000 | |||
\******************************************************************************/ | |||
#include <stdio.h> | |||
#include <csl.h> | |||
#include <csl_irq.h> | |||
#include <csl_timer.h> | |||
#include "uart.h" | |||
/*----------------------------------------------------------------------------*/ | |||
/* In this exmaple, we are simply setting the timer to interrupt */ | |||
/* every 0x800 clock cycles. All timer setup will be done in a */ | |||
/* TASK function that executes after exit from "main" */ | |||
/* Create a timer control structure */ | |||
TIMER_Config myTConfig = { | |||
TIMER_TCR_RMK( | |||
TIMER_TCR_SOFT_WAITZERO, | |||
TIMER_TCR_FREE_NOSOFT, | |||
TIMER_TCR_TRB_RESET, | |||
TIMER_TCR_TSS_START, | |||
TIMER_TCR_TDDR_OF(0) | |||
), /* TCR0 */ | |||
0x0800u /* PRD0 */ | |||
}; | |||
/* Global declarations */ | |||
TIMER_Handle mhTimer; | |||
volatile Uint16 timer_int_cnt = 0; | |||
interrupt void timerIsr(void); | |||
void taskFunc(void); | |||
/*----------------------------------------------------------------------------*/ | |||
void main() { | |||
uart_puts("C5416 Timer Test Start...\n"); | |||
/* Initialize CSL library, this step is required */ | |||
CSL_init(); | |||
/* Call example task/function */ | |||
taskFunc(); | |||
while(1); | |||
} | |||
/*----------------------------------------------------------------------------*/ | |||
void taskFunc(void) { | |||
Uint16 eventId; | |||
int old_intm; | |||
Uint16 err = 0; | |||
//printf("<TIMER>\n"); | |||
uart_puts("<TIMER>\n"); | |||
/* Temporarily disable all maskable interrupts, preserving */ | |||
/* previous state of INTM */ | |||
old_intm = IRQ_globalDisable(); | |||
/* Open Timer 0, this returns a pointer to a Timer Handle */ | |||
/* that will be used as an argument to other CSL functions */ | |||
mhTimer = TIMER_open(TIMER_DEV0, TIMER_OPEN_RESET); | |||
/* Write configuration structure values to Timer control */ | |||
/* registers. */ | |||
TIMER_config(mhTimer, &myTConfig); | |||
/* Get Event ID associated with Timer interrupt */ | |||
eventId = TIMER_getEventId(mhTimer); | |||
/* Clear any pending Timer interrupts */ | |||
IRQ_clear(eventId); | |||
/* Place interrupt service routine address at associated vector */ | |||
IRQ_plug(eventId,timerIsr); | |||
/* Enable Timer interrupt */ | |||
IRQ_enable(eventId); | |||
/* Enable all maskable interrupts */ | |||
IRQ_globalEnable(); | |||
/* Start Timer */ | |||
TIMER_start(mhTimer); | |||
/* wait for 20 timer periods */ | |||
while(timer_int_cnt < 20); | |||
/* We are through with the Timer, so close it */ | |||
TIMER_close(mhTimer); | |||
/* Restore old value of INTM */ | |||
IRQ_globalRestore(old_intm); | |||
if (timer_int_cnt < 20) | |||
++err; | |||
//printf("%s\n",err?"TEST FAILED":"TEST PASSED"); | |||
//printf("<DONE>\n"); | |||
if (err) | |||
uart_puts("TEST FAILED\n"); | |||
else | |||
uart_puts("TEST PASSED\n"); | |||
uart_puts("<DONE>\n"); | |||
} | |||
/*----------------------------------------------------------------------------*/ | |||
/* Timer ISR - will be called by DSP/BIOS dispatcher */ | |||
interrupt void timerIsr(void) { | |||
TIMER_stop(mhTimer); | |||
timer_int_cnt = timer_int_cnt + 1; | |||
if (timer_int_cnt < 20) { | |||
TIMER_start(mhTimer); | |||
} | |||
uart_puts("Entry Timer Isr function...\n"); | |||
} | |||
@ -0,0 +1,60 @@ | |||
/*****************************************************************************/ | |||
/* */ | |||
/* LNK.CMD - V2.00 COMMAND FILE FOR LINKING C PROGRAMS */ | |||
/* */ | |||
/* Usage: lnk500 <obj files...> -o <out file> -m <map file> lnk.cmd */ | |||
/* cl500 <src files...> -z -o <out file> -m <map file> lnk.cmd */ | |||
/* */ | |||
/* Description: This file is a sample command file that can be used */ | |||
/* for linking programs built with the C54x C Compiler. */ | |||
/* This file has been designed to work for */ | |||
/* 548 C54x device. */ | |||
/* Use it as a guideline; you may want to make alterations */ | |||
/* appropriate for the memory layout of the target */ | |||
/* system and/or your application. */ | |||
/* */ | |||
/* Notes: (1) You must specify the directory in which rts.lib is */ | |||
/* located. Either add a "-i<directory>" line to this */ | |||
/* file, or use the system environment variable C_DIR to */ | |||
/* specify a search path for the libraries. */ | |||
/* */ | |||
/* (2) If the run-time library you are using is not */ | |||
/* named rts.lib, be sure to use the correct name here. */ | |||
/*****************************************************************************/ | |||
MEMORY { | |||
PAGE 0: /* program memory */ | |||
PROG_RAM (RWX) : origin = 0x1400, length = 0x2C00 | |||
PROG_EXT (RWX) : origin = 0x8000, length = 0x4000 | |||
/* boot interrupt vector table location */ | |||
VECTORS (RWX): origin = 0xFF80, length = 0x80 | |||
PAGE 1: | |||
DATA_RAM (RW): origin = 0x4000, length = 0x2C00 | |||
DATA_EXT (RW): origin = 0x8000, length = 0x7FFF | |||
} /* MEMORY */ | |||
SECTIONS { | |||
.text > PROG_RAM | PROG_EXT PAGE 0 /* code */ | |||
.switch > PROG_RAM PAGE 0 /* switch table info */ | |||
.cinit > PROG_RAM PAGE 0 | |||
.vectors > VECTORS PAGE 0 /* interrupt vectors */ | |||
.cio > DATA_RAM PAGE 1 /* C I/O */ | |||
.data > DATA_RAM | DATA_EXT PAGE 1 /* initialized data */ | |||
.bss > DATA_RAM | DATA_EXT PAGE 1 /* global & static variables */ | |||
.const > DATA_RAM PAGE 1 /* constant data */ | |||
.sysmem > DATA_RAM | DATA_EXT PAGE 1 /* heap */ | |||
.stack > DATA_RAM | DATA_EXT PAGE 1 /* stack */ | |||
.csldata > DATA_RAM PAGE 1 | |||
} /* SECTIONS */ |
@ -0,0 +1,135 @@ | |||
/* | |||
* Copyright 2002 by Texas Instruments Incorporated. | |||
* All rights reserved. Property of Texas Instruments Incorporated. | |||
* Restricted rights to use, duplicate or disclose this code are | |||
* granted through contract. | |||
* | |||
*/ | |||
/* "@(#) DSP/BIOS 4.80.188 12-06-02 (bios,dsk5416-a11)" */ | |||
/******************************************************************************\ | |||
* Copyright (C) 2000 Texas Instruments Incorporated. | |||
* All Rights Reserved | |||
*------------------------------------------------------------------------------ | |||
* FILENAME...... timer.c | |||
* DATE CREATED.. 01/11/2000 | |||
* LAST MODIFIED. 12/29/2000 | |||
\******************************************************************************/ | |||
#include <stdio.h> | |||
#include <csl.h> | |||
#include <csl_irq.h> | |||
#include <csl_timer.h> | |||
#include "uart.h" | |||
/*----------------------------------------------------------------------------*/ | |||
/* In this exmaple, we are simply setting the timer to interrupt */ | |||
/* every 0x800 clock cycles. All timer setup will be done in a */ | |||
/* TASK function that executes after exit from "main" */ | |||
/* Create a timer control structure */ | |||
TIMER_Config myTConfig = { | |||
TIMER_TCR_RMK( | |||
TIMER_TCR_SOFT_WAITZERO, | |||
TIMER_TCR_FREE_NOSOFT, | |||
TIMER_TCR_TRB_RESET, | |||
TIMER_TCR_TSS_START, | |||
TIMER_TCR_TDDR_OF(0) | |||
), /* TCR0 */ | |||
0x0800u /* PRD0 */ | |||
}; | |||
/* Global declarations */ | |||
TIMER_Handle mhTimer; | |||
volatile Uint16 timer_int_cnt = 0; | |||
interrupt void timerIsr(void); | |||
void taskFunc(void); | |||
/*----------------------------------------------------------------------------*/ | |||
void main() { | |||
uart_puts("C5416 Timer Test Start...\n"); | |||
/* Initialize CSL library, this step is required */ | |||
CSL_init(); | |||
/* Call example task/function */ | |||
taskFunc(); | |||
} | |||
/*----------------------------------------------------------------------------*/ | |||
void taskFunc(void) { | |||
Uint16 eventId; | |||
int old_intm; | |||
Uint16 err = 0; | |||
//printf("<TIMER>\n"); | |||
uart_puts("<TIMER>\n"); | |||
/* Temporarily disable all maskable interrupts, preserving */ | |||
/* previous state of INTM */ | |||
old_intm = IRQ_globalDisable(); | |||
/* Open Timer 0, this returns a pointer to a Timer Handle */ | |||
/* that will be used as an argument to other CSL functions */ | |||
mhTimer = TIMER_open(TIMER_DEV0, TIMER_OPEN_RESET); | |||
/* Write configuration structure values to Timer control */ | |||
/* registers. */ | |||
TIMER_config(mhTimer, &myTConfig); | |||
/* Get Event ID associated with Timer interrupt */ | |||
eventId = TIMER_getEventId(mhTimer); | |||
/* Clear any pending Timer interrupts */ | |||
IRQ_clear(eventId); | |||
/* Place interrupt service routine address at associated vector */ | |||
IRQ_plug(eventId,timerIsr); | |||
/* Enable Timer interrupt */ | |||
IRQ_enable(eventId); | |||
/* Enable all maskable interrupts */ | |||
IRQ_globalEnable(); | |||
/* Start Timer */ | |||
TIMER_start(mhTimer); | |||
/* wait for 20 timer periods */ | |||
while(timer_int_cnt < 20); | |||
/* We are through with the Timer, so close it */ | |||
TIMER_close(mhTimer); | |||
/* Restore old value of INTM */ | |||
IRQ_globalRestore(old_intm); | |||
if (timer_int_cnt < 20) | |||
++err; | |||
//printf("%s\n",err?"TEST FAILED":"TEST PASSED"); | |||
//printf("<DONE>\n"); | |||
if (err) | |||
uart_puts("TEST FAILED\n"); | |||
else | |||
uart_puts("TEST PASSED\n"); | |||
uart_puts("<DONE>\n"); | |||
} | |||
/*----------------------------------------------------------------------------*/ | |||
/* Timer ISR - will be called by DSP/BIOS dispatcher */ | |||
interrupt void timerIsr(void) { | |||
TIMER_stop(mhTimer); | |||
timer_int_cnt = timer_int_cnt + 1; | |||
if (timer_int_cnt < 20) { | |||
TIMER_start(mhTimer); | |||
} | |||
uart_puts("Entry Timer Isr function...\n"); | |||
} | |||
@ -0,0 +1,27 @@ | |||
; Code Composer Project File, Version 2.0 (do not modify or remove this line) | |||
[Project Settings] | |||
ProjectName="timer" | |||
ProjectDir="D:\CCStudio_v3.3\examples\dsk5416\csl\timer\timer1\" | |||
ProjectType=Executable | |||
CPUFamily=TMS320C54XX | |||
Tool="Compiler" | |||
Tool="CustomBuilder" | |||
Tool="DspBiosBuilder" | |||
Tool="Linker" | |||
Config="Debug" | |||
[Source Files] | |||
Source="timer.c" | |||
Source="uart.c" | |||
Source="timer.cmd" | |||
["Compiler" Settings: "Debug"] | |||
Options=-g -k -q -fr".\Debug" -d"_DEBUG" -d"CHIP_5416" -mf -v548 | |||
["DspBiosBuilder" Settings: "Debug"] | |||
Options=-v54 | |||
["Linker" Settings: "Debug"] | |||
Options=-q -c -m".\Debug\timer.out" -o".\Debug\timer.out" -x -l"csl5416x.lib" -l"rts500EXT.lib" | |||
@ -0,0 +1,195 @@ | |||
/* | |||
* uart.c | |||
*/ | |||
/*******************************************************/ | |||
/* printf²Ù×÷º¯Êý */ | |||
/*******************************************************/ | |||
#include <stdio.h> | |||
#define SKYEYE 1 | |||
void uart_putc (const char c) | |||
{ | |||
if (SKYEYE) | |||
*(char *)0xd000 = c; /* write char to Transmit Buffer Register */ | |||
else | |||
putc(c, stdout); | |||
return; | |||
} | |||
void uart_puts (const char *s) | |||
{ | |||
while (*s) | |||
{ | |||
uart_putc (*s++); | |||
} | |||
return; | |||
} | |||
int my_strlen(char *str) | |||
{ | |||
int i; | |||
for(i = 0; str[i] != '\0'; i++); | |||
return i; | |||
} | |||
char *myitoa(int n, int hex) | |||
{ | |||
int num, i = 0, k = 0; | |||
static char str[100]; | |||
char temp; | |||
if(n < 0) | |||
{ | |||
str[i++] = '-'; | |||
n = -1 * n; | |||
} | |||
do | |||
{ | |||
num = n; | |||
n = n / hex; | |||
if (num%hex > 9) | |||
str[i+k++] = 'a' + (num%hex - 0xa); | |||
else | |||
str[i + k++] = '0' + num % hex; | |||
}while(n); | |||
str[i + k] = '\0'; | |||
k = my_strlen(str) - 1; | |||
for(;i < k; i++, k--) | |||
{ | |||
temp = str[i]; | |||
str[i] = str[k]; | |||
str[k] = temp; | |||
} | |||
return str; | |||
} | |||
unsigned square(unsigned val, unsigned num){ | |||
int i; | |||
unsigned ret = val; | |||
for(i = 0; i < num - 1; i++){ | |||
ret = ret*val; | |||
} | |||
return ret; | |||
} | |||
char * ftoa(double val, int prec) | |||
{ | |||
int sig = 0, index = 0, p, i, j; | |||
static char s[100] = {'\0'}; | |||
char temp_ch; | |||
long val_long, num; | |||
double val_temp; | |||
float v; | |||
long val_float; | |||
if(val < 0){ | |||
s[index++] = '-'; | |||
val_long = ((long)val) * -1; | |||
val_temp = val * -1; | |||
p = 1; | |||
}else{ | |||
val_long = (long)val; | |||
val_temp = val; | |||
p = 0; | |||
} | |||
do | |||
{ | |||
num = val_long; | |||
val_long = val_long / 10; | |||
s[index++] = '0' + num % 10; | |||
}while(val_long); | |||
for(i = p, j = index - 1; i < j; i++, j--){ | |||
temp_ch = s[i]; | |||
s[i] = s[j]; | |||
s[j] = temp_ch; | |||
} | |||
s[index++] = '.'; | |||
p = index; | |||
v = (val_temp - (long)val_temp) * square(10, prec); | |||
val_float = (long)v; | |||
for(i = 0; i < prec; i++){ | |||
num = val_float; | |||
val_float = val_float/10; | |||
s[index++] = '0' + num % 10; | |||
} | |||
for(i = p, j = index - 1; i < j; i++, j--){ | |||
temp_ch = s[i]; | |||
s[i] = s[j]; | |||
s[j] = temp_ch; | |||
} | |||
s[index] = '\0'; | |||
return s; | |||
} | |||
void uart_printf(const char *format, ...) | |||
{ | |||
va_list ap; | |||
char c; | |||
va_start(ap ,format); | |||
while((c = *format++) > 0) | |||
{ | |||
if(c == '%') | |||
{ | |||
switch(c = *format++){ | |||
case 'c':{ | |||
char ch = va_arg(ap, int); | |||
uart_putc(ch); | |||
break; | |||
} | |||
case 's':{ | |||
char *p = va_arg(ap, char*); | |||
uart_puts(p); | |||
break; | |||
} | |||
case '%': | |||
{ | |||
uart_putc(c); | |||
break; | |||
} | |||
case 'd': | |||
{ | |||
int num = va_arg(ap, int); | |||
char *p = myitoa(num, 10); | |||
uart_puts(p); | |||
break; | |||
} | |||
case 'x': | |||
{ | |||
int num = va_arg(ap, int); | |||
char *p = myitoa(num, 16); | |||
uart_puts(p); | |||
break; | |||
} | |||
case 'f': | |||
{ | |||
double fdata = va_arg(ap, double); | |||
char *str = ftoa(fdata, 6); | |||
uart_puts(str); | |||
break; | |||
} | |||
default: | |||
uart_putc(c); | |||
break; | |||
} | |||
} | |||
else if(c == '\\') | |||
{ | |||
switch(c = *format++){ | |||
case 'n':{ | |||
uart_putc('\r'); | |||
break; | |||
} | |||
default: | |||
uart_putc(c); | |||
break; | |||
} | |||
} | |||
else | |||
uart_putc(c); | |||
} | |||
va_end(ap); | |||
} |
@ -0,0 +1,20 @@ | |||
/* | |||
* uart.h | |||
*/ | |||
/*******************************************************/ | |||
/* printf²Ù×÷º¯Êý */ | |||
/*******************************************************/ | |||
#ifndef __UART_H__ | |||
#define __UART_H__ | |||
void uart_putc (const char c); | |||
void uart_puts (const char *s); | |||
int my_strlen(char *str); | |||
char *myitoa(int n, int hex); | |||
unsigned square(unsigned val, unsigned num); | |||
char * ftoa(double val, int prec); | |||
void uart_printf(const char *format, ...); | |||
#endif |
@ -0,0 +1,8 @@ | |||
C5416 Timer Test Start... | |||
<TIMER> | |||
Entry Timer Isr function... | |||
Entry Timer Isr function... | |||
Entry Timer Isr function... | |||
Entry Timer Isr function... | |||
Entry Timer Isr function... | |||
ÿÿ |
@ -0,0 +1,86 @@ | |||
import csv | |||
import os | |||
def deal_params(dev_list,fun): | |||
para_list=[] | |||
for i in dev_list: | |||
a=fun(i) | |||
dict1=demo(a) | |||
para_list.append(dict1) | |||
read_params_list=[] | |||
for i in para_list: | |||
if len(i)>0: | |||
for j,k in i.items(): | |||
k.append(j) | |||
read_params_list.append(tuple(k)) | |||
for l in range(len(k)): | |||
if isinstance(k[l],int): | |||
pass | |||
read_params_list=sort_list(read_params_list) | |||
return read_params_list | |||
def output_value_csv(data,header =["test_num","device_name","reg_name","offset","alter_value","expect_value"],file_name="data.csv"): | |||
if file_name=="data.csv": | |||
if os.path.exists(file_name): | |||
print("{}文件已存在".format(file_name)) | |||
else: | |||
with open(file_name,"w",encoding="utf-8",newline='')as fq: | |||
writer=csv.writer(fq) | |||
writer.writerow(header) | |||
writer.writerows(data) | |||
else: | |||
if os.path.exists(file_name): | |||
print("{}已删除,重新生成".format(file_name)) | |||
os.remove(file_name) | |||
with open(file_name,"w",encoding="utf-8",newline='')as fq: | |||
writer=csv.writer(fq) | |||
writer.writerow(header) | |||
writer.writerows(data) | |||
def out_put_test_reslut(data): | |||
file_name="testcase_result.csv" | |||
header=["tst_num","device_name","reg_name","offset","init_value","alter_value","expect_value","actual_value","test_result"] | |||
output_value_csv(data,header=header,file_name=file_name) | |||
def read_csv(): | |||
try: | |||
reg_par_list=[] | |||
with open("data.csv") as f: | |||
f_csv=csv.reader(f) | |||
headers=next(f_csv) | |||
for row in f_csv: | |||
reg_params=(row[0],row[1],row[2],int(row[3],16),int(row[4],16),int(row[5],16)) | |||
reg_par_list.append(reg_params) | |||
return reg_par_list | |||
except IndexError: | |||
print("请补充测试数据") | |||
except Exception as ep: | |||
print(ep) | |||
def demo(a): | |||
dict1={} | |||
for j,k in a.items(): | |||
for i in range(len(k)): | |||
dict1[k[i]["name"]] = [j,k[i]["offset"]] | |||
return dict1 | |||
def sort_list(a): | |||
for i in range(len(a)): | |||
for j in range(i+1,len(a)): | |||
if a[i][0] == a[j][0]: | |||
if a[i][1]>a[j][1]: | |||
a[i],a[j] = a[j],a[i] | |||
res=[] | |||
res1=[] | |||
for i in a: | |||
i=list(i) | |||
res.append(i) | |||
[res1.append(res[i][0]) for i in range(len(res)) if res[i][0] not in res1] | |||
for i in res1: | |||
a=1 | |||
for k in res: | |||
if i in k: | |||
testcasenum="testcase{}_({})".format(str(a),i) | |||
k.insert(0,testcasenum) | |||
a+=1 | |||
return res |
@ -0,0 +1,433 @@ | |||
import os,sys,time | |||
import cli | |||
from conf import * | |||
from skyeye_common_module import * | |||
import se_system as ss | |||
import threading | |||
from fuzzywuzzy import fuzz | |||
import fault_inject as fi | |||
import se_func as sf | |||
import skyeye_autotest_command as sac | |||
import pytimer | |||
import skyeye_common_module as scm | |||
MO_READ = 1 | |||
MO_WRITE = 2 | |||
OP_CHAR_TYPE = 1 | |||
OP_SHORT_TYPE = 2 | |||
OP_WORD_TYPE = 4 | |||
OP_DWORD_TYPE = 8 | |||
TY_INT = "int" | |||
TY_FLOAT = "float" | |||
TY_DOUBLE = "double" | |||
def SE_define_conf(filename): | |||
try: | |||
Config = json_conf(parent = None, filename = filename) | |||
if Config.get_init_result() == False: | |||
print ("load_config error") | |||
return False | |||
Config.instance() | |||
SetGlobalConfig(Config) | |||
define_json_file[0] = os.path.join(os.getcwd(), filename) | |||
except: | |||
print ("load_config error") | |||
return False | |||
def SE_load_binary(cpuname,filename): | |||
if os.path.isfile(filename)==False: | |||
print ("No such binary file") | |||
return False | |||
if SkyEyeLoadBinary(cpuname,filename)!=1: | |||
print ("load_binary error") | |||
return False | |||
binary_l[cpuname] = os.path.join(os.getcwd(), filename) | |||
def SE_init_ok(): | |||
SkyEyePrepareToRun() | |||
if ss.system ==None: | |||
ss.CreateClass() | |||
def SE_run_script(filename): | |||
fullfilename = os.path.realpath(filename) | |||
if not os.path.exists(fullfilename): | |||
print ("%s file does not exists!" % fullfilename) | |||
return False | |||
fp = open(fullfilename,'r') | |||
lines = fp.readlines() | |||
fp.close() | |||
cmd = cli.GetCommand("run-command") | |||
if cmd == None: | |||
SE_print("Can not find command: run-command") | |||
return False | |||
for line in lines: | |||
line = line.strip(' \n') | |||
if line == "" or line[0] == '#' or "run-pyfile" in line: | |||
continue | |||
try: | |||
ret=cmd.run(line) | |||
except Exception as e: | |||
SE_print(e) | |||
return False | |||
return True | |||
def SE_run(): | |||
SkyEyeRun() | |||
def SE_stop(): | |||
SkyEyeStop() | |||
def SE_stop_autotest(): | |||
if sac.ac != None: | |||
sac.ac.autotest_run = False | |||
def SE_reset(): | |||
SkyEyeReset() | |||
def SE_restart(): | |||
SE_reset() | |||
SE_define_conf(define_json_file[0]) | |||
for binary in binary_l.keys(): | |||
SE_load_binary(binary,os.path.normpath(binary_l[binary])) | |||
SE_init_ok() | |||
def SE_running_status(): | |||
return SkyEyeRunningStatus() | |||
def SE_pre_conf_obj(classname, objname): | |||
SkyEyePreConfObj(objname,classname) | |||
obj = ss.SkyEyeBaseClass(objname,classname,None) | |||
return obj | |||
def SE_sleep(s): | |||
time.sleep(s) | |||
log=None | |||
def SE_print(data): | |||
global log | |||
if log == None: | |||
return | |||
r_obj=ss.__redirection__() | |||
r_obj.set_out() | |||
print (data) | |||
r_obj.reset() | |||
log.WriteText(r_obj.buff) | |||
def SE_compare(actual_out,expect_out,accuracy): | |||
sj_output=actual_out | |||
try: | |||
fp1=open(sj_output,'r') | |||
except: | |||
SE_print('The actual output file was not found') | |||
return | |||
actual=fp1.read() | |||
fp1.close() | |||
rmlist=['\t','\r',' ','\n'] | |||
for i in rmlist: | |||
actual=actual.replace(i,'') | |||
expect_out=expect_out.replace(i,'') | |||
if len(actual)==0: | |||
SE_print('The actual output file is empty') | |||
return | |||
if len(expect_out)==0: | |||
SE_print('The desired output is empty') | |||
return | |||
accuracy_list=[] | |||
accuracy_list.append(fuzz.ratio(actual,expect_out)) | |||
accuracy_list.append(fuzz.partial_ratio(actual,expect_out)) | |||
if accuracy!=100: | |||
accuracy_list.append(fuzz.token_set_ratio(actual,expect_out)) | |||
max_accuracy = max(accuracy_list) | |||
if max_accuracy >= accuracy: | |||
SE_print("Proofreading success") | |||
return True | |||
else: | |||
SE_print('Check failure. expect accuracy: %d%% max actual accuracy: %d%%'%(accuracy,max_accuracy)) | |||
return False | |||
def SE_set_fault_inject(machname,addr,bit,mode): | |||
return fi.skyeye_set_fj_by_aadr(machname,addr,bit,mode) | |||
def SE_get_fault_inject(): | |||
return fi.skyeye_get_fj() | |||
def SE_clear_fault_injece(machname,addr,bit,mode): | |||
return fi.skyeye_clear_fj_by_addr(machname,addr,bit,mode) | |||
def SE_set_register_value(machname,addr,value): | |||
return sf.set_reg_value_by_addr(machname,addr,value) | |||
def SE_get_register_value(machname,addr): | |||
return sf.get_reg_value_by_addr(machname,addr) | |||
def SE_get_simulation_time(cpuname): | |||
return SkyEyeGetSimulationRunTime(cpuname) | |||
def SE_enable_parse_symbol(cpuname,binary): | |||
cmd = cli.GetCommand("parse-symbol") | |||
if cmd == None: | |||
SE_print("Can not find command: parse-symbol") | |||
return False | |||
try: | |||
ret=cmd.run([cpuname,binary]) | |||
except Exception as e: | |||
SE_print(e) | |||
return False | |||
return ret | |||
def SE_get_global_variable_addr(cpuname,varname): | |||
return SkyEyeGetSymbolAddr(cpuname,varname) | |||
def SE_get_global_variable_value(cpuname,varname,value_bytes_number,value_type): | |||
if value_type == TY_INT: | |||
return SkyEyeGetSymbolValue(cpuname,varname,value_bytes_number) | |||
elif value_type == TY_FLOAT: | |||
return SkyEyeGetFloatSymbolValue(cpuname,varname,value_bytes_number) | |||
elif value_type == TY_DOUBLE: | |||
return SkyEyeGetDoubleSymbolValue(cpuname,varname,value_bytes_number) | |||
else: | |||
pass | |||
def SE_set_global_variable_value(cpuname,varname,value,value_bytes_number,value_type): | |||
if value_type == TY_INT: | |||
return SkyEyeSetSymbolValue(cpuname,varname,value,value_bytes_number) | |||
elif value_type == TY_FLOAT: | |||
return SkyEyeSetFloatSymbolValue(cpuname,varname,value,value_bytes_number) | |||
elif value_type == TY_DOUBLE: | |||
return SkyEyeSetDoubleSymbolValue(cpuname,varname,value,value_bytes_number) | |||
else: | |||
pass | |||
def SE_log_output(filename,content): | |||
now_time = time.strftime('%m%d%H%M%S',time.localtime(time.time())) | |||
new_filename = filename+"_"+now_time+".txt" | |||
try: | |||
fp = open(new_filename,"w") | |||
fp.write(content) | |||
fp.close() | |||
except: | |||
print ("Write file failed") | |||
def SE_out_error_log(log): | |||
if sac.ac != None: | |||
sac.ac.error_test.append([sac.ac.error_reset(sac.ac.test_info),log]) | |||
def SE_run_to_time(cpuname,time_s): | |||
sf.run_to_time(cpuname,time_s) | |||
def SE_create_breakpoint(cpuname,addr): | |||
try: | |||
SkyEyeCreateBreakpoint(cpuname,addr) | |||
except Exception as e: | |||
SE_print(e) | |||
def SE_get_current_pc(cpuname): | |||
try: | |||
return SkyEyeGetPcByCoreName(cpuname) | |||
except Exception as e: | |||
SE_print(e) | |||
def SE_get_cpu_freq(cpuname): | |||
try: | |||
return SkyEyeGetCpuFreq(cpuname) | |||
except Exception as e: | |||
SE_print(e) | |||
def SE_read_byte(cpuname,addr): | |||
try: | |||
return SkyEyeReadByte(cpuname,addr) | |||
except Exception as e: | |||
SE_print(e) | |||
def SE_read_dword(cpuname,addr): | |||
try: | |||
return SkyEyeReadDWord(cpuname,addr) | |||
except Exception as e: | |||
SE_print(e) | |||
def SE_write_byte(cpuname,addr,value): | |||
try: | |||
return SkyEyeWriteByte(cpuname,addr,value) | |||
except Exception as e: | |||
SE_print(e) | |||
def SE_write_dword(cpuname,addr,value): | |||
try: | |||
return SkyEyeWriteDWord(cpuname,addr,value) | |||
except Exception as e: | |||
SE_print(e) | |||
def SE_sync_callback(cpuname,my_callback,argument): | |||
return pytimer.PyTmrCreate(cpuname,0,pytimer.TMR_ONE_SHOT,my_callback, argument) | |||
def SE_create_timer(cpuname,time_ms,my_callback,argument): | |||
return pytimer.PyTmrCreate(cpuname,time_ms,pytimer.TMR_ONE_SHOT,my_callback, argument) | |||
def SE_delete_timer(tmr): | |||
try: | |||
return pytimer.PyTmrDelete(tmr) | |||
except: | |||
return False | |||
def SE_set_watch_on_pc(cpuname,pc_addr,my_callback,argument): | |||
return pytimer.PySetWatchOnPc(cpuname,pc_addr,my_callback,argument) | |||
def SE_del_watch_on_pc(watch): | |||
try: | |||
return pytimer.PyUnWatchOnPc(watch) | |||
except: | |||
return False | |||
def SE_set_watch_on_mem(ms_name,mm_type,addr,data_type,length,my_callback,argument): | |||
return pytimer.PySetWatchOnMem(ms_name,mm_type,addr,data_type,length,my_callback,argument) | |||
def SE_del_watch_on_mem(watch): | |||
try: | |||
return pytimer.PyUnWatchOnMem(watch) | |||
except: | |||
return False | |||
def SE_get_func_addr(cpuname,funcname): | |||
try: | |||
return SkyEyeGetFuncAddr(cpuname,funcname) | |||
except Exception as e: | |||
SE_print(e) | |||
def SE_get_func_length(cpuname,funcname): | |||
try: | |||
return SkyEyeGetFuncLength(cpuname,funcname) | |||
except Exception as e: | |||
SE_print(e) | |||
def SE_load_file(memoryname, filename, pc_addr): | |||
if os.path.isfile(filename)==False: | |||
print ("No such binary file") | |||
return False | |||
if SkyEyeNewLoadFile(memoryname, filename, pc_addr) != 1: | |||
print ("load_file error") | |||
return False | |||
def SE_cpu_load_file(cpuname, filename, pc_addr): | |||
if os.path.isfile(filename)==False: | |||
print ("No such binary file") | |||
return False | |||
if SkyEyeLoadFile(cpuname, filename, pc_addr) != 1: | |||
print ("load_file error") | |||
return False | |||
def SE_term_wait_for_string(termname, string): | |||
return SkyEyeTermWaitForString(termname, string) | |||
def SE_term_write(termname, string): | |||
return SkyEyeTermWrite(termname, string) | |||
def SE_term_wait_then_write(termname, wait_string, write_string): | |||
return SkyEyeTermWaitThenWrite(termname, wait_string, write_string) | |||
def SE_get_device_register_list(machname, devicename): | |||
regs = [] | |||
RegNum = SkyEyeGetDevRegNum(machname,devicename) | |||
for regid in range(0,RegNum): | |||
regs.append(SkyEyeGetDevRegNameById(machname,devicename,regid)) | |||
return regs | |||
def SE_Device_skyEyeGetDevRegNum(machname,devicename): | |||
return SkyEyeGetDevRegNum(machname,devicename) | |||
def SE_SkyEyeGetModules(): | |||
return SkyEyeGetModules() | |||
def SE_get_regs(machname,devname): | |||
return fi.get_device_register_info(machname,devname) | |||
def SE_get_registers(devicename): | |||
reg_list = [] | |||
reg_list1=[] | |||
reg_attr_dic1 = {} | |||
try: | |||
num = scm.SkyEyeGetDevRegNum(None, devicename) | |||
except: | |||
return None | |||
for i in range(0, num): | |||
try: | |||
name = scm.SkyEyeGetDevRegNameById(None, devicename, i) | |||
if name == None: | |||
continue | |||
except: | |||
return None | |||
try: | |||
value = scm.SkyEyeGetDevRegValueById(None, devicename, i) | |||
except: | |||
return None | |||
try: | |||
offset = scm.SkyEyeGetDevRegOffsetById(None, devicename, i) | |||
except: | |||
return None | |||
if offset == 0xffffffff: | |||
offset = i * 4 | |||
reg_attr_dic={} | |||
reg_attr_dic["offset"] = offset | |||
reg_attr_dic["size"] = 4 | |||
reg_attr_dic["value"] = value | |||
reg_attr_dic["name"] = name | |||
reg_list.append(reg_attr_dic) | |||
reg_attr_dic1[devicename] = reg_list | |||
# reg_list1.append(reg_attr_dic1) | |||
return reg_attr_dic1 | |||
def SE_ReadDevice4(device, offset): | |||
return SkyEyeReadDevice4(device, offset) | |||
def SE_WriteDevice4(device, offset,data): | |||
return SkyEyeWriteDevice4(device, offset,data) | |||
def SE_Test_regs_read_wirte(test_num,device,reg_name, offset,alter_value,expect): | |||
alter_value=int(alter_value) | |||
init_vaule= SkyEyeReadDWord(device,offset) | |||
a=SE_write_dword(device, offset,alter_value) | |||
actual_value = SkyEyeReadDWord(device,offset) | |||
if actual_value == expect: | |||
result = "true" | |||
else: | |||
result = "false" | |||
return [test_num,device,reg_name,hex(eval(str(offset))),hex(eval(str(init_vaule))),hex(eval(str(alter_value))),hex(eval(str(expect))),hex(eval(str(actual_value))),result] | |||
def SE_get_simulation_device_info(): | |||
result='false' | |||
error=None | |||
device_info={} | |||
config = GetGlobalConfig() | |||
if config!=None: | |||
mach_list=config.get_mach_list() | |||
for machname in mach_list: | |||
device_info[machname]={} | |||
device_list = config.get_device_list_by_mach(machname) | |||
dev_list=[] | |||
if device_list != None: | |||
for device in device_list: | |||
cls = config.get_device_classname(machname, device) | |||
base=SkyEyeGetClassType(cls) | |||
if "image" in cls or "memory_space" in cls or "ram" in cls or "_core" in cls: | |||
pass | |||
else: | |||
dev_list.append(device) | |||
device_info[machname]=dev_list | |||
result=device_info | |||
device_list=[] | |||
for j,k in result.items(): | |||
device_list.extend(k) | |||
else: | |||
error="The config is None" | |||
return device_list | |||
def SE_Quit(): | |||
SkyEyeQuit() |