diff options
author | Michael Abed <michaelabed@gmail.com> | 2012-03-21 13:17:47 -0400 |
---|---|---|
committer | Michael Abed <michaelabed@gmail.com> | 2012-03-21 13:17:47 -0400 |
commit | 2ac48fa0e44016a6cb49cab84a154eb7ec2dcab4 (patch) | |
tree | 9819721233275cee6e39483867818a54299a4fc1 /Test_ContdownController.v | |
download | ec311-lab4-2ac48fa0e44016a6cb49cab84a154eb7ec2dcab4.tar.gz ec311-lab4-2ac48fa0e44016a6cb49cab84a154eb7ec2dcab4.tar.bz2 ec311-lab4-2ac48fa0e44016a6cb49cab84a154eb7ec2dcab4.zip |
Initial Commit
Diffstat (limited to 'Test_ContdownController.v')
-rw-r--r-- | Test_ContdownController.v | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/Test_ContdownController.v b/Test_ContdownController.v new file mode 100644 index 0000000..ba3b63c --- /dev/null +++ b/Test_ContdownController.v @@ -0,0 +1,94 @@ +`timescale 1ns / 1ps + +//////////////////////////////////////////////////////////////////////////////// +// Company: +// Engineer: +// +// Create Date: 17:21:16 03/16/2012 +// Design Name: CountdownController +// Module Name: /home/michael/Documents/School/EC311/lab4/Test_ContdownController.v +// Project Name: lab4 +// Target Device: +// Tool versions: +// Description: +// +// Verilog Test Fixture created by ISE for module: CountdownController +// +// Dependencies: +// +// Revision: +// Revision 0.01 - File Created +// Additional Comments: +// +//////////////////////////////////////////////////////////////////////////////// + +module Test_ContdownController; + + // Inputs + reg btnA; + reg btnB; + reg btnC; + reg clk; + reg rst; + + // Outputs + wire [6:0] ssd; + wire [3:0] AN; + + // Instantiate the Unit Under Test (UUT) + CountdownController uut ( + .btnA(btnA), + .btnB(btnB), + .btnC(btnC), + .clk(clk), + .rst(rst), + .ssd(ssd), + .AN(AN) + ); + + reg [31:0] i = 0; + reg [3:0] j = 0; + initial begin + // Initialize Inputs + btnA = 0; + btnB = 0; + btnC = 0; + clk = 0; + rst = 0; + + // Wait 100 ns for global reset to finish + #100; + + // Add stimulus here + + + + + while (11) begin + clk = ~clk; #1; + if (i < 100) begin + i = i + 1; + if (i == 50) begin + for (j = 0; j < 5; j = j + 1) begin + btnA = 1; #1 + clk = ~clk; + btnA = 0; #1; + clk = ~clk; + end + for (j = 0; j < 2; j = j + 1) begin + btnB = 1; #1; + clk = ~clk; + btnB = 0; #1; + clk = ~clk; + end + end + if (i == 90) begin + btnC = 1; #1; clk = ~clk; btnC = 0; + end + end + end + + end + +endmodule + |