Please enable JavaScript to view this site.

winIDEA Help

Version: 9.21.246

emuSync

In this topic

Configuration

Instance workspaces

 

 

Introduction

The emuSync application offers coordinate use of multiple winIDEA sessions, synchronously starting and stopping parallel processors under winIDEA control.

 

i-icon

emuSync is an Open Source project shared on GitHub.

 

emuSync streamlines working with multiprocessor systems, allowing to keep track of the many different winIDEA applications controlling each processor, providing shorthands to operations that are commonly performed in all processors at once (download, start, etc) and automatizing synchronous starts and stops.

When using emuSync a list of winIDEA workspaces is specified, where each one can be master and/or slave. Stopping master workspace causes all slave work spaces to stop. Optionally all slave work spaces could be started if a master work spaces runs. EmuSync can load and save different configurations.

 

emuSync is a single window application divided in four parts:

 

EmuSync-1

 

Configuration

Display and access to configuration operations.

 

Instance workspaces

The instances list displays the list of work spaces that compose the current configuration.

 

Selected Instance

Displays the path to the currently selected instance and provides access to operations and properties of this instance. Different commands for operating winIDEA instances are available.

 

All instances

Groups operations that are performed on all instances.

 

 

Configuration

Configuration information is saved into text files with the .EmuSync extension, which can be manually edited. The file is located in the winIDEA installation folder: C:\iSYSTEM\winIDEA9\scripts\emuSync.

The configuration file itself includes three main sections:

Configuration: This is where the selected winIDEA workspaces are specified (wsPath field) and their operation mode (opMode field: master/slave) is defined.

Logging: If the “enable” field is set to true, the logging menu appears in the EmuSync main menu bar.

Module: Each of the available hooks has its own specified file path (hookPath field), name of python hook start method/function (hookStart field) and an enable field (isActive).

 

The configuration section displays the path to the active configuration file. The 3dots button displays a pop-up menu with self-explanatory commands New, Open, Save, Save as.

Always on top -  When checked keeps the EmuSync window above all other windows

 

 

Below is an example of a configurations file:

configuration:

- opMode: master

 wsPath: C:\winIDEADemos\Sample1.xjrf

- opMode: slave

 wsPath: C:\winIDEADemos\Sample2.xjrf

- opMode: slave

 wsPath: C:\winIDEADemos\Sample3.xjrf

logging:

 enable: false

module:

 onDownload:

  hookPath: emuSyncHooks.py

   hookStart: onDownloadHook

   isActive: false

 onReset:

   hookPath: emuSyncHooks.py

   hookStart: onResetHook

   isActive: false

 onRun:

   hookPath: emuSyncHooks.py

   hookStart: onRunHook

   isActive: false

 onStop:

   hookPath: emuSyncHooks.py

   hookStart: onStopHook

   isActive: false

 preDownload:

   hookPath: emuSyncHooks.py

  hookStart: preDownloadHook

   isActive: false

 preReset:

  hookPath: emuSyncHooks.py

  hookStart: preResetHook

  isActive: false

preRun:

  hookPath: emuSyncHooks.py

   hookStart: preRunHook

   isActive: false

 preStop:

       hookPath: emuSyncHooks.py

  hookStart: preStopHook

   isActive: false

 

 

 

Instance workspaces

Each line of the list displays the number ID of the instance, its master and slave properties, its status, and the path to the workspace.

Add -  Add a workspace to the list

Remove - Deletes the currently selected instance (row) from the list

 

Status

Status

Description

EmuSyncNotAttachedStatus

Workspace not attached to a winIDEA process

EmuSyncstatusOffline

winIDEA is not connected to the debugger

EmuSyncstatusHalted

Core execution is halted

EmuSyncstatusStop

winIDEA instance is in the stop mode.

EmuSyncstatusRun

winIDEA instance is in the running mode

EmuSyncstatusDetached

winIDEA instance is detached

 

 

Selected Instance

Depending on the status of the workspace different commands are available. All of them are available as buttons and their name describes their function. To operate multiple winIDEA instances from EmuSync application, you need to Launch them first.

Launch - Launch a new winIDEA instance and attach to it.

Close - Close winIDEA instance

Attach - Attach to an open winIDEA instance or open one if no suitable instance is found.

Detach - Detach/disconnect from winIDEA instance

Run - Start/continue core execution

Stop - Stop core execution

Download - Download files to the target CPU

Reset - Trigger a reset on the core

 

Master and Slave selection

Master /  Slave radio buttons-  Display the properties and can be used to toggle them

 

 

All Instances

The command buttons available in the Selected instance section are duplicated here, but they operate on all instances at the same time. The check boxes on the bottom are global options.

Run slaves when master runs - If enabled, the master workspace entering running status causes all slaves to run

Close all on exit - If enabled causes all associated winIDEA applications to be closed when EmuSync is closed

 

 

Options

There are additional options available in the applications menu bar:

 

EmuSync-Options

 

Use Demo mode -  Toggle Demo mode across all winIDEA instances.

Module data - Provide a quick overview of the module and hook related settings in the currently loaded configuration file. To edit these settings, edit the configuration file itself and then reload it in the EmuSync application.

 

 

Hooks

emuSync allows the user to implement its own python hooks (or scripts) and runs them according to the selected command. Hook paths and starting methods for each of the supported events are defined in the configuration .emuSync file. If a specific hook is enabled in the configuration file, then it will be executed every time the specific command is given to a winIDEA instance.

 

Supported events

onDownload (after Download)

onReset (after Reset)

onRun (after Run)

onStop (after Stop)

preDownload (before Download)

preReset (before Reset)

preRun (before Run)

preStop (before Stop)

 

Requirements

The only requirement for a hook is that it can be passed an instance of the ConnectionMgr class. This enables you to create any and all of the other classes and managers available in the winIDEA SDK and manipulate winIDEA instances. No logging handler is passed, so you must implement your own logging solution if needed.

 

 

Implementation example

This is a hypothetical situation where I wish to run a custom python script after a Stop command is executed on the CPU.

Here is a step-by-step example on what you need to do:

1. Prepare your python script. In this example the script file is called “onStopScript.py” and it is located on my Desktop. Inside the file, there is a function called “onStopHook” which is the one I want EmuSync to run after Stop commands.

onStopScript.py:

 

 

 import isystem.connect as ic

 import time

 

 # The connection manager is passed to the hook from EmuSync so that you can manipulate winIDEA inside the hook.

 

 def onStopHook(connMgr):

          loaderMgr = ic.CLoaderController(connMgr)

         loaderMgr.download()

         executionMgr = ic.CExecutionController(connMgr)

         executionMgr.run()

         time.sleep(5)

         executionMgr.stop()

          print(“Hook over.”)

 

 

 

2. In your configuration file, update the hookPath and hookStart of the “onStop” hook type to correspond with your python script path and python method/function you wish to call.

 

3. In your configuration file, set the “isActive:” field of the “onStop” hook to True and save the file.

Configuration file excerpt:

 

 

 module:

        onStop:

         hookPath: C:\Users\User1\Desktop\onStopScript.py

         hookStart: onStopHook

         isActive: True

 

 

 

4. Open this configuration file in EmuSync.

 

 

Logging

To enable logging to file, set the logging: enable: from False to True in the Configurations file before it is loaded. This will enable a logging menu in the application menu bar. There you can select the desired logging level and open the folder containing the log files.

Copyright © 2024 TASKING Germany GmbH