2006-05-22 20:29:33 +02:00
|
|
|
// Copyright (c) 2006 The Regents of The University of Michigan
|
|
|
|
// All rights reserved.
|
|
|
|
//
|
|
|
|
// Redistribution and use in source and binary forms, with or without
|
|
|
|
// modification, are permitted provided that the following conditions are
|
|
|
|
// met: redistributions of source code must retain the above copyright
|
|
|
|
// notice, this list of conditions and the following disclaimer;
|
|
|
|
// redistributions in binary form must reproduce the above copyright
|
|
|
|
// notice, this list of conditions and the following disclaimer in the
|
|
|
|
// documentation and/or other materials provided with the distribution;
|
|
|
|
// neither the name of the copyright holders nor the names of its
|
|
|
|
// contributors may be used to endorse or promote products derived from
|
|
|
|
// this software without specific prior written permission.
|
|
|
|
//
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
//
|
|
|
|
// Authors: Gabe Black
|
|
|
|
// Steve Reinhardt
|
|
|
|
|
2006-01-29 23:25:54 +01:00
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2006-04-01 03:31:53 +02:00
|
|
|
// Nop instruction
|
2006-01-29 23:25:54 +01:00
|
|
|
//
|
|
|
|
|
2006-05-23 04:15:22 +02:00
|
|
|
// Per-cpu-model nop execute method.
|
|
|
|
def template NopExec {{
|
|
|
|
|
|
|
|
Fault execute(%(CPU_exec_context)s *xc, Trace::InstRecord *traceData) const
|
|
|
|
{
|
|
|
|
// Nothing to see here, move along
|
|
|
|
return NoFault;
|
|
|
|
}
|
|
|
|
}};
|
|
|
|
|
2006-01-29 23:25:54 +01:00
|
|
|
output header {{
|
|
|
|
/**
|
2006-04-01 03:31:53 +02:00
|
|
|
* Nop class.
|
2006-01-29 23:25:54 +01:00
|
|
|
*/
|
2006-04-01 03:31:53 +02:00
|
|
|
class Nop : public SparcStaticInst
|
2006-01-29 23:25:54 +01:00
|
|
|
{
|
2006-04-01 03:31:53 +02:00
|
|
|
public:
|
2006-03-07 10:33:10 +01:00
|
|
|
// Constructor
|
2006-04-01 03:31:53 +02:00
|
|
|
Nop(const char *mnem, ExtMachInst _machInst, OpClass __opClass) :
|
2006-03-07 10:33:10 +01:00
|
|
|
SparcStaticInst(mnem, _machInst, __opClass)
|
|
|
|
{
|
|
|
|
}
|
2006-01-29 23:25:54 +01:00
|
|
|
|
2006-04-01 03:31:53 +02:00
|
|
|
// All Nop instructions do the same thing, so this can be
|
2006-05-23 04:15:22 +02:00
|
|
|
// defined here. Nops can be defined directly, so there
|
|
|
|
// needs to be a default implementation. Interpolate via
|
|
|
|
// template so i gets expanded to a set of
|
|
|
|
// cpu-model-specific functions.
|
|
|
|
%(NopExec)s
|
2006-04-01 03:31:53 +02:00
|
|
|
|
2006-03-07 10:33:10 +01:00
|
|
|
std::string generateDisassembly(Addr pc,
|
|
|
|
const SymbolTable *symtab) const;
|
2006-01-29 23:25:54 +01:00
|
|
|
};
|
|
|
|
}};
|
|
|
|
|
|
|
|
output decoder {{
|
2006-04-01 03:31:53 +02:00
|
|
|
std::string Nop::generateDisassembly(Addr pc,
|
2006-03-07 10:33:10 +01:00
|
|
|
const SymbolTable *symtab) const
|
2006-01-29 23:25:54 +01:00
|
|
|
{
|
2006-04-01 03:31:53 +02:00
|
|
|
std::stringstream response;
|
|
|
|
printMnemonic(response, mnemonic);
|
|
|
|
return response.str();
|
2006-01-29 23:25:54 +01:00
|
|
|
}
|
|
|
|
}};
|
|
|
|
|
2006-04-01 03:31:53 +02:00
|
|
|
def template NopExecute {{
|
2006-03-07 10:33:10 +01:00
|
|
|
Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
|
|
|
|
Trace::InstRecord *traceData) const
|
2006-01-29 23:25:54 +01:00
|
|
|
{
|
2006-03-07 10:33:10 +01:00
|
|
|
//Nothing to see here, move along
|
|
|
|
return NoFault;
|
2006-01-29 23:25:54 +01:00
|
|
|
}
|
|
|
|
}};
|
|
|
|
|
|
|
|
// Primary format for integer operate instructions:
|
2006-04-01 03:31:53 +02:00
|
|
|
def format Nop(code, *opt_flags) {{
|
2006-01-29 23:25:54 +01:00
|
|
|
orig_code = code
|
|
|
|
cblk = CodeBlock(code)
|
2006-04-01 03:31:53 +02:00
|
|
|
iop = InstObjParams(name, Name, 'Nop', cblk, opt_flags)
|
2006-01-29 23:25:54 +01:00
|
|
|
header_output = BasicDeclare.subst(iop)
|
|
|
|
decoder_output = BasicConstructor.subst(iop)
|
2006-03-16 19:58:50 +01:00
|
|
|
decode_block = BasicDecode.subst(iop)
|
2006-04-01 03:31:53 +02:00
|
|
|
exec_output = NopExecute.subst(iop)
|
2006-01-29 23:25:54 +01:00
|
|
|
}};
|