Hi Geraldo,

You can create a Param.MyModule for the O3 CPU Python wrapper, and it will get 
passed to the C++ constructor.

In the configuration script you can create your module as a child of e.g. the 
system, along the lines of:

system.mymodule = MyModule()
for cpu in system.cpus:
   cpu.mymodule = system.mymodule

That should do the trick.

Andreas
From: gem5-users 
<[email protected]<mailto:[email protected]>> on behalf of 
Geraldo Francisco <[email protected]<mailto:[email protected]>>
Reply-To: gem5 users mailing list 
<[email protected]<mailto:[email protected]>>
Date: Monday, 5 December 2016 at 17:25
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>, 
"[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: [gem5-users] Connect O3 CPUs to custom module via pointer

Hi,

I'm trying to pass a pointer address to N O3 CPUS.
My scenario is the following: I've added a pointer to my custom module to the 
O3 CPU class. My module gets information from N CPUs, so I have a 1:N situation 
(one custom module to N CPUs).

However, I'm having problems to pass the address of my module to all CPUs using 
the python configuration script. I've tried to instantiate my module and then 
calling a method inside my C++ class that return its address, but I was not 
successful to call it from the configuration script.

Any suggestion?
Thank you.


--
Geraldo Francisco de Oliveira Junior
Mestrando em Computação - Universidade Federal do Rio Grande do Sul
Bacharel em Ciência da Computação - Universidade Federal de Viçosa
BSMP Computer Engineering - Portland State University
Técnico em Informática - Universidade Federal de Viçosa
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
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to