> On June 15, 2015, 10:09 p.m., Sooraj Puthoor wrote:
> > src/mem/protocol/MOESI_CMP_token-L2cache.sm, line 160
> > <http://reviews.gem5.org/r/2862/diff/1/?file=45916#file45916line160>
> >
> >     Hello Joel,
> >     Is it necessary to access the DirEntry by "getDirEntry(addr)" funciton 
> > always? Doesn't localDirectory[addr] work anymore?
> >     
> >     I am trying to quantify the number of changes I need to make in slicc 
> > files if I accept this patch in lieu of http://reviews.gem5.org/r/2786/.

I'm not sure if localDirectory[addr] works or not - you could try it. It 
probably fails, since SLICC appears to dereference pointers to AbstractEntry or 
AbstractCacheEntry subtypes (see src/mem/slicc/ast/MethodCallExprAST.py). Note 
that all existing uses of this CacheMemory or DirectoryMemory "operator[]" in 
gem5 require static casts to pointers (e.g. see 
src/mem/protocol/MESI_Three_Level-L0cache.sm). Since all uses currently require 
the static cast, we should probably do away with the automatic dereferencing so 
you could use the "operator[]" as though it returns a pointer.

That said, I'd strongly recommend that you use a function like 
getDirEntry(addr) to be consistent with all the existing protocols in gem5 and 
to slim down the "number of changes" required for merges like this. It's a 
simple, one-time change and can mostly be scripted, so it really doesn't make 
sense to count the number of required changes. Can I recommend using sed? 
Something like the following should be simple:

sed 's/localDirectory\[\(.*\)\]/DirEntry dir_entry := 
getDirEntry(\1);\ndir_entry/' -i filename.sm


- Joel


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviews.gem5.org/r/2862/#review6483
-----------------------------------------------------------


On May 29, 2015, 2:47 p.m., Joel Hestness wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviews.gem5.org/r/2862/
> -----------------------------------------------------------
> 
> (Updated May 29, 2015, 2:47 p.m.)
> 
> 
> Review request for Default.
> 
> 
> Repository: gem5
> 
> 
> Description
> -------
> 
> Changeset 10850:b88527f91254
> ---------------------------
> ruby: Change PerfectCacheMemory::lookup to return pointer
> 
> CacheMemory and DirectoryMemory lookup functions return pointers to entries
> stored in the memory. Bring PerfectCacheMemory in line with this convention,
> and clean up SLICC code generation that was in place solely to handle
> references like that which was returned by PerfectCacheMemory::lookup.
> 
> 
> Diffs
> -----
> 
>   src/mem/protocol/MOESI_CMP_directory-L2cache.sm e61f847e74fd 
>   src/mem/protocol/MOESI_CMP_token-L2cache.sm e61f847e74fd 
>   src/mem/ruby/structures/PerfectCacheMemory.hh e61f847e74fd 
>   src/mem/slicc/ast/MethodCallExprAST.py e61f847e74fd 
> 
> Diff: http://reviews.gem5.org/r/2862/diff/
> 
> 
> Testing
> -------
> 
> Build and run tests with all protocols.
> 
> Please consider this patch in leiu of http://reviews.gem5.org/r/2786/
> 
> 
> Thanks,
> 
> Joel Hestness
> 
>

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

Reply via email to