Thank you for your reply, Gabe.

Your answer solves my problem. The error was in the import statement, where I 
used the object name instead of the python file name.

Thanks a lot. I was stuck in this problem.

----------------------------------------------------------------------------------------------------------------------------------------------
Francisco Carlos Silva Junior
Phd Student

________________________________
De: gem5-users <gem5-users-boun...@gem5.org> em nome de Gabe Black 
<gabebl...@google.com>
Enviado: segunda-feira, 23 de março de 2020 18:05
Para: gem5 users mailing list <gem5-users@gem5.org>
Assunto: Re: [gem5-users] Problem passing a SimObject as Parameter

Gabe

On Mon, Mar 23, 2020 at 2:05 PM Gabe Black 
<gabebl...@google.com<mailto:gabebl...@google.com>> wrote:
Hi Fransisco. When creating a parameter, you use Param.{object type name}, when 
creating an instance of an object to fill a parameter, you use 
m5.objects.{etc}. Assuming you're doing that part right, then you need to make 
sure the name you're using in m5.objects.{etc} is correct. The first part 
should be the name of the file you passed to scons's SimObject(). For instance, 
if you have an object of type Bar in a file called Foo.py, you would import 
m5.objects.Foo.Bar. Frequently the name of the file and the name of the object 
are the same since it may be the primary or only object defined in that file, 
but it doesn't have to be.

Gane

On Mon, Mar 23, 2020 at 1:58 PM Muhammet Abdullah Soytürk 
<muhammetabdullahsoyt...@gmail.com<mailto:muhammetabdullahsoyt...@gmail.com>> 
wrote:
Hi Francisco,

Apparently gem5 cannot register your object to object list. With the 
information you gave, I can only guess.

- Did you register your object in the SConscript file?
- Did you recompile gem5.opt after you created your SimObject? While you 
compiling the gem5 binary with scons build/RISCV/gem5.opt, you should be able 
to see your object's name in the list of compiled objects.

Best,
Muhammet

Francisco Carlos <juninho.u...@hotmail.com<mailto:juninho.u...@hotmail.com>>, 
23 Mar 2020 Pzt, 23:47 tarihinde şunu yazdı:
I am facing a problem in passing a simObject as Parameter to DerivO3Cpu 
simObject . I create a simObject named DtmObject and it appears when I run the 
command for listing the simObjects:
./build/RISCV/gem5.opt --list-sim-objects.

However, when I try to import (from m5.objects.DtmObject import *) to use it as 
a parameter in other SimObject, in the O3CPU.py file to be more specific, I get 
the following error: ImportError: No module named DtmObject.

Am I missing something? I followed the tutorial in the gem5 page 
(http://www.gem5.org/documentation/learning_gem5/part2/parameters/) and still, 
I can't figure out what is going on.

Thanks in advance.

----------------------------------------------------------------------------------------------------------------------------------------------
Francisco Carlos Silva Junior
Phd Student at University of Brasilia
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org<mailto:gem5-users@gem5.org>
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org<mailto: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

Reply via email to