simX floating-point fixes and refactoring
This commit is contained in:
73
simX/core.h
73
simX/core.h
@@ -5,6 +5,7 @@
|
||||
#include <list>
|
||||
#include <stack>
|
||||
#include <unordered_map>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
|
||||
#include "debug.h"
|
||||
@@ -13,14 +14,15 @@
|
||||
#include "decode.h"
|
||||
#include "mem.h"
|
||||
#include "warp.h"
|
||||
#include "trace.h"
|
||||
#include "pipeline.h"
|
||||
|
||||
namespace vortex {
|
||||
|
||||
class Core {
|
||||
public:
|
||||
Core(const ArchDef &arch, Decoder &decoder, MemoryUnit &mem, Word id = 0);
|
||||
~Core();
|
||||
Core(const ArchDef &arch, Decoder &decoder, MemoryUnit &mem, Word id);
|
||||
|
||||
void clear();
|
||||
|
||||
bool running() const;
|
||||
|
||||
@@ -33,7 +35,7 @@ public:
|
||||
}
|
||||
|
||||
Warp& warp(int i) {
|
||||
return warps_[i];
|
||||
return *warps_.at(i);
|
||||
}
|
||||
|
||||
Decoder& decoder() {
|
||||
@@ -42,23 +44,23 @@ public:
|
||||
|
||||
const ArchDef& arch() const {
|
||||
return arch_;
|
||||
}
|
||||
|
||||
Word interruptEntry() const {
|
||||
return interruptEntry_;
|
||||
}
|
||||
|
||||
unsigned long num_insts() const {
|
||||
return num_insts_;
|
||||
return insts_;
|
||||
}
|
||||
|
||||
unsigned long num_steps() const {
|
||||
return steps_;
|
||||
}
|
||||
|
||||
Word getIRegValue(int reg) const {
|
||||
return warps_[0]->getIRegValue(reg);
|
||||
}
|
||||
|
||||
Word get_csr(Addr addr, int tid, int wid);
|
||||
|
||||
void set_csr(Addr addr, Word value);
|
||||
void set_csr(Addr addr, Word value, int tid, int wid);
|
||||
|
||||
void barrier(int bar_id, int count, int warp_id);
|
||||
|
||||
@@ -70,20 +72,22 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
void schedule();
|
||||
void fetch();
|
||||
void decode();
|
||||
void scheduler();
|
||||
void execute_unit();
|
||||
void load_store();
|
||||
void issue();
|
||||
void execute();
|
||||
void writeback();
|
||||
|
||||
void getCacheDelays(trace_inst_t *);
|
||||
void warpScheduler();
|
||||
|
||||
std::vector<std::vector<bool>> iRenameTable_;
|
||||
std::vector<std::vector<bool>> fRenameTable_;
|
||||
std::vector<bool> vRenameTable_;
|
||||
std::vector<bool> stalled_warps_;
|
||||
|
||||
|
||||
std::vector<RegMask> in_use_iregs_;
|
||||
std::vector<RegMask> in_use_fregs_;
|
||||
RegMask in_use_vregs_;
|
||||
WarpMask stalled_warps_;
|
||||
std::vector<std::shared_ptr<Warp>> warps_;
|
||||
std::vector<WarpMask> barriers_;
|
||||
std::vector<Word> csrs_;
|
||||
std::vector<Byte> fcsrs_;
|
||||
|
||||
Word id_;
|
||||
const ArchDef &arch_;
|
||||
@@ -91,22 +95,19 @@ private:
|
||||
MemoryUnit &mem_;
|
||||
#ifdef SM_ENABLE
|
||||
RAM shared_mem_;
|
||||
#endif
|
||||
std::vector<Warp> warps_;
|
||||
std::vector<WarpMask> barriers_;
|
||||
std::vector<Word> csrs_;
|
||||
int schedule_w_;
|
||||
uint64_t steps_;
|
||||
uint64_t num_insts_;
|
||||
Word interruptEntry_;
|
||||
bool foundSchedule_;
|
||||
#endif
|
||||
|
||||
trace_inst_t inst_in_fetch_;
|
||||
trace_inst_t inst_in_decode_;
|
||||
trace_inst_t inst_in_scheduler_;
|
||||
trace_inst_t inst_in_exe_;
|
||||
trace_inst_t inst_in_lsu_;
|
||||
trace_inst_t inst_in_wb_;
|
||||
Pipeline inst_in_schedule_;
|
||||
Pipeline inst_in_fetch_;
|
||||
Pipeline inst_in_decode_;
|
||||
Pipeline inst_in_issue_;
|
||||
Pipeline inst_in_execute_;
|
||||
Pipeline inst_in_writeback_;
|
||||
|
||||
uint64_t steps_;
|
||||
uint64_t insts_;
|
||||
uint64_t loads_;
|
||||
uint64_t stores_;
|
||||
};
|
||||
|
||||
} // namespace vortex
|
||||
Reference in New Issue
Block a user