1# Copyright (c) 2013 Advanced Micro Devices, Inc. |
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 |
59 mtid = msg_type.c_ident |
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 --- |