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

Subversion Repositories fluid_core_2

[/] [fluid_core_2/] [trunk/] [bench/] [tb_Reg_hist.v] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 azmathmoos
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// Copyright (C) 2014-2015 Azmath Moosa                         ////
4
////                                                              ////
5
//// This source file may be used and distributed without         ////
6
//// restriction provided that this copyright statement is not    ////
7
//// removed from the file and that any derivative work contains  ////
8
//// the original copyright notice and the associated disclaimer. ////
9
////                                                              ////
10
//// This source file is free software; you can redistribute it   ////
11
//// and/or modify it under the terms of the GNU Lesser General   ////
12
//// Public License as published by the Free Software Foundation; ////
13
//// either version 3 of the License, or (at your option) any     ////
14
//// later version.                                               ////
15
////                                                              ////
16
//// This source is distributed in the hope that it will be       ////
17
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
18
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
19
//// PURPOSE.  See the GNU Lesser General Public License for more ////
20
//// details.                                                     ////
21
////                                                              ////
22
//// You should have received a copy of the GNU Lesser General    ////
23
//// Public License along with this source; if not, download it   ////
24
//// from http://www.opencores.org/lgpl.shtml                     ////
25
////                                                              ////
26
//////////////////////////////////////////////////////////////////////
27
`timescale 1ns / 1ps
28
 
29
 
30
module tb_Reg_hist;
31
 
32
        // Inputs
33
        reg Clk;
34
        reg [0:2] nxt_reg_A;
35
        reg [0:2] nxt_reg_B;
36
        reg [0:2] nxt_dest;
37
 
38
        // Outputs
39
        wire [0:1] reg_src_A;
40
        wire [0:1] reg_src_B;
41
 
42
        // Instantiate the Unit Under Test (UUT)
43
        Reg_Hist uut (
44
                .Clk(Clk),
45
                .nxt_reg_A(nxt_reg_A),
46
                .nxt_reg_B(nxt_reg_B),
47
                .nxt_dest(nxt_dest),
48
                .reg_src_A(reg_src_A),
49
                .reg_src_B(reg_src_B)
50
        );
51
 
52
              initial begin
53
                // Initialize Inputs
54
                Clk = 1;
55
                nxt_reg_A = 0;
56
                nxt_reg_B = 0;
57
                nxt_dest = 0;
58
 
59
                // Wait 100 ns for global reset to finish
60
                #100;
61
 
62
                // Add stimulus here
63
 
64
        end
65
   always begin
66
        #50 Clk = ~Clk;
67
        end
68
 
69
        always begin
70
        #100 nxt_dest = 0;
71
        #100 nxt_dest = 1;
72
        #100 nxt_dest = 2;
73
                  nxt_reg_A = 1;
74
                  nxt_reg_B = 0;
75
 
76
        #100 nxt_dest = 3;
77
                  nxt_reg_A = 1;
78
                  nxt_reg_B = 2;
79
        end
80
endmodule
81
 

powered by: WebSVN 2.1.0

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