@@ -20,49 +20,50 @@ class FpgaTile{
2020 int y;
2121 int W;
2222
23+ // 指向相邻的FPGA块的指针
2324 FpgaTile *left;
2425 FpgaTile *right;
2526 FpgaTile *up;
2627 FpgaTile *down;
2728
28- map<int , RRNode *> logicPin;
29- vector<RRNode *> vWires;
30- vector<RRNode *> hWires;
29+ map<int , RRNode *> logicPin; // 逻辑块引脚
30+ vector<RRNode *> vWires; // 垂直导线
31+ vector<RRNode *> hWires; // 水平导线
3132
32- vector<RRNode *> rrNodes;
33+ vector<RRNode *> rrNodes; // 该FPGA块拥有的布线资源节点(导线或引脚)
3334
3435public:
35- int getX () { return x; }
36- int getY () { return y; }
36+ int getX () { return x; } // 获得FPGA块的x坐标
37+ int getY () { return y; } // 获得FPGA块的y坐标
3738
38- vector<RRNode *> &getRRNodes () { return rrNodes; }
39+ vector<RRNode *> &getRRNodes () { return rrNodes; } // 获得该FPGA块拥有的布线资源节点
3940
40- FpgaTile *getDown () const { return down; }
41- void setDown (FpgaTile *down) { this ->down = down; }
41+ FpgaTile *getDown () const { return down; } // 获得该FPGA块下方的FPGA块
42+ void setDown (FpgaTile *down) { this ->down = down; } // 设置该FPGA块的下方FPGA块
4243
43- FpgaTile *getUp () const { return up; }
44- void setUp (FpgaTile *up) { this ->up = up; }
44+ FpgaTile *getUp () const { return up; } // 获得该FPGA块上方的FPGA块
45+ void setUp (FpgaTile *up) { this ->up = up; } // 设置该FPGA块的上方FPGA块
4546
46- FpgaTile *getLeft () const { return left; }
47- void setLeft (FpgaTile *left) { this ->left = left; }
47+ FpgaTile *getLeft () const { return left; } // 获得该FPGA块左边的FPGA块
48+ void setLeft (FpgaTile *left) { this ->left = left; } // 设置该FPGA块的左边FPGA块
4849
49- FpgaTile *getRight () const { return right; }
50- void setRight (FpgaTile *right) { this ->right = right; }
50+ FpgaTile *getRight () const { return right; } // 获得该FPGA块右边的FPGA块
51+ void setRight (FpgaTile *right) { this ->right = right; } // 设置该FPGA块的右边FPGA块
5152
5253 void generateContents ();
5354 void populateSwitchbox ();
5455
55- RRNode &getLogicPin (int idx) {
56+ RRNode &getLogicPin (int idx) { // 获得逻辑块的idx引脚
5657 assert (logicPin.find (idx) != logicPin.end ());
5758 return *(logicPin[idx]);
5859 }
5960
60- RRNode &getVWire (int idx) {
61+ RRNode &getVWire (int idx) { // 获得FPGA块的垂直导线
6162 assert ((size_t ) idx < vWires.size ());
6263 return *(vWires[idx]);
6364 }
6465
65- RRNode &getHWire (int idx) {
66+ RRNode &getHWire (int idx) { // 获得FPGA块的水平导线
6667 assert ((size_t ) idx < hWires.size ());
6768 return *(hWires[idx]);
6869 }
0 commit comments