}
// If running a cache trace, don't worry about the last arrival checks
- if (!g_system_ptr->m_warmup_enabled) {
+ if (!RubySystem::getWarmupEnabled()) {
m_last_arrival_time = arrival_time;
}
m_transitions_per_cycle(p->transitions_per_cycle),
m_buffer_size(p->buffer_size), m_recycle_latency(p->recycle_latency),
memoryPort(csprintf("%s.memory", name()), this, ""),
- m_responseFromMemory_ptr(new MessageBuffer()),
- m_rubySystem(p->ruby_system)
+ m_responseFromMemory_ptr(new MessageBuffer())
{
// Set the sender pointer of the response message buffer from the
// memory controller.
pkt->pushSenderState(s);
// Use functional rather than timing accesses during warmup
- if (m_rubySystem->m_warmup_enabled) {
+ if (RubySystem::getWarmupEnabled()) {
memoryPort.sendFunctional(pkt);
recvTimingResp(pkt);
return;
pkt->pushSenderState(s);
// Use functional rather than timing accesses during warmup
- if (m_rubySystem->m_warmup_enabled) {
+ if (RubySystem::getWarmupEnabled()) {
memoryPort.sendFunctional(pkt);
recvTimingResp(pkt);
return;
// memory controller.
MessageBuffer *m_responseFromMemory_ptr;
- // Needed so we know if we are warming up
- RubySystem *m_rubySystem;
-
// State that is stored in packets sent to the memory controller.
struct SenderState : public Packet::SenderState
{
request_address, total_latency);
// update the data unless it is a non-data-carrying flush
- if (g_system_ptr->m_warmup_enabled) {
+ if (RubySystem::getWarmupEnabled()) {
data.setData(pkt->getConstPtr<uint8_t>(),
request_address.getOffset(), pkt->getSize());
} else if (!pkt->isFlush()) {
delete srequest;
- if (g_system_ptr->m_warmup_enabled) {
+ if (RubySystem::getWarmupEnabled()) {
assert(pkt->req);
delete pkt->req;
delete pkt;
g_system_ptr->m_cache_recorder->enqueueNextFetchRequest();
- } else if (g_system_ptr->m_cooldown_enabled) {
+ } else if (RubySystem::getCooldownEnabled()) {
delete pkt;
g_system_ptr->m_cache_recorder->enqueueNextFlushRequest();
} else {
uint32_t RubySystem::m_block_size_bytes;
uint32_t RubySystem::m_block_size_bits;
uint32_t RubySystem::m_memory_size_bits;
+bool RubySystem::m_warmup_enabled = false;
+// To look forward to allowing multiple RubySystem instances, track the number
+// of RubySystems that need to be warmed up on checkpoint restore.
+unsigned RubySystem::m_systems_to_warmup = 0;
+bool RubySystem::m_cooldown_enabled = false;
RubySystem::RubySystem(const Params *p)
: ClockedObject(p), m_access_backing_store(p->access_backing_store)
m_block_size_bits = floorLog2(m_block_size_bytes);
m_memory_size_bits = p->memory_size_bits;
- m_warmup_enabled = false;
- m_cooldown_enabled = false;
-
// Setup the global variables used in Ruby
g_system_ptr = this;
readCompressedTrace(cache_trace_file, uncompressed_trace,
cache_trace_size);
m_warmup_enabled = true;
+ m_systems_to_warmup++;
vector<Sequencer*> sequencer_map;
Sequencer* t = NULL;
delete m_cache_recorder;
m_cache_recorder = NULL;
- m_warmup_enabled = false;
+ m_systems_to_warmup--;
+ if (m_systems_to_warmup == 0) {
+ m_warmup_enabled = false;
+ }
// Restore eventq head
eventq_head = eventq->replaceHead(eventq_head);
void
RubySystem::RubyEvent::process()
{
- if (ruby_system->m_warmup_enabled) {
+ if (RubySystem::getWarmupEnabled()) {
ruby_system->m_cache_recorder->enqueueNextFetchRequest();
- } else if (ruby_system->m_cooldown_enabled) {
+ } else if (RubySystem::getCooldownEnabled()) {
ruby_system->m_cache_recorder->enqueueNextFlushRequest();
}
}
static uint32_t getBlockSizeBytes() { return m_block_size_bytes; }
static uint32_t getBlockSizeBits() { return m_block_size_bits; }
static uint32_t getMemorySizeBits() { return m_memory_size_bits; }
+ static bool getWarmupEnabled() { return m_warmup_enabled; }
+ static bool getCooldownEnabled() { return m_cooldown_enabled; }
SimpleMemory *getPhysMem() { return m_phys_mem; }
const bool getAccessBackingStore() { return m_access_backing_store; }
static uint32_t m_block_size_bytes;
static uint32_t m_block_size_bits;
static uint32_t m_memory_size_bits;
+ static bool m_warmup_enabled;
+ static unsigned m_systems_to_warmup;
+ static bool m_cooldown_enabled;
SimpleMemory *m_phys_mem;
const bool m_access_backing_store;
public:
Profiler* m_profiler;
- bool m_warmup_enabled;
- bool m_cooldown_enabled;
CacheRecorder* m_cache_recorder;
};