Hi Jasmin,
I refer to a thread on the mailing list from 2014: "Simulation core of gem5“
Andreas H. answered that detailed:
> As part of the initialisation, the various SimObjects schedule their own
> events and place them on the event queue (there can as many event queues
> as you want, but in most cases there will only be a single one). This is
> done as part of the init(), initState/loadState, startup() sequence that
> takes place when launching the simulator.
>
> The objects are traversed in the order they were created, so if Object A
> and Object B both create events at time T, then Object A will have its
> event executed first.
so its in fact a two dimensional time.
For example, consider the simulation objects Obj{1,2,3} are cores:
Tick Obj1 Obj2 Obj3
0 eventA
1 eventB eventC
2 eventD
so the single threaded simulator will execute it in the following order,
assuming that Obj2 earlier scheduled its eventB:
eventA
proceed with time
eventB
eventC
proceed with time
eventD
proceed with time
There are also priorities and insertion sort:
> The event queue works like any 'normal' discrete-event simulator. It is
> sorted on time, denoted in Ticks, and after the initalisation is done, the
> queue picks the first event, updates the current tick to match the time of
> this event, and then processes/executes the event. There is also a notion
> of even priorities to order events within the same tick. This is used,
> amongst other things, to ensure that all Œexecution¹ is done before
> dumping statistics.
>
> In the execution of an event more events may be created, also for the
> current tick. If this is the case they are insertion sorted into the event
> queue based on their tick and priority. They will thus happen after any
> existing events in the current tick that have the same priority.
>
> Have a look at eventq.hh/cc to see the details of how this works.
I hope that answered your question ;)
Regards
Matthias
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users