winIDEA SDK
Python Examples by Group

Execution Control

test_call.py

test_run_stop.py

test_get_cpustatus.py

test_goto_address.py

test_goto_function.py

test_hot_attach_detach.py

test_reset_and_run.py

test_run_until_address.py

test_run_until_function.py

test_run_until_return.py

test_set_polling_enabled.py

test_set_slow_run.py

test_step_high.py

test_step_inst.py

test_step_over_high.py

test_step_over_inst.py

test_wait_state.py

test_set_blue_box_target_connection.py

test_set_blue_box_tristate_status.py

Address control

test_get_address_of_source_line.py

test_get_code_area.py

test_get_expression_address.py

test_get_function_address.py

test_get_function_names.py

test_get_label_address.py

test_get_source_line_at_address.py

test_get_symbol_at_address.py

test_get_test_point_id_prefix.py

test_get_variable_addresses.py

test_get_source_location.py

Breakpoint Control

test_clear_bp_condition.py

test_delete_all.py

test_delete_all_hwbp.py

test_delete_bp.py

test_remove_bp.py

test_remove_bps.py

test_remove_all_bps.py

test_reapply_all.py

test_set_bp.py

test_get_bps.py

test_set_bp_condition.py

test_set_bp_symbol.py

test_set_bp_source.py

test_set_bp_enabled.py

test_set_bp_action.py

test_set_enabled.py

test_set_enabled_all.py

test_set_hwbp.py

test_set_hw_enabled.py

test_set_hw_enabled_all.py

set_bp_on_first_available_line.py

set_bp_symbol_action.py

Coverage Control

test_area.py

test_close.py

test_configure.py

test_execution_control.py

test_coverage_all_code.py

test_coverage_export_data.py

test_coverage_get_status.py

test_get_analyzer_session_status.py

test_get_document_status.py

test_merge.py

test_coverage_save.py

test_scope.py

test_trigger.py

test_coverage_create_instance.py

test_get_coverage_meta_info.py

test_get_iterator.py

test_get_root.py

test_coverage_custom_scope.py

test_coverage_data.py

test_get_statistic.py

Connection

test_connect.py

test_connection_mgr.py

test_disconnect.py

test_enumerate_winidea_instances.py

test_find_existing_instance.py

test_find_or_start_instance.py

test_get_last_error_msg.py

test_is_attached.py

test_conn_is_connected.py

test_launch_core1.py

test_logger.py

test_start_new_instance.py

test_cconnection_config.py

DAQ control

test_attach_detach.py

test_daq_configure.py

test_create_config_item.py

test_run.py

daq_simple.py

Data Control

test_batch_access.py

test_code_store.py

test_code_store_diff.py

test_code_store_item.py

test_configure_stack_usage.py

test_cpu_info.py

test_cs_read_memory.py

test_cs_verify_downloaded.py

test_data_evaluate.py

test_get_default_endian.py

test_get_functions.py

test_get_labels.py

test_get_macros.py

test_get_memory_area_bytes_per_mau.py

test_get_modules.py

test_get_partitions.py

test_get_set_byte.py

test_get_stack_frames.py

test_get_symbols.py

test_get_system_memory_areas.py

test_get_typedefs.py

test_get_types.py

test_get_variables.py

test_data_modify.py

test_read_write_memory.py

test_read_write_register.py

test_read_write_value.py

test_seed_get_stack_usage.py

test_evaluate_composite.py

test_get_configuration.py

test_get_cpusfrs.py

test_get_disassembly.py

test_get_expression_type.py

test_get_globals.py

test_get_register_info.py

test_get_stack_frame_info.py

test_get_target_info.py

test_read_write_sfr.py

test_set_stack_frame_context.py

call_hierarchy.py

data_recorder_with_daq.py

Configuration control

test_ide_app_files.py

test_ide_ws.py

test_doc_an_trig.py

test_doc_an_trig_process.py

test_doc_an_trig_process_profiler_code.py

test_doc_an_trig_process_profiler_data.py

test_doc_an_trig_process_profiler_os.py

test_ide_soc_files.py

test_ide_test.py

test_ide_socs.py

test_ide_soc.py

test_ide_app.py

test_doc.py

test_plugin_config.py

test_ide_apps.py

