summaryrefslogtreecommitdiff
path: root/A5.1/Verilog/Piotr/majority_tb.v
blob: 3d19a068974d818d526f58e9deeff398372ed775 (plain)
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
64
65
66
67
//                              -*- Mode: Verilog -*-
// Filename        : majority_tb.v
// Description     : 
// Author          : piotr
// Created On      : Mon Jan 19 16:41:43 2009
// Last Modified By: .
// Last Modified On: .
// Update Count    : 0
// Status          : Unknown, Use with caution!

module majority_tb();
   reg	R1_clk_bit, R2_clk_bit, R3_clk_bit;
   wire R1_clk_out, R2_clk_out,	R3_clk_out;
   
   majority majority_inst(
			  .R1_clk_bit(R1_clk_bit),
			  .R2_clk_bit(R2_clk_bit),
			  .R3_clk_bit(R3_clk_bit),
			  .R1_clk_out(R1_clk_out),
			  .R2_clk_out(R2_clk_out),
			  .R3_clk_out(R3_clk_out)
			  );

  initial
   begin
      R1_clk_bit = 0;
      R2_clk_bit = 0;
      R3_clk_bit = 0;
      
      #10 R1_clk_bit = 1;
      R2_clk_bit = 0;
      R3_clk_bit = 0;
      
      #10 R1_clk_bit = 0;
      R2_clk_bit = 1;
      R3_clk_bit = 0;      

      #10 R1_clk_bit = 1;
      R2_clk_bit = 1;
      R3_clk_bit = 0;      

      #10 R1_clk_bit = 0;
      R2_clk_bit = 0;
      R3_clk_bit = 1;

      #10 R1_clk_bit = 1;
      R2_clk_bit = 0;
      R3_clk_bit = 1;      
      
      #10 R1_clk_bit = 0;
      R2_clk_bit = 1;
      R3_clk_bit = 1;
      
      #10 R1_clk_bit = 1;
      R2_clk_bit = 1;
      R3_clk_bit = 1;      
   end
  
   initial
   begin    
      $dumpvars;
      $dumpfile("majority_tb.vcd");
      $dumpon;
      #90 $dumpoff;
   end  
   
endmodule
personal git repositories of Harald Welte. Your mileage may vary