Re: [Gems-users] some problems about writing SLICC


Date: Tue, 18 Aug 2009 12:25:07 -0500
From: Xuehai Qian <xqian2@xxxxxxxxxxxx>
Subject: Re: [Gems-users] some problems about writing SLICC

On Aug 18, 2009, at 9:30 AM, shanshuchang wrote:

Hi all,
I am trying to add a new field in structure Entry which is defined in MOESI_CMP_directory-L1cache.sm: 

    structure(Entry, desc="...", interface="AbstractCacheEntry") {
        State CacheState,        desc="cache state";
        bool Dirty,              desc="Is the data dirty (different than memory)?";
        DataBlock DataBlk,       desc="data for the block";
    
      // added 
        NodeID m_id,             desc="the processor related to the L1 cache";
        
int numofprocessors,      desc="the number of processors in the chip";
     
       }

(1)Can the NodeID be implicitly used in SLICC ? That is, can I directly use NodeID as a parameter in structure Entry? If not ,should I use MachineID as a parameter and then use function NodeID L1CacheMachIDToProcessorNum(MachineID machID) to convert it when needed?

I believe you have to include the type somewhere in the set of .sm files. Search for "set", and see how it is implemented.
 
(2)The NodeID is defined to be of type 'int'(ruby/system/NodeID.h),but when I use it as int in a comparator like this:
 
    NodeID id;
    id < 5; 
 
When I try to compiled the L1cache.sm, there are errors:

    ../protocols/MOESI_CMP_directory-L1cache.sm:282: Error: Type mismatch: left operand of operator '<=' expects input type 'int', actual was NodeID'
    make[1]: *** [generated/MOESI_CMP_directory/generated] Error 1
    make[1]: Leaving directory `/export/workspace/shanshuchang/gems/ruby'
How can I use NodeID as a 'int' type?

When you include the type correctly, the error doesn't occur.
 
(3) How can I get the number of processors in slicc?

I believe there is no way to directly read the number. But it should be a global parameter, you can just write a function in some module (i.e. sequencer) to return that number and call it from you .sm file. Don't forget to include that function in the .sm file.


I am sorry for so much questions, but I want to step forward for my work...
Any help will be appreciated!
_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/gems-users
Use Google to search the GEMS Users mailing list by adding "site:https://lists.cs.wisc.edu/archive/gems-users/" to your search.


[← Prev in Thread] Current Thread [Next in Thread→]