#include #include #include "acc_user.h" #include "vcs_acc_user.h" #include "svdpi.h" #include "counter_tb_ports.h" #include "counter_tb_exports.h" void sc_counter_init() { init_sc(); // Initialize SystemC Model } int sc_counter_interface(int iclk, int idout) { static unsigned long SimNow = 0; int lrst; // IO ports systemC testbench static INVECTOR invector; static OUTVECTOR outvector; invector.clk = iclk; invector.d_out = idout; // Execute the SytemC Shell exec_sc(&invector, &outvector, (tf_gettime()-SimNow)); SimNow = tf_gettime(); lrst = outvector.rst; if (outvector.done) { tf_dofinish(); } return(lrst); }