2012年11月24日土曜日

`timescale 1ns / 1ns

////////////////////////////////////////////////////////////////////////////////

module cnt16_test;

    // Inputs
    reg clk;
    reg res;
    reg mv;

    // Outputs
    wire [15:0] cnt;
   
    parameter c_s = 100;
    parameter c_s_h = 50;

    // Instantiate the Unit Under Test (UUT)
    cnt_16bit uut (
        .clk(clk),
        .res(res),
        .mv(mv),
        .cnt(cnt)
    );

    initial begin
        // Initialize Inputs
        clk = 0;
        res = 0;
        mv = 0;

        // Wait 100 ns for global reset to finish
        #100;
       
        // Add stimulus here
        res = 1;
        mv = 0;
        #(c_s*10)
        res = 0;
        mv = 0;
       
        #(c_s*10)
        res = 0;
        mv = 1;

        #(c_s*10000);
       
        #(c_s*10)
        res = 0;
        mv = 0;
   
        #(c_s*50)
        res = 0;
        mv = 0;

        #(c_s*10000);
   

    end
    always #(c_s_h) clk = ~clk;
   
endmodule