00001 #ifndef PORT_MAPPING_CACHE_H_INCLUDED_ 00002 #define PORT_MAPPING_CACHE_H_INCLUDED_ 00003 00004 #include <unordered_map> 00005 00006 #include "rose.h" 00007 00008 #include "instance_tree.h" 00009 #include "path_instance_mapper.h" 00010 00011 namespace risc { 00012 00016 class PortMappingCache { 00017 00018 public: 00019 PortMappingCache(); 00020 00028 std::unordered_map<int, 00029 std::unordered_map<SgVariableDefinition*, 00030 std::pair<risc::InstanceTree, 00031 int> > > mapping_; 00032 00037 void initialize(PathInstanceMapper *path_instance_mapper); 00038 00039 void print(); 00040 00044 std::list<std::pair<int, InstanceTree>> 00045 get_mapped_module(int channel_id, SgClassDefinition *channel_definition); 00046 00047 private: 00048 bool is_initialized_; 00049 }; 00050 00051 }; // end of namespace risc 00052 00053 #endif /* PORT_MAPPING_CACHE_H_INCLUDED_ */