StateMachine.py (13672:2969e4d5abf4) | StateMachine.py (13675:afeab32b3655) |
---|---|
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 2# Copyright (c) 2009 The Hewlett-Packard Development Company 3# Copyright (c) 2013 Advanced Micro Devices, Inc. 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 225 unchanged lines hidden (view full) --- 234''') 235 code.indent() 236 for param in self.config_parameters: 237 dflt_str = '' 238 239 if param.rvalue is not None: 240 dflt_str = str(param.rvalue.inline()) + ', ' 241 | 1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 2# Copyright (c) 2009 The Hewlett-Packard Development Company 3# Copyright (c) 2013 Advanced Micro Devices, Inc. 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 225 unchanged lines hidden (view full) --- 234''') 235 code.indent() 236 for param in self.config_parameters: 237 dflt_str = '' 238 239 if param.rvalue is not None: 240 dflt_str = str(param.rvalue.inline()) + ', ' 241 |
242 if python_class_map.has_key(param.type_ast.type.c_ident): | 242 if param.type_ast.type.c_ident in python_class_map: |
243 python_type = python_class_map[param.type_ast.type.c_ident] 244 code('${{param.ident}} = Param.${{python_type}}(${dflt_str}"")') 245 246 else: 247 self.error("Unknown c++ to python class conversion for c++ " \ 248 "type: '%s'. Please update the python_class_map " \ 249 "in StateMachine.py", param.type_ast.type.c_ident) 250 --- 853 unchanged lines hidden (view full) --- 1104 code.indent() 1105 code.indent() 1106 1107 # InPorts 1108 # 1109 for port in self.in_ports: 1110 code.indent() 1111 code('// ${ident}InPort $port') | 243 python_type = python_class_map[param.type_ast.type.c_ident] 244 code('${{param.ident}} = Param.${{python_type}}(${dflt_str}"")') 245 246 else: 247 self.error("Unknown c++ to python class conversion for c++ " \ 248 "type: '%s'. Please update the python_class_map " \ 249 "in StateMachine.py", param.type_ast.type.c_ident) 250 --- 853 unchanged lines hidden (view full) --- 1104 code.indent() 1105 code.indent() 1106 1107 # InPorts 1108 # 1109 for port in self.in_ports: 1110 code.indent() 1111 code('// ${ident}InPort $port') |
1112 if port.pairs.has_key("rank"): | 1112 if "rank" in port.pairs: |
1113 code('m_cur_in_port = ${{port.pairs["rank"]}};') 1114 else: 1115 code('m_cur_in_port = 0;') 1116 if port in port_to_buf_map: 1117 code('try {') 1118 code.indent() 1119 code('${{port["c_code_in_port"]}}') 1120 --- 472 unchanged lines hidden --- | 1113 code('m_cur_in_port = ${{port.pairs["rank"]}};') 1114 else: 1115 code('m_cur_in_port = 0;') 1116 if port in port_to_buf_map: 1117 code('try {') 1118 code.indent() 1119 code('${{port["c_code_in_port"]}}') 1120 --- 472 unchanged lines hidden --- |