Re: [Gems-users] Ruby - slicc question


Date: Wed, 29 Nov 2006 13:23:45 -0600 (CST)
From: Mike Marty <mikem@xxxxxxxxxxx>
Subject: Re: [Gems-users] Ruby - slicc question
I would probably just add another "hack" variable to SLICC.  Thus you
could do something like:

CacheMemory NUCAcacheMemory, template_hack="<L2Cache_Entry>",
constructor_hack='L2_CACHE_NUM_SETS_BITS,L2_CACHE_ASSOC,MachineType_L2Cache,int_to_string(i)',
abstract_chip_ptr="true", my_new_hack="yes";

Then in $GEMS/slicc/symbols/SymbolTable.C where the Chip.C code is
generated, just check for the existence of your new variable pair by
doing:

if (var->existPair("my_new_hack")) {

  // MY SPECIAL CODE
}

--Mike


>
> I am trying to modify the following lines:
>
>  In protocols/MOESI_CMP_NUCA-L2cache.sm
>
>
>  CacheMemory NUCAcacheMemory, template_hack="<L2Cache_Entry>",
> constructor_hack='L2_CACHE_NUM_SETS_BITS,L2_CACHE_ASSOC,MachineType_L2Cache,int_to_string(i)',
> abstract_chip_ptr="true";
>
> So that in generated/MOESI_CMP_NUCA/Chip.C, instead of:
>  m_L2Cache_NUCAcacheMemory_vec.setSize(RubyConfig::numberOfL2CachePerChip(m_id));
>   for (int i = 0; i < RubyConfig::numberOfL2CachePerChip(m_id); i++)  {
>   *  m_L2Cache_NUCAcacheMemory_vec[i] = new CacheMemory<L2Cache_Entry>(this,
> *L2_CACHE_NUM_SETS_BITS,L2_CACHE_ASSOC,MachineType_L2Cache,int_to_string(i));
>     assert(m_L2Cache_NUCAcacheMemory_vec[i] != NULL);
>
> The third line would match the declaration
> of  m_L2Cache_NUCAcacheMemory_vec. I have modified the declaration
> from Vector < CacheMemory<L2Cache_Entry>* > m_L2Cache_NUCAcacheMemory_vec;
>  to *Vector < Vector < CacheMemory<L2Cache_Entry> >* >
> m_L2Cache_NUCAcacheMemory_vec;
> *
> But I haven't been able to modify the MOESI_CMP_NUCA-L2cache.sm to get the
> correct structure in Chip.C. Any kind of help is appreciated.
>
> Thanks a lot,
> Mishali
> Undergraduate Student, UCLA
>
[← Prev in Thread] Current Thread [Next in Thread→]