#include "python/pybind11/pybind.hh"
#include "sim/init.hh"
#include "systemc/ext/core/sc_main.hh"
+#include "systemc/ext/utils/sc_report_handler.hh"
// A default version of this function in case one isn't otherwise defined.
// This ensures everything will link properly whether or not the user defined
}
EmbeddedPyBind embed_("systemc", &systemc_pybind);
+sc_stop_mode _stop_mode = SC_STOP_FINISH_DELTA;
+sc_status _status = SC_ELABORATION;
+
+uint64_t _deltaCycles = 0;
+
} // anonymous namespace
int
void
sc_set_stop_mode(sc_stop_mode mode)
{
- warn("%s not implemented.\n", __PRETTY_FUNCTION__);
+ if (sc_is_running()) {
+ SC_REPORT_ERROR("attempt to set sc_stop mode "
+ "after start will be ignored", "");
+ return;
+ }
+ _stop_mode = mode;
}
sc_stop_mode
sc_get_stop_mode()
{
- warn("%s not implemented.\n", __PRETTY_FUNCTION__);
- return SC_STOP_FINISH_DELTA;
+ return _stop_mode;
}
void
sc_dt::uint64
sc_delta_count()
{
- warn("%s not implemented.\n", __PRETTY_FUNCTION__);
- return 0;
+ return _deltaCycles;
}
bool
sc_is_running()
{
- warn("%s not implemented.\n", __PRETTY_FUNCTION__);
- return false;
+ return _status & (SC_RUNNING | SC_PAUSED);
}
bool
bool
sc_pending_activity()
{
- warn("%s not implemented.\n", __PRETTY_FUNCTION__);
- return false;
+ return sc_pending_activity_at_current_time() ||
+ sc_pending_activity_at_future_time();
}
sc_time
sc_status
sc_get_status()
{
- warn("%s not implemented.\n", __PRETTY_FUNCTION__);
- return SC_ELABORATION;
+ return _status;
}
} // namespace sc_core