OpenCores
URL https://opencores.org/ocsvn/fpga-cf/fpga-cf/trunk

Subversion Repositories fpga-cf

[/] [fpga-cf/] [trunk/] [hdl/] [PATLPP/] [checksum/] [checksum_tb.v] - Blame information for rev 11

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 peteralieb
// CHECKSUM_TB - testbench
2
//
3
 
4
`timescale 1ns / 1ns
5
 
6
module checksum_tb;
7
 
8
reg clk, rst, checksum_add, checksum_clear;
9
reg [15:0] data_in;
10
wire checksum_check;
11
wire [15:0] checksum_out;
12
 
13
checksum dut
14
(
15
        .clk(clk),
16
        .rst(rst),
17
        .checksum_add(checksum_add),
18
        .checksum_clear(checksum_clear),
19
        .data_in(data_in),
20
        .checksum_check(checksum_check),
21
        .checksum_out(checksum_out)
22
);
23
 
24
always #10 clk <= ~clk;
25
 
26
initial
27
begin
28
        clk = 1;
29
        rst = 1;
30
        data_in = 0;
31
        checksum_add = 0;
32
        checksum_clear = 0;
33
        @(posedge clk);
34
        rst = 0;
35
        @(posedge clk);
36
        data_in = 16'hffff;
37
        @(posedge clk);
38
        checksum_add = 1;
39
        @(posedge clk);
40
        data_in = 1;
41
        @(posedge clk);
42
        @(posedge clk);
43
        checksum_clear = 1;
44
        @(posedge clk);
45
        checksum_clear = 0;
46
        @(posedge clk);
47
        @(posedge clk);
48
        @(posedge clk);
49
end
50
 
51
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.