`timescale 1ns / 1ps //////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 08:21:11 02/01/2012 // Design Name: CounterMod4 // Module Name: D:/Comp541/Lab3/CounterMod4_test.v // Project Name: Lab3 // Target Device: // Tool versions: // Description: // // Verilog Test Fixture created by ISE for module: CounterMod4 // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // //////////////////////////////////////////////////////////////////////////////// module CounterMod4_test; // Inputs reg clock; reg reset; // Outputs wire [1:0] value; // Instantiate the Unit Under Test (UUT) CounterMod4 uut ( .clock(clock), .reset(reset), .value(value) ); integer i; initial begin // Initialize Inputs clock = 0; reset = 0; // Wait 5 ns before starting #5; // Let us count for 5 clock cycles // Each clock cycle is 2ns (1ns high and 1ns low) for(i=0; i<5; i=i+1) begin #1 clock = ~clock; #1 clock = ~clock; end // Wait 2 ns and then reset the counter #1 reset = 1; #1 clock = 1; #1 reset = 0; clock = 0; // Let us count again 3 clock cycles for(i=0; i<3; i=i+1) begin #1 clock = ~clock; #1 clock = ~clock; end #2 $finish; end endmodule