decoder.hh (9020:14321ce30881) decoder.hh (9022:bb25e7646c41)
1/*
2 * Copyright (c) 2012 Google
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;

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

26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Gabe Black
29 */
30
31#ifndef __ARCH_MIPS_DECODER_HH__
32#define __ARCH_MIPS_DECODER_HH__
33
1/*
2 * Copyright (c) 2012 Google
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;

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

26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Gabe Black
29 */
30
31#ifndef __ARCH_MIPS_DECODER_HH__
32#define __ARCH_MIPS_DECODER_HH__
33
34#include "arch/generic/decoder.hh"
34#include "arch/types.hh"
35#include "cpu/decode_cache.hh"
36#include "cpu/static_inst_fwd.hh"
35
36namespace MipsISA
37{
38
37
38namespace MipsISA
39{
40
39class Decoder : public GenericISA::Decoder
40{};
41class Decoder
42{
43 protected:
44 /// A cache of decoded instruction objects.
45 static DecodeCache defaultCache;
41
46
47 public:
48 StaticInstPtr decodeInst(ExtMachInst mach_inst);
49
50 /// Decode a machine instruction.
51 /// @param mach_inst The binary instruction to decode.
52 /// @retval A pointer to the corresponding StaticInst object.
53 StaticInstPtr
54 decode(ExtMachInst mach_inst, Addr addr)
55 {
56 return defaultCache.decode(this, mach_inst, addr);
57 }
58};
59
42} // namespace MipsISA
43
44#endif // __ARCH_MIPS_DECODER_HH__
60} // namespace MipsISA
61
62#endif // __ARCH_MIPS_DECODER_HH__