From 043c2566c112f0d913c52aa80c9fcc4da5fb11ae Mon Sep 17 00:00:00 2001 From: bd Date: Thu, 27 Mar 2025 20:47:44 -0400 Subject: Use an unordered map to record pipe stage history on instructions --- inc/instrDTO.h | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'inc') diff --git a/inc/instrDTO.h b/inc/instrDTO.h index 7f2c688..2a6ab1f 100644 --- a/inc/instrDTO.h +++ b/inc/instrDTO.h @@ -2,6 +2,8 @@ #define INSTRDTO_H #include #include +#include +#include "accessor.h" class InstrDTO { @@ -13,9 +15,9 @@ class InstrDTO ~InstrDTO() = default; /** - * @return if_cycle + * @return hist entry for Accessor */ - int get_if_cycle(); + int get_time_of(Accessor); /** * @return id_cycle */ @@ -42,13 +44,9 @@ class InstrDTO std::string get_oper_name(); /** - * @param if_cycle + * @param set hist key */ - void set_if_cycle(int); - /** - * @param id_cycle - */ - void set_id_cycle(int); + void set_time_of(Accessor, int); /** * @param instr_bits */ @@ -68,13 +66,9 @@ class InstrDTO private: /** - * The clock cycle this instruction finished being fetched. - */ - int if_cycle; - /** - * The clock cycle this instruction finished being identified. + * The clock cycle each stage finished an operation. */ - int id_cycle; + std::unordered_map hist; /** * The raw bits encoding the instruction. */ -- cgit v1.2.3