PeekStatementAST.py (10963:51f40b101a56) PeekStatementAST.py (10967:b36204de88c0)
1# Copyright (c) 2013 Advanced Micro Devices, Inc.
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
2# Copyright (c) 2009 The Hewlett-Packard Development Company
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 41 unchanged lines hidden (view full) ---

50 var = Var(self.symtab, "in_msg", self.location, msg_type, "(*in_msg_ptr)",
51 self.pairs)
52 self.symtab.newSymbol(var)
53
54 # Check the queue type
55 self.queue_name.assertType("InPort")
56
57 # Declare the new "in_msg_ptr" variable
2# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3# Copyright (c) 2009 The Hewlett-Packard Development Company
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
9# notice, this list of conditions and the following disclaimer;

--- 41 unchanged lines hidden (view full) ---

51 var = Var(self.symtab, "in_msg", self.location, msg_type, "(*in_msg_ptr)",
52 self.pairs)
53 self.symtab.newSymbol(var)
54
55 # Check the queue type
56 self.queue_name.assertType("InPort")
57
58 # Declare the new "in_msg_ptr" variable
58 mtid = msg_type.ident
59 mtid = msg_type.c_ident
59 qcode = self.queue_name.var.code
60 code('''
61{
62 // Declare message
63 const $mtid* in_msg_ptr M5_VAR_USED;
64 in_msg_ptr = dynamic_cast<const $mtid *>(($qcode).${{self.method}}());
65 if (in_msg_ptr == NULL) {
66 // If the cast fails, this is the wrong inport (wrong message type).

--- 32 unchanged lines hidden ---
60 qcode = self.queue_name.var.code
61 code('''
62{
63 // Declare message
64 const $mtid* in_msg_ptr M5_VAR_USED;
65 in_msg_ptr = dynamic_cast<const $mtid *>(($qcode).${{self.method}}());
66 if (in_msg_ptr == NULL) {
67 // If the cast fails, this is the wrong inport (wrong message type).

--- 32 unchanged lines hidden ---