/************************************************** versys eda example--**** test.cpp ****------------- --------------Test module of inverter-------------- Copyright (c) 1996-2007, by all Contributions. All rights reserved. *******************2007/11/22 by ogu, lexim,inc.***/ #include #include #include "systemc.h" #include "inverter.h" int sc_main(int argc, char *argv[]) { int i; sc_signal din; sc_signal dout; inverter *inva; inva = new inverter("inva"); (*inva)(din, dout); sc_trace_file *trace_f; trace_f = sc_create_vcd_trace_file("inverter"); ((vcd_trace_file *)trace_f) -> sc_set_vcd_time_unit(-9); sc_trace(trace_f, din, "din"); sc_trace(trace_f, dout, "dout"); sc_initialize(); cout << "din | dout" << endl; cout << "---------" << endl; for(i=0;i<20;i++) { if(i%2) din = true; else din = false; sc_start(50,SC_NS); cout << din << " | " << dout << endl; } sc_close_vcd_trace_file(trace_f); return 0; }