Download The LSE User`s Manual
Transcript
Chapter 4. Instruction set emulation
Using the emulation interface
Declaring the emulator in lss
Emulators are a particular kind of domain class and, as such, are declared to lss in the same way as other domain
classes. The domain class name for emulators is LSE_emu.
A particular emulator is generally named for the ISA which it supports. Thus, the emulator supplied with LSE for
the Intel IA64 architecture is LSE_IA64 and the emulator supplied for the PowerPC architecture is
LSE_PowerPC.
To include an emulator in a simulation, use the following lss code:
import LSE_emu;
var emu = LSE_emu::create("inst0","LSE_IA64",
"command argument list")
: domain ref;
add_to_domain_searchpath(emu);
Ê
Ë
Ì
Ê
Bring the LSE_emu domain class into scope.
Ë
Create an emulator instance named inst0 using the emulator named LSE_IA64. The final argument gives
command-line arguments for the emulator which will be presented to it at run-time; allowing a configuration
to set "default" command-line arguments for the final simulator.
Ì
Add this emulator instance to the domain search path for all module instances below the module instance in
which this lss scope is processed (in this example, the top-level).
References to emulator types can be made within LSS using the LSS package syntax, e.g.,
LSE_emu::SIM_emu_addr_t. References to a particular emulator instance’s implementation of an emulator
type can be made using a function-call like syntax: LSE_emu::SIM_emu_addr_t(emu). This later notation may
be necessary because many emulator types are polymorphic; the implementation of the type depends upon the
particular emulator. Thus it is sometimes necessary to indicate which emulator instance’s type definition is being
referred to.
Datatypes
The emulation interface provides several datatypes to represent common datatypes in ISAs or information about
instructions. Some of these datatypes (such as the datatype for target addresses) are specified by the underlying
emulator. Others of the datatypes are constructed based upon the capabilities of the underlying emulator; for
example, emulators which do not provide information about branch targets do not have a field to record that
information in their instruction information structure.
The following is a list of the most useful datatypes provided by the emulation interface. For a complete list,
including information about what capabilities are required for a certain type or structure field to be present, see
the chapter entitled Emulation API in The Liberty Simulation Environment Reference Manual.
• LSE_emu_addr_t
is an address.
93