isystem.connect
Python Examples by Group

Connecting to winIDEA

debugIdeTraceProfilerCoverageSample.py

Almost all scripts on this page connect to winIDEA.

multicoreConnection.py

This script demonstrates how to connect to multi-core winIDEA instances.

Downloading

addFileToDownloadList.py

This script adds file to download list in winIDEA.

addRemoveDownloadFile.py

This script demonstrates handling of download files and their options in winIDEA.

advancedDownloadOptions.py

This script prints advanced download options, which are set in winIDEA. See winIDEA dialog Debug | Files for download | tab Download Files | button Properties | button Advanced.

verifyDownloadAndGetCapabilities.py

This script demonstrates usage of method verifyDownload().

targetDownload.py

This script demonstrates the usage of target download, where file not in the download list can be downloaded, and target is not reset.

debugIdeTraceProfilerCoverageSample.py

This script demonstrates usage of debug, ide, trace, profiler, and coverage interfaces.

Execution Control

callTargetFunction.py

This script demonstrates how to call function on the target.

debugIdeTraceProfilerCoverageSample.py

This script demonstrates usage of debug, ide, trace, profiler, and coverage interfaces.

executionPointManipulationExample.py

This script makes use of CExecutionController's execution point manipulation functions.

Watch expressions and other data access

evaluateExpression.py

This script demonstrates evaluation of watch expressions with isystem.connect. It evaluates an expression specified in the command line and prints its value.

batchAccess.py

This script demonstrates the usage of isystem.connect batch access. Several chunks of memory are periodically read by winIDEA.

readTargetVariable.py

This script reads a variable 'iCounter' on the target and prints its value until it reaches value of 100000.

debugIdeTraceProfilerCoverageSample.py

This script demonstrates usage of debug, ide, trace, profiler, and coverage interfaces.

availableMemoryAccess.py

This script prints available memory access - if target read-writes, and real-time read-writes are available.

dataWriteModifyExample.py

This script demonstrates evaluation of watch expressions with isystem.connect. It evaluates an expression specified in the command line and prints its value.

evaluateComposite.py

This script demonstrates evaluation of complex variable, for example array of structures.

Other debug control

addressControllerExample.py

This script demonstrates usage CAddressController. It prints address of function given in command line, or address of 'main()' if no function name is given in command line.

analyzeCallTree.py

This script generates a call tree for a function from its disassembly information. This script is ony a proof of concept. Use testIDEA to generate scripts, which produce more readable call graphs.

callHierarchy.py

This script demonstrates usage of API for getting call hierarchy from symbol information. Analyzer is not required for this information to be available.

analyzeDisassembly.py

This script prints the disassembly information for function. This script is only a proof of concept. If compiler adds data inside object code, the information returned by this script may not be accurate.

breakpointExample.py

This example demonstrates various breakpoint operations - how to set them, delete them, and disable them.

setBPOnFirstAvailableLine.py

This script tries to set breakpoint on the requested line, but if this line does not generate any code, then it tries to find the first line, where breakpoint can be set.

showTypeHierarchy.py

This script prints members of a data type (for example struct).

stepSample.py

This script demonstrates stepping on target driven by script on desktop computer.

getSourceLocation.py

This script demonstrates how to get file name and line number of source line with specific text.

hwBreakpoints.py

This script demonstrates setting of hardware breakpoints.

Examples with charts

chartSample.py

This script opens a window with chart and reads and draws values of target variable 'iCounter' in real-time for 5 seconds.

dataRecorder.py

This script demonstrates recording of watch expressions and variables using slower but more flexible evaluator and fast batch access. The recorded data is then written to CSV file. If the 'openpyxl' module is installed, the data is also written to XLSX file. All the above functionality is grouped into functions, so you can easily take out only part of the script. This script can also be imported as a module by other scripts, so it is easy to reuse functions found here.

dataRecorderWithLivePlot.py

This script opens a window with chart and reads and draws values of target variable given in command line in real-time for 5 seconds. Since data acquisition is used, sampling times can be around 1ms (target dependent).

variablesChart.py

This script plots several variables in one chart. The chart is automatically scaled so that all the data is visible. To use this script as a module, import it to your scripts and call function startRecorder() with the list of variables you want to observe.

flowChart.py

This script generates a flow chart for a function from its disassembly information. Graphwiz must be installed on the system, and its bin directory in system PATH.

seqDiagram.py

This script processes data recorded by profiler and creates two types of diagrams - UML sequence diagrams and call graphs. See comment in the script for additional modules required to run the script.

IDE Control

ideControllerExample.py

This script demonstrates usage of class CIDEController.

markerExample.py

This script sets marker in winIDEA document.

Trace

trace2Example.py

This script demonstrates usage of trace with isystem.connect API.

traceBinToHtml.py

This script parses exported trace binary file, and writes it to HTML format.

traceChart.py

