Just to chime in...

I think the reason a the templated parameter is used there is to give the
compiler a chance to make optimizations on all the different
arrays/structures that get instantiated with Impl::MyValue as well as any
control statements that used the Impl::MyValue in their conditions. For
example, I'd think the compiler could do a better job with "i <
Impl::MyValue" then "i < skidBuffer.size()".

I'd agree that if you are talking about allocating a vector then it
probably doesnt matter if it's done in the constructor or not: either way
spatial locality would be preserved.

But, I think there are some other benefits to providing the templated value
there which is the reason that it's done that way...

-Korey

On Mon, Mar 12, 2012 at 12:01 AM, Brian Grayson <[email protected]>wrote:

> >> It seems to me that there should be no limit on what the width can be
> >> set to. Is there any reason why Impl::MaxWidth is required?
> >It's required to appropriately size the structures that pass instructions
> between stages. It could be done dynamically, but i imagine >that would
> create a rather large performance penalty since data that has lots of
> spacial locality no longer would. I think the change is >good and will
> commit it.
>
> Note that it *could* be done at constructor time, which isn't really all
> that dynamic -- only once per object -- which would preserve the locality
> benefits.  That's how it's been done in other simulator frameworks that
> I've
> used.
>
> > FYI, we have a review board (reviews.gem5.org) that is meant for posting
> and reviewing changes. If you wouldn't mind posting your
> > changes there in the future that makes it easier to comment and track
> patches. See http://www.m5sim.org/Commit_Access for more
> > information about how to post a patch.
>
> Thanks for the info.  I'll use that avenue in the future.
>
> Brian Grayson
>
> _______________________________________________
> gem5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/gem5-dev
>



-- 
- Korey
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to