Hi Hao, Answers inline. On Dec 9, 2016, at 3:13 PM, Hao Zheng <haozh...@gwmail.gwu.edu<mailto:haozh...@gwmail.gwu.edu>> wrote:
Dear Prof. Tushar Krishna, I have a question about how to add component in garnet 2.0. As we known, the garnet is event driven simulator, and it would schedule the event and execute it by time sequence. I'm trying to add a component in the network to bypass the flit which is going to the router. As I observed, Both of Inputunit and NetworkInterface have its own consumer, and they are consuming the flits from the NetworkLink. Hence, I am going to add that component to consume the flit which is supposed to be consumed by the Inputunit. I added that component in the garnet, but it cannot be waken by the consumer. I'm really confused by how to wake up them in right sequence in the garnet because it seems that each component is going to be waken by the consumer. I’m not entirely sure what you want to do but I think you are getting confused by what it means to be a consumer. Both InputUnit and NetworkInterface inherit from the “Consumer" class - this simply means that they can be added into the event queue by somebody. The event queue calls the wakeup() function inside every consumer that cycle. I didn’t understand what you mean by bypass the flit going to the router. Currently this is the sequence of steps: NetworkInterface -> NetworkLink -> Router -> NetworkLink -> Router -> NetworkLink -> … Router -> NetworkLink -> NetworkInterface. The Router object internally calls the wakeup function of the InputUnits without putting the InputUnit in the event queue. Every producer has a queue that the consumer consumes. This is setup when the network is created in GarnetNetwork.cc<http://garnetnetwork.cc> See the makeInternalLink, makeExtInLink() .. etc functions ... If you want the flit to go to some new unit instead of the router, then you will need to create a new class like Router, that inherits from Consumer. The NetworkLink class during its setup is currently setting its consumer to be a router. You can set it to be your new module. OR I would suggest an easier solution might be to add your component inside the Router class. And then update the Router::wakeup() function to call that instead of the InputUnit … Then you don’t need to worry about adding new things into the event queue. Another concern is what the difference between scheduleEvent and scheduleEventAbsolute? Are they used to set up to wakeup its own consumer after several cycles later? scheduleEvent uses relative time. E.g., scheduleEvent(Cycles(x)) will call wakeup x cycles later. scheduleEventAbsolute uses absolute time. E.g., scheduleEvent(Cycles(x)) will call wakeup at absolute time x. Your helps would be appreciated in advance! Best regards, Hao Cheers, Tushar
_______________________________________________ gem5-users mailing list gem5-users@gem5.org http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users