It turns out it was a SCons dependency issue. The auto-generated SWIG
interface file for my device
(build/ARM_SE/python/m5/internal/param_Mydevice.i in this case) wasn't
updated. I deleted the .i file and re-built, and it works.

Just to shared the details -

I looked at the config.ini and confirmed the python param class member has
the value populated. Then it must have been the SWIG's fault for dropping
the ball. I looked at the param_Mydevice.i file and realized

 39 %nodefault Mydevice;
 40 class Mydevice
 41     : public MemObject

Where it should have been

 39 %nodefault Mydevice;
 40 class Mydevice
 41     : public DmaDevice

Thanks,

Min

On Fri, Sep 30, 2011 at 7:32 PM, Gabe Black <[email protected]> wrote:

> **
> Devices don't work in SE mode. In the future they might, but for now they
> don't for reasons like what you're seeing.
>
> Gabe
>
>
> On 09/30/11 16:31, Min Kyu Jeong wrote:
>
> Hi,
>
> I am trying to get a device working in SE mode. I hacked SConscripts here
> and there, and successed compiling a device that inherits DmaDevice.
>
> The intertance chain looks like
> MyDevice:DmaDevice:PioDevice:MemObject:SimObject
>
> The problem is, the PioDevice.sys (a pointer to the system) is not
> initialized properly (holds 0).
>
> It should be initilazed in the Ctor of PioDevice as:
>
> dev/io_device.cc
>
> PioDevice::PioDevice(const Params *p)
>     : MemObject(p),
> #if FULL_SYSTEM
>     platform(p->platform),
> #endif
>     sys(p->system), pioPort(NULL)
> {}
>
> I gdbed and p->system holds 0 when the Ctor is executed. I guess p->system
> should have been initialized in the following
>
> dev/Device.py
>
> class PioDevice(MemObject):
>     type = 'PioDevice'
>     abstract = True
>     pio = Port("Programmed I/O port")
>     if buildEnv['FULL_SYSTEM']:
>         platform = Param.Platform(Parent.any, "Platform this device is part
> of")
>     system = Param.System(Parent.any, "System this device is part of")
>
>
> Now it is the where python-SWIG magic occurs, so I would appreciate any
> advice how should I proceed debugging from here.
>
> Thanks,
>
> Min
>
>
> _______________________________________________
> gem5-users mailing 
> [email protected]http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
>
>
> _______________________________________________
> gem5-users mailing list
> [email protected]
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to