Thanks again Jason. Will do per your guidance below. 

 

From: Jason Lowe-Power <ja...@lowepower.com> 
Sent: Thursday, April 28, 2022 11:00 AM
To: rshank...@austin.rr.com
Cc: gem5 users mailing list <gem5-users@gem5.org>
Subject: Re: [gem5-users] Re: Adding DmaDevice leads to TypeError: No 
constructor defined

 

Hello,

 

The `DMADevice` is also abstract. See 
https://gem5.googlesource.com/public/gem5/+/refs/heads/stable/src/dev/Device.py#82

 

Maybe what you're trying to do would be best accomplished by adding a new 
SimObject which inherits from DMADevice.

 

Cheers,

Jason

 

On Wed, Apr 27, 2022 at 9:45 AM <rshank...@austin.rr.com 
<mailto:rshank...@austin.rr.com> > wrote:

Jason,

 

Thanks for again for the fix related to PioDevice & your guidance to use 
DmaDevice

 

DmaDevice also provides same “No Constructor TypeError” which checking the 
dma_device.cc – the constructor is empty

 

 

 

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "build/X86/python/m5/main.py", line 455, in main
    exec (filecode, scope)
  File "/home/raghu/gem5/configs/learning_gem5/part1/test.py", line 187, in 
<module>
    m5.instantiate()
  File "build/X86/python/m5/simulate.py", line 116, in instantiate
    for obj in root.descendants(): obj.createCCObject()
  File "build/X86/python/m5/SimObject.py", line 1790, in createCCObject
    self.getCCParams()
  File "build/X86/python/m5/SimObject.py", line 1720, in getCCParams
    cc_params = cc_params_struct()

TypeError: _m5.param_DmaDevice.DmaDeviceParams: No constructor defined!

 

Dma_device.cc

DmaDevice::DmaDevice(const Params &p)

     : PioDevice(p), dmaPort(this, sys, p.sid, p.ssid)

{ }

 

From: Jason Lowe-Power via gem5-users <gem5-users@gem5.org 
<mailto:gem5-users@gem5.org> > 
Sent: Friday, April 22, 2022 11:16 AM
To: gem5 users mailing list <gem5-users@gem5.org <mailto:gem5-users@gem5.org> >
Cc: rshank...@austin.rr.com <mailto:rshank...@austin.rr.com> ; Jason Lowe-Power 
<ja...@lowepower.com <mailto:ja...@lowepower.com> >
Subject: [gem5-users] Re: Adding PioDevice leads to TypeError: No constructor 
defined

 

I just pushed a change that will make this error message better.

 

"fatal: Cannot instantiate an abstract SimObject (system.dev 
<http://system.dev> )" is what the error now says :).

 

See https://gem5-review.googlesource.com/c/public/gem5/+/59049

 

Cheers,

Jason

 

On Fri, Apr 22, 2022 at 8:57 AM Jason Lowe-Power <ja...@lowepower.com 
<mailto:ja...@lowepower.com> > wrote:

Hello,

 

I believe the problem is that gem5 tries to do too much automatically for you! 
gem5 automatically creates a lot of the constructor/destructor codes. Given all 
of this hidden/automatic code generation, it's difficult to know exactly what's 
going wrong (for both you and for us).

 

That said, I think the problem is that `PioDevice` is an abstract SimObject, 
not a concrete SimObject. This may work if you instead use the `DmaDevice`.

 

Cheers,

Jason

 

On Thu, Apr 21, 2022 at 1:58 PM Raghu Shankar via gem5-users 
<gem5-users@gem5.org <mailto:gem5-users@gem5.org> > wrote:

By adding a PioDevice() to my version of two_level.py configuration script, I 
get this error

 

TypeError: _m5.param_PioDevice.PioDeviceParams: No constructor defined!

And checking io_device.cc the constructor looks empty 

 

Any help please? Thanks

 

Details:

 

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "build/X86/python/m5/main.py", line 455, in main
    exec(filecode, scope)


  File "/home/raghu/gem5/configs/learning_gem5/part1/two_level.py", line 187, 
in <module>
    m5.instantiate()
  File "build/X86/python/m5/simulate.py", line 116, in instantiate
    
  File "build/X86/python/m5/SimObject.py", line 1790, in createCCObject
    self.getCCParams()
  File "build/X86/python/m5/SimObject.py", line 1720, in getCCParams
    cc_params = cc_params_struct()

TypeError: _m5.param_PioDevice.PioDeviceParams: No constructor defined!

 

 

Io_device.cc

include "dev/io_device.hh"

#include "base/trace.hh"
#include "debug/AddrRanges.hh"
#include "sim/system.hh"

namespace gem5
{

PioDevice::PioDevice(const Params &p)
    : ClockedObject(p), sys(p.system), pioPort(this)
{}

PioDevice::~PioDevice()
{
}

 

_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org <mailto:gem5-users@gem5.org> 
To unsubscribe send an email to gem5-users-le...@gem5.org 
<mailto:gem5-users-le...@gem5.org> 
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org

Reply via email to