'trigger is not recongnized for MSI protocol withRuby in gem5

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.



Solution 1:[1]

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.

Solution 2:[2]

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.

Solution 3:[3]

I would guess 1) that you are trying to deploy on Streamlit Cloud and 2) that you are running into an issue with relative paths as described in this forum post:

https://discuss.streamlit.io/t/issues-with-reading-in-dataset-filenotfounderror/12414/2?u=randyzwitch

The issue is resolved by using pathlib, as described by the user:

from pathlib import Path

garret_burhenn_pitches_csv = Path(__file__).parents[1] / 'GarretBurhennData/Garret_Burhenn_Pitches.csv'

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 zfzf
Solution 2 Ng Allen
Solution 3 Randy Zwitch