ruby: apply some fixes that were overwritten by the recent ruby import.
This commit is contained in:
@@ -52,4 +52,6 @@
|
||||
using namespace std;
|
||||
using namespace __gnu_cxx;
|
||||
|
||||
typedef unsigned int uint;
|
||||
|
||||
#endif //INCLUDES_H
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "assert.hh"
|
||||
#include <cassert>
|
||||
|
||||
#include "mem/gems_common/util.hh"
|
||||
|
||||
// Split a string into a head and tail strings on the specified
|
||||
@@ -101,6 +102,8 @@ bool string_to_bool(const string & str)
|
||||
return false;
|
||||
else
|
||||
assert(0);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Log functions
|
||||
|
||||
@@ -35,7 +35,8 @@ if not main['RUBY']:
|
||||
|
||||
sticky_vars.AddVariables(
|
||||
BoolVariable('NO_VECTOR_BOUNDS_CHECKS', "Don't do bounds checks", True),
|
||||
BoolVariable('RUBY_DEBUG', "Add debugging stuff to Ruby", False))
|
||||
BoolVariable('RUBY_DEBUG', "Add debugging stuff to Ruby", False),
|
||||
('GEMS_ROOT', "Add debugging stuff to Ruby", Dir('..').srcnode().abspath))
|
||||
|
||||
export_vars += [ 'NO_VECTOR_BOUNDS_CHECKS', 'RUBY_DEBUG' ]
|
||||
export_vars += [ 'NO_VECTOR_BOUNDS_CHECKS', 'RUBY_DEBUG', 'GEMS_ROOT' ]
|
||||
|
||||
|
||||
@@ -296,7 +296,7 @@ void MessageBuffer::pop()
|
||||
{
|
||||
DEBUG_MSG(QUEUE_COMP,MedPrio,"pop from " + m_name);
|
||||
assert(isReady());
|
||||
Time ready_time = m_prio_heap.extractMin().m_time;
|
||||
m_prio_heap.extractMin();
|
||||
// record previous size and time so the current buffer size isn't adjusted until next cycle
|
||||
if (m_time_last_time_pop < g_eventQueue_ptr->getTime()) {
|
||||
m_size_at_cycle_start = m_size;
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met: redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer;
|
||||
* redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution;
|
||||
* neither the name of the copyright holders nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "mem/ruby/common/DataBlock.hh"
|
||||
|
||||
DataBlock &
|
||||
|
||||
@@ -45,21 +45,31 @@ extern Debug* g_debug_ptr;
|
||||
std::ostream * debug_cout_ptr;
|
||||
|
||||
bool Debug::m_protocol_trace = false;
|
||||
|
||||
// component character list
|
||||
const char DEFINE_COMP_CHAR[] =
|
||||
struct DebugComponentData
|
||||
{
|
||||
#undef DEFINE_COMP
|
||||
#define DEFINE_COMP(component, character, description) character,
|
||||
#include "Debug.def"
|
||||
const char *desc;
|
||||
const char ch;
|
||||
};
|
||||
|
||||
// component description list
|
||||
const char* DEFINE_COMP_DESCRIPTION[] =
|
||||
// component character list
|
||||
DebugComponentData debugComponents[] =
|
||||
{
|
||||
#undef DEFINE_COMP
|
||||
#define DEFINE_COMP(component, character, description) description,
|
||||
#include "Debug.def"
|
||||
{"System", 's' },
|
||||
{"Node", 'N' },
|
||||
{"Queue", 'q' },
|
||||
{"Event Queue", 'e' },
|
||||
{"Network", 'n' },
|
||||
{"Sequencer", 'S' },
|
||||
{"Tester", 't' },
|
||||
{"Generated", 'g' },
|
||||
{"SLICC", 'l' },
|
||||
{"Network Queues", 'Q' },
|
||||
{"Time", 'T' },
|
||||
{"Network Internals", 'i' },
|
||||
{"Store Buffer", 'b' },
|
||||
{"Cache", 'c' },
|
||||
{"Predictor", 'p' },
|
||||
{"Allocator", 'a' },
|
||||
};
|
||||
|
||||
extern "C" void changeDebugVerbosity(VerbosityLevel vb);
|
||||
@@ -226,7 +236,7 @@ bool Debug::checkFilter(char ch)
|
||||
{
|
||||
for (int i=0; i<NUMBER_OF_COMPS; i++) {
|
||||
// Look at all components to find a character match
|
||||
if (DEFINE_COMP_CHAR[i] == ch) {
|
||||
if (debugComponents[i].ch == ch) {
|
||||
// We found a match - return no error
|
||||
return false; // no error
|
||||
}
|
||||
@@ -292,9 +302,9 @@ bool Debug::addFilter(char ch)
|
||||
{
|
||||
for (int i=0; i<NUMBER_OF_COMPS; i++) {
|
||||
// Look at all components to find a character match
|
||||
if (DEFINE_COMP_CHAR[i] == ch) {
|
||||
if (debugComponents[i].ch == ch) {
|
||||
// We found a match - update the filter bit mask
|
||||
cout << " Debug: Adding to filter: '" << ch << "' (" << DEFINE_COMP_DESCRIPTION[i] << ")" << endl;
|
||||
cout << " Debug: Adding to filter: '" << ch << "' (" << debugComponents[i].desc << ")" << endl;
|
||||
m_filter |= (1 << i);
|
||||
return false; // no error
|
||||
}
|
||||
@@ -320,7 +330,7 @@ void Debug::usageInstructions(void)
|
||||
{
|
||||
cerr << "Debug components: " << endl;
|
||||
for (int i=0; i<NUMBER_OF_COMPS; i++) {
|
||||
cerr << " " << DEFINE_COMP_CHAR[i] << ": " << DEFINE_COMP_DESCRIPTION[i] << endl;
|
||||
cerr << " " << debugComponents[i].ch << ": " << debugComponents[i].desc << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,21 +31,39 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef DEBUG_H
|
||||
#define DEBUG_H
|
||||
#ifndef __MEM_RUBY_DEBUG_HH__
|
||||
#define __MEM_RUBY_DEBUG_HH__
|
||||
|
||||
#include <unistd.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "config/ruby_debug.hh"
|
||||
#include "mem/ruby/common/Global.hh"
|
||||
|
||||
extern std::ostream * debug_cout_ptr;
|
||||
|
||||
// component enumeration
|
||||
enum DebugComponents
|
||||
{
|
||||
#undef DEFINE_COMP
|
||||
#define DEFINE_COMP(component, character, description) component,
|
||||
#include "Debug.def"
|
||||
NUMBER_OF_COMPS
|
||||
SYSTEM_COMP,
|
||||
NODE_COMP,
|
||||
QUEUE_COMP,
|
||||
EVENTQUEUE_COMP,
|
||||
NETWORK_COMP,
|
||||
SEQUENCER_COMP,
|
||||
TESTER_COMP,
|
||||
GENERATED_COMP,
|
||||
SLICC_COMP,
|
||||
NETWORKQUEUE_COMP,
|
||||
TIME_COMP,
|
||||
NETWORK_INTERNALS_COMP,
|
||||
STOREBUFFER_COMP,
|
||||
CACHE_COMP,
|
||||
PREDICTOR_COMP,
|
||||
ALLOCATOR_COMP,
|
||||
NUMBER_OF_COMPS
|
||||
};
|
||||
|
||||
enum PriorityLevel {HighPrio, MedPrio, LowPrio};
|
||||
@@ -55,7 +73,7 @@ class Debug {
|
||||
public:
|
||||
// Constructors
|
||||
Debug();
|
||||
Debug( const string & name, const vector<string> & argv );
|
||||
Debug(const std::string & name, const std::vector<std::string> & argv);
|
||||
Debug( const char *filterString, const char *verboseString,
|
||||
Time filterStartTime, const char *filename );
|
||||
|
||||
@@ -65,7 +83,7 @@ public:
|
||||
// Public Methods
|
||||
static bool getProtocolTrace() { return m_protocol_trace; }
|
||||
bool validDebug(int module, PriorityLevel priority);
|
||||
void printVerbosity(ostream& out) const;
|
||||
void printVerbosity(std::ostream& out) const;
|
||||
void setVerbosity(VerbosityLevel vb);
|
||||
static bool checkVerbosityString(const char *verb_str);
|
||||
bool setVerbosityString(const char *);
|
||||
@@ -79,7 +97,7 @@ public:
|
||||
bool addFilter(char);
|
||||
void clearFilter();
|
||||
void allFilter();
|
||||
void print(ostream& out) const;
|
||||
void print(std::ostream& out) const;
|
||||
/* old school debugging "vararg": sends messages to screen and log */
|
||||
void debugMsg( const char *fmt, ... );
|
||||
|
||||
@@ -104,13 +122,13 @@ private:
|
||||
};
|
||||
|
||||
// Output operator declaration
|
||||
ostream& operator<<(ostream& out, const Debug& obj);
|
||||
std::ostream& operator<<(std::ostream& out, const Debug& obj);
|
||||
|
||||
// ******************* Definitions *******************
|
||||
|
||||
// Output operator definition
|
||||
extern inline
|
||||
ostream& operator<<(ostream& out, const Debug& obj)
|
||||
std::ostream& operator<<(std::ostream& out, const Debug& obj)
|
||||
{
|
||||
obj.print(out);
|
||||
out << flush;
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
virtual void get_network_config() {}
|
||||
virtual void dmaHitCallback() = 0;
|
||||
virtual void hitCallback(NodeID proc, SubBlock& data, CacheRequestType type, int thread) = 0; // Called by sequencer
|
||||
virtual void conflictCallback(NodeID proc, SubBlock& data, CacheRequestType type, int thread) { assert(0) }; // Called by sequencer
|
||||
virtual void conflictCallback(NodeID proc, SubBlock& data, CacheRequestType type, int thread) { assert(0); }; // Called by sequencer
|
||||
virtual integer_t getInstructionCount(int procID) const { return 1; }
|
||||
virtual integer_t getCycleCount(int procID) const { return 1; }
|
||||
virtual void addThreadDependency(int procID, int requestor_thread, int conflict_thread) const { assert(0);}
|
||||
|
||||
@@ -566,7 +566,7 @@ void Set::print(ostream& out) const
|
||||
#ifdef __32BITS__
|
||||
sprintf(buff,"%08X ",m_p_nArray[i]);
|
||||
#else
|
||||
sprintf(buff,"0x %016llX ",m_p_nArray[i]);
|
||||
sprintf(buff,"0x %016llX ", (long long)m_p_nArray[i]);
|
||||
#endif // __32BITS__
|
||||
out << buff;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ require "cfg.rb"
|
||||
num_cores = 16
|
||||
L1_CACHE_SIZE_KB = 32
|
||||
L1_CACHE_ASSOC = 8
|
||||
L1_CACHE_LATENCY = "auto"
|
||||
L1_CACHE_LATENCY = 2
|
||||
num_memories = 2
|
||||
memory_size_mb = 1024
|
||||
NUM_DMA = 1
|
||||
|
||||
@@ -220,7 +220,7 @@ static void print_parameters(ostream& out)
|
||||
#define PARAM_ARRAY( NAME, TYPE, DEFAULT_ARRAY_SIZE, DEFAULT_VALUE, CUSTOM_ACCESSOR ) { out << #NAME << ": ARRAY" << endl; }
|
||||
#define PARAM_ARRAY2D( NAME, TYPE, D1_DEFAULT_ARRAY_SIZE, D2_DEFAULT_ARRAY_SIZE, DEFAULT_VALUE, CUSTOM_ACCESSOR ) { out << #NAME << ": ARRAY2D" << endl; }
|
||||
#define PARAM_ARRAY3D( NAME, TYPE, D1_DEFAULT_ARRAY_SIZE, D2_DEFAULT_ARRAY_SIZE, D3_DEFAULT_ARRAY_SIZE, DEFAULT_VALUE, CUSTOM_ACCESSOR ) { out << #NAME << ": ARRAY3D" << endl; }
|
||||
#include CONFIG_VAR_FILENAME
|
||||
#include "mem/ruby/config/config.hh"
|
||||
#undef PARAM
|
||||
#undef PARAM_UINT
|
||||
#undef PARAM_ULONG
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
#include <assert.h>
|
||||
|
||||
#include "mem/ruby/common/TypeDefines.hh"
|
||||
#define CONFIG_VAR_FILENAME "mem/ruby/config/config.hh"
|
||||
|
||||
// Set paramterization
|
||||
/*
|
||||
@@ -182,7 +181,7 @@ public:
|
||||
array2d_accessor_##CUSTOM_ACCESSOR(TYPE, NAME)
|
||||
#define PARAM_ARRAY3D( NAME, TYPE, D1_DEFAULT_ARRAY_SIZE, D2_DEFAULT_ARRAY_SIZE, D3_DEFAULT_ARRAY_SIZE, DEFAULT_VALUE, CUSTOM_ACCESSOR ) \
|
||||
array3d_accessor_##CUSTOM_ACCESSOR(TYPE, NAME)
|
||||
#include CONFIG_VAR_FILENAME
|
||||
#include "mem/ruby/config/config.hh"
|
||||
#undef PARAM
|
||||
#undef PARAM_UINT
|
||||
#undef PARAM_ULONG
|
||||
@@ -214,7 +213,7 @@ private:
|
||||
static TYPE** m_##NAME;
|
||||
#define PARAM_ARRAY3D( NAME, TYPE, D1_DEFAULT_ARRAY_SIZE, D2_DEFAULT_ARRAY_SIZE, D3_DEFAULT_ARRAY_SIZE, DEFAULT_VALUE, CUSTOM_ACCESSOR ) \
|
||||
static TYPE*** m_##NAME;
|
||||
#include CONFIG_VAR_FILENAME
|
||||
#include "mem/ruby/config/config.hh"
|
||||
#undef PARAM
|
||||
#undef PARAM_UINT
|
||||
#undef PARAM_ULONG
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -97,6 +97,7 @@ void LSB_CountingBloomFilter::unset(const Address& addr)
|
||||
bool LSB_CountingBloomFilter::isSet(const Address& addr)
|
||||
{
|
||||
// TODO
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -91,9 +91,8 @@ void MultiGrainBloomFilter::merge(AbstractBloomFilter * other_filter)
|
||||
void MultiGrainBloomFilter::set(const Address& addr)
|
||||
{
|
||||
int i = get_block_index(addr);
|
||||
int j = get_page_index(addr);
|
||||
assert(i < m_filter_size);
|
||||
assert(j < m_page_filter_size);
|
||||
assert(get_page_index(addr) < m_page_filter_size);
|
||||
m_filter[i] = 1;
|
||||
m_page_filter[i] = 1;
|
||||
|
||||
@@ -107,9 +106,8 @@ void MultiGrainBloomFilter::unset(const Address& addr)
|
||||
bool MultiGrainBloomFilter::isSet(const Address& addr)
|
||||
{
|
||||
int i = get_block_index(addr);
|
||||
int j = get_page_index(addr);
|
||||
assert(i < m_filter_size);
|
||||
assert(j < m_page_filter_size);
|
||||
assert(get_page_index(addr) < m_page_filter_size);
|
||||
// we have to have both indices set
|
||||
return (m_filter[i] && m_page_filter[i]);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <sys/wait.h>
|
||||
#include <algorithm>
|
||||
|
||||
#include "config/gems_root.hh"
|
||||
#include "mem/ruby/libruby_internal.hh"
|
||||
#include "mem/ruby/system/RubyPort.hh"
|
||||
#include "mem/ruby/system/System.hh"
|
||||
@@ -98,9 +99,8 @@ void libruby_init(const char* cfg_filename)
|
||||
perror("Error redirecting stdout");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#define QUOTE_MACRO(x, y) QUOTE_TXT(x,y)
|
||||
#define QUOTE_TXT(x, y) #x y
|
||||
if (execlp("ruby", "ruby", "-I", QUOTE_MACRO(GEMS_ROOT, "/ruby/config"), QUOTE_MACRO(GEMS_ROOT, "/ruby/config/print_cfg.rb"), "-r", cfg_filename, NULL)) {
|
||||
if (execlp("ruby", "ruby", "-I", GEMS_ROOT "/ruby/config",
|
||||
GEMS_ROOT "/ruby/config/print_cfg.rb", "-r", cfg_filename, NULL)) {
|
||||
perror("execlp");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -134,7 +134,6 @@ void PerfectSwitch::wakeup()
|
||||
int highest_prio_vnet = m_virtual_networks-1;
|
||||
int lowest_prio_vnet = 0;
|
||||
int decrementer = 1;
|
||||
bool schedule_wakeup = false;
|
||||
NetworkMessage* net_msg_ptr = NULL;
|
||||
|
||||
// invert priorities to avoid starvation seen in the component network
|
||||
|
||||
@@ -204,8 +204,6 @@ void Throttle::wakeup()
|
||||
// Update the predictor
|
||||
Time current_time = g_eventQueue_ptr->getTime();
|
||||
while ((current_time - m_last_bandwidth_sample) > ADJUST_INTERVAL) {
|
||||
double utilization = m_bandwidth_since_sample/double(ADJUST_INTERVAL * getLinkBandwidth());
|
||||
|
||||
// Used less bandwidth
|
||||
m_bash_counter--;
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ static const int DEFAULT_BW_MULTIPLIER = 1; // Just to be consistent with above
|
||||
// of the network.
|
||||
|
||||
// Helper functions based on chapter 29 of Cormen et al.
|
||||
static Matrix extend_shortest_path(const Matrix& current_dist, Matrix& latencies, Matrix& inter_switches);
|
||||
static void extend_shortest_path(Matrix& current_dist, Matrix& latencies, Matrix& inter_switches);
|
||||
static Matrix shortest_path(const Matrix& weights, Matrix& latencies, Matrix& inter_switches);
|
||||
static bool link_is_shortest_path_to_node(SwitchID src, SwitchID next, SwitchID final, const Matrix& weights, const Matrix& dist);
|
||||
static NetDest shortest_path_to_node(SwitchID src, SwitchID next, const Matrix& weights, const Matrix& dist);
|
||||
|
||||
@@ -822,7 +822,7 @@ void Profiler::profileConflictingRequests(const Address& addr)
|
||||
assert(addr == line_address(addr));
|
||||
Time last_time = m_ruby_start;
|
||||
if (m_conflicting_map_ptr->exist(addr)) {
|
||||
Time last_time = m_conflicting_map_ptr->lookup(addr);
|
||||
last_time = m_conflicting_map_ptr->lookup(addr);
|
||||
}
|
||||
Time current_time = g_eventQueue_ptr->getTime();
|
||||
assert (current_time - last_time > 0);
|
||||
@@ -1105,7 +1105,7 @@ GenericRequestType Profiler::CacheRequestType_to_GenericRequestType(const CacheR
|
||||
}
|
||||
|
||||
void Profiler::rubyWatch(int id){
|
||||
int rn_g1 = 0;//SIMICS_get_register_number(id, "g1");
|
||||
//int rn_g1 = 0;//SIMICS_get_register_number(id, "g1");
|
||||
uint64 tr = 0;//SIMICS_read_register(id, rn_g1);
|
||||
Address watch_address = Address(tr);
|
||||
const int ID_SPACES = 3;
|
||||
|
||||
@@ -53,12 +53,14 @@ uint64_t handleLoad(StoreBuffer * storebuffer, const RubyRequest & request) {
|
||||
return storebuffer->handleLoad(request);
|
||||
}
|
||||
|
||||
#if 0
|
||||
uint64_t handleAtomic(StoreBuffer * storebuffer, const RubyRequest & request) {
|
||||
// flush the store buffer
|
||||
storebuffer->flushStoreBuffer();
|
||||
// let storebuffer issue atomic
|
||||
//return storebuffer->issueAtomic(request);
|
||||
}
|
||||
#endif
|
||||
|
||||
void flushSTB(StoreBuffer * storebuffer) {
|
||||
// in in-order can't get a request to flushSTB if already flushing
|
||||
|
||||
@@ -30,11 +30,15 @@
|
||||
/* Includes */
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "mem/ruby/storebuffer/hfa.hh"
|
||||
#include "mem/ruby/storebuffer/storebuffer.hh"
|
||||
#include <map>
|
||||
#include "mem/ruby/common/Global.hh"
|
||||
|
||||
#ifdef RUBY_TSO_CHECKER
|
||||
#include "TsoChecker.hh"
|
||||
#endif
|
||||
|
||||
#define SYSTEM_EXIT ASSERT(0)
|
||||
|
||||
@@ -42,7 +46,9 @@
|
||||
// global map of request id_s to map them back to storebuffer pointers
|
||||
map <uint64_t, StoreBuffer *> request_map;
|
||||
|
||||
#ifdef RUBY_TSO_CHECKER
|
||||
Tso::TsoChecker * g_tsoChecker;
|
||||
#endif
|
||||
|
||||
void hit(int64_t id) {
|
||||
if (request_map.find(id) == request_map.end()) {
|
||||
@@ -59,7 +65,7 @@ void hit(int64_t id) {
|
||||
|
||||
//*****************************************************************************************
|
||||
StoreBuffer::StoreBuffer(uint32 id, uint32 block_bits, int storebuffer_size) {
|
||||
#ifdef TSO_CHECK
|
||||
#ifdef RUBY_TSO_CHECKER
|
||||
if (id == 0) {
|
||||
g_tsoChecker = new Tso::TsoChecker();
|
||||
g_tsoChecker->init(64);
|
||||
@@ -93,7 +99,7 @@ StoreBuffer::StoreBuffer(uint32 id, uint32 block_bits, int storebuffer_size) {
|
||||
|
||||
//******************************************************************************************
|
||||
StoreBuffer::~StoreBuffer(){
|
||||
#ifdef TSO_CHECK
|
||||
#ifdef RUBY_TSO_CHECKER
|
||||
if (m_id == 0) {
|
||||
delete g_tsoChecker;
|
||||
}
|
||||
@@ -266,13 +272,15 @@ void StoreBuffer::returnMatchedData(struct RubyRequest request) {
|
||||
ASSERT(checkForLoadHit(request) != NO_MATCH);
|
||||
physical_address_t lineaddr = physical_address & m_block_mask;
|
||||
bool found = false;
|
||||
#ifdef RUBY_TSO_CHECKER
|
||||
Tso::TsoCheckerCmd * cmd;
|
||||
#endif
|
||||
deque<struct SBEntry>::iterator satisfying_store;
|
||||
for (deque<struct SBEntry>::iterator it = buffer.begin(); it != buffer.end(); it++) {
|
||||
if ((it->m_request.paddr & m_block_mask) == lineaddr) {
|
||||
if (!found) {
|
||||
found = true;
|
||||
#ifdef TSO_CHECK
|
||||
#ifdef RUBY_TSO_CHECKER
|
||||
satisfying_store = it;
|
||||
cmd = new Tso::TsoCheckerCmd(m_id, // this thread id
|
||||
iseq, // instruction sequence
|
||||
@@ -305,7 +313,7 @@ void StoreBuffer::returnMatchedData(struct RubyRequest request) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TSO_CHECK
|
||||
#ifdef RUBY_TSO_CHECKER
|
||||
uint64_t tso_data = 0;
|
||||
memcpy(&tso_data, request.data, request.len);
|
||||
cmd->setData(tso_data);
|
||||
@@ -373,7 +381,6 @@ void StoreBuffer::complete(uint64_t id) {
|
||||
ASSERT(outstanding_requests.find(id) != outstanding_requests.end());
|
||||
physical_address_t physical_address = outstanding_requests.find(id)->second.paddr;
|
||||
RubyRequestType type = outstanding_requests.find(id)->second.type;
|
||||
int len = outstanding_requests.find(id)->second.len;
|
||||
#ifdef DEBUG_WRITE_BUFFER
|
||||
DEBUG_OUT("\n***StoreBuffer: complete BEGIN, contents:\n");
|
||||
DEBUG_OUT("\n");
|
||||
@@ -393,7 +400,8 @@ void StoreBuffer::complete(uint64_t id) {
|
||||
m_buffer_size--;
|
||||
ASSERT(m_buffer_size >= 0);
|
||||
|
||||
#ifdef TSO_CHECK
|
||||
#ifdef RUBY_TSO_CHECKER
|
||||
int len = outstanding_requests.find(id)->second.len;
|
||||
uint64_t data = 0;
|
||||
memcpy(&data, from_buffer.m_request.data, 4);
|
||||
|
||||
@@ -454,7 +462,7 @@ void StoreBuffer::complete(uint64_t id) {
|
||||
#endif
|
||||
} // end if (type == ST)
|
||||
else if (type == RubyRequestType_LD) {
|
||||
#ifdef TSO_CHECK
|
||||
#ifdef RUBY_TSO_CHECKER
|
||||
RubyRequest request = outstanding_requests.find(id)->second;
|
||||
uint64_t data = 0;
|
||||
memcpy(&data, request.data, request.len);
|
||||
@@ -503,7 +511,7 @@ void StoreBuffer::complete(uint64_t id) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef RUBY_TSO_CHECKER
|
||||
void StoreBuffer::insertTsoLL(Tso::TsoCheckerCmd * cmd) {
|
||||
uint64_t count = cmd->getIseq();
|
||||
Tso::TsoCheckerCmd * current = NULL;
|
||||
@@ -545,7 +553,7 @@ void StoreBuffer::insertTsoLL(Tso::TsoCheckerCmd * cmd) {
|
||||
previous->setNext(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//***************************************************************************************************
|
||||
void StoreBuffer::print( void )
|
||||
|
||||
@@ -31,11 +31,15 @@
|
||||
|
||||
#include <map>
|
||||
#include <deque>
|
||||
|
||||
#include "config/ruby_tso_checker.hh"
|
||||
#include "mem/ruby/storebuffer/hfa.hh"
|
||||
#include "mem/ruby/libruby.hh"
|
||||
#include "TsoCheckerCmd.hh"
|
||||
|
||||
#define TSO_CHECK
|
||||
#ifdef RUBY_TSO_CHECKER
|
||||
#include "TsoCheckerCmd.hh"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Status for write buffer accesses. The Write buffer can hit in fastpath, be full, or
|
||||
* successfully enqueue the store request
|
||||
@@ -49,8 +53,16 @@ enum load_match { NO_MATCH, PARTIAL_MATCH, FULL_MATCH };
|
||||
|
||||
struct SBEntry {
|
||||
struct RubyRequest m_request;
|
||||
#ifdef RUBY_TSO_CHECKER
|
||||
Tso::TsoCheckerCmd * m_next_ptr;
|
||||
SBEntry(struct RubyRequest request, void * ptr) { m_request = request; m_next_ptr = (Tso::TsoCheckerCmd*) ptr; }
|
||||
#endif
|
||||
SBEntry(struct RubyRequest request, void * ptr)
|
||||
: m_request(request)
|
||||
{
|
||||
#ifdef RUBY_TSO_CHECKER
|
||||
m_next_ptr = (Tso::TsoCheckerCmd*) ptr;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
class StoreBuffer {
|
||||
@@ -89,8 +101,10 @@ class StoreBuffer {
|
||||
/// prints out the contents of the Write Buffer
|
||||
void print();
|
||||
|
||||
#ifdef RUBY_TSO_CHECKER
|
||||
/// if load completes before store, insert correctly to be issued to TSOChecker
|
||||
void insertTsoLL(Tso::TsoCheckerCmd * cmd);
|
||||
#endif
|
||||
|
||||
/// Returns flag indicating whether we are using the write buffer
|
||||
bool useStoreBuffer() { return m_use_storebuffer; }
|
||||
|
||||
@@ -333,7 +333,6 @@ inline
|
||||
Index CacheMemory::addressToCacheSet(const Address& address) const
|
||||
{
|
||||
assert(address == line_address(address));
|
||||
Index temp = -1;
|
||||
return address.bitSelect(RubySystem::getBlockSizeBits(), RubySystem::getBlockSizeBits() + m_cache_num_set_bits-1);
|
||||
}
|
||||
|
||||
|
||||
@@ -291,7 +291,6 @@ void MemoryControl::enqueueMemRef (MemoryNode& memRef) {
|
||||
Time arrival_time = memRef.m_time;
|
||||
uint64 at = arrival_time;
|
||||
bool is_mem_read = memRef.m_is_mem_read;
|
||||
bool dirtyWB = memRef.m_is_dirty_wb;
|
||||
physical_address_t addr = memRef.m_addr;
|
||||
int bank = getBank(addr);
|
||||
if (m_debug) {
|
||||
|
||||
@@ -277,7 +277,6 @@ void Sequencer::readCallback(const Address& address, DataBlock& data) {
|
||||
|
||||
void Sequencer::hitCallback(SequencerRequest* srequest, DataBlock& data) {
|
||||
const RubyRequest & ruby_request = srequest->ruby_request;
|
||||
int size = ruby_request.len;
|
||||
Address request_address(ruby_request.paddr);
|
||||
Address request_line_address(ruby_request.paddr);
|
||||
request_line_address.makeLineAddress();
|
||||
|
||||
@@ -130,7 +130,7 @@ RubySystem::RubySystem(const vector <RubyObjConf> & sys_conf)
|
||||
const string & type = sys_conf[i].type;
|
||||
const string & name = sys_conf[i].name;
|
||||
const vector<string> & argv = sys_conf[i].argv;
|
||||
if (type == "RubySystem") {
|
||||
if (type == "System") {
|
||||
init(argv); // initialize system-wide variables before doing anything else!
|
||||
} else if (type == "Debug") {
|
||||
g_debug_ptr = new Debug(name, argv);
|
||||
@@ -151,8 +151,7 @@ RubySystem::RubySystem(const vector <RubyObjConf> & sys_conf)
|
||||
for (size_t i=0;i<sys_conf.size(); i++) {
|
||||
const string & type = sys_conf[i].type;
|
||||
const string & name = sys_conf[i].name;
|
||||
const vector<string> & argv = sys_conf[i].argv;
|
||||
if (type == "RubySystem" || type == "Debug")
|
||||
if (type == "System" || type == "Debug")
|
||||
continue;
|
||||
else if (type == "SetAssociativeCache")
|
||||
m_caches[name] = new CacheMemory(name);
|
||||
@@ -225,7 +224,7 @@ RubySystem::RubySystem(const vector <RubyObjConf> & sys_conf)
|
||||
string type = sys_conf[i].type;
|
||||
string name = sys_conf[i].name;
|
||||
const vector<string> & argv = sys_conf[i].argv;
|
||||
if (type == "RubySystem" || type == "Debug")
|
||||
if (type == "System" || type == "Debug")
|
||||
continue;
|
||||
else if (type == "SetAssociativeCache")
|
||||
m_caches[name]->init(argv);
|
||||
|
||||
@@ -353,7 +353,7 @@ DeclListAST* parse(string filename)
|
||||
exit(1);
|
||||
}
|
||||
g_line_number = 1;
|
||||
g_file_name = filename;
|
||||
g_file_name() = filename;
|
||||
yyin = file;
|
||||
g_decl_list_ptr = NULL;
|
||||
yyparse();
|
||||
@@ -362,7 +362,7 @@ DeclListAST* parse(string filename)
|
||||
|
||||
extern "C" void yyerror(char* s)
|
||||
{
|
||||
fprintf(stderr, "%s:%d: %s at %s\n", g_file_name.c_str(), g_line_number, s, yytext);
|
||||
fprintf(stderr, "%s:%d: %s at %s\n", g_file_name().c_str(), g_line_number, s, yytext);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user