110981SBrad.Beckmann@amd.com#
210981SBrad.Beckmann@amd.com# Copyright (c) 2013-15 Advanced Micro Devices, Inc.
310981SBrad.Beckmann@amd.com# All rights reserved.
410981SBrad.Beckmann@amd.com#
510981SBrad.Beckmann@amd.com# Redistribution and use in source and binary forms, with or without
610981SBrad.Beckmann@amd.com# modification, are permitted provided that the following conditions are
710981SBrad.Beckmann@amd.com# met: redistributions of source code must retain the above copyright
810981SBrad.Beckmann@amd.com# notice, this list of conditions and the following disclaimer;
910981SBrad.Beckmann@amd.com# redistributions in binary form must reproduce the above copyright
1010981SBrad.Beckmann@amd.com# notice, this list of conditions and the following disclaimer in the
1110981SBrad.Beckmann@amd.com# documentation and/or other materials provided with the distribution;
1210981SBrad.Beckmann@amd.com# neither the name of the copyright holders nor the names of its
1310981SBrad.Beckmann@amd.com# contributors may be used to endorse or promote products derived from
1410981SBrad.Beckmann@amd.com# this software without specific prior written permission.
1510981SBrad.Beckmann@amd.com#
1610981SBrad.Beckmann@amd.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1710981SBrad.Beckmann@amd.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1810981SBrad.Beckmann@amd.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1910981SBrad.Beckmann@amd.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2010981SBrad.Beckmann@amd.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2110981SBrad.Beckmann@amd.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2210981SBrad.Beckmann@amd.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2310981SBrad.Beckmann@amd.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2410981SBrad.Beckmann@amd.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2510981SBrad.Beckmann@amd.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2610981SBrad.Beckmann@amd.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2710981SBrad.Beckmann@amd.com#
2810981SBrad.Beckmann@amd.com
2910981SBrad.Beckmann@amd.comfrom slicc.ast.StatementAST import StatementAST
3010981SBrad.Beckmann@amd.com
3110981SBrad.Beckmann@amd.comclass CheckNextCycleAST(StatementAST):
3210981SBrad.Beckmann@amd.com    def __init__(self, slicc):
3310981SBrad.Beckmann@amd.com        super(CheckNextCycleAST, self).__init__(slicc)
3410981SBrad.Beckmann@amd.com
3510981SBrad.Beckmann@amd.com    def __repr__(self):
3610981SBrad.Beckmann@amd.com        return "[CheckNextCycleAST]"
3710981SBrad.Beckmann@amd.com
3810981SBrad.Beckmann@amd.com    def generate(self, code, return_type):
3910981SBrad.Beckmann@amd.com        code("scheduleEvent(Cycles(1));")
4010981SBrad.Beckmann@amd.com        return "CheckNextCycle"
41