mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-06-29 01:53:36 -04:00
UUID refactoring
This commit is contained in:
parent
8a933520f0
commit
ac669a30ca
3 changed files with 12 additions and 16 deletions
|
@ -225,8 +225,6 @@ uint64_t dpi_uuid_gen(bool reset, int wid, uint64_t PC) {
|
||||||
uuid_gen = it->second;
|
uuid_gen = it->second;
|
||||||
}
|
}
|
||||||
uint32_t instr_uuid = uuid_gen->get_uuid(PC);
|
uint32_t instr_uuid = uuid_gen->get_uuid(PC);
|
||||||
uint32_t instr_id = instr_uuid & 0xffff;
|
uint64_t uuid = (uint64_t(instr_uuid) << 12) | wid;
|
||||||
uint32_t instr_ref = instr_uuid >> 16;
|
|
||||||
uint64_t uuid = (uint64_t(instr_ref) << 32) | (wid << 16) | instr_id;
|
|
||||||
return uuid;
|
return uuid;
|
||||||
}
|
}
|
|
@ -24,19 +24,19 @@ public:
|
||||||
virtual ~UUIDGenerator() {}
|
virtual ~UUIDGenerator() {}
|
||||||
|
|
||||||
uint32_t get_uuid(uint64_t PC) {
|
uint32_t get_uuid(uint64_t PC) {
|
||||||
uint32_t id;
|
uint16_t id;
|
||||||
uint32_t ref;
|
uint16_t ref;
|
||||||
auto it = uuid_map_.find(PC);
|
auto it = uuid_map_.find(PC);
|
||||||
if (it != uuid_map_.end()) {
|
if (it != uuid_map_.end()) {
|
||||||
uint64_t value = it->second;
|
uint32_t value = it->second;
|
||||||
id = value & 0xffff;
|
ref = value & 0xffff;
|
||||||
ref = value >> 16;
|
id = value >> 16;
|
||||||
|
++ref;
|
||||||
} else {
|
} else {
|
||||||
|
ref = 0;
|
||||||
id = ids_++;
|
id = ids_++;
|
||||||
ref = -1;
|
}
|
||||||
}
|
uint32_t ret = (uint32_t(id) << 16) | ref;
|
||||||
++ref;
|
|
||||||
uint64_t ret = (uint64_t(ref) << 16) | id;
|
|
||||||
uuid_map_[PC] = ret;
|
uuid_map_[PC] = ret;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ public:
|
||||||
private:
|
private:
|
||||||
|
|
||||||
std::unordered_map<uint64_t, uint32_t> uuid_map_;
|
std::unordered_map<uint64_t, uint32_t> uuid_map_;
|
||||||
uint32_t ids_;
|
uint16_t ids_;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
|
@ -141,9 +141,7 @@ instr_trace_t* Emulator::step() {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
uint32_t instr_uuid = warp.uui_gen.get_uuid(warp.PC);
|
uint32_t instr_uuid = warp.uui_gen.get_uuid(warp.PC);
|
||||||
uint32_t g_wid = core_->id() * arch_.num_warps() + scheduled_warp;
|
uint32_t g_wid = core_->id() * arch_.num_warps() + scheduled_warp;
|
||||||
uint32_t instr_id = instr_uuid & 0xffff;
|
uint64_t uuid = (uint64_t(instr_uuid) << 12) | g_wid;
|
||||||
uint32_t instr_ref = instr_uuid >> 16;
|
|
||||||
uint64_t uuid = (uint64_t(instr_ref) << 32) | (g_wid << 16) | instr_id;
|
|
||||||
#else
|
#else
|
||||||
uint64_t uuid = 0;
|
uint64_t uuid = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue