Documentos de Académico
Documentos de Profesional
Documentos de Cultura
You have to logoff and login your windows user to reload the user variables.
Building the SystemC project to get the import library SystemC.lib
Open solution SystemC.sln in subfolder \msvc71\SystemC with Visual Studio. Build the
solution with F7. This may take a while. Afterwards the SystemC.lib will be generated in
subfolder /msvc71/SystemC/Debug.
Creating a new VS 2005 C++ project for using SystemC
Open visual studio and create a new project. In New Project dialogue select C+ ->
Win32 -> Win32 Console Application and chose a project name. In the Win32
Select Show Directories for Library Files from the same dialogue and add a new line
with: $(SYSTEMC)\SystemC\Debug
For each project you just created or for existing projects in which you plan to integrate
SystemC you have to ensure your project settings to meet this options:
Open your projects properties and set the Detect 64-bit Portability Issues option under
C/C++ -> General to No.
Select C/C++ - > Code Generation and set the value of Runtime Library to Multithreaded Debug (/MTd).
Select C/C++ - > Command Line and insert the compiler option /vmg.
Note: Without the /vmg option you may be able to build your project but it maybe
behaves wrong.
Select Linker -> Input and add systemc.lib to Additional Dependencies.
Now you should be able to build your project. For a simple test you could insert a
HelloWorld.cpp containing this sample code:
// sc_hello_world.cpp : Defines the entry point for the console
application.
//
#include "systemc.h"
#include <iostream>
SC_MODULE(Hello_SystemC)
{
sc_in_clk iclk;
SC_CTOR(Hello_SystemC)
{
SC_METHOD(main_method);
void main_method(void)
{
std::cout << sc_time_stamp() << " Hello World!" <<
std::endl;
}
};
int sc_main(int argc, char* argv[])
{
const sc_time t_PERIOD(8,SC_NS);
sc_clock clk("clk",t_PERIOD);
Hello_SystemC iHelloWorld("iHelloWorld");
iHelloWorld.iclk(clk);
sc_start(50,SC_NS);
return 0;
}
Your console output should look like this: