From d3aebe1f91aa166329c8ee102fdcb2c9734fdceb Mon Sep 17 00:00:00 2001 From: Nilay Vaish Date: Sun, 10 Feb 2013 21:26:24 -0600 Subject: ruby: replaces Time with Cycles in many places The patch started of with replacing Time with Cycles in the Consumer class. But to get ruby to compile, the rest of the changes had to be carried out. Subsequent patches will further this process, till we completely replace Time with Cycles. --- src/mem/slicc/symbols/StateMachine.py | 13 ++++++++----- src/mem/slicc/symbols/Type.py | 2 ++ 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/mem/slicc/symbols') diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py index d1e7dc147..e66743255 100644 --- a/src/mem/slicc/symbols/StateMachine.py +++ b/src/mem/slicc/symbols/StateMachine.py @@ -32,7 +32,8 @@ from slicc.symbols.Var import Var import slicc.generate.html as html import re -python_class_map = {"int": "Int", +python_class_map = { + "int": "Int", "uint32_t" : "UInt32", "std::string": "String", "bool": "Bool", @@ -42,8 +43,9 @@ python_class_map = {"int": "Int", "DirectoryMemory": "RubyDirectoryMemory", "MemoryControl": "MemoryControl", "DMASequencer": "DMASequencer", - "Prefetcher":"Prefetcher" - } + "Prefetcher":"Prefetcher", + "Cycles":"Cycles", + } class StateMachine(Symbol): def __init__(self, symtab, ident, location, pairs, config_parameters): @@ -629,7 +631,8 @@ $vid->setDescription("[Version " + to_string(m_version) + ", ${ident}, name=${{v if vtype.isBuffer: if "recycle_latency" in var: - code('$vid->setRecycleLatency(${{var["recycle_latency"]}});') + code('$vid->setRecycleLatency( ' \ + 'Cycles(${{var["recycle_latency"]}}));') else: code('$vid->setRecycleLatency(m_recycle_latency);') @@ -1055,7 +1058,7 @@ ${ident}_Controller::wakeup() m_fully_busy_cycles++; // Wakeup in another cycle and try again - scheduleEvent(1); + scheduleEvent(Cycles(1)); break; } ''') diff --git a/src/mem/slicc/symbols/Type.py b/src/mem/slicc/symbols/Type.py index ebf187630..ee1b8102a 100644 --- a/src/mem/slicc/symbols/Type.py +++ b/src/mem/slicc/symbols/Type.py @@ -423,6 +423,8 @@ operator<<(std::ostream& out, const ${{self.c_ident}}& obj) #include #include "mem/protocol/${{self.c_ident}}.hh" +#include "mem/ruby/common/Global.hh" +#include "mem/ruby/system/System.hh" using namespace std; ''') -- cgit v1.2.3