Development Tools User’s Guide
223
Intel® IXP2400/IXP2800 Network Processors
Foreign Model Simulation Extensions
7.3
Foreign Model Dynamic-Link Library (DLL)
The foreign model DLL must provide the exported function
GetForeignModelFunctions()
, that the Transactor calls to get the addresses of the six
functions to interact with the foreign model.
The foreign model DLL runs in conjunction with the DLL version of the Transactor, so
Xactvmod.h must be included in the foreign model DLL source files, if needed, and it must be
linked against IXP2400.lib or IXP2800.lib.
To have the Transactor load a foreign model DLL, use the “foreign_model” command.
7.4
Simulating Media Devices
Simulating of devices involves the following:
•
Getting states of pins,
•
Determining appropriate action based on the pin states, and
•
Setting the appropriate pin states
The Workbench provides media device foreign models as described in
. These foreign models support several protocol types for each network processor.
For streaming packets through the Transactor, refer to
before developing your own
foreign model.
Appendix A, “Transactor States”
documents the Transactor state names and a brief description of
the states for various device pins including QDR and MSF devices.
7.5
Creating A Foreign Model DLL
This section contains sample code demonstrating how to create a dynamic-link library (DLL) for a
foreign model. It is also available in
\me_tools\samples\ForeignModelDLL
on the
distribution CD.
In your DLL you must provide the exported function
GetForeignModelFunctions( )
,
which the Transactor calls to get the addresses of the six functions that it calls to interact with your
foreign model. Of the six functions, the
foreign_model_initialize()
function is
required but the other five are optional. If you do not need to be notified for an event, return a zero
as the pointer to the function associated with that event.
If you want to call the Transactor API from your foreign model, you must include xact_vmod.h in
your source files. If and you want to statically bind your foreign model to a specific Transactor
DLL, you must link against the appropriate Transactor library file (e.g., IXP2400.lib or
IXP2800.lib), depending on which
network processor you will be simulateing. If you want to dynamically bind your Foreign Model
DLL to a Transactor at run-time, you must include the file foreign_model_main.cpp in your
project, and you must compile and link it with your other source files to create your Foreign Model