0% found this document useful (0 votes)
45 views

Advanced Scripting Techniques For Automating Regression Tests and Measurements With The Code Composer Studio Scripting Utility

The document discusses using the Code Composer Studio (CCS) scripting utility and General Extension Language (GEL) to automate regression tests and measurements. It provides an overview of GEL and its limitations for automation. The CCS scripting utility addresses these limitations by allowing scripts to configure and control CCS from outside the IDE using synchronous APIs. Techniques for passing parameters to GEL calls and command line arguments to executables are presented. Automating profiling with the scripting utility is also discussed.

Uploaded by

gardoim_cilim
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Advanced Scripting Techniques For Automating Regression Tests and Measurements With The Code Composer Studio Scripting Utility

The document discusses using the Code Composer Studio (CCS) scripting utility and General Extension Language (GEL) to automate regression tests and measurements. It provides an overview of GEL and its limitations for automation. The CCS scripting utility addresses these limitations by allowing scripts to configure and control CCS from outside the IDE using synchronous APIs. Techniques for passing parameters to GEL calls and command line arguments to executables are presented. Automating profiling with the scripting utility is also discussed.

Uploaded by

gardoim_cilim
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Advanced Scripting

Techniques for
Automating Regression
Tests and Measurements
with the Code Composer
01001000100000110000001000001100 Studio Scripting Utility
010010001000

Name: Vincent Wan, Ki-Soo Lee


Title: SDO Applications Engineer
Company Name: Texas Instruments
Email: vwan@ti.com, kisoo@ti.com
Agenda
 The Growing Need for Automation
 CCStudio Tools for Automation
 CCStudio General Extension Language (GEL)
 CCStudio Scripting Utility (CCScripting)
 Scripting Tips and Tricks
 Scripting Demo: Automated Profiling Demo
 Summary
 References

2
Customers are Challenged with
Skyrocketing Application Size and Complexity

Skyrocketing Size and Complexity


 As embedded development continues to
grow in both scope and complexity, so
does the demands on unit and system
testing
 Effectively automating such testing is a
crucial phase in the development cycle
and can substantially decrease time to
market

3
CCStudio Tools for Automation

 General Extension Language (GEL)

 CCStudio Scripting Utility (CCScripting)

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

 GEL scripts can run only from within CCStudio


 CCStudio must already be configured and IDE running
 Many GEL calls only apply to that instance of the debug
window (heterogeneous debugging)
 Can not open CCStudio

 Asynchronous behavior for some built-in functions


 Difficult to create long complex script with dependencies
 Not enough built-in GEL callback functions (OnHalt(),
OnReset(), etc) to workaround this effectively
• Cannot create additional callback functions

 GEL was never meant for full blown automation


purposes like overnight testing or batch-runs

6
CCStudio Scripting Utility
 CCStudio plug-in available via Update Advisor

 Provides access to CCStudio functionality from either Perl or


COM-based (VBA, JScript, etc) scripting languages
 Provides 50+ useful API’s for common actions (launch CCStudio, open
project, load program, set breakpoints, run, halt, etc…)

 Addresses CCStudio GEL automation limitations


 Scripts can configure and open CCStudio
 All APIs are synchronous in behavior
 One script to control multiple CCStudio debug windows during multi-
processor debug

 Can run/call GEL Functions


 CCScripting can leverage all GEL functionality
 Not meant to replace GEL usage but support GEL usage for automation

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

 Creative usage of CCScripting can lead to powerful


scripts that:
 Are fully portable and reusable
 Are multi-purpose
 Can workaround known ‘limitations’ in CCS
 Provide fully automated test benches

 Some creative examples/techniques include:


 Avoiding hard-coded paths/parameters passed in to GEL calls
 Passing command line parameters to a CCS executable
 Creating a fully automated CCS profiling test bench
9
Passing parameters to GEL calls
 We can use CCScripting’s
TargetEvalExpression() API to dynamically
construct GEL calls with different parameters

 This is particularly useful for passing strings to


GEL functions since GEL scripts do not support
strings as a built-in type.

 Good for passing in different filenames and avoid


hard-coded paths
 Otherwise, similar variants of the same GEL file would
be needed to make GEL calls that require slightly
different parameters depending on ISA, platform, etc.

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)

 Often it is nice to be able to parameterized e.g. test code via


command line parameters

 CCScripting can do the parameter passing by directly


writing argc and argv to DSP memory before running an
executable

 We have implemented a Jscript function to do this for


C6000 platforms

 Need to allocate memory for arguments


 use –args linker switch (for non-BIOS executables)
 set .args section size in configuration tool (for BIOS executables)

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

Executable to be Automation Script


profiled written in Jscript
- one per platform
(e.g. C6416)
Profiling
Windows CCS Log files
results
Scripting Scripting
Host APIs

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

We can automate the iterative process of loading,


running and profiling RF3 on the simulator using
CCScripting
17
Peripheral simulation
The simulator simulates the application and its use of peripherals

CLKR External Clock

CLKX

Application EDMA McBSP


BCLK*

Hardware
FSR Audio Codec
DRR FSX
DXR

denotes fictitious signals/hardware


components, not present in simulation
denotes pin-connect simulated signal * BCLK is the base
denotes port-connect simulated address clock signal used to
drive the audio codec
18
Setting up pin and port connect

 To automate pin/port connect and disconnect, we


called these GEL functions using
TargetEvalExpression() in CCScripting:

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

 Creative usage of CCScripting can lead to


powerful scripts such as fully automated
benchmarking and regression testing of an
application with CCStudio

22
References
 Application Note (SPRAAB7): Automated
Regression Tests and Measurements with the
Code Composer Studio Scripting Utility

 Microsoft Windows Scripting: JScript

23
Advanced Scripting Techniques for
Automating Regression Tests and
Measurements with the Code Composer
Studio Scripting Utility

Presenter Name: Vincent Wan, Ki-Soo Lee


Title: SDO Applications Engineer
Company Name: Texas Instruments
Email Address: vwan@ti.com, kisoo@ti.com

24

You might also like