Table of Contents Previous topic Next topic
When you create a project you will select the ARM target family. This tells the Embedded Development Studio to look for sim.dll in sub-directory ARM\bin. If it finds it, it loads it and tells it to initialise itself. The simulator/debugger is therefore immediately initialised and ready to start in response to one of the run commands such as Go, Step Into, Step to Cursor, etc.
Wherever the simulator/debugger starts, it asks the Embedded Development Studio for the variant path. If there is a variant path, the simulator uses it to locate and load any simulator extensions that are in this directory.
So if VariantPath is for example LPC2103.var and the Embedded Development Studio is located in directory C:\ESTUDIO, the simulator will look in C:\ESTUDIO\ LPC2103.var \BIN for simulator extensions. It will first look for esim.dll and if found, load and initialise it. This name esim.dll is reserved for Crossware and should not be used for one of your own extensions. The simulator will then look for and load in sequence esim0.dll, esim1.dll, esim2.dll, etc. It will stop looking for extensions when the sequence is broken - eg. if esim0.dll and esim1.dll are present but esim2.dll is not, then the simulator will not look for esim3.dll.
Next the simulator will look for extensions in the BIN sub-directory (if present) of your project directory. So if your project is located in C:\ESTUDIO\PROJECTS\TEST, the simulator will look in C:\ESTUDIO\PROJECTS\TEST\BIN for simulator extensions. It will first look for esim0.dll and if found, load and initialise it. It will then look for and load in sequence esim1.dll, esim2.dll, esim3.dll, etc. It will stop looking for extensions when the sequence is broken - eg. if esim0.dll and esim1.dll are present but esim2.dll is not, then the simulator will not look for esim3.dll.
You can therefore associate an extension either with a particular target family or with a particular project.
Each simulator extension that is found and loaded will receive the extension interface calls that it exports. They will be called in the order loaded and so esim.dll will receive the call first, esim0.dll from VariantPath/bin will receive it next, then esim1.dll etc. and then the extensions loaded from ProjectPath/bin.
Some calls are made to all extensions regardless of whether or not they have been handled by an extension earlier in the chain - eg.GetPortPins().
Other calls stop at the extension that handles them - eg. GetDataDWord() - and extensions later in the chain will not see it. Therefore if esim0.dll handles GetDataDWord () for a particular address, then esim1.dll will never receive this call for this address. (It will however receive calls to GetDataDWord() for addresses that esim0.dll does not handle).
When the simulator is closed it unloads all of the extension dlls.