[sim, xcc] added PCRs to replace k0 and k1
authorAndrew Waterman <waterman@s141.Millennium.Berkeley.EDU>
Tue, 7 Sep 2010 05:48:37 +0000 (22:48 -0700)
committerAndrew Waterman <waterman@s141.Millennium.Berkeley.EDU>
Tue, 7 Sep 2010 05:48:37 +0000 (22:48 -0700)
riscv/insns/mfpcr.h
riscv/insns/mtpcr.h
riscv/insns/mwfpcr.h [deleted file]
riscv/insns/mwtpcr.h [deleted file]
riscv/insns/rdhwr.h [deleted file]
riscv/insns/slori.h [deleted file]
riscv/processor.h

index 05ed297c5b0e380a743c429168c56351fb2912e2..d9bfc223f20d1a0de02c02d3ac7b559dde8f94d8 100644 (file)
@@ -25,6 +25,13 @@ switch(insn.rtype.rb)
     val = sim->get_fromhost();
     break;
 
+  case 24:
+    val = pcr_k0;
+    break;
+  case 25:
+    val = pcr_k1;
+    break;
+
   default:
     val = -1;
 }
index 01b3e2f558d44bc4dc9385430dddc35759eff809..cbb580b52d152bc969aa299eeb9aca46f531680b 100644 (file)
@@ -17,4 +17,11 @@ switch(insn.rtype.rb)
   case 16:
     sim->set_tohost(val);
     break;
+
+  case 24:
+    pcr_k0 = val;
+    break;
+  case 25:
+    pcr_k1 = val;
+    break;
 }
diff --git a/riscv/insns/mwfpcr.h b/riscv/insns/mwfpcr.h
deleted file mode 100644 (file)
index 8a0a84a..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-require_supervisor;
-
-switch(insn.rtype.rb)
-{
-  case 0:
-    RA = sext32(sr);
-    break;
-  case 1:
-    RA = sext32(epc);
-    break;
-  case 2:
-    RA = sext32(badvaddr);
-    break;
-  case 3:
-    RA = sext32(ebase);
-    break;
-
-  case 8:
-    RA = sext32(MEMSIZE >> 12);
-    break;
-
-  case 17:
-    RA = sext32(sim->get_fromhost());
-    break;
-
-  default:
-    RA = -1;
-}
diff --git a/riscv/insns/mwtpcr.h b/riscv/insns/mwtpcr.h
deleted file mode 100644 (file)
index ca593df..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-require_supervisor;
-
-switch(insn.rtype.rb)
-{
-  case 0:
-    set_sr(sext32(RA));
-    break;
-  case 1:
-    epc = sext32(RA);
-    break;
-  case 3:
-    ebase = sext32(RA & ~0xFFF);
-    break;
-
-  case 16:
-    sim->set_tohost(sext32(RA));
-    break;
-}
diff --git a/riscv/insns/rdhwr.h b/riscv/insns/rdhwr.h
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/riscv/insns/slori.h b/riscv/insns/slori.h
deleted file mode 100644 (file)
index 732091b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-RA = (RA << 32) | (BIGIMM << IMM_BITS);
index 942c491836255235261a03ddb7a8607f8e37e19b..2624b40a46801840a688c9fb06ba45d8e21e97f0 100644 (file)
@@ -27,6 +27,8 @@ private:
   reg_t epc;
   reg_t badvaddr;
   reg_t ebase;
+  reg_t pcr_k0;
+  reg_t pcr_k1;
   uint32_t id;
   uint32_t sr;