Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
tinebp committed Jan 22, 2025
1 parent 9dc1d3f commit e80ee2c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
2 changes: 2 additions & 0 deletions sim/simx/decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ static const char* op_string(const Instr &instr) {
}
}

#ifdef EXT_V_ENABLE
inline void print_vec_attr(std::ostream &os, const Instr &instr) {
uint32_t mask = instr.getVattrMask();
if (mask & vattr_vlswidth)
Expand Down Expand Up @@ -432,6 +433,7 @@ inline void print_vec_attr(std::ostream &os, const Instr &instr) {
if (mask & vattr_vediv)
os << ", ediv:" << instr.getVediv();
}
#endif

namespace vortex {
std::ostream &operator<<(std::ostream &os, const Instr &instr) {
Expand Down
9 changes: 3 additions & 6 deletions sim/simx/emulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ void Emulator::warp_t::clear(uint64_t startup_addr) {
this->uuid = 0;
this->fcsr = 0;

#ifdef EXT_V_ENABLE
this->vtype = {0, 0, 0, 0, 0};
this->vl = 0;
this->vlmax = 0;
#endif

for (auto& reg_file : this->ireg_file) {
for (auto& reg : reg_file) {
#ifndef NDEBUG
Expand Down Expand Up @@ -82,6 +76,9 @@ void Emulator::warp_t::clear(uint64_t startup_addr) {
#endif
}
}
this->vtype = {0, 0, 0, 0, 0};
this->vl = 0;
this->vlmax = 0;
#endif
}

Expand Down
4 changes: 3 additions & 1 deletion sim/simx/emulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,14 @@ class Emulator {
ThreadMask tmask;
std::vector<std::vector<Word>> ireg_file;
std::vector<std::vector<uint64_t>>freg_file;
std::vector<std::vector<Byte>> vreg_file;
std::stack<ipdom_entry_t> ipdom_stack;
Byte fcsr;
#ifdef EXT_V_ENABLE
std::vector<std::vector<Byte>> vreg_file;
vtype_t vtype;
uint32_t vl;
Word vlmax;
#endif
uint32_t uuid;
};

Expand Down
24 changes: 12 additions & 12 deletions sim/simx/instr.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,18 @@ enum DecodeConstants {
};

enum VectorAttrMask {
vattr_vlswidth = (1 << 3),
vattr_vmop = (1 << 4),
vattr_vumop = (1 << 5),
vattr_vnf = (1 << 6),
vattr_vmask = (1 << 7),
vattr_vs3 = (1 << 8),
vattr_zimm = (1 << 9),
vattr_vlmul = (1 << 10),
vattr_vsew = (1 << 11),
vattr_vta = (1 << 12),
vattr_vma = (1 << 13),
vattr_vediv = (1 << 14)
vattr_vlswidth = (1 << 0),
vattr_vmop = (1 << 1),
vattr_vumop = (1 << 2),
vattr_vnf = (1 << 3),
vattr_vmask = (1 << 4),
vattr_vs3 = (1 << 5),
vattr_zimm = (1 << 6),
vattr_vlmul = (1 << 7),
vattr_vsew = (1 << 8),
vattr_vta = (1 << 9),
vattr_vma = (1 << 10),
vattr_vediv = (1 << 11)
};

class Instr {
Expand Down

0 comments on commit e80ee2c

Please sign in to comment.