test_ide_opt.py

Core control

test_memory_fill.py

test_memory_read.py

test_memory_write.py

test_observe.py

Session control

test_begin_prepare.py

test_begin_program.py

test_get_process.py

test_get_soc.py

test_session_get_status.py

test_get_terminal.py

test_get_topology.py

test_multi_core_session.py

test_process_attach.py

test_process_focus.py

Soc control

test_soc_ctrl_attach.py

test_soc_ctrl_detach.py

test_soc_ctrl_bus_fill.py

test_soc_ctrl_bus_read.py

test_soc_ctrl_bus_write.py

test_soc_ctrl_get_core.py

test_soc_ctrl_smp_get_focused_core.py

test_soc_ctrl_smp_set_focused_core.py

test_soc_ctrl_bus_access_batch.py

Option control

test_set_multi.py

test_get_set.py

test_find.py

test_size.py

test_get_set_int_uint.py

test_at.py

test_add_remove.py

test_opt.py

test_index_of.py

test_get_set_bool.py

test_url.py

Document control

test_doc_close.py

test_doc_control.py

test_focus.py

test_marker.py

test_reset.py

test_save.py

test_terminal_ctrl.py

test_terminal_doc.py

IDE control

test_activate.py

test_cd_to_winidea_workspace_dir.py

test_document_manipulation.py

test_dynamic_option.py

test_export_import_layout.py

test_get_capabilities.py

test_get_default_download_file.py

test_get_option.py

test_get_path.py

test_get_pid.py

test_get_winidea_version.py

test_get_set_option_json.py

test_get_set_options_map.py

test_invoke.py

test_iopen_disconnect.py

test_is_api_compatible.py

test_is_winidea_open_version.py

test_layout_manipulation.py

test_msg_box_hook.py

test_option.py

test_option_exists.py

test_window_manipulation.py

test_set_interrupts_disable.py

test_set_option.py

test_get_license_description.py

Multicore connection

test_connect_core.py

test_connect_primary_core.py

test_get_connected_core_ids.py

test_is_connected.py

Plugin control

plugin_controller.py

test_plugin_control.py

test_get_content.py

Profiler control

test_add_items.py

test_profiler_create_trigger.py

test_data_areatype2str.py

test_export_configuration.py

test_export_format.py

test_exports.py

test_remove_items.py

test_set_function_trigger.py

test_set_profiling_sections.py

test_state_vardef2str.py

test_trace_msgdef2str.py

profiler_controller.py

test_get_set_session_duration.py

test_bin_timeline.py

test_create_close_instance.py

test_get_area.py

test_get_area_iterator.py

test_get_parser_warnings.py

test_get_statistics.py

test_get_statistics_for_function.py

test_get_timeline_iterator.py

test_get_total_session_time_ns.py

test_has_area.py

test_has_statistics_for_area.py

test_has_statistics_for_function.py

test_has_statistics_for_state_area.py

test_get_contexts.py

profiler_data.py

export_profiler_data.py

Project control

test_build_actions.py

test_dependencies.py

test_enumerate_project_option.py

test_export_import_project.py

test_proj_get_status.py

test_modify_project_option.py

test_options.py

test_set_target.py

test_custom_operation.py

Debug Facade

test_run_until_expression.py|

test_get_controllers.py|

Remote file control

test_exists.py

test_read_write.py

test_remove.py

Storage device control

test_storage_read.py

test_storage_write.py

test_storage_erase.py

test_storage_flush.py

test_storage_verify.py

test_storage_is_device_empty.py

test_storage_fill.py

test_storage_read_state.py

test_storage_read_hash.py

test_storage_get_last_error.py

test_storage_secure_unsecure_check.py

test_storage_init_terminate.py

test_storage_get_partition_info.py

test_storage_get_devices_number.py

test_storage_get_devices_names.py

test_storage_get_device_info.py

test_storage_get_device_index.py

test_storage_emmc_read_write.py

test_storage_emmc_read.py

test_storage_emmc_modify.py

test_storage_emmc_is_device_empty.py

test_storage_emmc_erase.py

Storage device security module control

test_clear_diagnostic.py

test_get_diagnostic.py

test_secure_unsecure_check.py

test_set_buffer_size.py

test_set_test_mode.py

