diff options
Diffstat (limited to 'inc/instrDTO.h')
-rw-r--r-- | inc/instrDTO.h | 69 |
1 files changed, 63 insertions, 6 deletions
diff --git a/inc/instrDTO.h b/inc/instrDTO.h index 86cec05..77a223e 100644 --- a/inc/instrDTO.h +++ b/inc/instrDTO.h @@ -1,5 +1,10 @@ #ifndef INSTRDTO_H #define INSTRDTO_H +#include "accessor.h" +#include "instr.h" +#include <functional> +#include <string> +#include <unordered_map> class InstrDTO { @@ -11,29 +16,81 @@ class InstrDTO ~InstrDTO() = default; /** - * @return if_cycle + * @return hist entry for Accessor */ - int get_if_cycle(); + int get_time_of(Accessor); + /** + * @return id_cycle + */ + int get_id_cycle(); /** * @return instr_bits */ signed int get_instr_bits(); + /** + * @return s1 + */ + signed int get_s1(); + /** + * @return s2 + */ + signed int get_s2(); + /** + * @return s3 + */ + signed int get_s3(); + /** + * @return the mnemonic of the instruction + */ + Mnemonic get_mnemonic(); /** - * @param if_cycle + * @param set hist key */ - void set_if_cycle(int); + void set_time_of(Accessor, int); /** * @param instr_bits */ void set_instr_bits(signed int); + /** + * @param s1 + */ + void set_s1(signed int); + /** + * @param s2 + */ + void set_s2(signed int); + /** + * @param s3 + */ + void set_s3(signed int); + /** + * @param the mnemonic of the instruction + */ + void set_mnemonic(Mnemonic); private: /** - * The current clock cycle. + * The clock cycle each stage finished an operation. + */ + std::unordered_map<Accessor, int> hist; + /** + * The raw bits encoding the instruction. */ - int if_cycle; signed int instr_bits; + /** + * Slots in this instruction, for storing temporary registers, immediates, + * or other. + * Some instruction types may use these differently. + * The `oper` function is in charge of knowing how to parse these. + */ + signed int s1; + signed int s2; + signed int s3; + /** + * The mnemonic of the operation. + */ + Mnemonic mnemonic; }; #endif /* INSTRDTO_H_INCLUDED */ |