-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVcBuffer.java
99 lines (55 loc) · 1.34 KB
/
VcBuffer.java
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package Router;
import java.util.ArrayList;
public class VcBuffer {
public int VC_id;
public int Flit_counter;
public ArrayList<Flit> Data;
public int Size_of_VcBuffer;//nombre de slot dans VCbuffer?? in final-param
//buffer_size()
public int port;
//vc_id
public VcBuffer(int port,int VC_id) {
this.Data=new ArrayList<>();
this.Size_of_VcBuffer = Final_parametre.Buffer_size;
//en parametre buffer_size() et le physiquel link (0 1 2 3 4)
this.port=port;
this.VC_id=VC_id;//?????????????????
Flit_counter=0;
}
/*si le buffer est vide retourné 1 si non retourné 0 */
public Flit getFlit() {
return Data.get(0);
}
public void setData(Flit flit) {
Data.add(flit);
}
public boolean Check_Flit_Condiate() {
if (this.Data.isEmpty())
return false;
else
return true;
}
public void erese_Flit() {
Update_Flit_Counter();
this.Data.remove(0);
}
public void Update_Flit_Counter() {
this.Flit_counter--;
}
public void Update_Status() {
Flit_counter=this.Size_of_VcBuffer;
//lok
}
public int getVC_id() {
return VC_id;
}
public void setVC_id(int vC_id) {
VC_id = vC_id;
}
public int getPort() {
return port;
}
public void setPort(int port) {
this.port = port;
}
}