-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNetlist.h
76 lines (68 loc) · 1.92 KB
/
Netlist.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#pragma once
#include "utils.h"
class Node
{
public:
Node()
{
m_bPO = false;
m_nUnschedSucc = 0;
m_nUnschedPred = 0;
m_nConstPI = -1;
}
vector<int> m_vecnSucc;
vector<int> m_vecnPred;
vector<bool> m_vecbPredComp;
vector<int> m_vecnPredPI;
vector<bool> m_vecbPredPIComp;
unsigned int m_nIndex;
bool m_bPO;
bool m_bMAJ;
int m_nConstPI;
int m_nUnschedPred;
int m_nUnschedSucc;
bool m_bScheduled;
std::map<int, int> m_mapArrayRow;
int m_nES;
};
class NetList
{
public:
NetList() {}
NetList(vector<Node> vecNode, vector<Node> vecIn, vector<int> vecnPo);
void ReadFromFile(string strFile);
void ConfigWithXMG();
void UpdateMem(Node& nd);
void RemoveFromMem(int nArray, int nRow);
void AddToMem(int nIndex, int nArray, int nRow);
string PrintCompute(Node& nd, int nArray, int nRow);
string PrintCopy(int nArrayFrom, int nRowFrom, int nArrayTo, int nRowTo);
int CalcRlv(const Node& nd, int nArray, int nNdRow);
vector<int> PickRow(int nArray, bool bAllowCopy = true);
void PickCrossRlvForNode(Node& nd, vector<vector<int>>& vecvecBestResult, int& nBestCopy, int& nBestRlv, int& nBestArray);
void PrintSchedCrossRlv(Node& nd, vector<vector<int>>& vecvecBestResult, int& nBestArray);
void CrossRlvRA();
void CrossRlvScheduleRand();
void PrintCurrentInstr();
std::map<int, std::map<int, int>> m_mapmapNodeArrayRowTmp;
std::map<int, int>& GetTempArrayRow(int nNodeIndex);
std::map<int, int>& GetCurrentArrayRow(int nNodeIndex);
xmg_network m_net;
int m_nOffset;
vector<Node> m_vecNode;
vector<Node> m_vecIn;
vector<int> m_vecnPO;
vector<int> m_vecnSchedule;
vector<int> m_vecnPOIndex;
vector<bool> m_vecbPOComp;
int m_nSize;
int m_nCross;
int m_nNumArray;
int m_nArrayRow;
int m_nNumPI;
string m_strBench;
vector<set<int>> m_vecsetBan;
int m_nArrayBegin;
vector<vector<int>> m_vecvecClkInst;
vector<vector<int>> m_matMemStatus;
};