[Gems-users] problems when add a victim cache structure in .sm files


Date: Wed, 2 Sep 2009 22:05:25 +0800
From: "shanshuchang" <shanshuchang@xxxxxxxxx>
Subject: [Gems-users] problems when add a victim cache structure in .sm files
Hi all,
I have got some problems when I tried to add a new victim cache for the MOESI_CMP_directory protocol.
Firstly, using CacheMemory as a example,I write a new class VictimCache.h and placed it at $GEMS_ROOT/ruby/system folder just like CacheMemory.h.
 
Then, I tried to add the VictimCache as a external type like this:   
  external_type(VictimCache) {
    //some function like CacheMemory
  } ;
 
VictimCache L1DVictim,template_hack="<L1Victim_Entry>", constructor_hack='L1_CACHE_ASSOC,MachineType_L1Cache,int_to_string(i)+"_L1D"',abstract_chip_ptr="true";
 
Then I tried to compiled it and the errors found here:
generated/MOESI_NEW/Chip.C: In constructor `Chip::Chip(NodeID, Network*)':
generated/MOESI_NEW/Chip.C:216: error: `m_L1Cache_L1DVictim_vec' was not declared in this scope
generated/MOESI_NEW/Chip.C:218: error: `L1Victim_Entry' was not declared in this scope
generated/MOESI_NEW/Chip.C:218: error: template argument 1 is invalid
generated/MOESI_NEW/Chip.C:224: error: `m_L1Cache_L1IVictim_vec' was not declared in this scope
generated/MOESI_NEW/Chip.C:226: error: `L1Victim_Entry' was not declared in this scope
generated/MOESI_NEW/Chip.C:226: error: template argument 1 is invalid
generated/MOESI_NEW/Chip.C: In destructor `virtual Chip::~Chip()':
generated/MOESI_NEW/Chip.C:369: error: `m_L1Cache_L1DVictim_vec' was not declared in this scope
generated/MOESI_NEW/Chip.C:372: error: `m_L1Cache_L1IVictim_vec' was not declared in this scope
generated/MOESI_NEW/Chip.C: In member function `virtual void Chip::printConfig(std::ostream&)':
generated/MOESI_NEW/Chip.C:435: error: `m_L1Cache_L1DVictim_vec' was not declared in this scope
generated/MOESI_NEW/Chip.C:437: error: `m_L1Cache_L1IVictim_vec' was not declared in this scope
make[1]: *** [amd64-linux/generated/MOESI_NEW/obj/Chip.o] Error 1
make[1]: Leaving directory `/export/workspace/shanshuchang/gems/ruby'
make: *** [all] Error 2
 
It is said that I should remove the words--abstract_chip_ptr="true" or include the definition  to ruby/slicc_interface/AbstractChip.h
I followed them both and maked it again and again, still some errors exists:
 
(1)Modified Like this:
 In .sm file: VictimCache L1DVictim,template_hack="<L1Victim_Entry>", constructor_hack='L1_CACHE_ASSOC,MachineType_L1Cache,int_to_string(i)+"_L1D"';)
n file included from generated/MOESI_NEW/Chip.C:3:
generated/MOESI_NEW/Chip.h:69: error: `L1Victim_Entry' was not declared in this scope
generated/MOESI_NEW/Chip.h:69: error: template argument 1 is invalid
generated/MOESI_NEW/Chip.h:69: error: template argument 1 is invalid
generated/MOESI_NEW/Chip.h:69: error: ISO C++ forbids declaration of `m_L1Cache_L1DVictim_vec' with no type
generated/MOESI_NEW/Chip.h:70: error: `L1Victim_Entry' was not declared in this scope
generated/MOESI_NEW/Chip.h:70: error: template argument 1 is invalid
generated/MOESI_NEW/Chip.h:70: error: template argument 1 is invalid
generated/MOESI_NEW/Chip.h:70: error: ISO C++ forbids declaration of `m_L1Cache_L1IVictim_vec' with no type
generated/MOESI_NEW/Chip.C: In constructor `Chip::Chip(NodeID, Network*)':
generated/MOESI_NEW/Chip.C:216: error: request for member `setSize' in `((Chip*)this)->Chip::m_L1Cache_L1DVictim_vec', which is of non-class type `int'
generated/MOESI_NEW/Chip.C:218: error: invalid types `int[int]' for array subscript
generated/MOESI_NEW/Chip.C:218: error: `L1Victim_Entry' was not declared in this scope
generated/MOESI_NEW/Chip.C:218: error: template argument 1 is invalid
generated/MOESI_NEW/Chip.C:220: error: invalid types `int[int]' for array subscript
generated/MOESI_NEW/Chip.C:224: error: request for member `setSize' in `((Chip*)this)->Chip::m_L1Cache_L1IVictim_vec', which is of non-class type `int'
generated/MOESI_NEW/Chip.C:226: error: invalid types `int[int]' for array subscript
generated/MOESI_NEW/Chip.C:226: error: `L1Victim_Entry' was not declared in this scope
generated/MOESI_NEW/Chip.C:226: error: template argument 1 is invalid
generated/MOESI_NEW/Chip.C:228: error: invalid types `int[int]' for array subscript
generated/MOESI_NEW/Chip.C: In destructor `virtual Chip::~Chip()':
generated/MOESI_NEW/Chip.C:369: error: invalid types `int[int]' for array subscript
generated/MOESI_NEW/Chip.C:372: error: invalid types `int[int]' for array subscript
generated/MOESI_NEW/Chip.C: In member function `virtual void Chip::printConfig(std::ostream&)':
generated/MOESI_NEW/Chip.C:435: error: invalid types `int[int]' for array subscript
generated/MOESI_NEW/Chip.C:437: error: invalid types `int[int]' for array subscript
make[1]: *** [amd64-linux/generated/MOESI_NEW/obj/Chip.o] Error 1
make[1]: Leaving directory `/export/workspace/shanshuchang/gems/ruby'
make: *** [all] Error 2
 
(2)I also tried to add codes to AbstractChip.h to include head file L1Victim_Entry.h (just like L1Cache_Entry) and add some definition code of m_L1Cache_L1DVictim_vec
However, the make errors sounds like that can't generate L1Victim_Entry.h.
 
 
There may be some GEMS experts here who has already did some work similar to me and any help will be appreciated.
[← Prev in Thread] Current Thread [Next in Thread→]
  • [Gems-users] problems when add a victim cache structure in .sm files, shanshuchang <=