EnqueueStatementAST.py (10472:399f35ed5cca) EnqueueStatementAST.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;

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

49 msg_type = self.type_ast.type
50
51 # Add new local var to symbol table
52 v = Var(self.symtab, "out_msg", self.location, msg_type, "*out_msg",
53 self.pairs)
54 self.symtab.newSymbol(v)
55
56 # Declare message
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;

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

50 msg_type = self.type_ast.type
51
52 # Add new local var to symbol table
53 v = Var(self.symtab, "out_msg", self.location, msg_type, "*out_msg",
54 self.pairs)
55 self.symtab.newSymbol(v)
56
57 # Declare message
57 code("std::shared_ptr<${{msg_type.ident}}> out_msg = "\
58 "std::make_shared<${{msg_type.ident}}>(clockEdge());")
58 code("std::shared_ptr<${{msg_type.c_ident}}> out_msg = "\
59 "std::make_shared<${{msg_type.c_ident}}>(clockEdge());")
59
60 # The other statements
61 t = self.statements.generate(code, None)
62 self.queue_name.assertType("OutPort")
63
64 if self.latexpr != None:
65 ret_type, rcode = self.latexpr.inline(True)
66 code("(${{self.queue_name.var.code}}).enqueue(" \

--- 13 unchanged lines hidden ---
60
61 # The other statements
62 t = self.statements.generate(code, None)
63 self.queue_name.assertType("OutPort")
64
65 if self.latexpr != None:
66 ret_type, rcode = self.latexpr.inline(True)
67 code("(${{self.queue_name.var.code}}).enqueue(" \

--- 13 unchanged lines hidden ---