"...composable_kernel.git" did not exist on "7337ec2565d82399d6b9587e8fec128a39a4d4c5"
Commit 1c0da7d4 authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

sims/e1000_gem5: fix clock edges consistent with e1000 in gem5

parent 893ec208
...@@ -78,6 +78,14 @@ void IGbE::Timed(nicbm::TimedEvent &te) ...@@ -78,6 +78,14 @@ void IGbE::Timed(nicbm::TimedEvent &te)
/******************************************************************************/ /******************************************************************************/
/* gem5-ish APIs */ /* gem5-ish APIs */
Tick IGbE::clockEdge(Tick t)
{
if (t % 1000 != 0)
t += 1000 - (t % 1000);
t += 1000;
return t;
}
void IGbE::schedule(EventFunctionWrapper &ev, Tick t) void IGbE::schedule(EventFunctionWrapper &ev, Tick t)
{ {
if (ev.sched) { if (ev.sched) {
......
...@@ -1846,7 +1846,7 @@ IGbE::restartClock() ...@@ -1846,7 +1846,7 @@ IGbE::restartClock()
DPRINTF(EthernetSM, "IGbE: requesting restart clock: sched=%d rxt=%d txt=%d txf=%d\n", DPRINTF(EthernetSM, "IGbE: requesting restart clock: sched=%d rxt=%d txt=%d txf=%d\n",
tickEvent.scheduled(), rxTick, txTick, txFifoTick); tickEvent.scheduled(), rxTick, txTick, txFifoTick);
if (!tickEvent.scheduled() && (rxTick || txTick || txFifoTick)) { if (!tickEvent.scheduled() && (rxTick || txTick || txFifoTick)) {
schedule(tickEvent, curTick() + 1000); schedule(tickEvent, clockEdge(curTick()));
DPRINTF(EthernetSM, "IGbE: scheduled\n"); DPRINTF(EthernetSM, "IGbE: scheduled\n");
} }
} }
......
...@@ -71,6 +71,7 @@ class IGbE : public nicbm::Runner::Device ...@@ -71,6 +71,7 @@ class IGbE : public nicbm::Runner::Device
virtual void Timed(nicbm::TimedEvent &te); virtual void Timed(nicbm::TimedEvent &te);
Tick clockEdge(Tick t);
void schedule(EventFunctionWrapper &ev, Tick t); void schedule(EventFunctionWrapper &ev, Tick t);
void reschedule(EventFunctionWrapper &ev, Tick t, bool always=false); void reschedule(EventFunctionWrapper &ev, Tick t, bool always=false);
void deschedule(EventFunctionWrapper &ev); void deschedule(EventFunctionWrapper &ev);
...@@ -192,7 +193,7 @@ class IGbE : public nicbm::Runner::Device ...@@ -192,7 +193,7 @@ class IGbE : public nicbm::Runner::Device
*/ */
void cpuClearInt(); void cpuClearInt();
Tick intClock() { return 1024 * 1024; /* 1us */ } Tick intClock() { return 1000 * 1024; /* 1us */ }
/** This function is used to restart the clock so it can handle things like /** This function is used to restart the clock so it can handle things like
* draining and resume in one place. */ * draining and resume in one place. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment