4 sv_reg_csr_entry sv_csrs
[SV_CSR_SZ
];
5 sv_reg_entry sv_int_tb
[NXPR
];
6 sv_reg_entry sv_fp_tb
[NFPR
];
7 sv_pred_csr_entry sv_pred_csrs
[SV_CSR_SZ
];
8 sv_pred_entry sv_pred_tb
[NXPR
];
10 bool sv_check_reg(bool intreg
, uint64_t reg
)
23 // XXX raise exception
25 if (r
->active
&& r
->isvec
)
32 /* this is the "remap" function. note that registers can STILL BE REDIRECTED
33 * yet NOT BE MARKED AS A VECTOR.
35 * reg 5 -> active=false, regidx=XX, isvec=XX -> returns 5
36 * reg 5 -> active=true , regidx=35, isvec=false -> returns 35
37 * reg 5 -> active=true , regidx=35, isvec=true -> returns 35 *PLUS LOOP*
39 * so it is possible for example to use the remap system for C instructions
40 * to get access to the *full* range of registers x0..x63 (yes 63 because
41 * SV doubles both the int and fp regfile sizes), by setting
42 * "active=true, isvec=false" for any of x8..x15
44 * where "active=true, isvec=true" this is the "expected" behaviour
45 * of SV. it's "supposed" to "just" be a vectorisation API. it isn't:
46 * it's quite a bit more.
48 uint64_t sv_insn_t::remap(uint64_t reg
, bool intreg
, int &voffs
)
50 // okaay so first determine which map to use. intreg is passed
51 // in (ultimately) from id_regs.py's examination of the use of
52 // FRS1/RS1, WRITE_FRD/WRITE_RD, which in turn gets passed
53 // in from sv_insn_t::fimap...
63 // next we check if this entry is active. if not, the register
64 // is not being "redirected", so just return the actual reg.
67 return reg
; // not active: return as-is
70 // next we go through the lookup table. *THIS* is why the
71 // sv_reg_entry table is 32 entries (5-bit) *NOT* 6 bits
72 // the *KEY* (reg) is 5-bit, the *VALUE* (actual target reg) is 6-bit
73 // XXX TODO: must actually double NXPR and NXFR in processor.h to cope!!
76 // now we determine if this is a scalar/vector: if it's scalar
77 // we return the re-mapped register...
78 if (!r
->isvec
) // scalar
80 return reg
; // ... remapped at this point...
83 // aaand now, as it's a "vector", FINALLY we can add on the loop-offset
84 // which was passed in to the sv_insn_t constructor (by reference)
85 // and, at last, we have "parallelism" a la contiguous registers.
86 reg
+= voffs
; // wheww :)
88 // however... before returning, we increment the loop-offset for
89 // this particular register, so that on the next loop the next
90 // contiguous register will be used.