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

Subversion Repositories mips_16

[/] [mips_16/] [trunk/] [bench/] [EX_stage/] [EX_stage_tb_0.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 Doyya
////////////////////////////////////////////////////////////////////////////////
2
// Company: 
3
// Engineer:
4
//
5
// Create Date:   20:27:50 02/08/2012
6
// Design Name:   EX_stage
7
// Module Name:   F:/Projects/My_MIPS/mips_16/bench/EX_stage/EX_stage_tb_0.v
8
// Project Name:  mips_16
9
// Target Device:  
10
// Tool versions:  
11
// Description: 
12
//
13
// Verilog Test Fixture created by ISE for module: EX_stage
14
//
15
// Dependencies:
16
// 
17
// Revision:
18
// Revision 0.01 - File Created
19
// Additional Comments:
20
// 
21
////////////////////////////////////////////////////////////////////////////////
22
`timescale 1ns/1ps
23
`include "mips_16_defs.v"
24
module EX_stage_tb_0_v;
25
 
26
        // Inputs
27
        reg clk;
28
        reg rst;
29
        reg [56:0] pipeline_reg_in;
30
 
31
        // Outputs
32
        wire [37:0] pipeline_reg_out;
33
        wire [2:0] ex_op_dest;
34
 
35
        // Instantiate the Unit Under Test (UUT)
36
        EX_stage uut (
37
                .clk(clk),
38
                .rst(rst),
39
                .pipeline_reg_in(pipeline_reg_in),
40
                .pipeline_reg_out(pipeline_reg_out),
41
                .ex_op_dest(ex_op_dest)
42
        );
43
 
44
        parameter CLK_PERIOD = 10;
45
        always #(CLK_PERIOD /2)
46
                clk =~clk;
47
 
48
        initial begin
49
                // Initialize Inputs
50
                clk = 0;
51
                rst = 0;
52
                pipeline_reg_in = 0;
53
 
54
                // Wait 100 ns for global reset to finish
55
                #100;
56
                // Add stimulus here
57
                #(CLK_PERIOD/2)
58
                #1
59
                #(CLK_PERIOD*1) rst = 1;
60
                #(CLK_PERIOD*1) rst = 0;
61
 
62
                #(CLK_PERIOD*10)
63
                pipeline_reg_in = {`ALU_ADD, 16'd12345, 16'd12345, 22'hcad28};
64
 
65
                #(CLK_PERIOD*0.5)
66
                if (ex_op_dest == 3'b100)
67
                        $display("ok1 ");
68
                else
69
                        $display("error1, %x ", ex_op_dest);
70
 
71
                #(CLK_PERIOD*0.5)
72
                if( pipeline_reg_out == {16'd24690, 22'hcad28} )
73
                        $display("ok2 ");
74
                else
75
                        $display("error2, %x ", pipeline_reg_out);
76
 
77
                #(CLK_PERIOD*10)
78
                $stop;
79
        end
80
 
81
endmodule
82
 

powered by: WebSVN 2.1.0

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