Test control

test_control.py

test_create_parameter.py

test_create_stub.py

test_create_user_stub.py

test_set_debug_mode_on.py

test_create_variable.py

test_evaluate.py

test_get_test_case_handle.py

test_get_active_stub.py

test_init_close.py

test_modify.py

test_persistent_vars.py

test_set_test_batch.py

test_set_test_timeout.py

test_state_to_str.py

test_s2i64.py

test_case_controller_example.py

Trace control

test_apply_trigger_wizard.py

test_create_trigger.py

test_ctrace_config_wizard.py

test_ctrace_csv_export_format.py

test_ctrace_text_export_format.py

test_ctrace_xml_export_format.py

test_ctrace_bin_export_format.py

test_ctrace_export_config.py

test_export_data.py

test_create_instance.py

test_get_binary_export_config.py

test_trace_get_parser_warnings.py

test_trace_get_timeline_iterator.py

trace_controller.py

export_trace_data.py

workspace control

test_close_open.py

test_workspace_save.py

Examples with charts

chart_sample.py

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

data_recorder.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.

data_recorder_with_live_plot.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).

variables_chart.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.

flow_chart.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.

sequence_diagram.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.

Code Store

test_code_store.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

test_hil_read_write.py

FNet

fnet_ain.py

This script demonstrates usage of CFNetAInController class.

fnet_aout.py

This script demonstrates usage of CFNetAOutController class.

fnet_can.py

This script demonstrates usage of CFNetCANController class.

fnet_counter.py

This script demonstrates usage of CFNetCounterController class.

fnet_mdio.py

This script demonstrates usage of CFNetmDIOController class.

fnet_dio.py

This script demonstrates usage of CFNetDIOController class.

fnet_lin.py

This script demonstrates usage of CFNetLINController class.

fnet_power_sense.py

This script demonstrates usage of CFNetPowerSenseController class.

fnet_spi.py

This script demonstrates usage of CFNetSPIController class.

iTest

cumulative_coverage.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.

cumulative_module_coverage.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.

filter_tests.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.

itest_sample.py

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

itest_with_parameters.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)

persistent_vars.py

This script demonstrates usage of persistent variables in unit tests.

script_callback_methods.py

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

programmatic_test_case_creation.py

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

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.

create_test_report.py

This script demonstrates how to set up data structures used in isystem.test module to produce test reports. You can use this functionality of isystem.test to create testIDEA looking reports even when tests are executed by Python scripts, not with iyaml test specification, for example in complex system tests.

stubs_and_user_stubs_in_sys_tests.py

Misc

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.

service_call.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.

service_functions.py

This script demonstrates misc. isystem.connect functions.

stack_frames.py

This script shows how to get stack frames from target.

global_symbols.py

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

daq_recorder.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.

disassembly.py

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

emmc_example.py

This script demonstrates usage of class CEMMCController.

array_chart.py

This script plots values of target arrays given as command line args.

invoke.py

This script demonstrates usage of invoke() call.

invoke_oscontrol.py

This script demonstrates usage of invoke() call for OS control.

target_call_with_trace.py

advanced_local_launching.py

advanced_winidea_launching.py

winidea_instance_enumeration.py

connect_to_winidea_version.py

find_free_emulator.py

show_connection_status.py

show_type_hierarchy.py

dynamic_options.py

mpc5xxx_tlb_read_write.py

analyze_call_tree.py

trace_coverage_profiler.py

read_uint64.py

require_version.py

connect_to_multiple_winideas.py

ADIO_usecases_example.py

This script demonstrates the automated usage of ADIO in different use-cases, as described in winIDEA Help

CANLIN_use_case.py

This script demonstrates different use cases for CAN/LIN Add-on module, as described in winIDEA Help

Workspace configuration

configure_ws_basic.py

This script demonstrates how to use WorkspaceConfigurator in order to create and configure a winIDEA workspace.

configure_ws_advanced.py

This script demonstrates how to use WorkspaceConfigurator in order to create a winIDEA workspace, and configure it to use two different applications with multiple download files on the same core. It then configures the profiler to record both applications at the same time.

ws_cfg.py

This script serves as a wrapper for some workspace related functionality used by the configure_ws_basic.py and configure_ws_advanced.py example scripts.