⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tglobalroutingtable.h

📁 片上网络的noxim仿真平台
💻 H
字号:
#ifndef __TGLOBALROUTINGTABLE_H__#define __TGLOBALROUTINGTABLE_H__//---------------------------------------------------------------------------#include <vector>#include <map>#include <set>using namespace std;//---------------------------------------------------------------------------typedef pair<int,int> TLinkId; // source, destination node// Routing tabletypedef set<TLinkId> TAdmissibleOutputs;// Map a destination to a set of admissible outputstypedef map<int,TAdmissibleOutputs> TRoutingTableLink; // Map an input link to its routing tabletypedef map<TLinkId,TRoutingTableLink> TRoutingTableNode;// Map a node of the network to its routing tabletypedef map<int,TRoutingTableNode> TRoutingTableNoC;//---------------------------------------------------------------------------// Converts an input direction to a link TLinkId direction2ILinkId(const int node_id, const int dir);// Converts an input direction to a linkint oLinkId2Direction(const TLinkId& out_link);// Converts a set of output links to a set of directionsvector<int> admissibleOutputsSet2Vector(const TAdmissibleOutputs& ao);//---------------------------------------------------------------------------class TGlobalRoutingTable{public:  TGlobalRoutingTable();   // Load routing table from file. Returns true if ok, false otherwise  bool load(const char* fname);  TRoutingTableNode getNodeRoutingTable(const int node_id);  bool isValid() { return valid; }private:  TRoutingTableNoC rt_noc;    bool             valid;  // Search label rt_label through the file  //  bool seek(const char* fname, const char* rt_label, ifstream& fin);};//---------------------------------------------------------------------------#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -