123 lines
2.9 KiB
Plaintext
123 lines
2.9 KiB
Plaintext
; --------------------------------------------------------------------------------
|
|
; @Title: Code Coverage Export Example (ARM and PowerPC Simulator)
|
|
; @Description:
|
|
; Example to show the export of code coverage data
|
|
; Creates XML-file "example.xml"
|
|
;
|
|
; With "t32transform.xsl" in the same directory you can view "example.xml"
|
|
; directly in your webbrowser
|
|
;
|
|
; Supported Targets:
|
|
; TRACE32 Instruction Set Simulator for ARM
|
|
; TRACE32 Instruction Set Simulator for PowerPC
|
|
;
|
|
; @Author: HLG
|
|
; @Props: Template
|
|
; @Keywords: coverage export xml
|
|
; @Copyright: (C) 1989-2014 Lauterbach GmbH, licensed for use with TRACE32(R) only
|
|
; --------------------------------------------------------------------------------
|
|
; $Id: example.cmm 15120 2019-10-18 13:25:56Z hlohn $
|
|
|
|
LOCAL &min
|
|
&min=41727.
|
|
IF VERSION.BUILD()<&min
|
|
(
|
|
DIALOG.OK "Sorry, this demo requires a least TRACE32 build "+FORMAT.Decimal(1,&min)+"."
|
|
ENDDO
|
|
)
|
|
IF !SIMULATOR()
|
|
(
|
|
DIALOG.OK "Sorry, this demo is intended for TRACE32 running in simulator mode." "Start TRACE32 with PBI=SIM in config.t32"
|
|
ENDDO
|
|
)
|
|
|
|
WinCLEAR
|
|
AREA.CLEAR
|
|
COVerage.RESet
|
|
ISTATistic.RESet
|
|
BookMark.RESet
|
|
Trace.RESet
|
|
Trace.SIZE 5000000.
|
|
Trace.Mode Stack
|
|
Trace.AutoInit OFF
|
|
Trace.AutoArm ON
|
|
|
|
IF CPUFAMILY()=="ARM"
|
|
(
|
|
DO "~~~~/../arm/compiler/gnu/demo_sram.cmm"
|
|
WAIT !RUN()
|
|
|
|
Trace.Init
|
|
Go.direct func23
|
|
|
|
BookMark.Create "1" main\47
|
|
BookMark.Create "nop1" func4\4+0x0e
|
|
|
|
)
|
|
ELSE IF CPUFAMILY()=="POWERPC"
|
|
(
|
|
DO "~~~~/../powerpc/compiler/gnu-vle/demo_sram.cmm"
|
|
WAIT !RUN()
|
|
|
|
Trace.Init
|
|
Go.direct func23
|
|
|
|
BookMark.Create "1" main\43
|
|
BookMark.Create "nop1" func4\4
|
|
)
|
|
ELSE
|
|
(
|
|
PRINT %ERROR "Sorry, this demo is not yet running with " CPUFAMILY()
|
|
ENDDO
|
|
)
|
|
|
|
BookMark.Create "bad1" background
|
|
BookMark.Create "bad2" func27
|
|
BookMark.EditRemark "1" "j is never 0, seems to be useless code"
|
|
BookMark.EditRemark "bad1" "never called => dead code"
|
|
BookMark.EditRemark "bad2" "never called => dead code"
|
|
BookMark.EditRemark "nop1" "padding NOP"
|
|
|
|
Trace.CLOCK 50.MHZ
|
|
|
|
WAIT !RUN()
|
|
WAIT Trace.STATE()==0
|
|
Trace.TRACK 0.
|
|
COVerage.ADD
|
|
ISTATistic.ADD
|
|
|
|
Mode.Hll
|
|
|
|
WinCLEAR
|
|
FramePOS ,,,,Maximized
|
|
|
|
WinPOS 0% 85% 100% 15%
|
|
WinTABS 10. 14. 33. 8. 66.
|
|
BookMark /Track
|
|
|
|
WinPOS 0% 0% 100% 50%
|
|
List.auto /COVerage /Track
|
|
|
|
WinPOS 0% 50% 100% 35%
|
|
WinTABS 18.
|
|
COVerage.ListFunc
|
|
|
|
DO "~~~~/single_file_report/create_report.cmm" "_start--sYmbol.END(background)"
|
|
List.EXPORT.Mix "~~~~/single_file_report/example-list.xml" _start--sYmbol.END(background)
|
|
List.EXPORT.Mix "~~~~/single_file_report/example-istat.xml" _start--sYmbol.END(background) /ISTAT
|
|
|
|
DO "~~~~/multi_file_report/create_report.cmm" "~~~~/example_report" "ADDRESS" "_start--sYmbol.END(background)" "EXISTING=BACKUP COMPRESSION=4"
|
|
|
|
PRIVATE &ppd
|
|
&ppd=OS.PPD()
|
|
IF PRACTICE.CoMmanD.AVAILable("OS.OPEN")
|
|
(
|
|
OS.OPEN "&ppd/multi_file_report/example_report/index.html"
|
|
)
|
|
ELSE IF OS.FILE("~~/demo/practice/lib.cmm")
|
|
(
|
|
DO "~~/demo/practice/lib.cmm" OPENURL "&ppd/multi_file_report/example_report/index.html"
|
|
)
|
|
ENDDO
|
|
|