Hi Jasmin,

To answer your question: Yes. Every SimObject in gem5 can schedule and
execute events for any tick.

Note: Ticks are usually running at 1 THz (1 tick = 1 picosecond), though
this is an option when initializing the system in the Python config files.
So, if you want to schedule an event for the next cycle and your cycle time
is 1 GHz, then you schedule the event for 1000 ticks in the future.

Every event calls a "process()" function. You can do anything you want
within this process function, including scheduling new events.

For more information:
1. A very high-level idea of how to create events can be found in my
Learning gem5 book: http://learning.gem5.org/book/part2/events.html
2. The code is the best place to understand how things work. See
src/sim/eventq* and src/sim/clocked_object.* for details of the event queue.

As for the "delta cycle" feature in SystemC, I'm not very familiar with it,
but I can try to explain how gem5 relates.
gem5 does not have the idea of two phase execution of events or an
evaluation and update phase. gem5 logically only has a single event queue.
You *can* schedule an event for the same tick, if needed, but this is quite
brittle in gem5. Additionally, gem5 supports event priorities, which can
solve some of the same issues as delta cycles (I think). Though, the event
priorities are rarely used in practice. Hopefully this helps some.

Cheers,
Jason

On Wed, Jan 18, 2017 at 5:11 AM Matthias Jung <jun...@eit.uni-kl.de> wrote:

> Hi Jason, Jasmin,
>
> I think what he wants to ask is if gem5 is using like HDL simulators or
> SystemC
> delta cycles - a two dimensional time in order to simulate concurrency?
>
> Regards
> Matthias
>
>
> > Am 17.01.2017 um 22:32 schrieb Jasmin Jahic <jasmin.ja...@gmail.com>:
> >
> > Dear Jason,
> >
> > thank you for your answer. It gives me a hint how does gem5 work, but I
> am unsure about the details. Is there any document which explains this?
> >
> > To be concrete, if there are 4 cores and 4 threads, within once cycle,
> each of them executes tick() on their own?
> >
> > Best regards,
> > Jasmin
> >
> > On Tue, Jan 17, 2017 at 3:59 PM, Jason Lowe-Power <ja...@lowepower.com>
> wrote:
> > Hi Jasmin,
> >
> > gem5 is an event-driven simulator. So, when there are multiple objects
> (e.g., multiple CPU cores, or caches, or memory controllers, etc.) all of
> these objects can execute in parallel in simulated time (or guest time to
> use virtual machine nomenclature). The CPU models don't necessarily execute
> one instruction at a time. Instead they are simulated at the clock-cycle
> level. Each action which takes place at some clock-cycle boundary is
> scheduled and then executed as an event in the event-driven simulation.
> >
> > gem5 is mostly single threaded. All of the CPUs in your simulated
> system, and all of the other objects like caches, etc. are simulated in a
> single host thread. There are a few places where this isn't true, but it's
> unusual to run gem5 with parallel event queues.
> >
> > Hopefully this helps explain things. Let us know if you have more
> questions.
> >
> > Cheers,
> > Jason
> >
> > On Tue, Jan 17, 2017 at 4:29 AM Jasmin Jahic <jasmin.ja...@gmail.com>
> wrote:
> > Hello,
> >
> > I have one question regarding multi threading in gem5, in full system
> mode. Since gem5 is seen as one process at host OS, how does gem5 actually
> emulate multiple threads/processes? Let's say that we have 4 core CPU and
> several processes and threads. Are these run in parallel really (one
> instruction of this thread, then one instruction of another thread...?) or
> there is some more complex mechanism?
> >
> > Is there perhaps a presentation or document which explains this?
> >
> > Best regards,
> > Jasmin JAHIC
> > _______________________________________________
> > gem5-users mailing list
> > gem5-users@gem5.org
> > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
> > --
> > Jason
> >
> >
> > _______________________________________________
> > gem5-users mailing list
> > gem5-users@gem5.org
> > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
> >
> > _______________________________________________
> > gem5-users mailing list
> > gem5-users@gem5.org
> > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
> _______________________________________________
> gem5-users mailing list
> gem5-users@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

-- 

Jason
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to