Creating DLL Projects


All in-process simulators are implemented as dynamic linked libraries (DLLs). The following describes the procedures that you need to perform in order to create a DLL project in conjunction with the source files generated by SansGUI.

Creating DLL Projects

We recommend the following naming convention and project location for your new DLL projects:

Suppose you have generated MySim version 1.2.1.8 in the working directory MySim, the contents of the MySim directory will look like:

 

Directory or File

Description

MySim\

Simulator project directory

  MySim.sgs

Schema Definition file

  MySim_1_2.sgo

Object Library generated for version 1.2.1.8

  MySim_1_2.sgb

Backup of Schema Definition prior to the Object Library version 1.2.1.8 generation

  MySim_1_2_1_8\

Source file directory, created by SansGUI Source Code Framework

    Base_MyClass.c

Sample source file in C for class Base.MyClass

    Base_MyClass.f

Sample source file in Fortran for class Base.MyClass

    ...

Other source files

  MySim_1_2\

Simulator DLL directory

    MySim_1_2.dsw

Simulator DLL workspace created by IDE

    ...

Other simulator DLL project files without source code

    Debug\

Debug build directory, will not be used

    Release\

Release build directory of the simulator DLL

      MySim_1_2.dll

The simulator DLL built for software release

    Trace\

Manually created directory for debugging and tracing

      MySim_1_2.dll

The simulator DLL built for debugging and tracing

Microsoft Visual C++ IDE

To create a new DLL project in MSVC, do the following:

Compaq Visual Fortran IDE

To create a new DLL project in CVF, do the following:

Inserting Source Files

After the DLL project workspace is created, the next step is to insert the generated source files for the classes in the simulator into the project. To do so, use Project>AddToProject>Files... to locate and select the generated source files. Once you are done, click on the OK button to insert the files.

If you use a single programming language, include all the source files with the associated extension. If you use multiple programming languages in a cooperative IDE, such as MSVC and CVF, you can insert the appropriate source files with the extensions associated with the languages on a class-by-class basis. Normally, we recommend that you implement all the functions in a class in the same language. If you really need to implement the functions of the class in mixed programming languages, you will need to manage multiple source files for that class manually. You also need to incorporate other source files or libraries that your simulator will use in the project workspace.

Building Simulator DLL

Because the SansGUI source code framework generates skeleton code for the class functions, you can immediately build the simulator DLL with all the functions returning SG_R_OK.

 



C:\FH_Suite\htmlgifs\home.gif Preparing Development Environments Implementing Class Behavior

SansGUI Modeling and Simulation Environment Version 1.2

Copyright © 2000-2003 ProtoDesign, Inc. All rights reserved.

http://protodesign-inc.com