Advanced Scripting Techniques For Automating Regression Tests and Measurements With The Code Composer Studio Scripting Utility
Advanced Scripting Techniques For Automating Regression Tests and Measurements With The Code Composer Studio Scripting Utility
Techniques for
Automating Regression
Tests and Measurements
with the Code Composer
01001000100000110000001000001100 Studio Scripting Utility
010010001000
2
Customers are Challenged with
Skyrocketing Application Size and Complexity
3
CCStudio Tools for Automation
4
GEL (General Extension Language)
OnTargetConnect()
‘C’ like scripting language {
/* User must set this value based on board being used */
that extends CCStudio int sdr_ddr_startup = 0; /* (SDR=0 DDR=1) */
usefulness int armboot;
Enter GEL expressions in a
GEL file GEL_MapOff();
Use GEL to automate actions
/* Determine value of ARMBOOT */
within CCStudio armboot = find_armboot();
/* Memory mapping */
Many built-in GEL functions GEL_MapReset();
memorymap_init(armboot);
for common IDE actions GEL_MapOn();
(Halt, Run, Load Program, /* OMAP3.2 Setup */
Set Breakpoint, etc) memif_init(armboot);
access_width_init();
release_MGS3_reset();
Create custom GEL if (sdr_ddr_startup == 0) {
functions for additional SDR_enable();
functionality } else {
DDR_enable();
Automate several steps within }
one GEL function
/* Helen2 Setup */
helen2_setup();
watchdog_disable();
}
5
GEL Limitations for Automation
6
CCStudio Scripting Utility
CCStudio plug-in available via Update Advisor
7
GEL vs. CCScripting
GEL (for Automation) CCScripting
Integrated w/CCStudio Available via Update Advisor
Scripts run from within IDE Scripts called outside the IDE
Mix of synchronous and All APIs are synchronous in behavior
asynchronous behavior of built-in
functions
Control active debug window Control multiple debug windows
(Parallel Debugging) from one script
~100 built-in GEL functions + ability ~50 CCScripting APIs + access to all
to create additional custom GEL GEL functions (built-in or custom)
functions
Additional capability provided with
the scripting language being used
(file system access, logging, etc)
8
Maximizing the Value of CCScripting
The CCS Scripting Utility can be a valuable tool for
automating your environment
10
Passing parameters to GEL calls
/* do pin connect for the specified McBSP using
correct pin connect file */
tmp = basePathFwdSlash + testEnv.simFilesPath +
"/CLKX" + testEnv.mcbspNumber + ".txt";
Can pass this in
pin = "CLKX" + testEnv.mcbspNumber; based on the
device
ccs.TargetEvalExpression('GEL_PinConnect("' + pin
+ '", "' + tmp + '" )' );
Constructed this GEL call
GEL_PinConnect(“CLKX0”, “c:/CLKX0.txt”)
Note: code shown in JScript 11
Passing command line parameters to
a DSP executable
CCS does not have built-in support to set command line
parameters to a DSP executable (argc, argv)
12
Contents of argument memory
section
For a non-bios-based executable:
Int argc;
Char * argv[0]; string corresponding to arg 0 32-bit value
Char * argv[1]; string corresponding to arg 1 written by script
… …
Char * argv[n]; string corresponding to last arg string written by
For a bios-based executable: script
Int argc; not supported
Char ** argv; (ignored) by
script
Char * envp
Char * argv[0]; string corresponding to arg 0
Char * argv[1]; string corresponding to arg 1
… …
Char * argv[n]; string corresponding to last arg 13
Getting profiling results via
CCScripting
Profiling can easily be automated via
CCScripting
Has built-in APIs to expose functionality of the
CCS profiler
• Configure, start, stop profiler
• Allow access to profiler clock
• Export data in both binary and Excel spreadsheet
formats
Also has extended API for accessing the ATK via
Perl in the form of a Perl module
• We have ported the tprof2xls functionality to Jscript so
that ATK results can be delivered in a spreadsheet with a
single function call
14
Automated Profiling Demo
15
Demo Setup
CCS 3.1
CCScripting 1.50
C6416 Device Cycle Accurate Simulator
Reference Frameworks level 3 (with minor
modifications to run on simulator)
16
Profiling RF3
Make minor (almost zero) modifications to
Reference Frameworks Level 3
Use Simulation of McBSP, EDMA, Timers.
Use pin and port connect to simulate McBSP
interaction with a ‘virtual audio codec’
Use the analysis toolkit (ATK) to profile the
application
Identify function(s) to optimize
Validate numbers again post-optimization
CLKX
Hardware
FSR Audio Codec
DRR FSX
DXR
GEL_PinConnect()
GEL_PortConnect()
GEL_PinDisconnect()
GEL_PortDisconnect()
19
Multi Event Profiler
Also referred to as Analysis Toolkit (ATK)
Provides exclusive function profiling and
code coverage
Results displayed in an Excel spreadsheet
20
Demo and script walkthrough
21
Summary
The Code Composer Studio Scripting
Utility was designed to provide the ability
to automate unit and system-level testing
of an application with CCStudio
22
References
Application Note (SPRAAB7): Automated
Regression Tests and Measurements with the
Code Composer Studio Scripting Utility
23
Advanced Scripting Techniques for
Automating Regression Tests and
Measurements with the Code Composer
Studio Scripting Utility
24