Environment: VC Toolkit 2003 System C 2.0.1
In order to find SYSTEMC defined which global variables / static variables, I am in CRT / SRC / CRT0DAT.C
Void_initterm (_PVFV * Pfbegin, _PVFV * PFEND)
Set the breakpoint in the function, at line 598:
IF (* pfbegin! = null) (** pfbegin) (); // is interrupted here
Then a single step tracking program is obtained from the rough initialization order of Systemc: (C standard does not guarantee the initialization order of global variables between each translation unit, so the can be seen as a typical situation)
According to I observe, Systemc defines 15 full-time / static variables, 7 of which are like:
Static int windy_two = initialize ();
Scattered communication / sc_communication_ids.cpp, datatypes / bit / sc_bit_ids.cpp, datatypes / fx / sc_fx_ids.cpp, datatypes / int / sc_int_ids.cpp, kernel / sc_kernel_ids.cpp, utils / sc_report.cpp, utils / sc_utils_ids.cpp.
The remaining 8 initialization points are:
KERNEL / SC_TIME.CPP, L355
Const SC_TIME SC_ZERO_TIME;
2. Communication / SC_Interface.cpp, L78
SC_EVENT SC_INTERFACE :: m_never_notified;
// This will turn to call kernel / sc_simcontext.cpp, l835: // sc_get_curr_simcontext () // to initialize the global SC_SIMCONTEXT object, big event!
3. Kernel / SC_Module.cpp, L136
Const sc_bind_proxy sc_bind_proxy_nil;
4. kernel / sc_cor_fiber.cpp, l49
Static SC_COR_FIBER Main_COR;
// This is related to the platform if it is a UNIX Like platform, then "Coroutine Class Implement with /// QuickThreads."; If it is a Win32 platform, then "COROUTINE IMPLEMENTATION WITH FIBERS." // The comment in the program seems to be wrong: )
5. Utils / SC_Report_Handler.cpp, L205
Static Handler_GC_Name GC;
6. kernel / sc_lambda.cpp, l59
SC_LAMBDA SC_LAMBDA :: Dummy_Lambda;
7. DataTypes / Bit / SC_Logic.cpp, L154, initialize 4 logical value constants
const sc_logic sc_logic_0 (Log_0); const sc_logic sc_logic_1 (Log_1); const sc_logic sc_logic_Z (Log_Z); const sc_logic sc_logic_X (Log_X); const sc_logic SC_LOGIC_0 (Log_0); const sc_logic SC_LOGIC_1 (Log_1); const sc_logic SC_LOGIC_Z (Log_Z); const SC_Logic SC_Logic_x (log_x); 8. DataTypes / FX / SCFX_REP.CPP, L57
Static scfx_pow10 pow10_fx;
In the future, I will continue to analyze what these initialization do something, the weight is of course the initialization of the SC_SIMCONTEXT object.