This script runs a target and records trace. Trace is saved after run and values of target variable 'adIn' are plotted on a chart.

traceData.py

This script demonstrates reading of trace export files with isystem.connect API.

traceData2XLSX.py

This script reads binary trace export file, and writes data to XLSX file, which can be opened by Excel or Calc. The binary export file must be saved with header version 2.

trace2Profile.py

This script demonstrates profiler analysis on existing trace recording.

traceCoverageProfiler.py

This script demonstrates coverage and profiler analysis on the same analyzer recording.

targetCallWithTrace.py

This example demonstrates recording of trace when a single function on the target is called. In this case we can not use

CExecutionController.call(funcName)

because it performs some init actions, which start recording prematurely. This script implements a replacement function in Python, which starts trace at the right moment.

Profiler

profileSingleFunction.py

This script measures one function and prints results.

profiler2Example.py

This script demonstrates usage of profiler with isystem.connect API.

profilerData.py

This script reads data recorded by profiler and prints it to stdout.

profilerData2XLS.py

This script reads XML file with profiler recording, and writes data to XLS file, which can be opened by Excel or Calc. Use this script only if XLS format is required, because this format has limitation of 65636 lines per sheet. It is recommended to use the script 'pythonData2XLSX.py' instead.

profilerData2XLSX.py

This script reads XML file with profiler recording, and writes data to XLSX file, which can be opened by Excel or Calc.

debugIdeTraceProfilerCoverageSample.py

This script demonstrates usage of debug, ide, trace, profiler, and coverage interfaces.

callSequence2Excel.py

This script processes data recorded by profiler (XML export) and writes function call sequence to Excel file.

Coverage

coverage2Example.py

This script demonstrates usage of coverage. All downloaded code is used, coverage starts on target run.

coverageData.py

This script reads data recorded by winIDEA coverage and prints it to stdout. It demonstrates usage of class CCoverageData2 and related classes.

coverageExport.py

This script demonstrates how to export existing coverage data.

coverageMerge.py

This script demonstrates merging of coverage information from two analyzer files.

coverageWithAppend.py

This script demonstrates appending coverage to the same analyzer recording.

coverageOfSingleFunction.py

This script demonstrates measurement of coverage of a single function.

coverageToHtml.py

This script reads data recorded by winIDEA coverage and writes it to HTML files, one source file to one HTML file. This script can be used as a starting point for customized HTML coverage reports.

slowRun.py

This script demonstrates usage of slow run mode. This mode enables usage of analyzer on targets without trace capabilities.

debugIdeTraceProfilerCoverageSample.py

This script demonstrates usage of debug, ide, trace, profiler, and coverage interfaces.

Code Store

codeStoreExample.py

This script shows simple CCodeStore usage.

codeStoreDifExample.py

An example to demonstrate the use of CCodeStore ability to be used as a difference of two different code stores.

codeStore_MotorolaSave.py

This example uses CCodeStore class to read a chunk of code and stores it inside such an object and later saves it into a file in specified format.

IO Module

hilControllerExample.py

This script demonstrates usage of CHILController class. It writes and reads values to/from IO module ports. See winIDEA menu Help | Display Option..., radio button HIL for available channel names and output values.

DAQ

dataRecorderWithDAQ.py

This script demonstrates usage of CDAQController class. It adds two locations to the DAQ monitoring system. The obtained results are read in a loop and printed to console.

iTest

cumulativeCoverage.py

This script demonstrates testing with coverage measurement. Only one function is tested and tests are implemented in a way to reach 100% coverage. Coverage is completely configured in test specification.

cumulativeModuleCoverage.py

This script demonstrates testing with coverage measurement. Several functions are tested. Coverage document is configured with isystem.connect calls, and later reused in test specification.

emitterDemo.py

This script demonstrates usage of XML and YAML emitters to write test specification to file. Note that YAML files are parseable by isystem.test classes, while XML files are not. They can be used for import to other applications.

filterTests.py

This script demonstrates testing cycle with custom filtering of tests to be executed. Contains function for recursive execution of tests in the test specification tree.

itestSample.py

This script demonstrates usage of isystem.test from Python. Test specifications are given as multi-line Python strings in the code.

itestSpecVsTestControllerSample.py

This script demonstrates the difference between testing with test specification YAML format and testing with API usage.

itestWithParameters.py

This example demonstrates the usage of parametrized test specifications. Two ways for parameterizing tests are shown:

  • modifying test specifications (two examples)
  • using isystem.test API to modify test contents (the last example)

loadRunReport.py

This script demonstrates testing cycle with loading test spec. from file, executing the test, and saving a report.

lowLevelAPI.py

This script demonstrates usage of isystem.test by calling API methods instead of using test specifications.

persistentVars.py

This script demonstrates usage of persistent variables in unit tests.

scriptCallbackMethods.py

This script demonstrates calling of script methods specified in test specification. See tags initFunc and endFunc in test specification.

testResults.py

