summaryrefslogtreecommitdiff
path: root/src/mem/slicc
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2019-01-25 12:12:38 +0000
committerAndreas Sandberg <andreas.sandberg@arm.com>2019-02-12 17:36:12 +0000
commit5cd4248672e5cd62cfec4753bd6d6ce666694f1f (patch)
tree7b0379ee8f0ff44a76895ff50922becda6a16d40 /src/mem/slicc
parent5cf312eb5bec50ab2142ce4c7df05d673cd9a716 (diff)
downloadgem5-5cd4248672e5cd62cfec4753bd6d6ce666694f1f.tar.xz
python: Replace dict.has_key with 'key in dict'
Python 3 has removed dict.has_key in favour of 'key in dict'. Change-Id: I9852a5f57d672bea815308eb647a0ce45624fad5 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/15987 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Diffstat (limited to 'src/mem/slicc')
-rw-r--r--src/mem/slicc/ast/PeekStatementAST.py4
-rw-r--r--src/mem/slicc/symbols/StateMachine.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mem/slicc/ast/PeekStatementAST.py b/src/mem/slicc/ast/PeekStatementAST.py
index 00d26e908..6cadb3130 100644
--- a/src/mem/slicc/ast/PeekStatementAST.py
+++ b/src/mem/slicc/ast/PeekStatementAST.py
@@ -71,7 +71,7 @@ class PeekStatementAST(StatementAST):
}
''')
- if self.pairs.has_key("block_on"):
+ if "block_on" in self.pairs:
address_field = self.pairs['block_on']
code('''
if (m_is_blocking &&
@@ -82,7 +82,7 @@ class PeekStatementAST(StatementAST):
}
''')
- if self.pairs.has_key("wake_up"):
+ if "wake_up" in self.pairs:
address_field = self.pairs['wake_up']
code('''
if (m_waiting_buffers.count(in_msg_ptr->m_$address_field) > 0) {
diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py
index 330cc0369..03e624b11 100644
--- a/src/mem/slicc/symbols/StateMachine.py
+++ b/src/mem/slicc/symbols/StateMachine.py
@@ -239,7 +239,7 @@ class $py_ident(RubyController):
if param.rvalue is not None:
dflt_str = str(param.rvalue.inline()) + ', '
- if python_class_map.has_key(param.type_ast.type.c_ident):
+ if param.type_ast.type.c_ident in python_class_map:
python_type = python_class_map[param.type_ast.type.c_ident]
code('${{param.ident}} = Param.${{python_type}}(${dflt_str}"")')
@@ -1109,7 +1109,7 @@ ${ident}_Controller::wakeup()
for port in self.in_ports:
code.indent()
code('// ${ident}InPort $port')
- if port.pairs.has_key("rank"):
+ if "rank" in port.pairs:
code('m_cur_in_port = ${{port.pairs["rank"]}};')
else:
code('m_cur_in_port = 0;')