Workbench/VxWorks 653 Topics

Integration of the Simulation Environment in Workbench

Building a System

A VxWorks 653 system can be configured and built in the usual way, either from the command line or from within Workbench. See the VxWorks 653 user manuals for general instructions, or the GNATbench tutorial available in Workbench via Help –> Help Contents –> GNATbench Ada Development User Guide –> Tutorial: Creating a VxWorks 653 Integration Project. If using the latter, follow the instructions given for a QEMU BSP.

Creating a ROM Image

The VxWorks 653 build system generates separate image files for each component. These images have to be gathered into a single ROM image in order to be executed by GNATemulator. To simplify this unification procedure, we provide the powerpc-wrs-vxworksae-romgen tool. It automatically extracts the list of partitions and their respective locations from the configRecord.xml file and uses this data to automatically build the final ROM image.

To use generate a ROM image from a VxWorks 653 system under Workbench, add a build target, e.g. qemu_system.flash to the integration project. Let’s call this build target KERNEL_IMAGE in further discussion.

In the Makefile for the integration project, append KERNEL_IMAGE to the prerequites of the all target, e.g.

all: <other targets> KERNEL_IMAGE

Then add a target for the image:

KERNEL_IMAGE: rom
     powerpc-wrs-vxworksae-romgen -o KERNEL_IMAGE

Note that the second line starts with a <tab> character, not spaces.

If using a Makefile for the integration project from the command line, you can omit the step of adding the build target, and still make the changes to the Makefile.

Running the System

The simulator can easily be run from the Workbench interface. To do so:

  1. Click on External Tools Configuration... in the menu entry Run ‣ External Tools.
  2. Select Program and click on the New button.
  3. In Location enter powerpc-wrs-vxworksae-gnatemu with its full path (e.g. %GNATEMULATOR_INSTALL_DIR%\bin\powerpc-wrs-vxworksae-gnatemu.exe).
  4. In the Working Directory browse to the directory containing KERNEL_IMAGE and select it.
  5. In the Arguments section enter the arguments to pass to powerpc-wrs-vxworksae-gnatemu. See Using GNATemulator for the available options. You should add --wdb to enable target server connections.
  6. Under the Build tab, uncheck Build before launch in order to avoid systematic recompilation when you start the simulation environment.

Clicking on Run will save the configuration and run the system. The simulation platform can then be easily accessed from the Workbench toolbar in the Advanced Development perspective via the green External Tools icon.

Creating a Target Server

The Wind River Debug Server (DFW) can connect to GNATemulator for VxWorks 653 using the wdbrpc backend that will use the ethernet connection available in GNATemulator.

To create a new target server for GNATemulator for VxWorks 653:

  1. Click on New Connection... in the Target menu of Workbench.
  2. Select Wind River VxWorks 653 Target Server Connection as the system type.
  3. In the Target Server Options page, select wdbrpc as the Backend, set the IP address to 127.0.0.1 and the port to 17185.
  4. Set the Kernel image using the boot.txt file.

#. To complete the setup of the target server you can keep the other fields to their default values.

Adapting QEMU for VxWorks 653 to other Contexts

Starting QEMU for VxWorks Manually

You can start manually powerpc-wrs-vxworksae-gnatemu using these following options:

$ powerpc-wrs-vxworksae-gnatemu [--wdb] KERNEL_IMAGE

Where KERNEL_IMAGE is the path to your kernel image.

Limitations

The following elements should be taken into account when using GNAT Emulator for VxWorks 653:

  1. The time reported to the guest operating system (here VxWorks 653) is based on the host OS time. The host OS is a time sharing OS (and not a real-time OS), which can lead to situations where QEMU is rescheduled or preempted by another host process, which in turn makes the VxWorks 653 OS miss certain deadlines. That may trigger error handlers in VxWorks 653. This means that you should avoid loading your host machine when running QEMU.

    See in Health Monitor Configuration an example of health monitor configuration that avoid unexpected simulator halts.

  2. GNAT Emulator is translating and executing instructions as fast as possible and thus won’t be cycle accurate. This means for example that within a frame defined by the active VxWorks 653 schedule, processing can be faster than on the final target.

  3. When GNAT Emulator is executing the VxWorks 653 operating system it will preempt all CPU available and allowed by its priority. The rest of the Windows system may become hardly usable because of a lack of CPU resources allocated to the rest of the system. This is particularly true on monocore host machines.

    If you don’t have a multicore system, it is advised to start GNAT Emulator with the following command:

    > start /LOW powerpc-wrs-vxworksae-gnatemu
    

Health Monitor Configuration

Here is an example of health monitor configuration that can be used to avoid a simulator stop in case of tick loss:

<HealthMonitor>
  <SystemHMTable Name="systemHm">
    <SystemState SystemState="HM_PARTITION_MODE">
      <ErrorIDLevel ErrorIdentifier="HME_DEFAULT"
                    ErrorLevel="HM_MODULE_LVL"/>
    </SystemState>
    <SystemState SystemState="HM_MODULE_MODE">
      <ErrorIDLevel ErrorIdentifier="HME_DEFAULT"
                    ErrorLevel="HM_MODULE_LVL"/>
    </SystemState>
    <SystemState SystemState="HM_PROCESS_MODE">
      <ErrorIDLevel ErrorIdentifier="HME_APPLICATION_ERROR"
                    ErrorLevel="HM_MODULE_LVL"/>
    </SystemState>
  </SystemHMTable>
  <ModuleHMTable Name="moduleHm">
    <SystemState>
      <ErrorIDAction ErrorIdentifier="HME_DEFAULT"
                     ErrorAction="hmDbg_DH_EventShow"/>
    </SystemState>
    <SystemState>
      <ErrorIDAction ErrorIdentifier="HME_APPLICATION_ERROR"
                     ErrorAction="hmDbg_DH_EventShow"/>
    </SystemState>
    <SystemState>
      <ErrorIDAction ErrorIdentifier="HME_LOST_TICKS"
                     ErrorAction=""/>
    </SystemState>
    <Settings stackSize="0x0400" maxQueueDepth="2" />
  </ModuleHMTable>
  <PartitionHMTable Name="helloHm">
    <SystemState>
      <ErrorIDAction ErrorIdentifier="HME_DEFAULT" ErrorAction=""/>
    </SystemState>
    <Settings stackSize="0x0400" maxQueueDepth="2" />
  </PartitionHMTable>
</HealthMonitor>