
/* ////////////////////////////////////////////////////////////////////////////
                                    dbn_t.v
///////////////////////////////////////////////////////////////////////////////
DESCRIPTION:    This is a test bench for the divide-by-N counter in dbn.v

REVISIONS:      22 Sep 07 - RAC - Genesis, with hints from an online example.
//////////////////////////////////////////////////////////////////////////// */

`timescale 1ns / 1ps
`define ON_TEST_BENCH
`include "dbn.v"

module DivideByNTester ;

    reg clock;                                  // Clock to be divided
    wire dividedClock;                          // Result
    wire [`COUNTER_WIDTH-1 : 0] counter;

    initial begin
        clock <= 0;
        #60 $finish;                            // Just run for 30 clocks
        end

    always begin                                // Toggle the clock at every
        #1 clock <= ~clock;                     //  simulator tick
        end

    always @(posedge clock) begin
        $display("counter: %d, out: %d", counter, dividedClock);
        end

    DivideByN X (clock, dividedClock, counter); // Connect DUT to test bench

    endmodule
