> On 2011-05-28 09:20:00, Ali Saidi wrote:
> > src/python/m5/proxy.py, line 187
> > <http://reviews.m5sim.org/r/720/diff/1/?file=12675#file12675line187>
> >
> >     Parent.all would find every object above you in the hierarchy that 
> > matched, although I've never tried it. I only use self.all..
> >     
> >     I can add a description for those two. Will you add one for the rest of 
> > the proxy objets? :)

After looking at BaseProxy.unproxy(), I'm pretty sure Parent.all will not work, 
since the base algorithm quits as soon as it sees a find() method return True.  
I don't think that's a huge problem, but it would be good to find a way to 
return an error on Parent.all instead of letting people find out the hard way 
that it doesn't work.


> On 2011-05-28 09:20:00, Ali Saidi wrote:
> > src/python/m5/params.py, line 187
> > <http://reviews.m5sim.org/r/720/diff/1/?file=12674#file12674line187>
> >
> >     The all proxy object is going to return an array which in then going to 
> > get turned into [[all,objects,that,match]]. we don't want this.

I understand why this code is necessary, but that doesn't mean I like it ;-).  
It seems like an arbitrary hack that could possibly turn around and bite us at 
some point.

Basically the current code assumes that a proxied VectorParam is a vector of 
scalar proxies, not a single proxy object that's going to return a vector of 
things.  This code assumes that if the first element of the unproxied vector is 
a vector, then you really want that and not the original vector.  Seems a 
little broad to me.  How about something like:

if len(self) == 1 and isinstance(self[0], AllProxy):
    return self[0].unproxy(base)
else:
    return [v.unproxy(base) for v in self]


- Steve


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviews.m5sim.org/r/720/#review1269
-----------------------------------------------------------


On 2011-05-26 19:17:18, Ali Saidi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviews.m5sim.org/r/720/
> -----------------------------------------------------------
> 
> (Updated 2011-05-26 19:17:18)
> 
> 
> Review request for Default, Ali Saidi, Gabe Black, Steve Reinhardt, and 
> Nathan Binkert.
> 
> 
> Summary
> -------
> 
> Config: Add support for a Self.all proxy object
> 
> 
> Diffs
> -----
> 
>   src/python/m5/SimObject.py 3f37cc5d25bc 
>   src/python/m5/params.py 3f37cc5d25bc 
>   src/python/m5/proxy.py 3f37cc5d25bc 
>   src/sim/System.py 3f37cc5d25bc 
> 
> Diff: http://reviews.m5sim.org/r/720/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Ali
> 
>

_______________________________________________
gem5-dev mailing list
gem5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to