diff options
author | Brad Beckmann <Brad.Beckmann@amd.com> | 2009-11-18 16:34:32 -0800 |
---|---|---|
committer | Brad Beckmann <Brad.Beckmann@amd.com> | 2009-11-18 16:34:32 -0800 |
commit | 20f872ed2a5dd7c1c08bbafc1cd5e82d6cc7444d (patch) | |
tree | 1a49df0051efe50d341d0df4ed83d107adc29df7 | |
parent | c6330094fba3b67e5a6e422f8c7ad74b3c44eb17 (diff) | |
download | gem5-20f872ed2a5dd7c1c08bbafc1cd5e82d6cc7444d.tar.xz |
ruby: Added boolean to State Machine parameters
* * *
ruby: Removed primitive .hh includes
-rw-r--r-- | src/mem/slicc/symbols/StateMachine.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py index 8583ed46b..008438869 100644 --- a/src/mem/slicc/symbols/StateMachine.py +++ b/src/mem/slicc/symbols/StateMachine.py @@ -162,7 +162,7 @@ class StateMachine(Symbol): seen_types = set() for var in self.objects: - if var.type.ident not in seen_types: + if var.type.ident not in seen_types and not var.type.isPrimitive: code('#include "mem/protocol/${{var.type.c_ident}}.hh"') seen_types.add(var.type.ident) @@ -283,7 +283,7 @@ static int m_num_controllers; # include object classes seen_types = set() for var in self.objects: - if var.type.ident not in seen_types: + if var.type.ident not in seen_types and not var.type.isPrimitive: code('#include "mem/protocol/${{var.type.c_ident}}.hh"') seen_types.add(var.type.ident) @@ -339,8 +339,11 @@ void $c_ident::init(Network *net_ptr, const vector<string> &argv) code('else if (argv[i] == "${{param.name}}")') if param.type_ast.type.ident == "int": code(' m_${{param.name}} = atoi(argv[i+1].c_str());') + elif param.type_ast.type.ident == "bool": + code(' m_${{param.name}} = string_to_bool(argv[i+1]);') else: - self.error("only int parameters are supported right now") + self.error("only int and bool parameters are "\ + "currently supported") code.dedent() code.dedent() code(''' |