sim: simulate with multiple threads and event queues
This patch adds support for simulating with multiple threads, each of which operates on an event queue. Each sim object specifies which eventq is would like to be on. A custom barrier implementation is being added using which eventqs synchronize. The patch was tested in two different configurations: 1. ruby_network_test.py: in this simulation L1 cache controllers receive requests from the cpu. The requests are replied to immediately without any communication taking place with any other level. 2. twosys-tsunami-simple-atomic: this configuration simulates a client-server system which are connected by an ethernet link. We still lack the ability to communicate using message buffers or ports. But other things like simulation start and end, synchronizing after every quantum are working. Committed by: Nilay Vaish
This commit is contained in:
parent
8a53da22c2
commit
de366a16f1
@@ -1,4 +1,6 @@
|
||||
# Copyright (c) 2006 The Regents of The University of Michigan
|
||||
# Copyright (c) 2013 Advanced Micro Devices, Inc.
|
||||
# Copyright (c) 2013 Mark D. Hill and David A. Wood
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -29,9 +31,9 @@
|
||||
import m5
|
||||
import internal.event
|
||||
|
||||
from internal.event import PythonEvent, SimLoopExitEvent as SimExit
|
||||
from internal.event import PythonEvent, GlobalSimLoopExitEvent as SimExit
|
||||
|
||||
mainq = internal.event.cvar.mainEventQueue
|
||||
mainq = None
|
||||
|
||||
def create(obj, priority=None):
|
||||
if priority is None:
|
||||
@@ -58,4 +60,10 @@ class ProgressEvent(Event):
|
||||
print "Progress! Time now %fs" % (m5.curTick()/1e12)
|
||||
self.eventq.schedule(self, m5.curTick() + self.period)
|
||||
|
||||
def getEventQueue(index):
|
||||
return internal.event.getEventQueue(index)
|
||||
|
||||
def setEventQueue(eventq):
|
||||
internal.event.curEventQueue(eventq)
|
||||
|
||||
__all__ = [ 'create', 'Event', 'ProgressEvent', 'SimExit', 'mainq' ]
|
||||
|
||||
Reference in New Issue
Block a user