Script_Language_Interface > SystemC
Block Name: SC_Sim
Code File Location: VisualSim/interfaces/systemC/SC_Sim
This block provides the user with the ability to add a timed interface between VisualSim and SystemC. The timed interface is the interface operation where both the VisualSim and SystemC simulator are synchornized so that the transfers across the interface are accurately performed according to the arrival time. The user sets the parameters according to the anticipated co-simulation interface timing, based on the Time_Resolution, Start_Time, and Stop_Time. The menu attribute for Time_Base will align the time entries to coinside with the SystemC time boundaries.
The Use Model for the SystemC_Sim is to model transactions between the two simulators with a simple timed interface to limit simulator interaction. Either simulator can be the initiating, or master, simulator in the co-simulation.
The method- and socket-based connections of TLM 1.0 and 2.0 are defined in the SC_Sim block field called Interface_Routing. This parameter must be added to the SC_Sim block and is required for all TLM routing done without using ports.
For TLM 2.0, the connections would look like this:
LtMinSystemTimed_m_initiator_1->processor_abstraction_socket(LtMinSystemTimed_m_bus->target_socket[0]);
LtMinSystemTimed_m_initiator_2->processor_abstraction_socket(LtMinSystemTimed_m_bus->target_socket[1]);
LtMinSystemTimed_m_bus->initiator_socket[0](LtMinSystemTimed_m_target_1->m_memory_socket);
LtMinSystemTimed_m_bus->initiator_socket[1](LtMinSystemTimed_m_target_2->m_memory_socket);
For TLM 1.0, the interface routing would look like this:
simple_bus_master_Wrapper->clock(*clk);
simple_bus_master_Wrapper->bus_port(*simple_bus);
To view the TLM 2.0 model in the BDE, click here.
It is possible to mix-and-match 1.0 and 2.0 in a single model. This is not recommended by the TLM standards.
If using SystemC on Windows, the $VS/bin/vsconf.bat file must be updated. The first line set VSDIR must point to the correct location of the Microsoft Visual Studio (Supported version is Visual Studio Express 2008, 2010 and 2013 with the Microsoft Windows SDK 6.1). If using SystemC on UNIX, the path to the g++ compiler (g++ 4.0.x or higher) must be included in the PATH environment variable.
Before starting up the interface, the SystemC.lib must be generated with the same compiler that will be used to compile the models. To compile, open the SystemC solution file in 2010 or 2013, click on build. That is it. With 2013, you need to add a preprocessor definition for "_ALLOW_KEYWORD_MACROS".
Parameter |
Explanation |
Type |
Example |
Time_Base |
Time_Base attribute, based on SystemC nomenclature, used to align timeResolution, Start_Time, and Stop_Time to boundary values. |
- |
SC_NS |
timeResolution |
This is the smallest time value that the interface between SystemC and VisualSim will communicate across the interface. The value has a time base as expression in the Time_Base parameter. |
Double |
1.0 |
Start_Time |
This is the time to initiate the SystemC simulation to start after the VisualSim model has started. The value has a time base as expression in the Time_Base parameter. |
Double |
0.0 |
Stop_Time |
The Stop_Time is the time after the start of the simulation when the interface is disabled. The value has a time base as expression in the Time_Base parameter. |
Double |
100.0 |
Created with the Personal Edition of HelpNDoc: Full-featured Help generator