WISHBONE为我们提供了灵活的连接结构,使我们能非常容易的定制自己的所需用途。它通过提供标准的数据交换协议,使
用户非常方便进行TEAMWORK,把系统组件化,增加了模块的重用性。节省了二次开发的时间。
WISHBONE地址和数据位都是32位(如果小于32位也可以这行通信),最多可以连接8个主设备,16个从设备,当多个主设
备申请控制时,通过仲裁机制决定什么时候哪个主设备能访问共享总线。
WISHBONE具有灵活的可变性连接方式,允许系统通过四种不同的方式实现IP CORES之间的互联:
一。点到点连接方式(point-to-point interconnection)
这是IP CORES之间最简单的连接方式,只需要一主一从两个IP CORES之间进行数据通信,例如,主设备可以是微处理器
IP CORE ,从设备可以使串口的I/O PORT.
二。数据流连接方式(data flow interconnection)
这种连接方式用于数据以时序的方式进行处理。一些时候,这种方式可用作流水线作业。比如下图三个IP CORES都是实现浮
点运算,假设它们工作的时间都相同,这样三个IP CORES互联在一起,可以实现高速的类似并行化的时序操作,使处理数据的
时间节省三分之二。
三。共享总线的连接方式(share bus interconnection)
这种方式通常用于两个或以上主设备和一个或以上从设备之间的互联,仲裁机制决定什么时候哪个主设备能够访问总线,
这种连接方式的主要优点是结构紧凑,能够用较少的逻辑资源去实现相关结构。缺点是:每次只能有一个主设备访问总线,
其他的主设备在总线忙时只能处于等待状态,降低了数据传输的速度。这种共享总线的连接方式我们可以在一些标准的总线
中看到,例如PCI,VMEbus。
四,交叉开关连接方式(crossbar switch interconnection)
这种连接方式主要用于两个或以上主设备和两个或以上从设备之间进行数据传递。由仲裁机制决定哪个主设备可以访问指定
的从设备。和共享总线连接方式不同的是,这种连接方式允许一个以上主设备同时进行通信,只要两个主设备不同时访问相同
的从设备就可以。例如:RACEway,SKY Channel,Myrinet都是基于此结构。
注意:这种连接方式比共享总线连接方式数据传送速度快很多,但需要更多的资源来实现这种连接。

五。片外连接方式(off-chip interconnection)
这种方式可以用以上四种基本连接方式实现。
仲裁机制
仲裁机制(arbiter)的实现原理是通过循环共享的方式(a round robin arbiter),使每个主设备具有相同的优先权。
仲裁机制的时间其实就是一个状态机,通过八种状态决定那个主设备访问总线。部分代码如下:

Code
1
(state) // synopsys parallel_case full_case
2
grant0:
3
// if this req is dropped or next is asserted, check for other req's
4
if(!req[0] )
5
begin
6
if(reqalways@(state or req )
7
begin
8
next_state = state; // Default Keep State
9
case[1]) next_state = grant1;
10
else
11
if(req[2]) next_state = grant2;
12
else
13
if(req[3]) next_state = grant3;
14
else
15
if(req[4]) next_state = grant4;
16
else
17
if(req[5]) next_state = grant5;
18
else
19
if(req[6]) next_state = grant6;
20
else
21
if(req[7]) next_state = grant7;
22
end
23
grant1:
24
// if this req is dropped or next is asserted, check for other req's
25
if(!req[1] )
26
begin
27
if(req[2]) next_state = grant2;
28
else
29
if(req[3]) next_state = grant3;
30
else
31
if(req[4]) next_state = grant4;
32
else
33
if(req[5]) next_state = grant5;
34
else
35
if(req[6]) next_state = grant6;
36
else
37
if(req[7]) next_state = grant7;
38
else
39
if(req[0]) next_state = grant0;
40
end
41
grant2:
42
// if this req is dropped or next is asserted, check for other req's
43
if(!req[2] )
44
begin
45
if(req[3]) next_state = grant3;
46
else
47
if(req[4]) next_state = grant4;
48
else
49
if(req[5]) next_state = grant5;
50
else
51
if(req[6]) next_state = grant6;
52
else
53
if(req[7]) next_state = grant7;
54
else
55
if(req[0]) next_state = grant0;
56
else
57
if(req[1]) next_state = grant1;
58
end
59
grant3:
60
// if this req is dropped or next is asserted, check for other req's
61
if(!req[3] )
62
begin
63
if(req[4]) next_state = grant4;
64
else
65
if(req[5]) next_state = grant5;
66
else
67
if(req[6]) next_state = grant6;
68
else
69
if(req[7]) next_state = grant7;
70
else
71
if(req[0]) next_state = grant0;
72
else
73
if(req[1]) next_state = grant1;
74
else
75
if(req[2]) next_state = grant2;
76
end
77
grant4:
78
// if this req is dropped or next is asserted, check for other req's
79
if(!req[4] )
80
begin
81
if(req[5]) next_state = grant5;
82
else
83
if(req[6]) next_state = grant6;
84
else
85
if(req[7]) next_state = grant7;
86
else
87
if(req[0]) next_state = grant0;
88
else
89
if(req[1]) next_state = grant1;
90
else
91
if(req[2]) next_state = grant2;
92
else
93
if(req[3]) next_state = grant3;
94
end
95
grant5:
96
// if this req is dropped or next is asserted, check for other req's
97
if(!req[5] )
98
begin
99
if(req[6]) next_state = grant6;
100
else
101
if(req[7]) next_state = grant7;
102
else
103
if(req[0]) next_state = grant0;
104
else
105
if(req[1]) next_state = grant1;
106
else
107
if(req[2]) next_state = grant2;
108
else
109
if(req[3]) next_state = grant3;
110
else
111
if(req[4]) next_state = grant4;
112
end
113
grant6:
114
// if this req is dropped or next is asserted, check for other req's
115
if(!req[6] )
116
begin
117
if(req[7]) next_state = grant7;
118
else
119
if(req[0]) next_state = grant0;
120
else
121
if(req[1]) next_state = grant1;
122
else
123
if(req[2]) next_state = grant2;
124
else
125
if(req[3]) next_state = grant3;
126
else
127
if(req[4]) next_state = grant4;
128
else
129
if(req[5]) next_state = grant5;
130
end
131
grant7:
132
// if this req is dropped or next is asserted, check for other req's
133
if(!req[7] )
134
begin
135
if(req[0]) next_state = grant0;
136
else
137
if(req[1]) next_state = grant1;
138
else
139
if(req[2]) next_state = grant2;
140
else
141
if(req[3]) next_state = grant3;
142
else
143
if(req[4]) next_state = grant4;
144
else
145
if(req[5]) next_state = grant5;
146
else
147
if(req[6]) next_state = grant6;
148
end
149
endcase
150
end
文章评论(0条评论)
登录后参与讨论