16019SN/A// -*- mode:c++ -*-
26019SN/A
312542Sgiacomo.travaglini@arm.com// Copyright (c) 2010,2018 ARM Limited
47189SN/A// All rights reserved
57189SN/A//
67189SN/A// The license below extends only to copyright in the software and shall
77189SN/A// not be construed as granting a license to any other intellectual
87189SN/A// property including but not limited to intellectual property relating
97189SN/A// to a hardware implementation of the functionality of the software
107189SN/A// licensed hereunder.  You may use the software subject to the license
117189SN/A// terms below provided that you ensure that this notice is replicated
127189SN/A// unmodified and in its entirety in all distributions of the software,
137189SN/A// modified or unmodified, in source code or in binary form.
147189SN/A//
156019SN/A// Copyright (c) 2007-2008 The Florida State University
166019SN/A// All rights reserved.
176019SN/A//
186019SN/A// Redistribution and use in source and binary forms, with or without
196019SN/A// modification, are permitted provided that the following conditions are
206019SN/A// met: redistributions of source code must retain the above copyright
216019SN/A// notice, this list of conditions and the following disclaimer;
226019SN/A// redistributions in binary form must reproduce the above copyright
236019SN/A// notice, this list of conditions and the following disclaimer in the
246019SN/A// documentation and/or other materials provided with the distribution;
256019SN/A// neither the name of the copyright holders nor the names of its
266019SN/A// contributors may be used to endorse or promote products derived from
276019SN/A// this software without specific prior written permission.
286019SN/A//
296019SN/A// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
306019SN/A// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
316019SN/A// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
326019SN/A// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
336019SN/A// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
346019SN/A// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
356019SN/A// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
366019SN/A// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
376019SN/A// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
386019SN/A// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
396019SN/A// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
406019SN/A//
416019SN/A// Authors: Stephen Hines
426019SN/A
436019SN/A////////////////////////////////////////////////////////////////////
446019SN/A//
457401SAli.Saidi@ARM.com// Breakpoint instructions
466019SN/A//
476019SN/A
4812542Sgiacomo.travaglini@arm.comdef format ArmBkptHlt() {{
4912542Sgiacomo.travaglini@arm.com    decode_block = '''
5012542Sgiacomo.travaglini@arm.com    {
5112542Sgiacomo.travaglini@arm.com        if (bits(machInst, 21)) {
5212789Sgiacomo.travaglini@arm.com            return new BkptInst(machInst);
5312542Sgiacomo.travaglini@arm.com        } else {
5412542Sgiacomo.travaglini@arm.com            uint32_t imm16 = (bits(machInst, 19, 8) << 4) |
5512542Sgiacomo.travaglini@arm.com                             (bits(machInst,  3, 0) << 0);
5612542Sgiacomo.travaglini@arm.com            return new Hlt(machInst, imm16);
5712542Sgiacomo.travaglini@arm.com        }
5812542Sgiacomo.travaglini@arm.com    }
5912542Sgiacomo.travaglini@arm.com    '''
606019SN/A}};
616019SN/A
62