1 |
6 |
dsheffie |
module dff(clk,rst,d,q);
|
2 |
|
|
input clk;
|
3 |
|
|
input rst;
|
4 |
|
|
parameter WIDTH = 10;
|
5 |
|
|
|
6 |
|
|
input [(WIDTH-1):0] d;
|
7 |
|
|
output [(WIDTH-1):0] q;
|
8 |
|
|
reg [(WIDTH-1):0] r_q;
|
9 |
|
|
assign q = r_q;
|
10 |
|
|
|
11 |
|
|
always@(posedge clk)
|
12 |
|
|
begin
|
13 |
|
|
if(rst)
|
14 |
|
|
begin
|
15 |
|
|
r_q <= 'd0;
|
16 |
|
|
end
|
17 |
|
|
else
|
18 |
|
|
begin
|
19 |
|
|
r_q <= d;
|
20 |
|
|
end
|
21 |
|
|
end
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
endmodule // dff
|
25 |
|
|
|
26 |
|
|
module sudoku(/*AUTOARG*/
|
27 |
|
|
// Outputs
|
28 |
|
|
outGrid, unsolvedCells, timeOut, allDone, anyChanged, anyError,
|
29 |
|
|
minIdx, minPoss,
|
30 |
|
|
// Inputs
|
31 |
|
|
clk, rst, clr, start, inGrid
|
32 |
|
|
);
|
33 |
|
|
input clk;
|
34 |
|
|
input rst;
|
35 |
|
|
input clr;
|
36 |
|
|
|
37 |
|
|
input start;
|
38 |
|
|
|
39 |
|
|
input [728:0] inGrid;
|
40 |
|
|
output [728:0] outGrid;
|
41 |
|
|
output [6:0] unsolvedCells;
|
42 |
|
|
output timeOut;
|
43 |
|
|
output allDone;
|
44 |
|
|
output anyChanged;
|
45 |
|
|
output anyError;
|
46 |
|
|
|
47 |
|
|
output [6:0] minIdx;
|
48 |
|
|
output [3:0] minPoss;
|
49 |
|
|
|
50 |
|
|
wire [8:0] grid2d [80:0];
|
51 |
|
|
wire [8:0] currGrid [80:0];
|
52 |
|
|
wire [80:0] done;
|
53 |
|
|
wire [80:0] changed;
|
54 |
|
|
wire [80:0] error;
|
55 |
|
|
|
56 |
|
|
wire [71:0] rows [80:0];
|
57 |
|
|
wire [71:0] cols [80:0];
|
58 |
|
|
wire [71:0] sqrs [80:0];
|
59 |
|
|
|
60 |
|
|
wire [71:0] r_rows [80:0];
|
61 |
|
|
wire [71:0] r_cols [80:0];
|
62 |
|
|
wire [71:0] r_sqrs [80:0];
|
63 |
|
|
|
64 |
|
|
//assign allDone = &done;
|
65 |
|
|
//assign anyChanged = |changed;
|
66 |
|
|
|
67 |
|
|
reg r_done, r_changed, r_error;
|
68 |
|
|
|
69 |
|
|
assign allDone = r_done;
|
70 |
|
|
assign anyChanged = r_changed;
|
71 |
|
|
assign anyError = r_error;
|
72 |
|
|
|
73 |
|
|
|
74 |
|
|
reg [3:0] r_cnt;
|
75 |
|
|
assign timeOut = (r_cnt == 4'b0100);
|
76 |
|
|
always@(posedge clk)
|
77 |
|
|
begin
|
78 |
|
|
if(rst)
|
79 |
|
|
begin
|
80 |
|
|
r_cnt <= 4'd0;
|
81 |
|
|
end
|
82 |
|
|
else
|
83 |
|
|
begin
|
84 |
|
|
r_cnt <= start ? 4'd0 : (r_changed ? 4'd0 : r_cnt + 4'd1);
|
85 |
|
|
end
|
86 |
|
|
end // always@ (posedge clk)
|
87 |
|
|
|
88 |
|
|
minPiece mP0
|
89 |
|
|
(
|
90 |
|
|
.minPoss(minPoss),
|
91 |
|
|
.minIdx(minIdx),
|
92 |
|
|
.clk(clk),
|
93 |
|
|
.rst(rst),
|
94 |
|
|
.inGrid(outGrid)
|
95 |
|
|
);
|
96 |
|
|
|
97 |
|
|
|
98 |
|
|
genvar i;
|
99 |
|
|
generate
|
100 |
|
|
for(i=0;i<81;i=i+1)
|
101 |
|
|
begin: unflatten
|
102 |
|
|
assign grid2d[i] = inGrid[(9*(i+1))-1:9*i];
|
103 |
|
|
end
|
104 |
|
|
endgenerate
|
105 |
|
|
|
106 |
|
|
generate
|
107 |
|
|
for(i=0;i<81;i=i+1)
|
108 |
|
|
begin: pipeline_wires
|
109 |
|
|
dff#(.WIDTH(72)) pipe_rows
|
110 |
|
|
(.clk(clk),
|
111 |
|
|
.rst(rst),
|
112 |
|
|
.d(rows[i]),
|
113 |
|
|
.q(r_rows[i])
|
114 |
|
|
);
|
115 |
|
|
dff#(.WIDTH(72)) pipe_cols
|
116 |
|
|
(.clk(clk),
|
117 |
|
|
.rst(rst),
|
118 |
|
|
.d(cols[i]),
|
119 |
|
|
.q(r_cols[i])
|
120 |
|
|
);
|
121 |
|
|
dff#(.WIDTH(72)) pipe_sqrs
|
122 |
|
|
(.clk(clk),
|
123 |
|
|
.rst(rst),
|
124 |
|
|
.d(sqrs[i]),
|
125 |
|
|
.q(r_sqrs[i])
|
126 |
|
|
);
|
127 |
|
|
end
|
128 |
|
|
endgenerate
|
129 |
|
|
|
130 |
|
|
wire [6:0] w_unSolvedCells;
|
131 |
|
|
reg [6:0] r_unSolvedCells;
|
132 |
|
|
always@(posedge clk)
|
133 |
|
|
begin
|
134 |
|
|
if(rst)
|
135 |
|
|
begin
|
136 |
|
|
r_unSolvedCells <= 7'd81;
|
137 |
|
|
end
|
138 |
|
|
else
|
139 |
|
|
begin
|
140 |
|
|
r_unSolvedCells <= start ? 7'd81 : w_unSolvedCells;
|
141 |
|
|
end
|
142 |
|
|
end // always@ (posedge clk)
|
143 |
|
|
assign unsolvedCells = r_unSolvedCells;
|
144 |
|
|
|
145 |
|
|
ones_count81 oc0 (.in(~done), .out(w_unSolvedCells));
|
146 |
|
|
|
147 |
|
|
generate
|
148 |
|
|
for(i=0;i<81;i=i+1)
|
149 |
|
|
begin: pieces
|
150 |
|
|
piece pg (
|
151 |
|
|
// Outputs
|
152 |
|
|
.changed (changed[i]),
|
153 |
|
|
.done (done[i]),
|
154 |
|
|
.curr_value (currGrid[i]),
|
155 |
|
|
.error (error[i]),
|
156 |
|
|
// Inputs
|
157 |
|
|
.clk (clk),
|
158 |
|
|
.rst (rst),
|
159 |
|
|
.clr (clr),
|
160 |
|
|
.start (start),
|
161 |
|
|
.start_value (grid2d[i]),
|
162 |
|
|
.my_row (r_rows[i]),
|
163 |
|
|
.my_col (r_cols[i]),
|
164 |
|
|
.my_square (r_sqrs[i])
|
165 |
|
|
);
|
166 |
|
|
end // block: pieces
|
167 |
|
|
endgenerate
|
168 |
|
|
|
169 |
|
|
assign cols[0] = {currGrid[9],currGrid[18],currGrid[27],currGrid[36],currGrid[45],currGrid[54],currGrid[63],currGrid[72]};
|
170 |
|
|
assign rows[0] = {currGrid[1],currGrid[2],currGrid[3],currGrid[4],currGrid[5],currGrid[6],currGrid[7],currGrid[8]};
|
171 |
|
|
assign sqrs[0] = {currGrid[1],currGrid[2],currGrid[9],currGrid[10],currGrid[11],currGrid[18],currGrid[19],currGrid[20]};
|
172 |
|
|
assign cols[1] = {currGrid[10],currGrid[19],currGrid[28],currGrid[37],currGrid[46],currGrid[55],currGrid[64],currGrid[73]};
|
173 |
|
|
assign rows[1] = {currGrid[0],currGrid[2],currGrid[3],currGrid[4],currGrid[5],currGrid[6],currGrid[7],currGrid[8]};
|
174 |
|
|
assign sqrs[1] = {currGrid[0],currGrid[2],currGrid[9],currGrid[10],currGrid[11],currGrid[18],currGrid[19],currGrid[20]};
|
175 |
|
|
assign cols[2] = {currGrid[11],currGrid[20],currGrid[29],currGrid[38],currGrid[47],currGrid[56],currGrid[65],currGrid[74]};
|
176 |
|
|
assign rows[2] = {currGrid[0],currGrid[1],currGrid[3],currGrid[4],currGrid[5],currGrid[6],currGrid[7],currGrid[8]};
|
177 |
|
|
assign sqrs[2] = {currGrid[0],currGrid[1],currGrid[9],currGrid[10],currGrid[11],currGrid[18],currGrid[19],currGrid[20]};
|
178 |
|
|
assign cols[3] = {currGrid[12],currGrid[21],currGrid[30],currGrid[39],currGrid[48],currGrid[57],currGrid[66],currGrid[75]};
|
179 |
|
|
assign rows[3] = {currGrid[0],currGrid[1],currGrid[2],currGrid[4],currGrid[5],currGrid[6],currGrid[7],currGrid[8]};
|
180 |
|
|
assign sqrs[3] = {currGrid[4],currGrid[5],currGrid[12],currGrid[13],currGrid[14],currGrid[21],currGrid[22],currGrid[23]};
|
181 |
|
|
assign cols[4] = {currGrid[13],currGrid[22],currGrid[31],currGrid[40],currGrid[49],currGrid[58],currGrid[67],currGrid[76]};
|
182 |
|
|
assign rows[4] = {currGrid[0],currGrid[1],currGrid[2],currGrid[3],currGrid[5],currGrid[6],currGrid[7],currGrid[8]};
|
183 |
|
|
assign sqrs[4] = {currGrid[3],currGrid[5],currGrid[12],currGrid[13],currGrid[14],currGrid[21],currGrid[22],currGrid[23]};
|
184 |
|
|
assign cols[5] = {currGrid[14],currGrid[23],currGrid[32],currGrid[41],currGrid[50],currGrid[59],currGrid[68],currGrid[77]};
|
185 |
|
|
assign rows[5] = {currGrid[0],currGrid[1],currGrid[2],currGrid[3],currGrid[4],currGrid[6],currGrid[7],currGrid[8]};
|
186 |
|
|
assign sqrs[5] = {currGrid[3],currGrid[4],currGrid[12],currGrid[13],currGrid[14],currGrid[21],currGrid[22],currGrid[23]};
|
187 |
|
|
assign cols[6] = {currGrid[15],currGrid[24],currGrid[33],currGrid[42],currGrid[51],currGrid[60],currGrid[69],currGrid[78]};
|
188 |
|
|
assign rows[6] = {currGrid[0],currGrid[1],currGrid[2],currGrid[3],currGrid[4],currGrid[5],currGrid[7],currGrid[8]};
|
189 |
|
|
assign sqrs[6] = {currGrid[7],currGrid[8],currGrid[15],currGrid[16],currGrid[17],currGrid[24],currGrid[25],currGrid[26]};
|
190 |
|
|
assign cols[7] = {currGrid[16],currGrid[25],currGrid[34],currGrid[43],currGrid[52],currGrid[61],currGrid[70],currGrid[79]};
|
191 |
|
|
assign rows[7] = {currGrid[0],currGrid[1],currGrid[2],currGrid[3],currGrid[4],currGrid[5],currGrid[6],currGrid[8]};
|
192 |
|
|
assign sqrs[7] = {currGrid[6],currGrid[8],currGrid[15],currGrid[16],currGrid[17],currGrid[24],currGrid[25],currGrid[26]};
|
193 |
|
|
assign cols[8] = {currGrid[17],currGrid[26],currGrid[35],currGrid[44],currGrid[53],currGrid[62],currGrid[71],currGrid[80]};
|
194 |
|
|
assign rows[8] = {currGrid[0],currGrid[1],currGrid[2],currGrid[3],currGrid[4],currGrid[5],currGrid[6],currGrid[7]};
|
195 |
|
|
assign sqrs[8] = {currGrid[6],currGrid[7],currGrid[15],currGrid[16],currGrid[17],currGrid[24],currGrid[25],currGrid[26]};
|
196 |
|
|
assign cols[9] = {currGrid[0],currGrid[18],currGrid[27],currGrid[36],currGrid[45],currGrid[54],currGrid[63],currGrid[72]};
|
197 |
|
|
assign rows[9] = {currGrid[10],currGrid[11],currGrid[12],currGrid[13],currGrid[14],currGrid[15],currGrid[16],currGrid[17]};
|
198 |
|
|
assign sqrs[9] = {currGrid[0],currGrid[1],currGrid[2],currGrid[10],currGrid[11],currGrid[18],currGrid[19],currGrid[20]};
|
199 |
|
|
assign cols[10] = {currGrid[1],currGrid[19],currGrid[28],currGrid[37],currGrid[46],currGrid[55],currGrid[64],currGrid[73]};
|
200 |
|
|
assign rows[10] = {currGrid[9],currGrid[11],currGrid[12],currGrid[13],currGrid[14],currGrid[15],currGrid[16],currGrid[17]};
|
201 |
|
|
assign sqrs[10] = {currGrid[0],currGrid[1],currGrid[2],currGrid[9],currGrid[11],currGrid[18],currGrid[19],currGrid[20]};
|
202 |
|
|
assign cols[11] = {currGrid[2],currGrid[20],currGrid[29],currGrid[38],currGrid[47],currGrid[56],currGrid[65],currGrid[74]};
|
203 |
|
|
assign rows[11] = {currGrid[9],currGrid[10],currGrid[12],currGrid[13],currGrid[14],currGrid[15],currGrid[16],currGrid[17]};
|
204 |
|
|
assign sqrs[11] = {currGrid[0],currGrid[1],currGrid[2],currGrid[9],currGrid[10],currGrid[18],currGrid[19],currGrid[20]};
|
205 |
|
|
assign cols[12] = {currGrid[3],currGrid[21],currGrid[30],currGrid[39],currGrid[48],currGrid[57],currGrid[66],currGrid[75]};
|
206 |
|
|
assign rows[12] = {currGrid[9],currGrid[10],currGrid[11],currGrid[13],currGrid[14],currGrid[15],currGrid[16],currGrid[17]};
|
207 |
|
|
assign sqrs[12] = {currGrid[3],currGrid[4],currGrid[5],currGrid[13],currGrid[14],currGrid[21],currGrid[22],currGrid[23]};
|
208 |
|
|
assign cols[13] = {currGrid[4],currGrid[22],currGrid[31],currGrid[40],currGrid[49],currGrid[58],currGrid[67],currGrid[76]};
|
209 |
|
|
assign rows[13] = {currGrid[9],currGrid[10],currGrid[11],currGrid[12],currGrid[14],currGrid[15],currGrid[16],currGrid[17]};
|
210 |
|
|
assign sqrs[13] = {currGrid[3],currGrid[4],currGrid[5],currGrid[12],currGrid[14],currGrid[21],currGrid[22],currGrid[23]};
|
211 |
|
|
assign cols[14] = {currGrid[5],currGrid[23],currGrid[32],currGrid[41],currGrid[50],currGrid[59],currGrid[68],currGrid[77]};
|
212 |
|
|
assign rows[14] = {currGrid[9],currGrid[10],currGrid[11],currGrid[12],currGrid[13],currGrid[15],currGrid[16],currGrid[17]};
|
213 |
|
|
assign sqrs[14] = {currGrid[3],currGrid[4],currGrid[5],currGrid[12],currGrid[13],currGrid[21],currGrid[22],currGrid[23]};
|
214 |
|
|
assign cols[15] = {currGrid[6],currGrid[24],currGrid[33],currGrid[42],currGrid[51],currGrid[60],currGrid[69],currGrid[78]};
|
215 |
|
|
assign rows[15] = {currGrid[9],currGrid[10],currGrid[11],currGrid[12],currGrid[13],currGrid[14],currGrid[16],currGrid[17]};
|
216 |
|
|
assign sqrs[15] = {currGrid[6],currGrid[7],currGrid[8],currGrid[16],currGrid[17],currGrid[24],currGrid[25],currGrid[26]};
|
217 |
|
|
assign cols[16] = {currGrid[7],currGrid[25],currGrid[34],currGrid[43],currGrid[52],currGrid[61],currGrid[70],currGrid[79]};
|
218 |
|
|
assign rows[16] = {currGrid[9],currGrid[10],currGrid[11],currGrid[12],currGrid[13],currGrid[14],currGrid[15],currGrid[17]};
|
219 |
|
|
assign sqrs[16] = {currGrid[6],currGrid[7],currGrid[8],currGrid[15],currGrid[17],currGrid[24],currGrid[25],currGrid[26]};
|
220 |
|
|
assign cols[17] = {currGrid[8],currGrid[26],currGrid[35],currGrid[44],currGrid[53],currGrid[62],currGrid[71],currGrid[80]};
|
221 |
|
|
assign rows[17] = {currGrid[9],currGrid[10],currGrid[11],currGrid[12],currGrid[13],currGrid[14],currGrid[15],currGrid[16]};
|
222 |
|
|
assign sqrs[17] = {currGrid[6],currGrid[7],currGrid[8],currGrid[15],currGrid[16],currGrid[24],currGrid[25],currGrid[26]};
|
223 |
|
|
assign cols[18] = {currGrid[0],currGrid[9],currGrid[27],currGrid[36],currGrid[45],currGrid[54],currGrid[63],currGrid[72]};
|
224 |
|
|
assign rows[18] = {currGrid[19],currGrid[20],currGrid[21],currGrid[22],currGrid[23],currGrid[24],currGrid[25],currGrid[26]};
|
225 |
|
|
assign sqrs[18] = {currGrid[0],currGrid[1],currGrid[2],currGrid[9],currGrid[10],currGrid[11],currGrid[19],currGrid[20]};
|
226 |
|
|
assign cols[19] = {currGrid[1],currGrid[10],currGrid[28],currGrid[37],currGrid[46],currGrid[55],currGrid[64],currGrid[73]};
|
227 |
|
|
assign rows[19] = {currGrid[18],currGrid[20],currGrid[21],currGrid[22],currGrid[23],currGrid[24],currGrid[25],currGrid[26]};
|
228 |
|
|
assign sqrs[19] = {currGrid[0],currGrid[1],currGrid[2],currGrid[9],currGrid[10],currGrid[11],currGrid[18],currGrid[20]};
|
229 |
|
|
assign cols[20] = {currGrid[2],currGrid[11],currGrid[29],currGrid[38],currGrid[47],currGrid[56],currGrid[65],currGrid[74]};
|
230 |
|
|
assign rows[20] = {currGrid[18],currGrid[19],currGrid[21],currGrid[22],currGrid[23],currGrid[24],currGrid[25],currGrid[26]};
|
231 |
|
|
assign sqrs[20] = {currGrid[0],currGrid[1],currGrid[2],currGrid[9],currGrid[10],currGrid[11],currGrid[18],currGrid[19]};
|
232 |
|
|
assign cols[21] = {currGrid[3],currGrid[12],currGrid[30],currGrid[39],currGrid[48],currGrid[57],currGrid[66],currGrid[75]};
|
233 |
|
|
assign rows[21] = {currGrid[18],currGrid[19],currGrid[20],currGrid[22],currGrid[23],currGrid[24],currGrid[25],currGrid[26]};
|
234 |
|
|
assign sqrs[21] = {currGrid[3],currGrid[4],currGrid[5],currGrid[12],currGrid[13],currGrid[14],currGrid[22],currGrid[23]};
|
235 |
|
|
assign cols[22] = {currGrid[4],currGrid[13],currGrid[31],currGrid[40],currGrid[49],currGrid[58],currGrid[67],currGrid[76]};
|
236 |
|
|
assign rows[22] = {currGrid[18],currGrid[19],currGrid[20],currGrid[21],currGrid[23],currGrid[24],currGrid[25],currGrid[26]};
|
237 |
|
|
assign sqrs[22] = {currGrid[3],currGrid[4],currGrid[5],currGrid[12],currGrid[13],currGrid[14],currGrid[21],currGrid[23]};
|
238 |
|
|
assign cols[23] = {currGrid[5],currGrid[14],currGrid[32],currGrid[41],currGrid[50],currGrid[59],currGrid[68],currGrid[77]};
|
239 |
|
|
assign rows[23] = {currGrid[18],currGrid[19],currGrid[20],currGrid[21],currGrid[22],currGrid[24],currGrid[25],currGrid[26]};
|
240 |
|
|
assign sqrs[23] = {currGrid[3],currGrid[4],currGrid[5],currGrid[12],currGrid[13],currGrid[14],currGrid[21],currGrid[22]};
|
241 |
|
|
assign cols[24] = {currGrid[6],currGrid[15],currGrid[33],currGrid[42],currGrid[51],currGrid[60],currGrid[69],currGrid[78]};
|
242 |
|
|
assign rows[24] = {currGrid[18],currGrid[19],currGrid[20],currGrid[21],currGrid[22],currGrid[23],currGrid[25],currGrid[26]};
|
243 |
|
|
assign sqrs[24] = {currGrid[6],currGrid[7],currGrid[8],currGrid[15],currGrid[16],currGrid[17],currGrid[25],currGrid[26]};
|
244 |
|
|
assign cols[25] = {currGrid[7],currGrid[16],currGrid[34],currGrid[43],currGrid[52],currGrid[61],currGrid[70],currGrid[79]};
|
245 |
|
|
assign rows[25] = {currGrid[18],currGrid[19],currGrid[20],currGrid[21],currGrid[22],currGrid[23],currGrid[24],currGrid[26]};
|
246 |
|
|
assign sqrs[25] = {currGrid[6],currGrid[7],currGrid[8],currGrid[15],currGrid[16],currGrid[17],currGrid[24],currGrid[26]};
|
247 |
|
|
assign cols[26] = {currGrid[8],currGrid[17],currGrid[35],currGrid[44],currGrid[53],currGrid[62],currGrid[71],currGrid[80]};
|
248 |
|
|
assign rows[26] = {currGrid[18],currGrid[19],currGrid[20],currGrid[21],currGrid[22],currGrid[23],currGrid[24],currGrid[25]};
|
249 |
|
|
assign sqrs[26] = {currGrid[6],currGrid[7],currGrid[8],currGrid[15],currGrid[16],currGrid[17],currGrid[24],currGrid[25]};
|
250 |
|
|
assign cols[27] = {currGrid[0],currGrid[9],currGrid[18],currGrid[36],currGrid[45],currGrid[54],currGrid[63],currGrid[72]};
|
251 |
|
|
assign rows[27] = {currGrid[28],currGrid[29],currGrid[30],currGrid[31],currGrid[32],currGrid[33],currGrid[34],currGrid[35]};
|
252 |
|
|
assign sqrs[27] = {currGrid[28],currGrid[29],currGrid[36],currGrid[37],currGrid[38],currGrid[45],currGrid[46],currGrid[47]};
|
253 |
|
|
assign cols[28] = {currGrid[1],currGrid[10],currGrid[19],currGrid[37],currGrid[46],currGrid[55],currGrid[64],currGrid[73]};
|
254 |
|
|
assign rows[28] = {currGrid[27],currGrid[29],currGrid[30],currGrid[31],currGrid[32],currGrid[33],currGrid[34],currGrid[35]};
|
255 |
|
|
assign sqrs[28] = {currGrid[27],currGrid[29],currGrid[36],currGrid[37],currGrid[38],currGrid[45],currGrid[46],currGrid[47]};
|
256 |
|
|
assign cols[29] = {currGrid[2],currGrid[11],currGrid[20],currGrid[38],currGrid[47],currGrid[56],currGrid[65],currGrid[74]};
|
257 |
|
|
assign rows[29] = {currGrid[27],currGrid[28],currGrid[30],currGrid[31],currGrid[32],currGrid[33],currGrid[34],currGrid[35]};
|
258 |
|
|
assign sqrs[29] = {currGrid[27],currGrid[28],currGrid[36],currGrid[37],currGrid[38],currGrid[45],currGrid[46],currGrid[47]};
|
259 |
|
|
assign cols[30] = {currGrid[3],currGrid[12],currGrid[21],currGrid[39],currGrid[48],currGrid[57],currGrid[66],currGrid[75]};
|
260 |
|
|
assign rows[30] = {currGrid[27],currGrid[28],currGrid[29],currGrid[31],currGrid[32],currGrid[33],currGrid[34],currGrid[35]};
|
261 |
|
|
assign sqrs[30] = {currGrid[31],currGrid[32],currGrid[39],currGrid[40],currGrid[41],currGrid[48],currGrid[49],currGrid[50]};
|
262 |
|
|
assign cols[31] = {currGrid[4],currGrid[13],currGrid[22],currGrid[40],currGrid[49],currGrid[58],currGrid[67],currGrid[76]};
|
263 |
|
|
assign rows[31] = {currGrid[27],currGrid[28],currGrid[29],currGrid[30],currGrid[32],currGrid[33],currGrid[34],currGrid[35]};
|
264 |
|
|
assign sqrs[31] = {currGrid[30],currGrid[32],currGrid[39],currGrid[40],currGrid[41],currGrid[48],currGrid[49],currGrid[50]};
|
265 |
|
|
assign cols[32] = {currGrid[5],currGrid[14],currGrid[23],currGrid[41],currGrid[50],currGrid[59],currGrid[68],currGrid[77]};
|
266 |
|
|
assign rows[32] = {currGrid[27],currGrid[28],currGrid[29],currGrid[30],currGrid[31],currGrid[33],currGrid[34],currGrid[35]};
|
267 |
|
|
assign sqrs[32] = {currGrid[30],currGrid[31],currGrid[39],currGrid[40],currGrid[41],currGrid[48],currGrid[49],currGrid[50]};
|
268 |
|
|
assign cols[33] = {currGrid[6],currGrid[15],currGrid[24],currGrid[42],currGrid[51],currGrid[60],currGrid[69],currGrid[78]};
|
269 |
|
|
assign rows[33] = {currGrid[27],currGrid[28],currGrid[29],currGrid[30],currGrid[31],currGrid[32],currGrid[34],currGrid[35]};
|
270 |
|
|
assign sqrs[33] = {currGrid[34],currGrid[35],currGrid[42],currGrid[43],currGrid[44],currGrid[51],currGrid[52],currGrid[53]};
|
271 |
|
|
assign cols[34] = {currGrid[7],currGrid[16],currGrid[25],currGrid[43],currGrid[52],currGrid[61],currGrid[70],currGrid[79]};
|
272 |
|
|
assign rows[34] = {currGrid[27],currGrid[28],currGrid[29],currGrid[30],currGrid[31],currGrid[32],currGrid[33],currGrid[35]};
|
273 |
|
|
assign sqrs[34] = {currGrid[33],currGrid[35],currGrid[42],currGrid[43],currGrid[44],currGrid[51],currGrid[52],currGrid[53]};
|
274 |
|
|
assign cols[35] = {currGrid[8],currGrid[17],currGrid[26],currGrid[44],currGrid[53],currGrid[62],currGrid[71],currGrid[80]};
|
275 |
|
|
assign rows[35] = {currGrid[27],currGrid[28],currGrid[29],currGrid[30],currGrid[31],currGrid[32],currGrid[33],currGrid[34]};
|
276 |
|
|
assign sqrs[35] = {currGrid[33],currGrid[34],currGrid[42],currGrid[43],currGrid[44],currGrid[51],currGrid[52],currGrid[53]};
|
277 |
|
|
assign cols[36] = {currGrid[0],currGrid[9],currGrid[18],currGrid[27],currGrid[45],currGrid[54],currGrid[63],currGrid[72]};
|
278 |
|
|
assign rows[36] = {currGrid[37],currGrid[38],currGrid[39],currGrid[40],currGrid[41],currGrid[42],currGrid[43],currGrid[44]};
|
279 |
|
|
assign sqrs[36] = {currGrid[27],currGrid[28],currGrid[29],currGrid[37],currGrid[38],currGrid[45],currGrid[46],currGrid[47]};
|
280 |
|
|
assign cols[37] = {currGrid[1],currGrid[10],currGrid[19],currGrid[28],currGrid[46],currGrid[55],currGrid[64],currGrid[73]};
|
281 |
|
|
assign rows[37] = {currGrid[36],currGrid[38],currGrid[39],currGrid[40],currGrid[41],currGrid[42],currGrid[43],currGrid[44]};
|
282 |
|
|
assign sqrs[37] = {currGrid[27],currGrid[28],currGrid[29],currGrid[36],currGrid[38],currGrid[45],currGrid[46],currGrid[47]};
|
283 |
|
|
assign cols[38] = {currGrid[2],currGrid[11],currGrid[20],currGrid[29],currGrid[47],currGrid[56],currGrid[65],currGrid[74]};
|
284 |
|
|
assign rows[38] = {currGrid[36],currGrid[37],currGrid[39],currGrid[40],currGrid[41],currGrid[42],currGrid[43],currGrid[44]};
|
285 |
|
|
assign sqrs[38] = {currGrid[27],currGrid[28],currGrid[29],currGrid[36],currGrid[37],currGrid[45],currGrid[46],currGrid[47]};
|
286 |
|
|
assign cols[39] = {currGrid[3],currGrid[12],currGrid[21],currGrid[30],currGrid[48],currGrid[57],currGrid[66],currGrid[75]};
|
287 |
|
|
assign rows[39] = {currGrid[36],currGrid[37],currGrid[38],currGrid[40],currGrid[41],currGrid[42],currGrid[43],currGrid[44]};
|
288 |
|
|
assign sqrs[39] = {currGrid[30],currGrid[31],currGrid[32],currGrid[40],currGrid[41],currGrid[48],currGrid[49],currGrid[50]};
|
289 |
|
|
assign cols[40] = {currGrid[4],currGrid[13],currGrid[22],currGrid[31],currGrid[49],currGrid[58],currGrid[67],currGrid[76]};
|
290 |
|
|
assign rows[40] = {currGrid[36],currGrid[37],currGrid[38],currGrid[39],currGrid[41],currGrid[42],currGrid[43],currGrid[44]};
|
291 |
|
|
assign sqrs[40] = {currGrid[30],currGrid[31],currGrid[32],currGrid[39],currGrid[41],currGrid[48],currGrid[49],currGrid[50]};
|
292 |
|
|
assign cols[41] = {currGrid[5],currGrid[14],currGrid[23],currGrid[32],currGrid[50],currGrid[59],currGrid[68],currGrid[77]};
|
293 |
|
|
assign rows[41] = {currGrid[36],currGrid[37],currGrid[38],currGrid[39],currGrid[40],currGrid[42],currGrid[43],currGrid[44]};
|
294 |
|
|
assign sqrs[41] = {currGrid[30],currGrid[31],currGrid[32],currGrid[39],currGrid[40],currGrid[48],currGrid[49],currGrid[50]};
|
295 |
|
|
assign cols[42] = {currGrid[6],currGrid[15],currGrid[24],currGrid[33],currGrid[51],currGrid[60],currGrid[69],currGrid[78]};
|
296 |
|
|
assign rows[42] = {currGrid[36],currGrid[37],currGrid[38],currGrid[39],currGrid[40],currGrid[41],currGrid[43],currGrid[44]};
|
297 |
|
|
assign sqrs[42] = {currGrid[33],currGrid[34],currGrid[35],currGrid[43],currGrid[44],currGrid[51],currGrid[52],currGrid[53]};
|
298 |
|
|
assign cols[43] = {currGrid[7],currGrid[16],currGrid[25],currGrid[34],currGrid[52],currGrid[61],currGrid[70],currGrid[79]};
|
299 |
|
|
assign rows[43] = {currGrid[36],currGrid[37],currGrid[38],currGrid[39],currGrid[40],currGrid[41],currGrid[42],currGrid[44]};
|
300 |
|
|
assign sqrs[43] = {currGrid[33],currGrid[34],currGrid[35],currGrid[42],currGrid[44],currGrid[51],currGrid[52],currGrid[53]};
|
301 |
|
|
assign cols[44] = {currGrid[8],currGrid[17],currGrid[26],currGrid[35],currGrid[53],currGrid[62],currGrid[71],currGrid[80]};
|
302 |
|
|
assign rows[44] = {currGrid[36],currGrid[37],currGrid[38],currGrid[39],currGrid[40],currGrid[41],currGrid[42],currGrid[43]};
|
303 |
|
|
assign sqrs[44] = {currGrid[33],currGrid[34],currGrid[35],currGrid[42],currGrid[43],currGrid[51],currGrid[52],currGrid[53]};
|
304 |
|
|
assign cols[45] = {currGrid[0],currGrid[9],currGrid[18],currGrid[27],currGrid[36],currGrid[54],currGrid[63],currGrid[72]};
|
305 |
|
|
assign rows[45] = {currGrid[46],currGrid[47],currGrid[48],currGrid[49],currGrid[50],currGrid[51],currGrid[52],currGrid[53]};
|
306 |
|
|
assign sqrs[45] = {currGrid[27],currGrid[28],currGrid[29],currGrid[36],currGrid[37],currGrid[38],currGrid[46],currGrid[47]};
|
307 |
|
|
assign cols[46] = {currGrid[1],currGrid[10],currGrid[19],currGrid[28],currGrid[37],currGrid[55],currGrid[64],currGrid[73]};
|
308 |
|
|
assign rows[46] = {currGrid[45],currGrid[47],currGrid[48],currGrid[49],currGrid[50],currGrid[51],currGrid[52],currGrid[53]};
|
309 |
|
|
assign sqrs[46] = {currGrid[27],currGrid[28],currGrid[29],currGrid[36],currGrid[37],currGrid[38],currGrid[45],currGrid[47]};
|
310 |
|
|
assign cols[47] = {currGrid[2],currGrid[11],currGrid[20],currGrid[29],currGrid[38],currGrid[56],currGrid[65],currGrid[74]};
|
311 |
|
|
assign rows[47] = {currGrid[45],currGrid[46],currGrid[48],currGrid[49],currGrid[50],currGrid[51],currGrid[52],currGrid[53]};
|
312 |
|
|
assign sqrs[47] = {currGrid[27],currGrid[28],currGrid[29],currGrid[36],currGrid[37],currGrid[38],currGrid[45],currGrid[46]};
|
313 |
|
|
assign cols[48] = {currGrid[3],currGrid[12],currGrid[21],currGrid[30],currGrid[39],currGrid[57],currGrid[66],currGrid[75]};
|
314 |
|
|
assign rows[48] = {currGrid[45],currGrid[46],currGrid[47],currGrid[49],currGrid[50],currGrid[51],currGrid[52],currGrid[53]};
|
315 |
|
|
assign sqrs[48] = {currGrid[30],currGrid[31],currGrid[32],currGrid[39],currGrid[40],currGrid[41],currGrid[49],currGrid[50]};
|
316 |
|
|
assign cols[49] = {currGrid[4],currGrid[13],currGrid[22],currGrid[31],currGrid[40],currGrid[58],currGrid[67],currGrid[76]};
|
317 |
|
|
assign rows[49] = {currGrid[45],currGrid[46],currGrid[47],currGrid[48],currGrid[50],currGrid[51],currGrid[52],currGrid[53]};
|
318 |
|
|
assign sqrs[49] = {currGrid[30],currGrid[31],currGrid[32],currGrid[39],currGrid[40],currGrid[41],currGrid[48],currGrid[50]};
|
319 |
|
|
assign cols[50] = {currGrid[5],currGrid[14],currGrid[23],currGrid[32],currGrid[41],currGrid[59],currGrid[68],currGrid[77]};
|
320 |
|
|
assign rows[50] = {currGrid[45],currGrid[46],currGrid[47],currGrid[48],currGrid[49],currGrid[51],currGrid[52],currGrid[53]};
|
321 |
|
|
assign sqrs[50] = {currGrid[30],currGrid[31],currGrid[32],currGrid[39],currGrid[40],currGrid[41],currGrid[48],currGrid[49]};
|
322 |
|
|
assign cols[51] = {currGrid[6],currGrid[15],currGrid[24],currGrid[33],currGrid[42],currGrid[60],currGrid[69],currGrid[78]};
|
323 |
|
|
assign rows[51] = {currGrid[45],currGrid[46],currGrid[47],currGrid[48],currGrid[49],currGrid[50],currGrid[52],currGrid[53]};
|
324 |
|
|
assign sqrs[51] = {currGrid[33],currGrid[34],currGrid[35],currGrid[42],currGrid[43],currGrid[44],currGrid[52],currGrid[53]};
|
325 |
|
|
assign cols[52] = {currGrid[7],currGrid[16],currGrid[25],currGrid[34],currGrid[43],currGrid[61],currGrid[70],currGrid[79]};
|
326 |
|
|
assign rows[52] = {currGrid[45],currGrid[46],currGrid[47],currGrid[48],currGrid[49],currGrid[50],currGrid[51],currGrid[53]};
|
327 |
|
|
assign sqrs[52] = {currGrid[33],currGrid[34],currGrid[35],currGrid[42],currGrid[43],currGrid[44],currGrid[51],currGrid[53]};
|
328 |
|
|
assign cols[53] = {currGrid[8],currGrid[17],currGrid[26],currGrid[35],currGrid[44],currGrid[62],currGrid[71],currGrid[80]};
|
329 |
|
|
assign rows[53] = {currGrid[45],currGrid[46],currGrid[47],currGrid[48],currGrid[49],currGrid[50],currGrid[51],currGrid[52]};
|
330 |
|
|
assign sqrs[53] = {currGrid[33],currGrid[34],currGrid[35],currGrid[42],currGrid[43],currGrid[44],currGrid[51],currGrid[52]};
|
331 |
|
|
assign cols[54] = {currGrid[0],currGrid[9],currGrid[18],currGrid[27],currGrid[36],currGrid[45],currGrid[63],currGrid[72]};
|
332 |
|
|
assign rows[54] = {currGrid[55],currGrid[56],currGrid[57],currGrid[58],currGrid[59],currGrid[60],currGrid[61],currGrid[62]};
|
333 |
|
|
assign sqrs[54] = {currGrid[55],currGrid[56],currGrid[63],currGrid[64],currGrid[65],currGrid[72],currGrid[73],currGrid[74]};
|
334 |
|
|
assign cols[55] = {currGrid[1],currGrid[10],currGrid[19],currGrid[28],currGrid[37],currGrid[46],currGrid[64],currGrid[73]};
|
335 |
|
|
assign rows[55] = {currGrid[54],currGrid[56],currGrid[57],currGrid[58],currGrid[59],currGrid[60],currGrid[61],currGrid[62]};
|
336 |
|
|
assign sqrs[55] = {currGrid[54],currGrid[56],currGrid[63],currGrid[64],currGrid[65],currGrid[72],currGrid[73],currGrid[74]};
|
337 |
|
|
assign cols[56] = {currGrid[2],currGrid[11],currGrid[20],currGrid[29],currGrid[38],currGrid[47],currGrid[65],currGrid[74]};
|
338 |
|
|
assign rows[56] = {currGrid[54],currGrid[55],currGrid[57],currGrid[58],currGrid[59],currGrid[60],currGrid[61],currGrid[62]};
|
339 |
|
|
assign sqrs[56] = {currGrid[54],currGrid[55],currGrid[63],currGrid[64],currGrid[65],currGrid[72],currGrid[73],currGrid[74]};
|
340 |
|
|
assign cols[57] = {currGrid[3],currGrid[12],currGrid[21],currGrid[30],currGrid[39],currGrid[48],currGrid[66],currGrid[75]};
|
341 |
|
|
assign rows[57] = {currGrid[54],currGrid[55],currGrid[56],currGrid[58],currGrid[59],currGrid[60],currGrid[61],currGrid[62]};
|
342 |
|
|
assign sqrs[57] = {currGrid[58],currGrid[59],currGrid[66],currGrid[67],currGrid[68],currGrid[75],currGrid[76],currGrid[77]};
|
343 |
|
|
assign cols[58] = {currGrid[4],currGrid[13],currGrid[22],currGrid[31],currGrid[40],currGrid[49],currGrid[67],currGrid[76]};
|
344 |
|
|
assign rows[58] = {currGrid[54],currGrid[55],currGrid[56],currGrid[57],currGrid[59],currGrid[60],currGrid[61],currGrid[62]};
|
345 |
|
|
assign sqrs[58] = {currGrid[57],currGrid[59],currGrid[66],currGrid[67],currGrid[68],currGrid[75],currGrid[76],currGrid[77]};
|
346 |
|
|
assign cols[59] = {currGrid[5],currGrid[14],currGrid[23],currGrid[32],currGrid[41],currGrid[50],currGrid[68],currGrid[77]};
|
347 |
|
|
assign rows[59] = {currGrid[54],currGrid[55],currGrid[56],currGrid[57],currGrid[58],currGrid[60],currGrid[61],currGrid[62]};
|
348 |
|
|
assign sqrs[59] = {currGrid[57],currGrid[58],currGrid[66],currGrid[67],currGrid[68],currGrid[75],currGrid[76],currGrid[77]};
|
349 |
|
|
assign cols[60] = {currGrid[6],currGrid[15],currGrid[24],currGrid[33],currGrid[42],currGrid[51],currGrid[69],currGrid[78]};
|
350 |
|
|
assign rows[60] = {currGrid[54],currGrid[55],currGrid[56],currGrid[57],currGrid[58],currGrid[59],currGrid[61],currGrid[62]};
|
351 |
|
|
assign sqrs[60] = {currGrid[61],currGrid[62],currGrid[69],currGrid[70],currGrid[71],currGrid[78],currGrid[79],currGrid[80]};
|
352 |
|
|
assign cols[61] = {currGrid[7],currGrid[16],currGrid[25],currGrid[34],currGrid[43],currGrid[52],currGrid[70],currGrid[79]};
|
353 |
|
|
assign rows[61] = {currGrid[54],currGrid[55],currGrid[56],currGrid[57],currGrid[58],currGrid[59],currGrid[60],currGrid[62]};
|
354 |
|
|
assign sqrs[61] = {currGrid[60],currGrid[62],currGrid[69],currGrid[70],currGrid[71],currGrid[78],currGrid[79],currGrid[80]};
|
355 |
|
|
assign cols[62] = {currGrid[8],currGrid[17],currGrid[26],currGrid[35],currGrid[44],currGrid[53],currGrid[71],currGrid[80]};
|
356 |
|
|
assign rows[62] = {currGrid[54],currGrid[55],currGrid[56],currGrid[57],currGrid[58],currGrid[59],currGrid[60],currGrid[61]};
|
357 |
|
|
assign sqrs[62] = {currGrid[60],currGrid[61],currGrid[69],currGrid[70],currGrid[71],currGrid[78],currGrid[79],currGrid[80]};
|
358 |
|
|
assign cols[63] = {currGrid[0],currGrid[9],currGrid[18],currGrid[27],currGrid[36],currGrid[45],currGrid[54],currGrid[72]};
|
359 |
|
|
assign rows[63] = {currGrid[64],currGrid[65],currGrid[66],currGrid[67],currGrid[68],currGrid[69],currGrid[70],currGrid[71]};
|
360 |
|
|
assign sqrs[63] = {currGrid[54],currGrid[55],currGrid[56],currGrid[64],currGrid[65],currGrid[72],currGrid[73],currGrid[74]};
|
361 |
|
|
assign cols[64] = {currGrid[1],currGrid[10],currGrid[19],currGrid[28],currGrid[37],currGrid[46],currGrid[55],currGrid[73]};
|
362 |
|
|
assign rows[64] = {currGrid[63],currGrid[65],currGrid[66],currGrid[67],currGrid[68],currGrid[69],currGrid[70],currGrid[71]};
|
363 |
|
|
assign sqrs[64] = {currGrid[54],currGrid[55],currGrid[56],currGrid[63],currGrid[65],currGrid[72],currGrid[73],currGrid[74]};
|
364 |
|
|
assign cols[65] = {currGrid[2],currGrid[11],currGrid[20],currGrid[29],currGrid[38],currGrid[47],currGrid[56],currGrid[74]};
|
365 |
|
|
assign rows[65] = {currGrid[63],currGrid[64],currGrid[66],currGrid[67],currGrid[68],currGrid[69],currGrid[70],currGrid[71]};
|
366 |
|
|
assign sqrs[65] = {currGrid[54],currGrid[55],currGrid[56],currGrid[63],currGrid[64],currGrid[72],currGrid[73],currGrid[74]};
|
367 |
|
|
assign cols[66] = {currGrid[3],currGrid[12],currGrid[21],currGrid[30],currGrid[39],currGrid[48],currGrid[57],currGrid[75]};
|
368 |
|
|
assign rows[66] = {currGrid[63],currGrid[64],currGrid[65],currGrid[67],currGrid[68],currGrid[69],currGrid[70],currGrid[71]};
|
369 |
|
|
assign sqrs[66] = {currGrid[57],currGrid[58],currGrid[59],currGrid[67],currGrid[68],currGrid[75],currGrid[76],currGrid[77]};
|
370 |
|
|
assign cols[67] = {currGrid[4],currGrid[13],currGrid[22],currGrid[31],currGrid[40],currGrid[49],currGrid[58],currGrid[76]};
|
371 |
|
|
assign rows[67] = {currGrid[63],currGrid[64],currGrid[65],currGrid[66],currGrid[68],currGrid[69],currGrid[70],currGrid[71]};
|
372 |
|
|
assign sqrs[67] = {currGrid[57],currGrid[58],currGrid[59],currGrid[66],currGrid[68],currGrid[75],currGrid[76],currGrid[77]};
|
373 |
|
|
assign cols[68] = {currGrid[5],currGrid[14],currGrid[23],currGrid[32],currGrid[41],currGrid[50],currGrid[59],currGrid[77]};
|
374 |
|
|
assign rows[68] = {currGrid[63],currGrid[64],currGrid[65],currGrid[66],currGrid[67],currGrid[69],currGrid[70],currGrid[71]};
|
375 |
|
|
assign sqrs[68] = {currGrid[57],currGrid[58],currGrid[59],currGrid[66],currGrid[67],currGrid[75],currGrid[76],currGrid[77]};
|
376 |
|
|
assign cols[69] = {currGrid[6],currGrid[15],currGrid[24],currGrid[33],currGrid[42],currGrid[51],currGrid[60],currGrid[78]};
|
377 |
|
|
assign rows[69] = {currGrid[63],currGrid[64],currGrid[65],currGrid[66],currGrid[67],currGrid[68],currGrid[70],currGrid[71]};
|
378 |
|
|
assign sqrs[69] = {currGrid[60],currGrid[61],currGrid[62],currGrid[70],currGrid[71],currGrid[78],currGrid[79],currGrid[80]};
|
379 |
|
|
assign cols[70] = {currGrid[7],currGrid[16],currGrid[25],currGrid[34],currGrid[43],currGrid[52],currGrid[61],currGrid[79]};
|
380 |
|
|
assign rows[70] = {currGrid[63],currGrid[64],currGrid[65],currGrid[66],currGrid[67],currGrid[68],currGrid[69],currGrid[71]};
|
381 |
|
|
assign sqrs[70] = {currGrid[60],currGrid[61],currGrid[62],currGrid[69],currGrid[71],currGrid[78],currGrid[79],currGrid[80]};
|
382 |
|
|
assign cols[71] = {currGrid[8],currGrid[17],currGrid[26],currGrid[35],currGrid[44],currGrid[53],currGrid[62],currGrid[80]};
|
383 |
|
|
assign rows[71] = {currGrid[63],currGrid[64],currGrid[65],currGrid[66],currGrid[67],currGrid[68],currGrid[69],currGrid[70]};
|
384 |
|
|
assign sqrs[71] = {currGrid[60],currGrid[61],currGrid[62],currGrid[69],currGrid[70],currGrid[78],currGrid[79],currGrid[80]};
|
385 |
|
|
assign cols[72] = {currGrid[0],currGrid[9],currGrid[18],currGrid[27],currGrid[36],currGrid[45],currGrid[54],currGrid[63]};
|
386 |
|
|
assign rows[72] = {currGrid[73],currGrid[74],currGrid[75],currGrid[76],currGrid[77],currGrid[78],currGrid[79],currGrid[80]};
|
387 |
|
|
assign sqrs[72] = {currGrid[54],currGrid[55],currGrid[56],currGrid[63],currGrid[64],currGrid[65],currGrid[73],currGrid[74]};
|
388 |
|
|
assign cols[73] = {currGrid[1],currGrid[10],currGrid[19],currGrid[28],currGrid[37],currGrid[46],currGrid[55],currGrid[64]};
|
389 |
|
|
assign rows[73] = {currGrid[72],currGrid[74],currGrid[75],currGrid[76],currGrid[77],currGrid[78],currGrid[79],currGrid[80]};
|
390 |
|
|
assign sqrs[73] = {currGrid[54],currGrid[55],currGrid[56],currGrid[63],currGrid[64],currGrid[65],currGrid[72],currGrid[74]};
|
391 |
|
|
assign cols[74] = {currGrid[2],currGrid[11],currGrid[20],currGrid[29],currGrid[38],currGrid[47],currGrid[56],currGrid[65]};
|
392 |
|
|
assign rows[74] = {currGrid[72],currGrid[73],currGrid[75],currGrid[76],currGrid[77],currGrid[78],currGrid[79],currGrid[80]};
|
393 |
|
|
assign sqrs[74] = {currGrid[54],currGrid[55],currGrid[56],currGrid[63],currGrid[64],currGrid[65],currGrid[72],currGrid[73]};
|
394 |
|
|
assign cols[75] = {currGrid[3],currGrid[12],currGrid[21],currGrid[30],currGrid[39],currGrid[48],currGrid[57],currGrid[66]};
|
395 |
|
|
assign rows[75] = {currGrid[72],currGrid[73],currGrid[74],currGrid[76],currGrid[77],currGrid[78],currGrid[79],currGrid[80]};
|
396 |
|
|
assign sqrs[75] = {currGrid[57],currGrid[58],currGrid[59],currGrid[66],currGrid[67],currGrid[68],currGrid[76],currGrid[77]};
|
397 |
|
|
assign cols[76] = {currGrid[4],currGrid[13],currGrid[22],currGrid[31],currGrid[40],currGrid[49],currGrid[58],currGrid[67]};
|
398 |
|
|
assign rows[76] = {currGrid[72],currGrid[73],currGrid[74],currGrid[75],currGrid[77],currGrid[78],currGrid[79],currGrid[80]};
|
399 |
|
|
assign sqrs[76] = {currGrid[57],currGrid[58],currGrid[59],currGrid[66],currGrid[67],currGrid[68],currGrid[75],currGrid[77]};
|
400 |
|
|
assign cols[77] = {currGrid[5],currGrid[14],currGrid[23],currGrid[32],currGrid[41],currGrid[50],currGrid[59],currGrid[68]};
|
401 |
|
|
assign rows[77] = {currGrid[72],currGrid[73],currGrid[74],currGrid[75],currGrid[76],currGrid[78],currGrid[79],currGrid[80]};
|
402 |
|
|
assign sqrs[77] = {currGrid[57],currGrid[58],currGrid[59],currGrid[66],currGrid[67],currGrid[68],currGrid[75],currGrid[76]};
|
403 |
|
|
assign cols[78] = {currGrid[6],currGrid[15],currGrid[24],currGrid[33],currGrid[42],currGrid[51],currGrid[60],currGrid[69]};
|
404 |
|
|
assign rows[78] = {currGrid[72],currGrid[73],currGrid[74],currGrid[75],currGrid[76],currGrid[77],currGrid[79],currGrid[80]};
|
405 |
|
|
assign sqrs[78] = {currGrid[60],currGrid[61],currGrid[62],currGrid[69],currGrid[70],currGrid[71],currGrid[79],currGrid[80]};
|
406 |
|
|
assign cols[79] = {currGrid[7],currGrid[16],currGrid[25],currGrid[34],currGrid[43],currGrid[52],currGrid[61],currGrid[70]};
|
407 |
|
|
assign rows[79] = {currGrid[72],currGrid[73],currGrid[74],currGrid[75],currGrid[76],currGrid[77],currGrid[78],currGrid[80]};
|
408 |
|
|
assign sqrs[79] = {currGrid[60],currGrid[61],currGrid[62],currGrid[69],currGrid[70],currGrid[71],currGrid[78],currGrid[80]};
|
409 |
|
|
assign cols[80] = {currGrid[8],currGrid[17],currGrid[26],currGrid[35],currGrid[44],currGrid[53],currGrid[62],currGrid[71]};
|
410 |
|
|
assign rows[80] = {currGrid[72],currGrid[73],currGrid[74],currGrid[75],currGrid[76],currGrid[77],currGrid[78],currGrid[79]};
|
411 |
|
|
assign sqrs[80] = {currGrid[60],currGrid[61],currGrid[62],currGrid[69],currGrid[70],currGrid[71],currGrid[78],currGrid[79]};
|
412 |
|
|
|
413 |
|
|
generate
|
414 |
|
|
for(i=0;i<81;i=i+1)
|
415 |
|
|
begin: outGridGen
|
416 |
|
|
assign outGrid[(9*(i+1)-1):(9*i)] = currGrid[i];
|
417 |
|
|
|
418 |
|
|
end
|
419 |
|
|
endgenerate
|
420 |
|
|
|
421 |
|
|
|
422 |
|
|
genvar ii,jj;
|
423 |
|
|
wire [80:0] c_rows [8:0];
|
424 |
|
|
wire [80:0] c_cols [8:0];
|
425 |
|
|
wire [80:0] c_grds [8:0];
|
426 |
|
|
wire [26:0] w_correct;
|
427 |
|
|
|
428 |
|
|
generate
|
429 |
|
|
for(ii=0;ii<9;ii=ii+1)
|
430 |
|
|
begin: row_check
|
431 |
|
|
assign c_rows[0][(9*(ii+1)-1):9*ii] = currGrid[ii];
|
432 |
|
|
assign c_rows[1][(9*(ii+1)-1):9*ii] = currGrid[9+ii];
|
433 |
|
|
assign c_rows[2][(9*(ii+1)-1):9*ii] = currGrid[18+ii];
|
434 |
|
|
assign c_rows[3][(9*(ii+1)-1):9*ii] = currGrid[27+ii];
|
435 |
|
|
assign c_rows[4][(9*(ii+1)-1):9*ii] = currGrid[36+ii];
|
436 |
|
|
assign c_rows[5][(9*(ii+1)-1):9*ii] = currGrid[45+ii];
|
437 |
|
|
assign c_rows[6][(9*(ii+1)-1):9*ii] = currGrid[54+ii];
|
438 |
|
|
assign c_rows[7][(9*(ii+1)-1):9*ii] = currGrid[63+ii];
|
439 |
|
|
assign c_rows[8][(9*(ii+1)-1):9*ii] = currGrid[72+ii];
|
440 |
|
|
end
|
441 |
|
|
endgenerate
|
442 |
|
|
|
443 |
|
|
generate
|
444 |
|
|
for(ii=0;ii<9;ii=ii+1)
|
445 |
|
|
begin: col_check
|
446 |
|
|
assign c_cols[0][(9*(ii+1)-1):9*ii] = currGrid[9*ii + 0];
|
447 |
|
|
assign c_cols[1][(9*(ii+1)-1):9*ii] = currGrid[9*ii + 1];
|
448 |
|
|
assign c_cols[2][(9*(ii+1)-1):9*ii] = currGrid[9*ii + 2];
|
449 |
|
|
assign c_cols[3][(9*(ii+1)-1):9*ii] = currGrid[9*ii + 3];
|
450 |
|
|
assign c_cols[4][(9*(ii+1)-1):9*ii] = currGrid[9*ii + 4];
|
451 |
|
|
assign c_cols[5][(9*(ii+1)-1):9*ii] = currGrid[9*ii + 5];
|
452 |
|
|
assign c_cols[6][(9*(ii+1)-1):9*ii] = currGrid[9*ii + 6];
|
453 |
|
|
assign c_cols[7][(9*(ii+1)-1):9*ii] = currGrid[9*ii + 7];
|
454 |
|
|
assign c_cols[8][(9*(ii+1)-1):9*ii] = currGrid[9*ii + 8];
|
455 |
|
|
end
|
456 |
|
|
endgenerate
|
457 |
|
|
|
458 |
|
|
genvar iii,jjj;
|
459 |
|
|
generate
|
460 |
|
|
for(ii=0; ii < 3; ii=ii+1)
|
461 |
|
|
begin: grd_check_y
|
462 |
|
|
for(jj = 0; jj < 3; jj=jj+1)
|
463 |
|
|
begin: grd_check_x
|
464 |
|
|
for(iii=3*ii; iii < 3*(ii+1); iii=iii+1)
|
465 |
|
|
begin: gg_y
|
466 |
|
|
for(jjj=3*jj; jjj < 3*(jj+1); jjj=jjj+1)
|
467 |
|
|
begin: gg_x
|
468 |
|
|
|
469 |
|
|
//(3*(iii-3*ii) + (jjj-3*jj))
|
470 |
|
|
assign c_grds[3*ii+jj][9*(3*(iii-3*ii) + (jjj-3*jj)+1)-1:9*(3*(iii-3*ii) + (jjj-3*jj))] = currGrid[9*iii + jjj];
|
471 |
|
|
end
|
472 |
|
|
end
|
473 |
|
|
end
|
474 |
|
|
end
|
475 |
|
|
endgenerate
|
476 |
|
|
|
477 |
|
|
generate
|
478 |
|
|
for(ii=0;ii<9;ii=ii+1)
|
479 |
|
|
begin: checks
|
480 |
|
|
checkCorrect cC_R (.y(w_correct[ii]), .in(c_rows[ii]));
|
481 |
|
|
checkCorrect cC_C (.y(w_correct[9+ii]), .in(c_cols[ii]));
|
482 |
|
|
checkCorrect cC_G (.y(w_correct[18+ii]), .in(c_grds[ii]));
|
483 |
|
|
end
|
484 |
|
|
endgenerate
|
485 |
|
|
|
486 |
|
|
//assign anyError = ~(&w_correct);
|
487 |
|
|
|
488 |
|
|
always@(posedge clk)
|
489 |
|
|
begin
|
490 |
|
|
if(rst)
|
491 |
|
|
begin
|
492 |
|
|
r_done <= 1'b0;
|
493 |
|
|
r_changed <= 1'b0;
|
494 |
|
|
r_error <= 1'b0;
|
495 |
|
|
end
|
496 |
|
|
else
|
497 |
|
|
begin
|
498 |
|
|
r_done <= start ? 1'b0 : &done;
|
499 |
|
|
r_changed <= start ? 1'b0 : |changed;
|
500 |
|
|
r_error <= start ? 1'b0 : ~(&w_correct);
|
501 |
|
|
end
|
502 |
|
|
end
|
503 |
|
|
|
504 |
|
|
|
505 |
|
|
|
506 |
|
|
endmodule
|