trigger is not recongnized for MSI protocol withRuby in gem5

Viewed 91

I'm trying to implement MSI protocol in gem5 using Ruby SLICC [version SHA: 8e9b03b640e1c2074896d1123fd55fd336c37d6c] following this source. When I run build, it raises exception and terminates operation.

Exception: MSI-dir.sm:124: Error: Unrecognized function name: 'trigger_Event_Addr'

Exception occurs at line 219 of MSI-dir.sm file.

in_port(memQueue_in, MemoryMsg, responseFromMemory) {
        if (memQueue_in.isReady(clockEdge())) {
            peek(memQueue_in, MemoryMsg) {
                if (in_msg.Type == MemoryRequestType:MEMORY_READ) {
                    trigger(Event:MemData, in_msg.addr); //exception raised here
                } else if (in_msg.Type == MemoryRequestType:MEMORY_WB) {
                    trigger(Event:MemAck, in_msg.addr);
                } else {
                    error("Invalid message");
                }
            }
        }
    }

I cloud not find any detail documentation of trigger function. According to gem5 documatation the number of arguments to trigger depend on the machine itself which I presume means variable arguments.Also my implementation of trigger is valid(I assume) as in ./src/mem/ruby/protocol also provides sample protocol file (Garnet_standalone-dir.sm) that has trigger implementation with two argument (trigger(Event:MemData, in_msg.addr);) just like mine. My system do not have dma controller.

Why this exception is being raised ? How cloud I solve this issue?

Note: After hours of surfing through internet , it seems like a lot changed in gem5 since this tutorial was written and it have not been updated. So, any sources on all the changes occurs will be very helpful. Also, any updated gem5 tutorial sources like this would be nice. Most of the links I found are mainly documents.

Thanks you very much. Piece.

2 Answers

I just came into the same problem, and can't find any helpful info on the Internet. However, after I reviewed my code, I found that it's maybe because too few arguments I pass in the trigger, like the actions triggered by the event need tbe and/or cache_entry and you didn't pass it to them.

To add some more information, I think the compiler checks the structures declared within the state machine and looks for a structure with AbstractCacheEntry interface with no main='false' and a structure named exactly TBE. When both structures are found, the trigger takes four arguments, namely trigger(Event, Addr, CacheEntry, TBE).

When none of the two structures are found, the trigger takes two arguments trigger(Event, Addr) and you will need to do whatever lookup within your actions.

Related