Remove non-standard modulo operator on sc_time

This commit is contained in:
2022-08-05 08:43:28 +02:00
parent 6fdc19a3bd
commit b3b0788e69
2 changed files with 2 additions and 2 deletions

View File

@@ -533,5 +533,5 @@ void Controller::sendToDram(Command command, tlm_generic_payload& payload, sc_ti
bool Controller::isFullCycle(const sc_core::sc_time& time) const
{
sc_time aligedAtHalfCycle = std::floor((time * 2 / memSpec.tCK + 0.5)) / 2 * memSpec.tCK;
return aligedAtHalfCycle % memSpec.tCK == SC_ZERO_TIME;
return sc_time::from_value(aligedAtHalfCycle.value() % memSpec.tCK.value()) == SC_ZERO_TIME;
}

View File

@@ -802,5 +802,5 @@ void CheckerHBM3::insert(Command command, const tlm_generic_payload &payload)
bool CheckerHBM3::isFullCycle(const sc_core::sc_time& time) const
{
sc_time aligedAtHalfCycle = std::floor((time * 2 / memSpec->tCK + 0.5)) / 2 * memSpec->tCK;
return aligedAtHalfCycle % memSpec->tCK == SC_ZERO_TIME;
return sc_time::from_value(aligedAtHalfCycle.value() % memSpec->tCK.value()) == SC_ZERO_TIME;
}