Using the Interface
Follow the steps to create a new SC_Module. More details are provided using the below examples.
- Drag a SC_Sim block from Full Library > Hardware_Language > SystemC > SC_Sim.
- Now drag a SC_Cosim block from Full Library > Hardware_Language > SystemC > SC_Cosim.
- Configure the block parameters as follows:
- SC_Module_Name
is the name of the block or Source Code. The module name is typically
the name of the top source code filename without the .ccp or .h
extension.
- SC_File_Path is the relative path of the Source Code.
For example:
If VS_C_Library = C:\VisualSim\VS930\UserNativeC, then the path is
SystemC/Source_Files/CPU_M.cpp.
- Next, configure the ports.
- Add as many input and output ports as required. Multiports are not supported.
- Configure the Remote Types to the corresponding types in SystemC. A list of the types are provided in Table 1 and Table 2.
- Execute from the Menu Bar; first Interface > Generate Wrapper and then Interface > Compile Wrapper.
Figure 1. Interface -> Generate Wrapper
- Now connect this block to the rest of the system.
- You should now be able to simulate the model.
Note: Using Object files
- If the code is better
compiled as an object file, this can be imported into VisualSim by
simply specifying the names of the object files. To do this, add a new
parameter called Obj_Files
to the SC_Cosim block. The parameter Obj_Files can contain space
separated list of additional files which has to be linked to the build
library.