In this topic:
•Introduction
•Requirements
•Start the simulation
•Configure the winIDEA Workspace
Introduction
winIDEA can connect to a VLAB VDM Virtual ECU (vECU) and offer the same debugging and scripting experience as you are used to on real hardware.
Requirements
•VLAB3
•VLAB license
•winIDEA version 9.21.382 or newer
•winIDEA vECU license
Start the simulation
Prepare and run a Python script that will launch the simulation.
Script example for a TC39xB device:
import vlab
import os
import dataclasses
import argparse
@dataclasses.dataclass
class CmdArgs():
elf_file_path: str
@staticmethod
def parse() -> "CmdArgs":
parser = argparse.ArgumentParser()
parser.add_argument("--elf_file_path", required=True, help="Path to elf file to be loaded in TC39xB/CPU0")
return CmdArgs(**vars(parser.parse_args()))
cmdArgs = CmdArgs.parse()
# Add TC3xx Simulator to vlab path
vlab.path.append(os.environ["VLAB_PATH"])
# This just creates global variables for complete path of cpu0..5
# cpu0 = "TC39xB/CPU0"
# cpu1 = "TC39xB/CPU1"
# ...
tc39xb = "TC39xB"
cpu_list = []
for cpu_num in range(6):
cpu_var_val = f"{tc39xb}/CPU{cpu_num}"
globals()[f"cpu{cpu_num}"] = cpu_var_val
cpu_list.append(cpu_var_val)
hsm = f"{tc39xb}/HSM_CORE"
print("\nElaborating TC3xx platform\n")
sim = vlab.Simulator()
sim.simulation_port = 9701
sim.elaborate("AURIX TC39xB")
# Get address space for stubbing
addr_space_probes = []
for cpu in cpu_list:
addr_space_probes.append(sim.address_space(f"{cpu}/virtual"))
# Load images into CPU memory
print("Loading elf into memory\n")
elf_file = addr_space_probes[0].load_elf(cmdArgs.elf_file_path, set_start_address = True)
# Wait for external debugger to attach
sim.wait_for_attach()
sim.run()
|
Configure the winIDEA Workspace
You are now ready to switch to winIDEA and start working with the virtual ECU.
1. Create a new Workspace and select MCD interface simulator as Debugger.
2. Specify the VDM you are using and select the application you wish to debug.
a.Make sure to preset the PC to the application’s entry point.
The workspace is now created.
3. Open MCD | Options and configure:
a.Server Connection:
i.Host Name - Either specify localhost or the IP / server name where the simulation is running.
ii.Specify Additional Configuration settings (the port number should match the one you configured in the Python script):
VlabAttachType=attach VlabPort=9701
b.MCD Configuration:
i.Enable MCD connection.
ii.Specify the path to the MCD dll based on your local installation.
4. Save your winIDEA Workspace in File | Workspace | Save Workspace.
5. Begin a debug session by selecting Debug | Download.
You can now start debugging your application in the same way as you would on real hardware.
More resources
•Debugging
•Multi-Core Debugging
•Operating Systems
•winIDEA SDK