OpenCores
URL https://opencores.org/ocsvn/othellogame/othellogame/trunk

Subversion Repositories othellogame

[/] [othellogame/] [trunk/] [test/] [test_game_ai.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 marius_mtm
`timescale 1ns / 1ps
2
 
3
////////////////////////////////////////////////////////////////////////////////
4
// Company: 
5
// Engineer:
6
//
7
// Create Date:   16:36:11 04/30/2009
8
// Design Name:   game_ai
9
// Module Name:   E:/Projects/Diplom/Othello/test_game_ai.v
10
// Project Name:  Othello
11
// Target Device:  
12
// Tool versions:  
13
// Description: 
14
//
15
// Verilog Test Fixture created by ISE for module: game_ai
16
//
17
// Dependencies:
18
// 
19
// Revision:
20
// Revision 0.01 - File Created
21
// Additional Comments:
22
// 
23
////////////////////////////////////////////////////////////////////////////////
24
 
25
module test_game_ai;
26
 
27
        // Inputs
28
        reg clk;
29
        reg RST;
30
        reg go;
31
 
32
        // Outputs
33
        wire [63:0] n_red;
34
        wire [63:0] n_blue;
35
        wire ok_move;
36
        wire o_pl;
37
        wire done;
38
        wire [2:0] m_x;
39
        wire [2:0] m_y;
40
        wire [2:0] bestX;
41
        wire [2:0] bestY;
42
 
43
        wire [63:0] RED_BMOVE;
44
        wire [63:0] BLUE_BMOVE;
45
 
46
        wire [63:0] R_in;
47
        wire [63:0] B_in;
48
 
49
        reg [63:0] rosa_d;
50
        reg [63:0] rosa_q;
51
 
52
        reg [63:0] nero_d;
53
        reg [63:0] nero_q;
54
 
55
        wire [63:0] Mw;
56
        wire [63:0] M_ram;
57
        wire [63:0] dbg_DATA_w;
58
        wire [63:0] dbg_DATA_q;
59
        wire [10:0] dbg_max_p_q;
60
        wire [19:0] dbg_heur;
61
        wire [3:0] fake;
62
 
63
        always #100 clk = ~clk;
64
 
65
 
66
//assign R_in = rosa_q;
67
//assign B_in = nero_q;
68
 
69
//      wire [63:0] init_RED =  64'b11111110_11001100_10000000_10010000_11000000_10000000_11000000_11100000;
70
//      wire [63:0] init_BLUE = 64'b00000000_00110000_01111110_01101110_00111111_01111000_00110000_00010000;    
71
 
72
        wire [63:0] init_RED =  64'b00000111_00000011_00000001_00000011_00001001_00000001_00110011_01111111;
73
        wire [63:0] init_BLUE = 64'b00001000_00001100_00011110_01111100_01110110_01111110_00001100_00000000;
74
 
75
 
76
//assign init_RED = 
77
/*
78
assign R_in = (RST) ?  64'b00000000_00000000_00000000_00001000_00010000_00000000_00000000_00000000 : n_red;
79
assign B_in = (RST) ?  64'b00000000_00000000_00000000_00010000_00001000_00000000_00000000_00000000 : n_blue;
80
*/
81
/*
82
assign RED  = 64'b00000000_00000000_00000000_00001000_00010000_00000000_00000000_00000000;
83
assign BLUE = 64'b00000000_00000000_00000000_00010000_00001000_00000000_00000000_00000000;
84
*/
85
        initial begin
86
                // Initialize Inputs
87
        //              rosa_q <= 64'b00000000_00000000_00000000_00001000_00010000_00000000_00000000_00000000;
88
        //              nero_q <= 64'b00000000_00000000_00000000_00010000_00001000_00000000_00000000_00000000;
89
 
90
                clk = 0;
91
                //rst = 0;
92
                go = 0;
93
                RST = 1;
94
                // Wait 100 ns for global reset to finish
95
                #250;
96
                RST = 0;
97
           go = 1;
98
                #200
99
                // Add stimulus here
100
 
101
                #200
102
      go = 0;
103
 
104
                // Add stimulus here
105
 
106
        end
107
 
108
/*
109
        always @( * ) begin
110
                rosa_d = n_red;
111
                nero_d = n_blue;
112
        end
113
 
114
 
115
   always @(posedge clk) begin
116
                if (RST) begin
117
                        rosa_q <= 64'b00000000_00000000_00000000_00001000_00010000_00000000_00000000_00000000;
118
                        nero_q <= 64'b00000000_00000000_00000000_00010000_00001000_00000000_00000000_00000000;
119
                end
120
                else begin
121
                        rosa_q <= rosa_d;
122
                        nero_q <= nero_d;
123
                end
124
        end
125
        */
126
        b_move uut2 (
127
                .clk(clk),
128
                .RST(RST),
129
                .player(o_pl),
130
                .R_(n_red),
131
                .B_(n_blue),
132
 
133
                .X(m_x),
134
                .Y(m_y),
135
 
136
                .R_OUT(RED_BMOVE),
137
                .B_OUT(BLUE_BMOVE)
138
        );
139
 
140
        // Instantiate the Unit Under Test (UUT)
141
        game_ai uut (
142
                .clk(clk),
143
                .rst(RST),
144
                .go(go),
145
                .init_red(init_RED),
146
                .init_blue(init_BLUE),
147
 
148
                .red_in(RED_BMOVE),
149
                .blue_in(BLUE_BMOVE),
150
 
151
                .n_red(n_red),
152
                .n_blue(n_blue),
153
 
154
//              .ok_move(ok_move), 
155
                .o_pl(o_pl),
156
                .done(done),
157
                .m_x(m_x),
158
                .m_y(m_y),
159
 
160
                .bestX(bestX),
161
                .bestY(bestY),
162
                .M_wq(Mw),
163
                .fake_state(fake),
164
                .M_wram(M_ram),
165
//              .dbg_DATA_w(dbg_DATA_w),
166
//              .dbg_DATA_q(dbg_DATA_q),                
167
                .dbg_max_p_q(dbg_max_p_q),
168
                .dbg_heur(dbg_heur)
169
        );
170
 
171
endmodule
172
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.