CCS + Opentest Enabling JTAG-Based DUT’s Control.

13
CCS + Opentest Enabling JTAG-Based DUT’s Control

Transcript of CCS + Opentest Enabling JTAG-Based DUT’s Control.

Page 1: CCS + Opentest Enabling JTAG-Based DUT’s Control.

CCS + Opentest

Enabling JTAG-Based

DUT’s Control

Page 2: CCS + Opentest Enabling JTAG-Based DUT’s Control.

TestTemplate

TestTemplate

Test Master Controller

Test Service Providers

DispatcherDispatcher Resource ManagerResource Manager MonitorMonitor

TEExTEEx BEExBEEx

OtherServiceOther

Service

Test Management System (TestLink)

Test Cases

Test Results

Test Reports

Test Requirements

TEEyTEEy

BEEyBEEy

BEEzBEEz

STAF messages

STAF messages

Opentest Client

TestTemplate

TestResults

SiteConfig

STAF messages

CLI Browser

TestTemplate

TestTemplate

New CCS Connection type Implemented here

Page 3: CCS + Opentest Enabling JTAG-Based DUT’s Control.

CCS Connectivity

• Add support to VATF TEE for CCS-based control of Device Under Test

• Supports CCSv4 and CCSv5 (tested w/ v5 only)

• Supported only on Linux for now

Page 4: CCS + Opentest Enabling JTAG-Based DUT’s Control.

Multiple Simultaneous Connections are possible

@equipment['dut1'].connect({'type' => ‘serial’}) .send_cmd command, expect, timeout .response .timeout?

@equipment['dut1'].connect({'type' => ‘telnet'}) .send_cmd command, expect, timeout .response .timeout?

@equipment['dut1'].connect({'type' => 'ccs'}) .create .build .load .run .run_dss .send_ipc_data .read_ipc_data

UART

ETH

J-TAG

DUT Driver

Page 5: CCS + Opentest Enabling JTAG-Based DUT’s Control.

CCS Connection API• create(timeout, options)

– Create project from sourcers– Wrapper for com.ti.ccstudio.apps.projectCreate

• build(timeout, options)– Build project– Wrapper for com.ti.ccstudio.apps.projectBuild

• load(outfile, timeout, options, extras)– Wrapper for loadti w/ changes to use automation

• run(outfile, timeout, options, extras)– Wrapper for loadti w/ changes to use automation

• run_dss(script, timeout, extras)– Wrapper for dss

• send_ipc_data(data, timeout)

• read_ipc_data(timeout)

• response

– Returns stderr and stdout data created by last command

• timeout?

– True if last command timed out, false otherwise

Page 6: CCS + Opentest Enabling JTAG-Based DUT’s Control.

Create & Build options

• 'workspace' • 'project_name' • 'device' • 'location' • 'kind' • 'endianness' • 'cgt_version' • 'cmd_file' • 'runtime_lib' • 'asm_only' • 'configurations'

• 'references' • 'set_build_opt' • 'add_file' • 'link_file' • 'define_var' • 'overwrite' • 'args' • 'enable_bios' • 'bios_version' • 'enable_rtsc' • 'xdc_version'

Page 7: CCS + Opentest Enabling JTAG-Based DUT’s Control.

Loadti Options

• 'async' • 'config' • 'load_only' • 'mem_load_raw' • 'mem_load_dat' • 'mem_save_raw' • 'xml_log'

• 'mem_save_dat' • 'no_profile' • 'quiet' • 'reset' • 'stdout_file' • 'timeout'

Page 8: CCS + Opentest Enabling JTAG-Based DUT’s Control.

Passing Params to DSS 1) Test parameters are 'imported' automatically into the javascript to be executed. In particular, the following parameters are 'imported': Software assets parameters (i.e. parameters defined in Testlink's build description) DUT provisioning parameters (i.e. parameters defined in Testslink's test case as 'DUT parameters') Application control parameters (i.e. parameters defined in Testslink's test case as 'Application parameters')

2) The parameters are available in javascript via autotestEnv map.For example to access the outFile value use 'autotestEnv.outFile' in your javascript

3) The default behavior described above can be overridden in your test script by setting the equipment's 'target.ccs.jsEnvArgsFile' variable. For example: @equipment['dut1'].target.ccs.jsEnvArgsFile = <your test args file>

Page 9: CCS + Opentest Enabling JTAG-Based DUT’s Control.

IPC: Test script ↔ DSS

• Test script side:– send_ipc_data(data, timeout)– read_ipc_data(timeout)

• DSS side:– To Send, write to file: autotestEnv.outIpc– To Read, read from file: autotestEnv.inIpc

Page 10: CCS + Opentest Enabling JTAG-Based DUT’s Control.

Sample Test Scriptrequire File.dirname(__FILE__)+'/default_ccs'

def run thr = Thread.new() { @equipment['dut1'].run_dss "/home/a0850405local/ti/dss-scripts/myplayground.js", 100 }

sleep 40 ip = /^Network Added:.+?:([\d\.]+)/.match(@equipment['dut1'].target.ccs.response).captures[0] @equipment['server1'].send_cmd("/home/a0850405local/code/mcu-sdk/fromTod/sendOneTcpMessage #{ip}", @equipment['server1'].prompt) thr.join if @equipment['dut1'].target.ccs.response.match(/Test Passed/) set_result(FrameworkConstants::Result[:pass], "Test Passed") else set_result(FrameworkConstants::Result[:fail], "Test Failed") endend

Page 11: CCS + Opentest Enabling JTAG-Based DUT’s Control.

Sample Test Script 2 (IPC)require File.dirname(__FILE__)+'/default_ccs'

def run thr = Thread.new() { @equipment['dut1'].run_dss "/home/a0850405local/ti/dss-scripts/myplayground2.js", 20 } begin data = @equipment['dut1'].read_ipc_data(20) rescue data = 'error' end if data.match(/hello/i) set_result(FrameworkConstants::Result[:pass], "Test Passed") else set_result(FrameworkConstants::Result[:fail], "Test Failed") endend

Page 12: CCS + Opentest Enabling JTAG-Based DUT’s Control.

Sample Bench File entrydut = EquipmentInfo.new("am180x-evm", "ccs")dut.driver_class_name='EquipmentDriver'dut.prompt = /[\w\d]+@.+[@:#]+/dut.boot_prompt = /U-Boot\s*>/mdut.login_prompt = /login:/dut.telnet_ip='158.218.103.93'dut.telnet_port=23dut.login = 'root'dut.telnet_login = 'root'dut.serial_port = '/dev/ttyS0'dut.serial_params = {"baud" => 115200, "data_bits" => 8, "stop_bits" => 1, "parity" => SerialPort::NONE}dut.power_port = {'apc.158.218.103.33' => 1}dut.params = {'ccs_type' => 'Ccsv5', 'ccs_install_dir' => '/opt/ti/ccsv5', 'ccs_workspace' => '/home/a0850405local/workspace_v5_1', 'ccsConfig' => '/home/a0850405local/ti/CCSTargetConfigurations/c6748.ccxml' 'gelFile' => '/home/a0850405local/ti/CCSTargetConfigurations/C6748.gel' 'ccsPlatform' => 'Spectrum Digital XDS510USB Emulator_0', 'ccsCpu' => 'C674X_0'}

Page 13: CCS + Opentest Enabling JTAG-Based DUT’s Control.

Pending/Future Work

• Current driver is EA quality

• Create Project and Build actions have not been verified

• Support Windows?

• Support Multicore?

• Need 'real' application to apply the new functionality