ASAM - XIL - Generic Simulator Interface - BS 2 5 - CSharp API Technology Reference Mapping Rules - V2 2 0
ASAM - XIL - Generic Simulator Interface - BS 2 5 - CSharp API Technology Reference Mapping Rules - V2 2 0
Part 2 of 5
Base Standard
Table of Contents
Foreword 5
1 Introduction 6
1.1 Overview .......................................................................................................... 6
1.2 Development Environment ............................................................................. 6
1.3 Generation of packages with respect to Namespaces.................................. 6
1.4 Delivered Components.................................................................................... 6
1.4.1 ASAM.XIL.Interfaces .............................................................................. 7
1.4.2 ASAM.XIL.Implementation ..................................................................... 7
1.4.3 ASAM.XIL.TestSuite .............................................................................. 7
1.4.4 ExampleVendor.XIL ............................................................................... 7
1.4.5 ASAM.XIL.MSI ....................................................................................... 7
3 Mapping of types 9
3.1 Mapping of ASAM Data Types ........................................................................ 9
3.2 Mapping of XIL Types ..................................................................................... 9
3.2.1 XIL Arrays .............................................................................................. 9
3.2.2 XIL Collections ..................................................................................... 10
3.2.3 XIL Enumerators .................................................................................. 10
3.2.4 XIL Data Types .................................................................................... 10
3.3 Disposable ..................................................................................................... 10
4 Exception Handling 11
5 Deprecated Elements 12
FOREWORD
The XIL standard is developed by ASAM to standardize the communication between test
automation software and X-in-the-loop testbenches. It supports testbenches at all stages in
the software development process – such as MIL1, SIL2, HIL3.
The application of the XIL standard allows users to combine the software and hardware tools
independent of the vendor, thus enabling the reuse of the existing programmed tests for
subsequent development stages (e.g. reuse of test cases for function models in software
tests at a HIL simulator). This results in reduced costs for test programming and reduced
training costs for testers.
The core specification includes a conceptual description (Programmer’s Guide), the UML
model (technology independent interface definition) of the Testbench and Framework API as
well as various file format specifications.
The mapping rules define the transformation of the technology independent definitions into
C# and Python specific representations. They include the C# interfaces and Python classes
generated from the technology neutral UML model as well as standard implementations of a
few, very fundamental interface classes (only C#).
The C# test suite provides a set of test cases for the XIL Testbench API to help vendors and
users to verify standard conformance of their C# implementations. The test cases are
provided as C# source code. They can be automatically executed using the NUnit4 test
framework and therefore easily integrated into automated build and test tool chains.
1
Model-in-the-Loop
2
Software-in-the-Loop
3
Hardware-in-the-Loop
4
NUnit: http://nunit.org
ASAM XIL C# API Technology Reference Mapping Rules Version 2.2.0 5
Introduction
1 INTRODUCTION
1.1 OVERVIEW
ASAMs goal has always been to define technology independent standards. Therefore the
object model of the XIL API is defined in UML. This UML model is mapped to different
programming languages. As a result of the mapping process, all XIL API classes are
available in each of the supported programming languages either as interface definitions or
using native data types.
These mapping rules shall describe the transformation from the generic UML Model to C#
specific interfaces, which shall be used by each client and server for implementation
purpose.
Note: The minimum target version that servers and clients have to be built for is .NET
Framework 4.0. There are no further restrictions or recommendations by the XIL
standard. Vendors are free to build their servers and clients for any higher target
version induced by technical or other parameters outside the XIL scope. However,
vendors must declare the minimum .NET Framework version required by their XIL
software in the documentation. It is recommended that installers of XIL servers and
clients ensure that a .NET Framework is installed which version is greater or equal
than the required minimum version. That means the installer would also install the
.NET Framework or upgrade an existing installation if necessary.
1.4.1 ASAM.XIL.INTERFACES
The C# project “ASAM.XIL.Interfaces.csproj” contains all C# interfaces required for XIL API
V2.2. The file structure widely follows the namespace scheme and start with
ASAM.XIL.Interfaces.
After compiling the project, an interface DLL ASAM.XIL.Interfaces.dll is created.
All source code is provided in C# language.
1.4.2 ASAM.XIL.IMPLEMENTATION
This implementations can be taken over in own projects, because it is running code for the
respective parts of the technology reference.
1.4.3 ASAM.XIL.TESTSUITE
1.4.4 EXAMPLEVENDOR.XIL
Contains numerous example implementations and respective unit tests, which are separated
in the following projects:
ExampleVendor.XIL.Framework
ExampleVendor.XIL.Framework.IntegrationTest
ExampleVendor.XIL.FrameworkClient
ExampleVendor.XIL.Testbench
ExampleVendor.XIL.TestbenchClient
1.4.5 ASAM.XIL.MSI
The project ASAM.XIL.MSI.csproj creates a setup file, which is used to install the following
components in the Windows global assembly cache (GAC):
ASAM.XIL.Implementation.Framework.dll
ASAM.XIL.Implementation.FrameworkFactory.dll
ASAM.XIL.Implementation.ManifestReader.dll
ASAM.XIL.Implementation.Testbench.dll
ASAM.XIL.Implementation.TestbenchFactory.dll
ASAM.XIL.Interfaces.dll
Class names, method names, attribute names, and parameter names of the C# source code
have been taken directly from the UML model.
Example:
UML model: BaseValue=> C# interface: IBaseValue
A corresponding C# implementation has to have the same name as the UML class name.
2.2 PROPERTIES
Methods in the UML model which start with “get” or “set” have been translated into C#
properties (get, set). E.g. the methods getMinBufferSize and getMaxBufferSize of
the Capture class in the UML diagram are mapped to C# as
1 long MinBufferSize { get; set; }
All return types are either of type void, C# base types or XIL-API interfaces.
All parameter types are either C# base types or XIL API interfaces.
2.4 ENUMERATIONS
The value names of enumerations in the UML model start with “e” followed by capital
characters. Enumeration classes in the generic UML model are directly mapped to C#
enums. If not explicitly specified differently, numerical values start with 0.
3 MAPPING OF TYPES
Note: TYPE stands for signed elements with stereotype <<data type>> and standard
specific interfaces (<AnyObject>).
Note: TYPE stands for signed elements with stereotype <<data type>> and standard
specific interfaces (<AnyObject>).
3.3 DISPOSABLE
Disposable will be deleted in the interface Reference. Interfaces derived from Disposable will
be derived from the C# IDisposable Interface
4 EXCEPTION HANDLING
The exception handling of XIL API integrates with the standard exception handling defined by
the .NET Framework. All Exception classes will be mapped to abstract Exception classes
(without prefix "I" at the class name).
The class Exception will be deleted, the standard type System.Exception classes is
used instead. So the implementation Classes of all Exceptions are derived from the
System.Exception.
5 DEPRECATED ELEMENTS
Methods, properties and interfaces which have been assigned the deprecated stereotype in
the generic UML model are annotated with the Obsolete attribute in the generated C# files.
For example the annotation of a deprecated interface looks like
This annotation will result in compiler and IDE warnings if deprecated elements are used. It
will help users to detect the use of deprecated elements in their code.
Entry points for client access to a XIL System are the FrameworkFactory and
TestbenchFactory interface. Implementation classes of these interfaces are delivered with
the ASAM XIL Technology Reference within the Implementation Package. These rely on the
Implementation Manifest files provided by XIL vendors. Both factories support instance
creation for different vendors at the same time.
The following source code listing illustrates how to obtain access to a vendor’s Framework
and Testbench implementation using the ASAM implementation of FrameworkFactory and
TestbenchFactory.
using ASAM.XIL.Implementation.FrameworkFactory.Framework;
using ASAM.XIL.Implementation.TestbenchFactory.Testbench;
using ASAM.XIL.Interfaces.Framework;
using ASAM.XIL.Interfaces.Testbench;
using ASAM.XIL.Interfaces.Testbench.MAPort;
This limitation becomes relevant when client applications need to combine multiple
Testbench or Framework implementations that do not share a common XIL version.
In this case there would not be a single Factory version that can instantiate all of
them. However, there are different approaches to overcome this problem:
o Apply assembly binding redirection (see: https://docs.microsoft.com/en-
us/dotnet/framework/configure-apps/redirect-assembly-versions) to redirect
ASAM.XIL.Interfaces used by your Testbench- and FrameworkFactory to
the lowest version that any of your Testbench or Framework
implementations is based on. However, for this to work properly, all referenced
XIL versions must be binary compatible to the one selected by the redirection.
Also all the used Testbench and Framework implementations must be
binary compatible to that XIL version. Note that with this approach new
methods and functionalities in servers based on more recent XIL versions are
not available to the client.
o Load and call all XIL functions dynamically at runtime using System.Reflection
and handle any version mismatches programmatically.”
8.1 INSTALLATION
To install generic ASAM assemblies (implementation and interfaces) into the Global
Assembly Cache (GAC), the setup, that is delivered with the standard, has to be executed.
There is an unattended mode, that allows the setup to run without user interaction. The
unattended mode can be activated using the command line parameter “/passive”.
The ASAM setup decides, whether and which files need to be installed.
8.2 DEINSTALLATION
If a tool, that uses an implementation of the XIL API, is deinstalled, the ASAM setup must
not be executed. Even if the deinstalled tool was the last consumer of the binaries, the
assemblies will remain installed. The user can remove the assemblies manually using the
system panel.
8.3 REPAIR
The setup has a repair mode, that can be chosen, if the setup is called once again. If
installed files are missing on the computer, they are installed again.