SimObject is a special case and is imported from "SimObject". MemObject
(and all other SimObject subclasses) are imported from m5.objects.*. You're
import should be from m5.objects.MemObject import MemObject.

Gabe

On Mon, Jun 15, 2020 at 5:34 AM Shaikhul Hadi via gem5-users <
[email protected]> wrote:

> I'm trying to build a simple memory object from this link
> <http://learning.gem5.org/book/part2/memoryobject.html>. But during
> building gem5.opt,[scons build/X86/gem5.opt] I'm getting this error:
>
>
>
>
>> ModuleNotFoundError: No module named 'MemObject':
>>
> ...
>>
> ...
>>
> File "[Path]/gem5/build/X86/SConscript", line 789:
>>     exec('from m5.objects import %s' % modname)
>>   File "<string>", line 1:
>>
>>   File "[Path]/gem5/build/X86/SConscript", line 769:
>>     exec(compiled, mod.__dict__)
>>   File "[Path]/gem5/src/simobject/SimpleMemobj.py", line 4:
>>     from MemObject import MemObject
>>
>
> My .py,.hh and .cc files are in src/simobject directory. [I used this same
> directory to generate simple SimObject and it worked perfectly.]
>
> I'm using gem5 [SHA: 332a9de33db603e0aefedae1e05134db4257ea3e ] and ubuntu
> 20.04
>
>
> _______________________________________________
> gem5-users mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
_______________________________________________
gem5-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to