This script demonstrates usage of class CTestResult. Most functions are used here. Their return values are printed to stdout for better understanding.

traceWiTestSample.py

This file demonstrates recording of test execution trace and exporting it to HTML format.

stubsInSysTests.py

This script demonstrates usage of stubs in system tests. Stubs are created without active test case.

stubsAndUserStubsInSysTests.py

This script demonstrates how to create and use normal and user stubs in system tests.

programmaticTestCaseCreation.py

This script demonstrates programmatic creation of test case using isystem.itest API.

testCaseExample2.py

This script demonstrates usage of isystem.test by calling API methods instead of using test specifications.

junitreport.py

This script can be used to write test results to XML file in JUnit format. Not all tags supported by JUnit are provided, but the script can easily be expanded to support them.

Misc

MPC5xxx_TLB_ReadWrite.py

This script demonstrates operations on MPC5xxxController

  • reads a TLB entry
  • writes a TLB entry

getSymbolAtAddress.py

This script demonstrates obtaining of function at the given memory address.

hotAttach.py

This script demonstrates hot-attach to target with isystem.connect API. Before running this script select option Hardware | Use Hot Attach in winIDEA.

jtagSample.py

This script demonstrates usage of JTAG scan with isystem.connect.

listFunctions.py

This script reads all functions from winIDEA and lists them sorted by their size in bytes.

listLocalVars.py

This script prints local variables in current function.

ocdRegisterRW.py

This example demonstrates reading and writing from/to OCD registers.

projectController.py

This script contains example for class CProjectController, which contains methods for handling project build process.

pythonBasics.py

This script demonstrates Python syntax. It is intended for those who do not know Python programming language.

workspaceController.py

This script demonstrates usage of isystem.connect CWorkspaceController class.

webserver.py

This script runs a web server, which provides page with target variables and their values. Real-time access is used when reading variables via isystem.connect.

serviceCall.py

This script demonstrates usage of service calls to winIDEA. This is advanced usage of isystem.connect - use it only when instructed by iSystem support.

serviceFunctions.py

This script demonstrates misc. isystem.connect functions.

stackUsage.py

This script demonstrates measurements of stack usage.

stackFrames.py

This script shows how to get stack frames from target.

globalSymbols.py

This script shows how to get global symbols (variables, functions, types, ...) for all download files in a project.

daqRecorder.py

This script simply connects to a most recently used instance of winIDEA and starts recording data using the fast data acquisition (DAQ) controller. In order to do this the application must be running on the target otherwise no data will be received.

dataAcquisition.py

This script demonstrates the usage of data acquisition, which provides fast periodic access to data on target. Because values are buffered on an emulator, this approach provides much smaller sampling periods than normal access with read() or evaluate() methods.

disassembly.py

This script demonstrates retrieval of disassembly information. Object code information is printed for several lines of function main().

fft.py

This script demonstrates loading of data from target and plotting it's FFT.

remoteFile.py

This script demonstrates usage of class CRemoteFileController.

Register access

readRegister.py

This script demonstrates usage of isystem.connect with 64-bit registers. It reads from a register specified in command line and prints its value.

writeRegister.py

This script demonstrates writing to target registers. It writes value to a register, as specified in command line, or 123 to R0 by default.

winIDEA options

setCommitOption.py

This script sets and commits option in winIDEA.

setOptionSample.py

This script sets option in winIDEA.

dynamicOptions.py

This script demonstrates usage of dynamic options. Before running this script make sure that there are at least three breakpoints defined in winIDEA.

winIDEA enumeration, launching, and connection

showConnectionStatus.py

This script demonstrates enumeration of all winIDEA instances and their status of connection to emulator.

advancedWinIDEALaunching.py

This script demonstrates advanced launching of winIDEA, where we want to connect to winIDEA on remote host or with special id or workspace. It also shows how to start winIDEA without GUI.

advancedLocalLaunching.py

This script demonstrates advanced launching of winIDEA on local host. The script connects to winIDEA via shared memory, which is faster than TCP/IP connection and has no problems with firewalls. It also shows how to start winIDEA without GUI.

winIDEAInstanceEnumeration.py

This script demonstrates enumeration of all winIDEA instances at the specified host.

findFreeEmulator.py

This script shows how to find a free emulator from the list of available emulators.

launchSecondCore.py

This script demonstrates launching of the second winIDEA instance for the second core.

connectToMultipleWinIDEAs.py

This script demonstrates how to control two winIDEAs connected to two BlueBoxes with different targets. In this example winIDEA workspace file name is used to identify winIDEA instance. It is also possible to specify winIDEA instance ID in winIDEA command line, and then use method ConnectionMgr::connect(CConnectionConfig cfg) to connect to it.

connectToWinIDEAVersion.py

This script demonstrates advanced launching of winIDEA, where we connect to winIDEA with specific version. This script can be used when there are multiple versions of winIDEA installed on the system.