Table of Contents Previous topic Next topic
When you create a project you will select the 8051 target family. This tells the Embedded Development Studio to look for sim.dll in sub-directory 8051\bin. If it finds it, it loads it and tells it to initialise itself. The simulator 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 starts, it asks the Embedded Development Studio for the variant path. The variant path is obtained by the VariantPath entry in the target.ini file and so depends upon the family member selection for the project. 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 SAB80C517 and the Embedded Development Studio is located in directory C:\ESTUDIO, the simulator will look in C:\ESTUDIO\SAB80C517\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. GetSfrMemory() - and extensions later in the chain will not see it. Therefore if esim0.dll handles GetSfrMemory() for addresses 0x82, then esim1.dll will never receive this call for this address. (It will however receive calls to GetSfrMemory() for addresses that esim0.dll does not handle).
When the simulator is closed it unloads all of the extension dlls. This means that you can modify the extensions without closing your project and also you can switch to another set of extensions by selecting a different family member.