FuncCallExprAST.py (10984:a86f453a7caa) | FuncCallExprAST.py (11029:32604f9e190b) |
---|---|
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 --- 79 unchanged lines hidden (view full) --- 88 89 # Look up the function in the symbol table 90 func = self.symtab.find(func_name_args, Func) 91 92 # Check the types and get the code for the parameters 93 if func is None: 94 self.error("Unrecognized function name: '%s'", func_name_args) 95 | 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 --- 79 unchanged lines hidden (view full) --- 88 89 # Look up the function in the symbol table 90 func = self.symtab.find(func_name_args, Func) 91 92 # Check the types and get the code for the parameters 93 if func is None: 94 self.error("Unrecognized function name: '%s'", func_name_args) 95 |
96 if len(self.exprs) != len(func.param_types): 97 self.error("Wrong number of arguments passed to function : '%s'" +\ 98 " Expected %d, got %d", self.proc_name, 99 len(func.param_types), len(self.exprs)) | 96 cvec, type_vec = func.checkArguments(self.exprs) |
100 | 97 |
101 cvec = [] 102 type_vec = [] 103 for expr,expected_type in zip(self.exprs, func.param_types): 104 # Check the types of the parameter 105 actual_type,param_code = expr.inline(True) 106 if str(actual_type) != 'OOD' and \ 107 str(actual_type) != str(expected_type): 108 expr.error("Type mismatch: expected: %s actual: %s" % \ 109 (expected_type, actual_type)) 110 cvec.append(param_code) 111 type_vec.append(expected_type) 112 | |
113 # OK, the semantics of "trigger" here is that, ports in the 114 # machine have different priorities. We always check the first 115 # port for doable transitions. If nothing/stalled, we pick one 116 # from the next port. 117 # 118 # One thing we have to be careful as the SLICC protocol 119 # writter is : If a port have two or more transitions can be 120 # picked from in one cycle, they must be independent. --- 85 unchanged lines hidden --- | 98 # OK, the semantics of "trigger" here is that, ports in the 99 # machine have different priorities. We always check the first 100 # port for doable transitions. If nothing/stalled, we pick one 101 # from the next port. 102 # 103 # One thing we have to be careful as the SLICC protocol 104 # writter is : If a port have two or more transitions can be 105 # picked from in one cycle, they must be independent. --- 85 unchanged lines hidden --- |