-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwall.sv
63 lines (54 loc) · 2.45 KB
/
wall.sv
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
module wall (input [9:0]DrawX,
input [9:0] DrawY,
output isWall
);
always_comb
begin
logic [10:0]index;
logic [5:0] drawx, drawy;
int maze[812]; //28 * 29
maze = '{
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //1
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //2
0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, //3
0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1, //4
0,1,0,1,1,1,0,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,0,1,1,1,0,1, //5
0,1,0,1,1,1,0,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,0,1,1,1,0,1, //6
0,1,0,1,1,1,0,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,0,1,1,1,0,1, //7
0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, //8
0,1,0,1,1,1,0,1,0,0,0,1,1,1,1,1,1,1,0,0,0,1,0,1,1,1,0,1, //9
0,1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1, //10
0,1,1,1,1,1,0,1,1,1,1,1,0,0,1,0,0,1,1,1,1,1,0,1,1,1,1,1, //11
0,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0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 0 && drawy <= 28 && drawy >= 0)
begin
index = drawy * 28 + drawx;
if(maze[index] == 1)
isWall = 1;
else
isWall = 0;
end
else
isWall = 0;
end
endmodule