[Gems-users] how to add a new MachineType


Date: Tue, 15 Sep 2009 15:22:37 +0800
From: "shanshuchang" <shanshuchang@xxxxxxxxx>
Subject: [Gems-users] how to add a new MachineType
Hi all,
 
I would like to add a new MachineType for MOESI_CMP_directory-L1Cache.sm
I tried to add the following codes in ruby/slicc_interface/Ruby_ComponentMapping.h like this(just following the method of MachineType_L1Cache):
 
 
#ifdef MACHINETYPE_L1VictimBuffer
#define MACHINETYPE_VICTIM_ENUM MachineType_L1VictimBuffer
#else
#define MACHINETYPE_VICTIM_ENUM MachineType_NUM
#endif
 
And then I used it in the L1.sm like this:
VictimBuffer L1IVictim, template_hack="<L1Cache_Entry>", constructor_hack='MachineType_L1VictimBuffer,int_to_string(i)+"_L1I"';
VictimBuffer L1DVictim, template_hack="<L1Cache_Entry>", constructor_hack='MachineType_L1VictimBuffer,int_to_string(i)+"_L1D"';  
when I make ruby, there is an error like this:

generated/MOESI_NEW/Chip.C: In constructor `Chip::Chip(NodeID, Network*)':
generated/MOESI_NEW/Chip.C:218: error: `MachineType_L1VictimBuffer' was not declared in this scope
generated/MOESI_NEW/Chip.C:226: error: `MachineType_L1VictimBuffer' was not declared in this scope
make[1]: *** [amd64-linux/generated/MOESI_NEW/obj/Chip.o] Error 1
make[1]: Leaving directory `/export/workspace1/shanshuchang/gems/ruby'
make: *** [all] Error 2
 
However,when I changed the constructor parameter 'MachineType_L1VictimBuffer' to 'MachineType_L1Cache',it managed to pass the make compilation.
 
Is there any additional locations I need to modify so I can manage to add this new MachineType--'MachineType_L1VictimBuffer'?
 
Thanks a lot!
 
 
[← Prev in Thread] Current Thread [Next in Thread→]