Browse Source

Use class member initialization in vector unit

pull/2049/head
Andrew Waterman 9 months ago
parent
commit
d3b3fcba82
  1. 48
      riscv/vector_unit.h

48
riscv/vector_unit.h

@ -87,19 +87,20 @@ using EGU8x16_t = std::array<uint8_t, 16>;
class vectorUnit_t class vectorUnit_t
{ {
public: public:
processor_t* p; processor_t* p = nullptr;
void *reg_file; void *reg_file = nullptr;
reg_t vlmax; int setvl_count = 0;
reg_t vlenb; reg_t vlmax = 0;
csr_t_p vxsat; reg_t vlenb = 0;
vector_csr_t_p vxrm, vstart, vl, vtype; csr_t_p vxsat = 0;
reg_t vma, vta; vector_csr_t_p vxrm = 0, vstart = 0, vl = 0, vtype = 0;
reg_t vsew; reg_t vma = 0, vta = 0;
float vflmul; reg_t vsew = 0;
reg_t altfmt; float vflmul = 0;
reg_t ELEN, VLEN; reg_t altfmt = 0;
bool vill; reg_t ELEN = 0, VLEN = 0;
bool vstart_alu; bool vill = false;
bool vstart_alu = false;
// vector element for various SEW // vector element for various SEW
template<class T> T& elt(reg_t vReg, reg_t n, bool is_write = false); template<class T> T& elt(reg_t vReg, reg_t n, bool is_write = false);
@ -122,26 +123,7 @@ public:
void reset(); void reset();
vectorUnit_t(): vectorUnit_t() {}
p(0),
reg_file(0),
vlmax(0),
vlenb(0),
vxsat(0),
vxrm(0),
vstart(0),
vl(0),
vtype(0),
vma(0),
vta(0),
vsew(0),
vflmul(0),
altfmt(0),
ELEN(0),
VLEN(0),
vill(false),
vstart_alu(false) {
}
~vectorUnit_t() { ~vectorUnit_t() {
free(reg_file); free(reg_file);

Loading…
Cancel
Save