summaryrefslogtreecommitdiff
path: root/src/arch/sparc/isa/formats
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2006-05-26 18:40:00 -0400
committerAli Saidi <saidi@eecs.umich.edu>2006-05-26 18:40:00 -0400
commite04f60667af9884fa871935e4c1274bdf0311707 (patch)
tree0d580e464c384d8636f9a9c685aaa491db9d8793 /src/arch/sparc/isa/formats
parent28ea9729427d2c994d54f0548f80afaeb221b88f (diff)
downloadgem5-e04f60667af9884fa871935e4c1274bdf0311707.tar.xz
Implement PR/HPR/ASR for full system
Rip out storage in miscreg file that will never store anything Add storage and defines for Priv and Hyperpriv registers Change defines to match the spec register numbers Change the way misc registers are named to match the spec with offsets to deal with ASR/PR/HPR/FSR. Change contextval to an int since both global registers and windowed registers are indexed by int in UA2005. Use bitfields for things that are rarely used in decoder Instead of decoding ASR/PR/HPR and having a specfic instruction, use a generic instruction instead Still todo: Protect rdpr, rdhpr, wrpr, wrhpr with checks that fault in insufficient privs Deal with signaling interrupts on timer expiration Deal with writes to softint/PIL generating interrupts how those are vectored to the CPU Other misc: Instruction decoding needs major help! src/arch/sparc/isa/decoder.isa: Remove tons of MISCREG_XXXX defines that weren't used and ControlRegs in that were never used. Ones that were used rarely changed to bitfields. src/arch/sparc/isa/formats/integerop.isa: These seems like a whole lot of overkill in printing, but i'll leave it the way it is for now. Allow Ccr to be set at once src/arch/sparc/isa/formats/priv.isa: PrivTick is handled by miscreg now, don't need a seperate class for it src/arch/sparc/isa/operands.isa: prune the number of control regs down to a reasonable amount src/arch/sparc/isa_traits.hh: Replace 8 defines with 1 and flick some bits src/arch/sparc/process.cc: Better to clean the entire registers that specific bits which leads to indetermanistic behavior. src/arch/sparc/regfile.hh: Rip out storage that will never be backed by anything Add storage for Priv and Hyperpriv registers change defines to match the spec change the way misc registers are named to match the spec with offsets to deal with ASR/PR/HPR/FSR. change contextval to an int since both global registers and windowed registers are indexed by int in UA2005. --HG-- extra : convert_revision : 64276a3ea884eea70112e721f85a515946ded4c2
Diffstat (limited to 'src/arch/sparc/isa/formats')
-rw-r--r--src/arch/sparc/isa/formats/integerop.isa48
-rw-r--r--src/arch/sparc/isa/formats/priv.isa48
2 files changed, 34 insertions, 62 deletions
diff --git a/src/arch/sparc/isa/formats/integerop.isa b/src/arch/sparc/isa/formats/integerop.isa
index 1fd87b1d3..1894ce541 100644
--- a/src/arch/sparc/isa/formats/integerop.isa
+++ b/src/arch/sparc/isa/formats/integerop.isa
@@ -316,22 +316,38 @@ let {{
return (header_output, decoder_output, exec_output, decode_block)
calcCcCode = '''
- CcrIccN = (Rd >> 31) & 1;
- CcrIccZ = ((Rd & 0xFFFFFFFF) == 0);
- CcrXccN = (Rd >> 63) & 1;
- CcrXccZ = (Rd == 0);
- CcrIccV = %(ivValue)s;
- CcrIccC = %(icValue)s;
- CcrXccV = %(xvValue)s;
- CcrXccC = %(xcValue)s;
- DPRINTF(Sparc, "in = %%d\\n", CcrIccN);
- DPRINTF(Sparc, "iz = %%d\\n", CcrIccZ);
- DPRINTF(Sparc, "xn = %%d\\n", CcrXccN);
- DPRINTF(Sparc, "xz = %%d\\n", CcrXccZ);
- DPRINTF(Sparc, "iv = %%d\\n", CcrIccV);
- DPRINTF(Sparc, "ic = %%d\\n", CcrIccC);
- DPRINTF(Sparc, "xv = %%d\\n", CcrXccV);
- DPRINTF(Sparc, "xc = %%d\\n", CcrXccC);
+ uint8_t tmp_ccriccc;
+ uint8_t tmp_ccriccv;
+ uint8_t tmp_ccriccz;
+ uint8_t tmp_ccriccn;
+ uint8_t tmp_ccrxccc;
+ uint8_t tmp_ccrxccv;
+ uint8_t tmp_ccrxccz;
+ uint8_t tmp_ccrxccn;
+
+ tmp_ccriccn = (Rd >> 31) & 1;
+ tmp_ccriccz = ((Rd & 0xFFFFFFFF) == 0);
+ tmp_ccrxccn = (Rd >> 63) & 1;
+ tmp_ccrxccz = (Rd == 0);
+ tmp_ccriccv = %(ivValue)s & 1;
+ tmp_ccriccc = %(icValue)s & 1;
+ tmp_ccrxccv = %(xvValue)s & 1;
+ tmp_ccrxccc = %(xcValue)s & 1;
+
+ Ccr = tmp_ccriccc | tmp_ccriccv << 1 |
+ tmp_ccriccz << 2 | tmp_ccriccn << 3|
+ tmp_ccrxccc << 4 | tmp_ccrxccv << 5|
+ tmp_ccrxccz << 6| tmp_ccrxccn << 7;
+
+
+ DPRINTF(Sparc, "in = %%d\\n", (uint16_t)tmp_ccriccn);
+ DPRINTF(Sparc, "iz = %%d\\n", (uint16_t)tmp_ccriccz);
+ DPRINTF(Sparc, "xn = %%d\\n", (uint16_t)tmp_ccrxccn);
+ DPRINTF(Sparc, "xz = %%d\\n", (uint16_t)tmp_ccrxccz);
+ DPRINTF(Sparc, "iv = %%d\\n", (uint16_t)tmp_ccriccv);
+ DPRINTF(Sparc, "ic = %%d\\n", (uint16_t)tmp_ccriccc);
+ DPRINTF(Sparc, "xv = %%d\\n", (uint16_t)tmp_ccrxccv);
+ DPRINTF(Sparc, "xc = %%d\\n", (uint16_t)tmp_ccrxccc);
'''
}};
diff --git a/src/arch/sparc/isa/formats/priv.isa b/src/arch/sparc/isa/formats/priv.isa
index a8de22c0e..7df59d736 100644
--- a/src/arch/sparc/isa/formats/priv.isa
+++ b/src/arch/sparc/isa/formats/priv.isa
@@ -51,23 +51,6 @@ output header {{
};
/**
- * Base class for user mode "tick" access.
- */
- class PrivTick : public SparcStaticInst
- {
- protected:
- // Constructor
- PrivTick(const char *mnem, ExtMachInst _machInst,
- OpClass __opClass) :
- SparcStaticInst(mnem, _machInst, __opClass)
- {
- }
-
- std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
- };
-
- /**
* Base class for privelege mode operations with immediates.
*/
class PrivImm : public Priv
@@ -83,21 +66,6 @@ output header {{
int32_t imm;
};
- /**
- * Base class for user mode "tick" access with immediates.
- */
- class PrivTickImm : public PrivTick
- {
- protected:
- // Constructor
- PrivTickImm(const char *mnem, ExtMachInst _machInst,
- OpClass __opClass) :
- PrivTick(mnem, _machInst, __opClass), imm(SIMM13)
- {
- }
-
- int32_t imm;
- };
}};
output decoder {{
@@ -106,12 +74,6 @@ output decoder {{
{
return "Privileged Instruction";
}
-
- std::string PrivTick::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
- {
- return "Regular access to Tick";
- }
}};
def template PrivExecute {{
@@ -154,16 +116,10 @@ let {{
// Primary format for integer operate instructions:
def format Priv(code, *opt_flags) {{
- checkCode = "(!PstatePriv)"
+ checkCode = "((xc->readMiscReg(PrStart + MISCREG_PSTATE))<2:2>)"
(header_output, decoder_output,
exec_output, decode_block) = doPrivFormat(code,
checkCode, name, Name, opt_flags)
}};
-// Primary format for integer operate instructions:
-def format PrivTick(code, *opt_flags) {{
- checkCode = "(!PstatePriv && TickNpt)"
- (header_output, decoder_output,
- exec_output, decode_block) = doPrivFormat(code,
- checkCode, name, Name, opt_flags)
-}};
+