19024Sgblack@eecs.umich.edu/* 29024Sgblack@eecs.umich.edu * Copyright (c) 2011 Google 39024Sgblack@eecs.umich.edu * All rights reserved. 49024Sgblack@eecs.umich.edu * 59024Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without 69024Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are 79024Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright 89024Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer; 99024Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright 109024Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the 119024Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution; 129024Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its 139024Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from 149024Sgblack@eecs.umich.edu * this software without specific prior written permission. 159024Sgblack@eecs.umich.edu * 169024Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 179024Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 189024Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 199024Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 209024Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 219024Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 229024Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 239024Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 249024Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 259024Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 269024Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 279024Sgblack@eecs.umich.edu * 289024Sgblack@eecs.umich.edu * Authors: Gabe Black 299024Sgblack@eecs.umich.edu */ 309024Sgblack@eecs.umich.edu 319024Sgblack@eecs.umich.edu#ifndef __ARCH_GENERIC_DECODE_CACHE_HH__ 329024Sgblack@eecs.umich.edu#define __ARCH_GENERIC_DECODE_CACHE_HH__ 339024Sgblack@eecs.umich.edu 349024Sgblack@eecs.umich.edu#include "arch/types.hh" 359024Sgblack@eecs.umich.edu#include "config/the_isa.hh" 369024Sgblack@eecs.umich.edu#include "cpu/decode_cache.hh" 379024Sgblack@eecs.umich.edu#include "cpu/static_inst_fwd.hh" 389024Sgblack@eecs.umich.edu 399024Sgblack@eecs.umich.edunamespace TheISA 409024Sgblack@eecs.umich.edu{ 419024Sgblack@eecs.umich.edu class Decoder; 429024Sgblack@eecs.umich.edu} 439024Sgblack@eecs.umich.edu 449024Sgblack@eecs.umich.edunamespace GenericISA 459024Sgblack@eecs.umich.edu{ 469024Sgblack@eecs.umich.edu 479024Sgblack@eecs.umich.educlass BasicDecodeCache 489024Sgblack@eecs.umich.edu{ 499024Sgblack@eecs.umich.edu private: 5012621Sgabeblack@google.com DecodeCache::InstMap<TheISA::ExtMachInst> instMap; 519024Sgblack@eecs.umich.edu DecodeCache::AddrMap<StaticInstPtr> decodePages; 529024Sgblack@eecs.umich.edu 539024Sgblack@eecs.umich.edu public: 549024Sgblack@eecs.umich.edu /// Decode a machine instruction. 559024Sgblack@eecs.umich.edu /// @param mach_inst The binary instruction to decode. 569024Sgblack@eecs.umich.edu /// @retval A pointer to the corresponding StaticInst object. 579024Sgblack@eecs.umich.edu StaticInstPtr decode(TheISA::Decoder * const decoder, 589024Sgblack@eecs.umich.edu TheISA::ExtMachInst mach_inst, Addr addr); 599024Sgblack@eecs.umich.edu}; 609024Sgblack@eecs.umich.edu 619024Sgblack@eecs.umich.edu} // namespace GenericISA 629024Sgblack@eecs.umich.edu 639024Sgblack@eecs.umich.edu#endif // __ARCH_GENERIC_DECODE_CACHE_HH__ 64