bool isPresent(Address);
}
- TBETable L1_TBEs, template="<L1Cache_TBE>";
+ TBETable L1_TBEs, template="<L1Cache_TBE>", constructor="m_number_of_TBEs";
MessageBuffer mandatoryQueue, ordered="false";
bool isPresent(Address);
}
- TBETable L2_TBEs, template="<L2Cache_TBE>";
+ TBETable L2_TBEs, template="<L2Cache_TBE>", constructor="m_number_of_TBEs";
void set_cache_entry(AbstractCacheEntry a);
void unset_cache_entry();
// ** OBJECTS **
- TBETable TBEs, template="<Directory_TBE>";
+ TBETable TBEs, template="<Directory_TBE>", constructor="m_number_of_TBEs";
void set_tbe(TBE tbe);
void unset_tbe();
// STRUCTURES
- TBETable TBEs, template="<L1Cache_TBE>";
+ TBETable TBEs, template="<L1Cache_TBE>", constructor="m_number_of_TBEs";
// PROTOTYPES
void set_cache_entry(AbstractCacheEntry a);
}
// ** OBJECTS **
- TBETable TBEs, template="<Directory_TBE>";
+ TBETable TBEs, template="<Directory_TBE>", constructor="m_number_of_TBEs";
void set_tbe(TBE b);
void unset_tbe();
MessageBuffer mandatoryQueue, ordered="false", abstract_chip_ptr="true";
- TBETable TBEs, template="<L1Cache_TBE>";
+ TBETable TBEs, template="<L1Cache_TBE>", constructor="m_number_of_TBEs";
TimerTable useTimerTable;
int l2_select_low_bit, default="RubySystem::getBlockSizeBits()";
bool isTagPresent(Address);
}
-
- TBETable TBEs, template="<L2Cache_TBE>";
+ TBETable TBEs, template="<L2Cache_TBE>", constructor="m_number_of_TBEs";
PerfectCacheMemory localDirectory, template="<L2Cache_DirEntry>";
void set_cache_entry(AbstractCacheEntry b);
-
/*
* Copyright (c) 1999-2005 Mark D. Hill and David A. Wood
* All rights reserved.
}
// ** OBJECTS **
- TBETable TBEs, template="<Directory_TBE>";
+ TBETable TBEs, template="<Directory_TBE>", constructor="m_number_of_TBEs";
void set_tbe(TBE b);
void unset_tbe();
MessageBuffer mandatoryQueue, ordered="false";
MessageBuffer triggerQueue, ordered="true";
- TBETable TBEs, template="<DMA_TBE>";
+ TBETable TBEs, template="<DMA_TBE>", constructor="m_number_of_TBEs";
State cur_state;
void set_tbe(TBE b);
void wakeUpAllBuffers();
void wakeUpBuffers(Address a);
- TBETable L1_TBEs, template="<L1Cache_TBE>";
+ TBETable L1_TBEs, template="<L1Cache_TBE>", constructor="m_number_of_TBEs";
MessageBuffer mandatoryQueue, ordered="false", abstract_chip_ptr="true";
PersistentTable persistentTable;
TimerTable reissueTimerTable;
- TBETable TBEs, template="<Directory_TBE>";
+ TBETable TBEs, template="<Directory_TBE>", constructor="m_number_of_TBEs";
bool starving, default="false";
int l2_select_low_bit, default="RubySystem::getBlockSizeBits()";
bool isPresent(Address);
}
- TBETable TBEs, template="<L1Cache_TBE>";
+ TBETable TBEs, template="<L1Cache_TBE>", constructor="m_number_of_TBEs";
void set_cache_entry(AbstractCacheEntry b);
void unset_cache_entry();
Set fwd_set;
- TBETable TBEs, template="<Directory_TBE>";
+ TBETable TBEs, template="<Directory_TBE>", constructor="m_number_of_TBEs";
Entry getDirectoryEntry(Address addr), return_by_pointer="yes" {
Entry dir_entry := static_cast(Entry, "pointer", directory[addr]);
DataBlock DataBlk, desc="Data in the block";
}
- // TBE fields
- structure(TBE, desc="...") {
- State TBEState, desc="Transient state";
- DataBlock DataBlk, desc="data for the block, required for concurrent writebacks";
- }
-
- structure(TBETable, external="yes") {
- TBE lookup(Address);
- void allocate(Address);
- void deallocate(Address);
- bool isPresent(Address);
- }
-
-
- // STRUCTURES
-
- TBETable TBEs, template="<L1Cache_TBE>";
-
-
// FUNCTIONS
// cpu/testers/networktest/networktest.cc generates packets of the type
}
- State getState(TBE tbe, Entry cache_entry, Address addr) {
+ State getState(Entry cache_entry, Address addr) {
return State:I;
}
- void setState(TBE tbe, Entry cache_entry, Address addr, State state) {
+ void setState(Entry cache_entry, Address addr, State state) {
}
if (mandatoryQueue_in.isReady()) {
peek(mandatoryQueue_in, RubyRequest) {
trigger(mandatory_request_type_to_event(in_msg.Type),
- in_msg.LineAddress,
- getCacheEntry(in_msg.LineAddress),
- TBEs[in_msg.LineAddress]);
+ in_msg.LineAddress, getCacheEntry(in_msg.LineAddress));
}
}
}
external_type(int, primitive="yes", default="0");
external_type(bool, primitive="yes", default="false");
external_type(std::string, primitive="yes");
+external_type(uint32_t, primitive="yes");
external_type(uint64, primitive="yes");
external_type(Time, primitive="yes", default="0");
external_type(PacketPtr, primitive="yes");
AbstractController::AbstractController(const Params *p)
: SimObject(p), Consumer(this)
{
- p->ruby_system->registerAbstractController(this);
+ m_version = p->version;
+ m_transitions_per_cycle = p->transitions_per_cycle;
+ m_buffer_size = p->buffer_size;
+ m_recycle_latency = p->recycle_latency;
+ m_number_of_TBEs = p->number_of_TBEs;
+ m_is_blocking = false;
+ p->ruby_system->registerAbstractController(this);
}
#include <iostream>
#include <string>
-#include "mem/packet.hh"
#include "mem/protocol/AccessPermission.hh"
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Consumer.hh"
#include "mem/ruby/common/DataBlock.hh"
#include "mem/ruby/network/Network.hh"
#include "mem/ruby/recorder/CacheRecorder.hh"
+#include "mem/ruby/system/MachineID.hh"
+#include "mem/packet.hh"
#include "params/RubyController.hh"
#include "sim/sim_object.hh"
//! Function for enqueuing a prefetch request
virtual void enqueuePrefetch(const Address&, const RubyRequestType&)
{ fatal("Prefetches not implemented!");}
+
+ protected:
+ int m_transitions_per_cycle;
+ int m_buffer_size;
+ int m_recycle_latency;
+ std::string m_name;
+ std::map<std::string, std::string> m_cfg;
+ NodeID m_version;
+ Network* m_net_ptr;
+ MachineID m_machineID;
+ bool m_is_blocking;
+ std::map<Address, MessageBuffer*> m_block_map;
+ typedef std::vector<MessageBuffer*> MsgVecType;
+ typedef std::map< Address, MsgVecType* > WaitingBufType;
+ WaitingBufType m_waiting_buffers;
+ int m_max_in_port_rank;
+ int m_cur_in_port_rank;
+ int m_number_of_TBEs;
};
#endif // __MEM_RUBY_SLICC_INTERFACE_ABSTRACTCONTROLLER_HH__
import re
python_class_map = {"int": "Int",
+ "uint32_t" : "UInt32",
"std::string": "String",
"bool": "Bool",
"CacheMemory": "RubyCache",
void wakeUpAllBuffers();
void initNetworkPtr(Network* net_ptr) { m_net_ptr = net_ptr; }
void print(std::ostream& out) const;
- void printConfig(std::ostream& out) const;
void wakeup();
void printStats(std::ostream& out) const;
void clearStats();
code('${{param.type_ast.type}} m_${{param.ident}};')
code('''
-int m_number_of_TBEs;
-
TransitionResult doTransition(${ident}_Event event,
''')
code('''
const Address& addr);
-std::string m_name;
-int m_transitions_per_cycle;
-int m_buffer_size;
-int m_recycle_latency;
-std::map<std::string, std::string> m_cfg;
-NodeID m_version;
-Network* m_net_ptr;
-MachineID m_machineID;
-bool m_is_blocking;
-std::map<Address, MessageBuffer*> m_block_map;
-typedef std::vector<MessageBuffer*> MsgVecType;
-typedef std::map< Address, MsgVecType* > WaitingBufType;
-WaitingBufType m_waiting_buffers;
-int m_max_in_port_rank;
-int m_cur_in_port_rank;
static ${ident}_ProfileDumper s_profileDumper;
${ident}_Profiler m_profiler;
static int m_num_controllers;
$c_ident::$c_ident(const Params *p)
: AbstractController(p)
{
- m_version = p->version;
- m_transitions_per_cycle = p->transitions_per_cycle;
- m_buffer_size = p->buffer_size;
- m_recycle_latency = p->recycle_latency;
- m_number_of_TBEs = p->number_of_TBEs;
- m_is_blocking = false;
m_name = "${ident}";
''')
#
elif var.ident.find("mandatoryQueue") < 0:
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:
- if expr.find("TBETable") >= 0:
- args = "m_number_of_TBEs"
- else:
- args = var.get("constructor_hack", "")
-
+ args = var.get("constructor", "")
code('$expr($args);')
code('assert($vid != NULL);')
out << "[$c_ident " << m_version << "]";
}
-void
-$c_ident::printConfig(ostream& out) const
-{
- out << "$c_ident config: " << m_name << endl;
- out << " version: " << m_version << endl;
- map<string, string>::const_iterator it;
- for (it = m_cfg.begin(); it != m_cfg.end(); it++)
- out << " " << it->first << ": " << it->second << endl;
-}
-
void
$c_ident::printStats(ostream& out) const
{