X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fcpu%2Finorder%2Freg_dep_map.hh;h=fa69e22342166f7173685fccd52b36c96865226c;hb=1eec115c31395e2819c073a1859d75eb5933dac2;hp=77d0cf0cae4d87a60e718eb346988482ca02b0b5;hpb=19e3eb29154ad17664bfe239423f6ba64c77cf05;p=gem5.git diff --git a/src/cpu/inorder/reg_dep_map.hh b/src/cpu/inorder/reg_dep_map.hh index 77d0cf0ca..fa69e2234 100644 --- a/src/cpu/inorder/reg_dep_map.hh +++ b/src/cpu/inorder/reg_dep_map.hh @@ -34,22 +34,24 @@ #include #include +#include #include "arch/isa_traits.hh" #include "config/the_isa.hh" #include "cpu/inorder/pipeline_traits.hh" -class InOrderCPU; - class RegDepMap { + public: typedef ThePipeline::DynInstPtr DynInstPtr; + typedef TheISA::RegIndex RegIndex; + typedef uint8_t RegType; - public: RegDepMap(int size = TheISA::TotalNumRegs); - ~RegDepMap(); + static std::string mapNames[]; + std::string name(); void setCPU(InOrderCPU *_cpu); @@ -60,47 +62,47 @@ class RegDepMap /** Insert all of a instruction's destination registers into map*/ void insert(DynInstPtr inst); - /** Insert an instruction into a specific destination register index - * onto map - */ - void insert(unsigned idx, DynInstPtr inst); - /** Remove all of a instruction's destination registers into map*/ void remove(DynInstPtr inst); - /** Remove a specific instruction and dest. register index from map*/ - void remove(unsigned idx, DynInstPtr inst); - /** Remove Front instruction from a destination register */ - void removeFront(unsigned idx, DynInstPtr inst); + void removeFront(uint8_t reg_type, RegIndex idx, DynInstPtr inst); /** Is the current instruction able to read from this * destination register? */ - bool canRead(unsigned idx, DynInstPtr inst); + bool canRead(uint8_t reg_type, RegIndex idx, DynInstPtr inst); /** Is the current instruction able to get a forwarded value from * another instruction for this destination register? */ - DynInstPtr canForward(unsigned reg_idx, DynInstPtr inst, unsigned clean_idx); + DynInstPtr canForward(uint8_t reg_type, unsigned reg_idx, + DynInstPtr inst); /** find an instruction to forward/bypass a value from */ - DynInstPtr findBypassInst(unsigned idx); + DynInstPtr findBypassInst(RegIndex idx); /** Is the current instruction able to write to this * destination register? */ - bool canWrite(unsigned idx, DynInstPtr inst); + bool canWrite(uint8_t reg_type, RegIndex idx, DynInstPtr inst); /** Size of Dependency of Map */ - int depSize(unsigned idx); + int depSize(RegIndex idx); void dump(); - protected: - // Eventually make this a map of lists for - // efficiency sake! - std::vector > regMap; + private: + /** Insert an instruction into a specific destination register index + * onto map. + */ + void insert(uint8_t reg_type, RegIndex idx, DynInstPtr inst); + + /** Remove a specific instruction and dest. register index from map */ + void remove(uint8_t reg_type, RegIndex idx, DynInstPtr inst); + + typedef std::vector > DepMap; + std::vector regMap; InOrderCPU *cpu; };