112855Sgabeblack@google.com#define SC_INCLUDE_FX 212855Sgabeblack@google.com 312855Sgabeblack@google.com#include <systemc.h> 412855Sgabeblack@google.com 512855Sgabeblack@google.com// 28) sc_core and sc_dt - check names still visible in <systemc.h> 612855Sgabeblack@google.com 712855Sgabeblack@google.comSC_MODULE(Mod) 812855Sgabeblack@google.com{ 912855Sgabeblack@google.com SC_CTOR(Mod) 1012855Sgabeblack@google.com { 1112855Sgabeblack@google.com SC_THREAD(T); 1212855Sgabeblack@google.com }; 1312855Sgabeblack@google.com void T() 1412855Sgabeblack@google.com { 1512855Sgabeblack@google.com sc_int<4> i; 1612855Sgabeblack@google.com sc_uint<4> ui; 1712855Sgabeblack@google.com sc_bigint<4> bi; 1812855Sgabeblack@google.com sc_biguint<4> bui; 1912855Sgabeblack@google.com sc_fixed<4,2> f; 2012855Sgabeblack@google.com sc_ufixed<4,2> uf; 2112855Sgabeblack@google.com sc_fixed_fast<4,2> ff; 2212855Sgabeblack@google.com sc_ufixed_fast<4,2> uff; 2312855Sgabeblack@google.com sc_bv<4> bv; 2412855Sgabeblack@google.com sc_lv<4> lv; 2512855Sgabeblack@google.com 2612855Sgabeblack@google.com sc_int_base ib; 2712855Sgabeblack@google.com sc_int_base uib; 2812855Sgabeblack@google.com sc_signed s; 2912855Sgabeblack@google.com sc_unsigned u; 3012855Sgabeblack@google.com sc_fix fi; 3112855Sgabeblack@google.com sc_ufix ufi; 3212855Sgabeblack@google.com sc_fix_fast ffi; 3312855Sgabeblack@google.com sc_ufix_fast uffi; 3412855Sgabeblack@google.com sc_logic l; 3512855Sgabeblack@google.com sc_bv_base bvb; 3612855Sgabeblack@google.com sc_lv_base lvb; 3712855Sgabeblack@google.com 3812855Sgabeblack@google.com //sc_value_base vb; 3912855Sgabeblack@google.com //sc_fxnum fx; 4012855Sgabeblack@google.com //sc_fxnum_fast fxf; 4112855Sgabeblack@google.com sc_fxval fxv; 4212855Sgabeblack@google.com sc_fxval_fast fxvf; 4312855Sgabeblack@google.com 4412855Sgabeblack@google.com sc_assert(sc_abs(-1) == 1); 4512855Sgabeblack@google.com sc_assert(sc_max(1, 2) == 2); 4612855Sgabeblack@google.com sc_assert(sc_min(1, 2) == 1); 4712855Sgabeblack@google.com sc_copyright(); 4812855Sgabeblack@google.com sc_version(); 4912855Sgabeblack@google.com sc_release(); 5012855Sgabeblack@google.com } 5112855Sgabeblack@google.com void f(sc_report& rpt) 5212855Sgabeblack@google.com { 5312855Sgabeblack@google.com sc_severity sev; 5412855Sgabeblack@google.com sev = SC_INFO; 5512855Sgabeblack@google.com sev = SC_WARNING; 5612855Sgabeblack@google.com sev = SC_ERROR; 5712855Sgabeblack@google.com sev = SC_FATAL; 5812855Sgabeblack@google.com sc_assert (sev == SC_FATAL); 5912855Sgabeblack@google.com 6012855Sgabeblack@google.com sc_actions act; 6112855Sgabeblack@google.com act = SC_DO_NOTHING; 6212855Sgabeblack@google.com } 6312855Sgabeblack@google.com void g(sc_exception x) {} 6412855Sgabeblack@google.com}; 6512855Sgabeblack@google.com 6612855Sgabeblack@google.comstruct Top: sc_module 6712855Sgabeblack@google.com{ 6812855Sgabeblack@google.com Top(sc_module_name) 6912855Sgabeblack@google.com { 7012855Sgabeblack@google.com tf = sc_create_vcd_trace_file("vcd"); 7112855Sgabeblack@google.com tf->set_time_unit(1.0, SC_NS); 7212855Sgabeblack@google.com sc_trace(tf, sig, "sig"); 7312855Sgabeblack@google.com sc_write_comment(tf, "Hello"); 7412855Sgabeblack@google.com } 7512855Sgabeblack@google.com ~Top() 7612855Sgabeblack@google.com { 7712855Sgabeblack@google.com sc_close_vcd_trace_file(tf); 7812855Sgabeblack@google.com } 7912855Sgabeblack@google.com sc_trace_file* tf; 8012855Sgabeblack@google.com sc_signal<sc_logic> sig; 8112855Sgabeblack@google.com}; 8212855Sgabeblack@google.com 8312855Sgabeblack@google.comint sc_main(int argc, char* argv[]) 8412855Sgabeblack@google.com{ 8512855Sgabeblack@google.com#if defined(_MSC_VER) && _MSC_VER < 1900 8612855Sgabeblack@google.com _set_output_format(_TWO_DIGIT_EXPONENT); 8712855Sgabeblack@google.com#endif 8812855Sgabeblack@google.com 8912855Sgabeblack@google.com cout << "Should be silent except for some renaming warnings..." << endl; 9012855Sgabeblack@google.com 9112855Sgabeblack@google.com Top top("top"); 9212855Sgabeblack@google.com 9312855Sgabeblack@google.com sc_attr_base ab("base"); 9412855Sgabeblack@google.com sc_attribute<int> at("attr"); 9512855Sgabeblack@google.com 9612855Sgabeblack@google.com sc_buffer<int> bu; 9712855Sgabeblack@google.com sc_signal_resolved sr; 9812855Sgabeblack@google.com sc_fifo<int> fi; 9912855Sgabeblack@google.com sc_mutex mut; 10012855Sgabeblack@google.com sc_semaphore sem(2); 10112855Sgabeblack@google.com sc_event_queue eq; 10212855Sgabeblack@google.com 10312855Sgabeblack@google.com sc_start(100, SC_NS); 10412855Sgabeblack@google.com 10512855Sgabeblack@google.com cout << endl << "Success" << endl; 10612855Sgabeblack@google.com return 0; 10712855Sgabeblack@google.com} 108