add remap CSR set
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 3 Nov 2018 10:25:42 +0000 (10:25 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 3 Nov 2018 10:25:42 +0000 (10:25 +0000)
riscv/processor.cc
riscv/sv.h

index 5c95f8ce6f2981750850139e0f0fec766d3c2e39..4e15497bd83184861c642b49e1649f7b80340790 100644 (file)
@@ -514,6 +514,16 @@ void processor_t::set_csr(int which, reg_t val)
       }
       break;
     }
+    case CSR_UREMAP:
+    {
+      state.remap[0].regidx = get_field(val, SV_REMAP_REGIDX0);
+      state.remap[1].regidx = get_field(val, SV_REMAP_REGIDX1);
+      state.remap[2].regidx = get_field(val, SV_REMAP_REGIDX2);
+      state.remap[0].shape = get_field(val, SV_REMAP_SHAPE0);
+      state.remap[1].shape = get_field(val, SV_REMAP_SHAPE1);
+      state.remap[2].shape = get_field(val, SV_REMAP_SHAPE2);
+      break;
+    }
 #endif
     case CSR_FFLAGS:
       dirty_fp_state;
index 89ed2e9d75bd801abd5742b6f4c2b2d91b4295d2..87c1ad3665a04a7372f47c521199e371f49bc73f 100644 (file)
@@ -84,4 +84,11 @@ typedef struct {
     int permute;
 } sv_shape_t;
 
+#define SV_REMAP_REGIDX0 (0x7f)
+#define SV_REMAP_REGIDX1 (0x7f<<8)
+#define SV_REMAP_REGIDX2 (0x7f<<16)
+#define SV_REMAP_SHAPE0 (0x3<<24)
+#define SV_REMAP_SHAPE1 (0x3<<26)
+#define SV_REMAP_SHAPE2 (0x3<<28)
+
 #endif