[gem5-users] Re: System() and RubySystem()

2021-06-16 Thread Gabriel Busnot via gem5-users
Hi Javed,

Please, see my comments inline.

Best,
Gabriel

Javed Osmany wrote:
> Hello
> 
> Trying to understand the following:
> 
> So in example config scripts I see the following:
> 
> system = System() // Is this then instantiating the default overall 
> system ??
This is pretty much it, yes.
> 
> Now, I understand that there are two types of memory system, namely classic 
> and Ruby.
Yes.
> 
> And then if "-ruby" is specified on the command line, the script Ruby.py is
> called.
> Within Ruby.py, the function creat_system() is called and in Ruby.py (lines 
> 193 - 194), we
> have the code
> 
>system.ruby = Ruby.System() // Is this then instantiating the Ruby 
> memory system
> within the overall System() ??
Here it gets a bit more technical but you are right.
Let me detail a little bit more what is going on.
BTW, Not sure which version of gem5 you have but I don't have a dot between 
Ruby and System and I believe that you should not have one either.

system, which is an instance of the System python class, is what is called a 
SimObject.
The SimObject python class, which System inherits from, gives special 
capabilities.
The most important one is to be able to build a SimObject tree by asigning 
SimObjects to other SimObjetcs attributes.
For instance, with A, B, C and D being SimObject instances, one can write:
A.b = B; B.c = c; A.d = d // Builds the SimObject tree [A->B->C ; A->D]

The SimObject tree that you have before calling m5.instantiate will define the 
order in which the C++ version of each SimObject will be constructed.
You basically go from the leafs to the root of the SimObject tree so that all 
parameters are valid in each C++ SimObject constructor.
Then, the init method of each C++ SimObject is called in a non-specified order 
in order to perform extra operations that cannot take place in the constructor.

In the present case, an instance of the SimObject "RubySystem" is being 
assigned to the ruby attribute of system (which also is a SimObject).
system initially has no ruby attribute but because we are assigning a 
SimObject, magic happens behind the scene and a new attribute "ruby" is 
dynamically added. Notice that you could use any attribute name instead of ruby.
In a nutshell, yes, our new RubySystem is now "physically" part of the overall 
System.

>ruby= system.ruby // This is then just an alias ??
Yes, this is a local alias: system.ruby could be used instead of ruby in the 
rest of the function.
> 
> 
> Thanks in advance.
> J.Osmany
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s


[gem5-users] Re: System() and RubySystem()

2021-06-16 Thread Javed Osmany via gem5-users
Many thanks for the clarification Giacomo.

Best regards
JO

-Original Message-
From: Giacomo Travaglini [mailto:giacomo.travagl...@arm.com] 
Sent: 16 June 2021 11:36
To: gem5 users mailing list 
Cc: Javed Osmany 
Subject: RE: System() and RubySystem()

Hi Javed,

You are correct in your assumptions. I believe the confusion arises from the 
overuse of the "System" keyword. As a summary, The System class (defined in 
src/sim/system.hh) is the child of the Root node and encompasses most of the 
simulated models (cpu, memory subsystem, devices, etc).

The RubySystem is a child of the System class (system.ruby = RubySystem() adds 
the RubySystem to the SimObject hierarchy under the system node).
In other words, the RubySystem is a subsystem, whose only purpose is to parent 
ruby memory models. It is not a replacement for the System class nor a 
different implementation

Kind regards

Giacomo

> -Original Message-
> From: Javed Osmany via gem5-users 
> Sent: 16 June 2021 11:17
> To: gem5 users mailing list 
> Cc: Javed Osmany 
> Subject: [gem5-users] FW: System() and RubySystem()
>
> Hello
>
>
>
> Wondering if any help to clear up the issues listed in my previous email?
>
>
>
> Tks
>
> JO
>
>
>
> From: Javed Osmany
> Sent: 14 June 2021 14:18
> To: gem5 users mailing list 
> Cc: Javed Osmany 
> Subject: System() and RubySystem()
>
>
>
> Hello
>
>
>
> Trying to understand the following:
>
>
>
> So in example config scripts I see the following:
>
>
>
> system = System() // Is this then instantiating the default 
> overall system ??
>
>
>
> Now, I understand that there are two types of memory system, namely 
> classic and Ruby.
>
>
>
> And then if "-ruby" is specified on the command line, the script 
> Ruby.py is called.
>
> Within Ruby.py, the function creat_system() is called and in Ruby.py 
> (lines
> 193 - 194), we have the code
>
>
>
>system.ruby = Ruby.System() // Is this then instantiating the 
> Ruby memory system within the overall System() ??
>
>ruby= system.ruby // This is then just an alias ??
>
>
>
>
>
> Thanks in advance.
>
> J.Osmany

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s


[gem5-users] Re: System() and RubySystem()

2021-06-16 Thread Giacomo Travaglini via gem5-users
Hi Javed,

You are correct in your assumptions. I believe the confusion arises from the 
overuse of the "System" keyword. As a summary,
The System class (defined in src/sim/system.hh) is the child of the Root node 
and encompasses most of the simulated models (cpu, memory subsystem, devices, 
etc).

The RubySystem is a child of the System class (system.ruby = RubySystem() adds 
the RubySystem to the SimObject hierarchy under the system node).
In other words, the RubySystem is a subsystem, whose only purpose is to parent 
ruby memory models. It is not a replacement for the System class nor a 
different implementation

Kind regards

Giacomo

> -Original Message-
> From: Javed Osmany via gem5-users 
> Sent: 16 June 2021 11:17
> To: gem5 users mailing list 
> Cc: Javed Osmany 
> Subject: [gem5-users] FW: System() and RubySystem()
>
> Hello
>
>
>
> Wondering if any help to clear up the issues listed in my previous email?
>
>
>
> Tks
>
> JO
>
>
>
> From: Javed Osmany
> Sent: 14 June 2021 14:18
> To: gem5 users mailing list 
> Cc: Javed Osmany 
> Subject: System() and RubySystem()
>
>
>
> Hello
>
>
>
> Trying to understand the following:
>
>
>
> So in example config scripts I see the following:
>
>
>
> system = System() // Is this then instantiating the default overall
> system ??
>
>
>
> Now, I understand that there are two types of memory system, namely
> classic and Ruby.
>
>
>
> And then if "-ruby" is specified on the command line, the script Ruby.py is
> called.
>
> Within Ruby.py, the function creat_system() is called and in Ruby.py (lines
> 193 - 194), we have the code
>
>
>
>system.ruby = Ruby.System() // Is this then instantiating the Ruby
> memory system within the overall System() ??
>
>ruby= system.ruby // This is then just an alias ??
>
>
>
>
>
> Thanks in advance.
>
> J.Osmany

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s