The right way to do this is to have the event reschedule itself every
time it runs for the proper latency until the next clock tick of the
device you're simulating.  (Note that you don't want to schedule every
1 tick, you need to base the latency off a clock parameter.)  See the
TickEvent in src/cpu/simple/atomic.{cc,hh} for an example; the event
gets rescheduled on the last line of the tick() function.

Steve

2010/3/12 Veydan Wu <[email protected]>:
> I just want my I/O device to run in parallel with CPU. Does the CPUs run
> over and over? More specifically speaking, CPU may send something to the I/O
> device to handle, but the time is not fixed. So it is better to let the
> device keep running and when it receive data ( by the write() function ), it
> can handle it. I do want the handling invoked within the write() function, I
> want it to act like a real hardware device. Is there any way I can do this?
> Thank you very much!
>
> Weidan
>
> 在 2010年3月12日 下午4:44,Gabe Black <[email protected]>写道:
>>
>> What are you implementing that needs to run over and over so often?
>>
>> Gabe
>>
>>
>
>
> _______________________________________________
> m5-users mailing list
> [email protected]
> http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
>
_______________________________________________
m5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/m5-users

Reply via email to