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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
module gfx_shader_back
import gfx::*;
(
input logic clk,
rst_n,
gfx_front_back.back back,
gfx_regfile_io.ab read_data,
gfx_regfile_io.wb reg_wb
);
logic abort;
gfx_wb out_wb(), p0_wb(), p1_wb(), p2_wb(), p3_wb();
gfx_shake p1_shake(), p2_shake(), p3_shake();
gfx_shader_abort p0_abort
(
.clk,
.p1(p1_shake.peek),
.p2(p2_shake.peek),
.p3(p3_shake.peek),
.abort
);
gfx_shader_fpint p0
(
.clk,
.rst_n,
.op(back.execute.p0),
.wb(p0_wb.tx),
.abort,
.read_data,
.in_valid(back.dispatch.valid)
);
gfx_shader_mem p1
(
.clk,
.rst_n,
.op(back.execute.p1),
.wb(p1_wb.tx),
.in_shake(p1_shake.rx),
.read_data
);
gfx_shader_sfu p2
(
.clk,
.rst_n,
.op(back.execute.p2),
.wb(p2_wb.tx),
.in_shake(p2_shake.rx),
.read_data
);
gfx_shader_group p3
(
.clk,
.rst_n,
.op(back.execute.p3),
.wb(p3_wb.tx),
.in_shake(p3_shake.rx),
.read_data
);
gfx_shader_writeback_arbiter4 writeback_arbiter
(
.clk,
.rst_n,
.p0(p0_wb.rx),
.p1(p1_wb.rx),
.p2(p2_wb.rx),
.p3(p3_wb.rx),
.out(out_wb.tx)
);
gfx_shader_writeback writeback
(
.clk,
.rst_n,
.wb(out_wb.rx),
.regs(reg_wb)
);
endmodule
module gfx_shader_abort
(
input logic clk,
gfx_shake.peek p1,
p2,
p3,
output logic abort
);
always_ff @(posedge clk)
abort <=
(p1.valid & p1.ready)
| (p2.valid & p2.ready)
| (p3.valid & p3.ready);
endmodule
module gfx_shader_writeback_arbiter4
(
input logic clk,
rst_n,
gfx_wb.rx p0,
p1,
p2,
p3,
gfx_wb.tx out
);
assert property (
@(posedge clk)
disable iff (~rst_n)
(p0.ready & out.ready)
);
gfx_wb p0_p1(), p2_p3();
gfx_shader_writeback_arbiter2_prio arbiter_p0_p1
(
.clk,
.rst_n,
.a(p0),
.b(p1),
.out(p0_p1.tx)
);
gfx_shader_writeback_arbiter2_prio arbiter_p2_p3
(
.clk,
.rst_n,
.a(p2),
.b(p3),
.out(p2_p3.tx)
);
gfx_shader_writeback_arbiter2_prio arbiter_out
(
.clk,
.rst_n,
.a(p0_p1.rx),
.b(p2_p3.tx),
.out
);
endmodule
module gfx_shader_writeback_arbiter2_prio
(
input logic clk,
rst_n,
gfx_wb.rx a,
b,
gfx_wb.tx out
);
//TODO
assign a.ready = out.ready;
assign b.ready = 0;
assign out.dest = a.dest;
assign out.lanes = a.lanes;
assign out.group = a.group;
assign out.valid = a.valid;
assign out.scalar = a.scalar;
assign out.writeback = a.writeback;
endmodule
module gfx_shader_writeback
(
input logic clk,
rst_n,
gfx_wb.rx wb,
gfx_regfile_io.wb regs
);
endmodule
|