----- Forwarded Message -----
From: Alex Tomala <[email protected]>
To: Malek Musleh <[email protected]> 
Sent: Saturday, October 12, 2013 7:27:46 PM
Subject: Re: [gem5-users] Arrays in SLICC
 


That is exactly what I need. The only issue I have right now is that I need to 
create a structure that contains an array. I can make the array by using a 
std::vector type in an external C++ file, but I then need to assign each index 
in the array with one of the L1 caches attached to the L2 cache in order for it 
the code to know where to send messages if needed. I don't know how to get this 
done.

In my custom topology I can easily figure out the L1 caches that belong to a L2 
cache so I am thinking that I may able to override the standard initialization 
method (of the L2 cache) with a special one that takes all the L1 caches and 
assigns each L1 cache to a value in the array. I don't know if this will work 
though.

- Alex


________________________________
 From: Malek Musleh <[email protected]>
To: Alex Tomala <[email protected]> 
Sent: Thursday, October 10, 2013 12:03:54 AM
Subject: Re: [gem5-users] Arrays in SLICC
 


Alex,

I am not sure I understand your confusion. 

All of the current external structures are written in C++ and exposed to SLICC 
via that RubySlicc_Types.sm file. You can 

1) declare/define your custom C++ Class, place it either in /ruby/system or 
/ruby/structures
2) Modify the corresponding Sconscript to include your new files
3) Be sure to add MakeInclude(CustomClass) in /ruby/Sconscript
4) modify RubySlicc_Types.sm accordingly
5) Instantiate an instance of your custom class at the top of whichever .sm 
file you want to use it (e.g. see prefetcher 
instantiation of MESI_CMP_directory, or even how L1I/L1D, Sequencers are 
instantiated.

Malek



On Tue, Oct 8, 2013 at 9:41 PM, Alex Tomala <[email protected]> wrote:

I am looking into the method you described but I am just wondering how I can 
add C++ code by defining a structure as external. I don't know where to put the 
C++ file and what else I would also need.
>
>
>- Alex
>
>
>
>On Thursday, October 3, 2013 9:36:31 AM, Alex <[email protected]> wrote:
> 
>Hello,
>
>For my L2 caches I require each cache entry to not only contain the cache 
>state of the L2 cache, but also contain the cache state of the L1 Caches that 
>are connected to it. There tends to be more then one L1 cache so that means I 
>will have to use an array to store the L1 cache states. I want the number of 
>L1 states required to be deteremined by a command line input.
>
>I will take a look into the method you described. 
>
>- Alex
>
>
>Malek Musleh <[email protected]> wrote:
>
>
>
>Alex,
>
>
>It's not clear why your trying to do what your asking. It might be easier to 
>create a new C++ Class (or append some members to an existing C++ Class such 
>as Sequencer/CacheMemory/Prefetcher depending on what your trying to do), and 
>access whatever arrays/data structures you want via function calls from slicc:
>
>
>l1dCacheMemory.getDataStructures(); Sure, there might be some "extra" function 
>call overhead if you do it repeatedly, but its easier than trying to hack in 
>new ways into SLICC.
>
>
>Look at RubySlicc_Types.sm at how the members of external c++ classes are 
>declared.
>
>
>Malek
>
>
>
>On Wed, Oct 2, 2013 at 7:29 PM, Alex Tomala <[email protected]> wrote:
>
>Hello,
>>
>>
>>I am trying to figure out a way to declare an array of an enumerated type, 
>>but I seem to have issues with it. None of the standard C++ methods work, so 
>>I am wondering if they is anyway to make an array with SLICC (or find a way 
>>around it).
>>
>>
>>- Alex
>>_______________________________________________
>>gem5-users mailing list
>>[email protected]
>>http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>
>
>Alex,
>
>It's not clear why your trying to do what your asking. It might be easier
>to create a new C++ Class (or append some members to an existing C++ Class
>such as Sequencer/CacheMemory/Prefetcher depending on what your trying to
>do), and access whatever arrays/data structures you want via function calls
>from slicc:
>
>l1dCacheMemory.getDataStructures(); Sure, there might be some "extra"
>function call overhead if you do it repeatedly, but its easier than trying
>to hack in new ways into SLICC.
>
>Look at RubySlicc_Types.sm at how the members of external c++ classes are
>declared.
>
>Malek
>
>
>On Wed, Oct 2, 2013 at 7:29 PM, Alex Tomala <[email protected]> wrote:
>
>> Hello,
>>
>> I am trying to figure out a way to declare an array of an enumerated type,
>> but I seem to have issues with it.
 None of the standard C++ methods work,
>> so I am wondering if they is anyway to make an array with SLICC (or find a
>> way around it).
>>
>> - Alex
>>
>> _______________________________________________
>> gem5-users mailing list
>> [email protected]
>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>
>
>
>
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to