6This script demonstrates how to use WorkspaceConfigurator in order to
7create a winIDEA workspace, and configure it to use two different applications
8with multiple download files on the same core. It then configures the profiler to
9record both applications at the same time.
12import isystem.connect
as ic
16from ws_cfg
import WorkspaceConfigurator
23 cmgr = ic.ConnectionMgr()
24 cmgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
26 wsCfg = WorkspaceConfigurator(cmgr)
28 WORKSPACE_NAME =
'example.xjrf'
29 wsCfg.create_workspace(WORKSPACE_NAME)
30 wsCfg.set_emulator_type(
'iC5000')
31 wsCfg.set_USB_comm(
'iC5000 (SN 12345)')
34 wsCfg.set_SoC(
'LS1012A')
36 wsCfg.add_application(
'myApplication0')
37 wsCfg.add_application(
'myApplication1')
39 wsCfg.add_symbol_file(
'myApplication0',
'program.elf',
'ELF')
40 wsCfg.add_symbol_file(
'myApplication1',
'program2.elf',
'ELF')
42 wsCfg.add_memory_space(
'memorySpace0',
'Core0',
43 'myApplication0', isEnabled=
True,
44 useMsid=
True, msidLevel=
'HV')
45 wsCfg.add_memory_space(
'memorySpace1',
'Core0',
46 'myApplication1', isEnabled=
True,
47 useMsid=
True, msidLevel=
'VM')
49 wsCfg.add_program_file(
'program.elf',
'ELF')
50 wsCfg.add_program_file(
'program2.elf',
'ELF')
51 wsCfg.add_program_file(
'program3.hex',
'HEX', offset=0x1000)
53 wsCfg.set_demo_mode(
True)
56 debugCtrl = ic.CDebugFacade(cmgr)
59 TRD_FILE_NAME =
"sample.trd"
61 profilerCtrl = ic.CProfilerController2(cmgr, TRD_FILE_NAME,
'w')
63 analyzerTriggerIdx = wsCfg.create_analyzer_trigger(profilerCtrl,
"trigger")
65 configCtrl = ic.CConfigurationController(cmgr)
68 optDoc = configCtrl.doc(TRD_FILE_NAME)
69 optAnalyzerTrigger = configCtrl.doc_an_triggers(optDoc).at(analyzerTriggerIdx)
71 optProcessTrigger = configCtrl.doc_an_trig_processes(optAnalyzerTrigger)
72 wsCfg.remove_existing_process_triggers(optProcessTrigger)
74 optProcessTrigger0 = wsCfg.add_new_process_trigger(optProcessTrigger,
75 "myApplication0",
"memorySpace0")
77 optProcessTrigger0.set(
'Profiler.ProfileData',
'true')
79 optProcessTrigger1 = wsCfg.add_new_process_trigger(optProcessTrigger,
80 "myApplication1",
"memorySpace1")
82 optProcessTrigger1.set(
'Profiler.ProfileData',
'true')
85 optProfilerData0 = configCtrl.doc_an_trig_process_profiler_data(optProcessTrigger0)
87 optProfilerData1 = configCtrl.doc_an_trig_process_profiler_data(optProcessTrigger1)
89 wsCfg.add_new_profiler_data_area(optProfilerData0, variableName=
"iCounter",
90 appName=
"myApplication0", memorySpaceName=
"memorySpace0",
91 interpretationType=
"State", accessType=
"Write")
92 wsCfg.add_new_profiler_data_area(optProfilerData1, variableName=
"iCounter",
93 appName=
"myApplication1", memorySpaceName=
"memorySpace1",
94 interpretationType=
"State", accessType=
"Write")
96 wsCfg.save_workspace()
97 wsCfg.close_workspace()
100if __name__ ==
"__main__":