// To this node's L0 cache FROM the network
MessageBuffer * bufferFromL1, network="From";
-{
- // Message queue between this controller and the processor
- MessageBuffer mandatoryQueue;
+ // Message queue between this controller and the processor
+ MessageBuffer * mandatoryQueue;
+{
// STATES
state_declaration(State, desc="Cache states", default="L0Cache_State_I") {
// Base states
// a L2 bank -> this L1
MessageBuffer * responseToL1Cache, network="From", virtual_network="1",
vnet_type="response";
-{
+
// Request Buffer for prefetches
- MessageBuffer optionalQueue;
+ MessageBuffer * optionalQueue;
+ // Buffer for requests generated by the processor core.
+ MessageBuffer * mandatoryQueue;
+{
// STATES
state_declaration(State, desc="Cache states", default="L1Cache_State_I") {
// Base states
TBETable TBEs, template="<L1Cache_TBE>", constructor="m_number_of_TBEs";
- MessageBuffer mandatoryQueue;
-
int l2_select_low_bit, default="RubySystem::getBlockSizeBits()";
void set_cache_entry(AbstractCacheEntry a);
vnet_type="response";
MessageBuffer * responseFromDir, network="To", virtual_network="1",
vnet_type="response";
+
+ MessageBuffer * responseFromMemory;
{
// STATES
state_declaration(State, desc="Directory states", default="Directory_State_I") {
(type == CoherenceRequestType:GETX);
}
- MessageBuffer responseFromMemory;
-
// ** OUT_PORTS **
out_port(responseNetwork_out, ResponseMsg, responseFromDir);
vnet_type="response";
MessageBuffer * requestToDir, network="To", virtual_network="0",
vnet_type="request";
+ MessageBuffer * mandatoryQueue;
{
state_declaration(State, desc="DMA states", default="DMA_State_READY") {
READY, AccessPermission:Invalid, desc="Ready to accept a new request";
Ack, desc="DMA write to memory completed";
}
- MessageBuffer mandatoryQueue;
State cur_state;
State getState(Addr addr) {
vnet_type="forward";
MessageBuffer * responseToCache, network="From", virtual_network="4",
vnet_type="response";
+
+ MessageBuffer * mandatoryQueue;
{
// STATES
state_declaration(State, desc="Cache states") {
}
// STRUCTURE DEFINITIONS
-
- MessageBuffer mandatoryQueue;
-
// CacheEntry
structure(Entry, desc="...", interface="AbstractCacheEntry") {
State CacheState, desc="cache state";
vnet_type="request";
MessageBuffer * dmaRequestToDir, network="From", virtual_network="0",
vnet_type="request";
+ MessageBuffer * responseFromMemory;
{
// STATES
state_declaration(State, desc="Directory states", default="Directory_State_I") {
return num_functional_writes;
}
- MessageBuffer responseFromMemory;
-
// ** OUT_PORTS **
out_port(forwardNetwork_out, RequestMsg, forwardFromDir);
out_port(responseNetwork_out, ResponseMsg, responseFromDir);
vnet_type="response";
MessageBuffer * requestToDir, network="To", virtual_network="0",
vnet_type="request";
+ MessageBuffer * mandatoryQueue;
{
state_declaration(State, desc="DMA states", default="DMA_State_READY") {
READY, AccessPermission:Invalid, desc="Ready to accept a new request";
Ack, desc="DMA write to memory completed";
}
- MessageBuffer mandatoryQueue;
State cur_state;
State getState(Addr addr) {
return cur_state;
}
+
void setState(Addr addr, State state) {
- cur_state := state;
+ cur_state := state;
}
AccessPermission getAccessPermission(Addr addr) {
// a L2 bank -> this L1
MessageBuffer * responseToL1Cache, network="From", virtual_network="2",
vnet_type="response";
+
+ MessageBuffer * triggerQueue;
+
+ MessageBuffer * mandatoryQueue;
{
// STATES
state_declaration(State, desc="Cache states", default="L1Cache_State_I") {
void set_tbe(TBE b);
void unset_tbe();
- MessageBuffer mandatoryQueue, abstract_chip_ptr="true";
-
TBETable TBEs, template="<L1Cache_TBE>", constructor="m_number_of_TBEs";
TimerTable useTimerTable;
int l2_select_low_bit, default="RubySystem::getBlockSizeBits()";
}
}
- MessageBuffer triggerQueue;
-
// ** OUT_PORTS **
out_port(requestNetwork_out, RequestMsg, requestFromL1Cache);
MessageBuffer * responseToL2Cache, network="From", virtual_network="2",
vnet_type="response"; // a local L1 || mod-directory -> this L2 bank
+ MessageBuffer * triggerQueue;
{
// STATES
state_declaration(State, desc="L2 Cache states", default="L2Cache_State_I") {
return num_functional_writes;
}
- MessageBuffer triggerQueue;
-
out_port(globalRequestNetwork_out, RequestMsg, GlobalRequestFromL2Cache);
out_port(localRequestNetwork_out, RequestMsg, L1RequestFromL2Cache);
out_port(responseNetwork_out, ResponseMsg, responseFromL2Cache);
MessageBuffer * responseFromDir, network="To", virtual_network="2",
vnet_type="response"; // Dir -> mod-L2 bank
+ MessageBuffer * responseFromMemory;
{
// STATES
state_declaration(State, desc="Directory states", default="Directory_State_I") {
return false;
}
- MessageBuffer responseFromMemory;
-
// ** OUT_PORTS **
out_port(forwardNetwork_out, RequestMsg, forwardFromDir);
out_port(responseNetwork_out, ResponseMsg, responseFromDir);
MessageBuffer * respToDir, network="To", virtual_network="2",
vnet_type="dmaresponse";
+ MessageBuffer * mandatoryQueue;
+ MessageBuffer * triggerQueue;
{
state_declaration(State, desc="DMA states", default="DMA_State_READY") {
READY, AccessPermission:Invalid, desc="Ready to accept a new request";
bool isPresent(Addr);
}
- MessageBuffer mandatoryQueue;
- MessageBuffer triggerQueue;
TBETable TBEs, template="<DMA_TBE>", constructor="m_number_of_TBEs";
State cur_state;
MessageBuffer * requestFromL1Cache, network="To", virtual_network="1",
vnet_type="request";
-
// To this node's L1 cache FROM the network
// a L2 bank -> this L1
MessageBuffer * requestToL1Cache, network="From", virtual_network="1",
vnet_type="request";
+ MessageBuffer * mandatoryQueue;
{
// STATES
state_declaration(State, desc="Cache states", default="L1Cache_State_I") {
TBETable L1_TBEs, template="<L1Cache_TBE>", constructor="m_number_of_TBEs";
- MessageBuffer mandatoryQueue, abstract_chip_ptr="true";
-
bool starving, default="false";
int l2_select_low_bit, default="RubySystem::getBlockSizeBits()";
MessageBuffer * dmaRequestToDir, network="From", virtual_network="0",
vnet_type="request";
+ MessageBuffer * responseFromMemory;
{
// STATES
state_declaration(State, desc="Directory states", default="Directory_State_O") {
return num_functional_writes;
}
- MessageBuffer responseFromMemory;
-
// ** OUT_PORTS **
out_port(responseNetwork_out, ResponseMsg, responseFromDir);
out_port(persistentNetwork_out, PersistentMsg, persistentFromDir);
MessageBuffer * reqToDirectory, network="To", virtual_network="0",
vnet_type="request";
+ MessageBuffer * mandatoryQueue;
{
state_declaration(State, desc="DMA states", default="DMA_State_READY") {
READY, AccessPermission:Invalid, desc="Ready to accept a new request";
Ack, desc="DMA write to memory completed";
}
- MessageBuffer mandatoryQueue;
State cur_state;
State getState(Addr addr) {
return cur_state;
}
+
void setState(Addr addr, State state) {
- cur_state := state;
+ cur_state := state;
}
AccessPermission getAccessPermission(Addr addr) {
vnet_type="forward";
MessageBuffer * responseToCache, network="From", virtual_network="4",
vnet_type="response";
+
+ MessageBuffer * mandatoryQueue;
+
+ MessageBuffer * triggerQueue;
{
// STATES
state_declaration(State, desc="Cache states", default="L1Cache_State_I") {
Block_Ack, desc="the directory is blocked and ready for the flush";
}
- // TYPES
-
// STRUCTURE DEFINITIONS
-
- MessageBuffer mandatoryQueue;
-
// CacheEntry
structure(Entry, desc="...", interface="AbstractCacheEntry") {
State CacheState, desc="cache state";
return cache_entry.AtomicAccessed;
}
- MessageBuffer triggerQueue;
-
// ** OUT_PORTS **
-
out_port(requestNetwork_out, RequestMsg, requestFromCache);
out_port(responseNetwork_out, ResponseMsg, responseFromCache);
out_port(unblockNetwork_out, ResponseMsg, unblockFromCache);
MessageBuffer * dmaRequestToDir, network="From", virtual_network="0",
vnet_type="request";
+
+ MessageBuffer * triggerQueue;
+ MessageBuffer * responseFromMemory;
{
// STATES
state_declaration(State, desc="Directory states", default="Directory_State_E") {
}
}
- MessageBuffer triggerQueue;
- MessageBuffer responseFromMemory;
-
// ** OUT_PORTS **
out_port(requestQueue_out, ResponseMsg, requestToDir); // For recycling requests
out_port(forwardNetwork_out, RequestMsg, forwardFromDir);
vnet_type="response";
MessageBuffer * requestToDir, network="To", virtual_network="0",
vnet_type="request";
+ MessageBuffer * mandatoryQueue;
{
state_declaration(State, desc="DMA states", default="DMA_State_READY") {
READY, AccessPermission:Invalid, desc="Ready to accept a new request";
Ack, desc="DMA write to memory completed";
}
- MessageBuffer mandatoryQueue;
State cur_state;
State getState(Addr addr) {
vnet_type = "forward";
MessageBuffer * responseFromCache, network="To", virtual_network="2",
vnet_type = "response";
+
+ MessageBuffer * mandatoryQueue;
{
// STATES
state_declaration(State, desc="Cache states", default="L1Cache_State_I") {
}
// STRUCTURE DEFINITIONS
-
- MessageBuffer mandatoryQueue;
DataBlock dummyData;
-
// CacheEntry
structure(Entry, desc="...", interface="AbstractCacheEntry") {
State CacheState, desc="cache state";
"Sequencer": "RubySequencer",
"DirectoryMemory": "RubyDirectoryMemory",
"MemoryControl": "MemoryControl",
+ "MessageBuffer": "MessageBuffer",
"DMASequencer": "DMASequencer",
"Prefetcher":"Prefetcher",
"Cycles":"Cycles",
if param.rvalue is not None:
dflt_str = str(param.rvalue.inline()) + ', '
- if param.type_ast.type.c_ident == "MessageBuffer":
- # The MessageBuffer MUST be instantiated in the protocol config
- code('${{param.ident}} = Param.MessageBuffer("")')
-
- elif python_class_map.has_key(param.type_ast.type.c_ident):
+ if python_class_map.has_key(param.type_ast.type.c_ident):
python_type = python_class_map[param.type_ast.type.c_ident]
code('${{param.ident}} = Param.${{python_type}}(${dflt_str}"")')
"type: '%s'. Please update the python_class_map " \
"in StateMachine.py", param.type_ast.type.c_ident)
- # Also add any MessageBuffers declared internally to the controller
- # Note: This includes mandatory and memory queues
- for var in self.objects:
- if var.type.c_ident == "MessageBuffer":
- code('${{var.ident}} = Param.MessageBuffer("")')
-
code.dedent()
code.write(path, '%s.py' % py_ident)
static int getNumControllers();
void init();
- MessageBuffer* getMandatoryQueue() const;
- MessageBuffer* getMemoryQueue() const;
+ MessageBuffer *getMandatoryQueue() const;
+ MessageBuffer *getMemoryQueue() const;
void initNetQueues();
void print(std::ostream& out) const;
if re.compile("sequencer").search(param.ident):
code('m_${{param.ident}}_ptr->setController(this);')
- for var in self.objects:
- # Some MessageBuffers (e.g. mandatory and memory queues) are
- # instantiated internally to StateMachines but exposed to
- # components outside SLICC, so make sure to set up this
- # controller as their receivers
- if var.type.c_ident == "MessageBuffer":
- code('''
-m_${{var.ident}}_ptr = p->${{var.ident}};
-m_${{var.ident}}_ptr->setReceiver(this);
-''')
-
code('''
for (int state = 0; state < ${ident}_State_NUM; state++) {
vnet_dir_set = set()
for var in self.config_parameters:
+ vid = "m_%s_ptr" % var.ident
if "network" in var:
vtype = var.type_ast.type
- vid = "m_%s_ptr" % var.ident
-
code('assert($vid != NULL);')
# Network port object
if "rank" in var:
code('$vid->setPriority(${{var["rank"]}})')
+ else:
+ if var.type_ast.type.c_ident == "MessageBuffer":
+ code('$vid->setReceiver(this);')
+ if var.ident.find("triggerQueue") >= 0:
+ code('$vid->setSender(this);')
+ elif var.ident.find("optionalQueue") >= 0:
+ code('$vid->setSender(this);')
+
code.dedent()
code('''
}
code('(*$vid) = ${{var["default"]}};')
else:
# Normal Object
- if var.type.c_ident != "MessageBuffer":
- th = var.get("template", "")
- expr = "%s = new %s%s" % (vid, vtype.c_ident, th)
- args = ""
- if "non_obj" not in vtype and not vtype.isEnumeration:
- args = var.get("constructor", "")
- code('$expr($args);')
+ th = var.get("template", "")
+ expr = "%s = new %s%s" % (vid, vtype.c_ident, th)
+ args = ""
+ if "non_obj" not in vtype and not vtype.isEnumeration:
+ args = var.get("constructor", "")
+ code('$expr($args);')
code('assert($vid != NULL);')
if "default" in var:
comment = "Type %s default" % vtype.ident
code('*$vid = ${{vtype["default"]}}; // $comment')
- # Set Priority
- if vtype.isBuffer and "rank" in var:
- code('$vid->setPriority(${{var["rank"]}});')
-
- # Set sender and receiver for trigger queue
- if var.ident.find("triggerQueue") >= 0:
- code('$vid->setSender(this);')
- code('$vid->setReceiver(this);')
- elif vtype.c_ident == "TimerTable":
+ if vtype.c_ident == "TimerTable":
code('$vid->setClockObj(this);')
- elif var.ident.find("optionalQueue") >= 0:
- code('$vid->setSender(this);')
- code('$vid->setReceiver(this);')
# Set the prefetchers
code()