exit_gen.cc revision 12400
112397SRiken.Gohil@arm.com/* 212397SRiken.Gohil@arm.com * Copyright (c) 2017 ARM Limited 312397SRiken.Gohil@arm.com * All rights reserved 412397SRiken.Gohil@arm.com * 512397SRiken.Gohil@arm.com * The license below extends only to copyright in the software and shall 612397SRiken.Gohil@arm.com * not be construed as granting a license to any other intellectual 712397SRiken.Gohil@arm.com * property including but not limited to intellectual property relating 812397SRiken.Gohil@arm.com * to a hardware implementation of the functionality of the software 912397SRiken.Gohil@arm.com * licensed hereunder. You may use the software subject to the license 1012397SRiken.Gohil@arm.com * terms below provided that you ensure that this notice is replicated 1112397SRiken.Gohil@arm.com * unmodified and in its entirety in all distributions of the software, 1212397SRiken.Gohil@arm.com * modified or unmodified, in source code or in binary form. 1312397SRiken.Gohil@arm.com * 1412397SRiken.Gohil@arm.com * Redistribution and use in source and binary forms, with or without 1512397SRiken.Gohil@arm.com * modification, are permitted provided that the following conditions are 1612397SRiken.Gohil@arm.com * met: redistributions of source code must retain the above copyright 1712397SRiken.Gohil@arm.com * notice, this list of conditions and the following disclaimer; 1812397SRiken.Gohil@arm.com * redistributions in binary form must reproduce the above copyright 1912397SRiken.Gohil@arm.com * notice, this list of conditions and the following disclaimer in the 2012397SRiken.Gohil@arm.com * documentation and/or other materials provided with the distribution; 2112397SRiken.Gohil@arm.com * neither the name of the copyright holders nor the names of its 2212397SRiken.Gohil@arm.com * contributors may be used to endorse or promote products derived from 2312397SRiken.Gohil@arm.com * this software without specific prior written permission. 2412397SRiken.Gohil@arm.com * 2512397SRiken.Gohil@arm.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2612397SRiken.Gohil@arm.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2712397SRiken.Gohil@arm.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 2812397SRiken.Gohil@arm.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2912397SRiken.Gohil@arm.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 3012397SRiken.Gohil@arm.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 3112397SRiken.Gohil@arm.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 3212397SRiken.Gohil@arm.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 3312397SRiken.Gohil@arm.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3412397SRiken.Gohil@arm.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 3512397SRiken.Gohil@arm.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3612397SRiken.Gohil@arm.com * 3712397SRiken.Gohil@arm.com * Authors: Riken Gohil 3812397SRiken.Gohil@arm.com */ 3912397SRiken.Gohil@arm.com 4012400Sgabeblack@google.com#include "base/logging.hh" 4112397SRiken.Gohil@arm.com#include "base/trace.hh" 4212397SRiken.Gohil@arm.com#include "debug/TrafficGen.hh" 4312397SRiken.Gohil@arm.com#include "exit_gen.hh" 4412397SRiken.Gohil@arm.com#include "sim/sim_exit.hh" 4512397SRiken.Gohil@arm.com 4612397SRiken.Gohil@arm.comvoid 4712397SRiken.Gohil@arm.comExitGen::enter() 4812397SRiken.Gohil@arm.com{ 4912397SRiken.Gohil@arm.com DPRINTF(TrafficGen, "%s has encountered the exit state and will " 5012397SRiken.Gohil@arm.com "terminate the simulation.\n", name()); 5112397SRiken.Gohil@arm.com exitSimLoop(name() + " has encountered the exit state and will " 5212397SRiken.Gohil@arm.com "terminate the simulation.\n"); 5312397SRiken.Gohil@arm.com} 5412397SRiken.Gohil@arm.com 5512397SRiken.Gohil@arm.comPacketPtr 5612397SRiken.Gohil@arm.comExitGen::getNextPacket() 5712397SRiken.Gohil@arm.com{ 5812397SRiken.Gohil@arm.com panic("Simulation should have exited"); 5912397SRiken.Gohil@arm.com return NULL; 6012397SRiken.Gohil@arm.com} 6112397SRiken.Gohil@arm.com 6212397SRiken.Gohil@arm.comTick 6312397SRiken.Gohil@arm.comExitGen::nextPacketTick(bool elastic, Tick delay) const 6412397SRiken.Gohil@arm.com{ 6512397SRiken.Gohil@arm.com return MaxTick; 6612397SRiken.Gohil@arm.com} 67