r->elwidth = c->b.elwidth;
r->regidx = c->b.regidx;
r->isvec = c->b.isvec;
- r->packed = c->b.packed;
r->active = true;
fprintf(stderr, "setting REGCFG type:%d isvec:%d %d %d\n",
c->b.type, r->isvec, (int)idx, (int)r->regidx);
r->regidx = c->b.regidx;
r->zero = c->b.zero;
r->inv = c->b.inv;
- r->active = c->b.active;
+ r->packed = c->b.packed;
+ r->active = true;
fprintf(stderr, "setting PREDCFG type:%d zero:%d %d %d\n",
c->b.type, r->zero, (int)idx, (int)r->regidx);
}
#include "decode.h"
// useful macros for constructing SV reg and predicate CSR CAM entries
-#define SV_REG_CSR(type, regkey, elwidth, regidx, isvec, packed) \
- (regkey | (elwidth<<5) | (type<<7) | (regidx<<8) | (isvec<<14) | (packed<<15))
-#define SV_PRED_CSR(type, regkey, zero, inv, regidx, active) \
- (regkey | (zero<<5) | (inv<<6) | (type<<7) | (regidx<<8) | (active<<14))
+#define SV_REG_CSR(type, regkey, elwidth, regidx, isvec) \
+ (regkey | (elwidth<<5) | (type<<7) | (regidx<<8) | (isvec<<15))
+#define SV_PRED_CSR(type, regkey, zero, inv, regidx, packed) \
+ (regkey | (zero<<5) | (inv<<6) | (type<<7) | (regidx<<8) | (packed<<15))
// this table is for the CSRs (4? for RV32E, 16 for other types)
// it's a CAM that's used to generate 2 tables (below)
union sv_reg_csr_entry {
struct {
uint64_t regkey : 5; // 5 bits
- unsigned int elwidth: 2; // 0=8-bit, 1=dflt, 2=dflt/2 3=dflt*2
+ unsigned int elwidth: 2; // 0=dflt, 1=dflt/2, 2=dflt*2 3=8-bit
unsigned int type : 1; // 1=INT, 0=FP
- uint64_t regidx : 6; // yes 6 bits
+ uint64_t regidx : 7; // yes 6 bits
unsigned int isvec : 1; // vector=1, scalar=0
- unsigned int packed : 1; // Packed SIMD=1
} b;
unsigned short u;
};
// in SV however the instruction is STILL ONLY 5 BITS.
typedef struct {
unsigned int elwidth: 2; // 0=8-bit, 1=dflt, 2=dflt/2 3=dflt*2
- uint64_t regidx : 6; // yes 6 bits.
+ uint64_t regidx : 7; // yes 7 bits.
unsigned int isvec : 1; // vector=1, scalar=0
- unsigned int packed : 1; // Packed SIMD=1
unsigned int active : 1; // enabled=1, disabled=0
} sv_reg_entry;
unsigned int zero : 1; // zeroing=1, skipping=0
unsigned int inv : 1; // inversion=1
unsigned int type : 1; // 1=INT, 0=FP
- uint64_t regidx: 6; // 6 bits
- unsigned int active: 1; // enabled=1, disabled=0
+ uint64_t regidx: 7; // 7 bits
+ unsigned int packed : 1; // Packed SIMD=1
} b;
unsigned short u;
};
uint64_t regkey: 5; // 5 bits
unsigned int zero : 1; // zeroing=1, skipping=0
unsigned int inv : 1; // inversion=1
- uint64_t regidx: 6; // 6 bits
+ uint64_t regidx: 7; // 7 bits
unsigned int active: 1; // enabled=1, disabled=0
+ unsigned int packed : 1; // Packed SIMD=1
} sv_pred_entry;
bool sv_check_reg(bool intreg, uint64_t reg);