OpenCores
URL https://opencores.org/ocsvn/neopixel_fpga/neopixel_fpga/trunk

Subversion Repositories neopixel_fpga

[/] [neopixel_fpga/] [trunk/] [rtl/] [ws2812_sequence_tb.v] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 splinedriv
/*
2
 *  FpgaNeoPixel - A spi to ws2812 machine
3
 *
4
 *  Copyright (C) 2020  Hirosh Dabui <hirosh@dabui.de>
5
 *
6
 *  Permission to use, copy, modify, and/or distribute this software for any
7
 *  purpose with or without fee is hereby granted, provided that the above
8
 *  copyright notice and this permission notice appear in all copies.
9
 *
10
 *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
 *  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
 *  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
 *  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
 *  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
 *  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
 *  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
 *
18
 */
19
`include "ws2812_sequence.v"
20
 
21
module testbench;
22
localparam CLK_HZ = 12_000_000;
23
reg clk;
24
wire dout;
25
wire done;
26
reg reset;
27
 
28
 
29
reg [4095:0] vcdfile;
30
always #5 clk = (clk === 1'b0);
31
ws2812_sequence uut(.clk(clk),
32
                     .din(24'h000001),
33
                     .resetn(reset),
34
                     .enable(1'b1),
35
                     .dout(dout),
36
                     .done(done)
37
                   );
38
 
39
        initial begin
40
                if ($value$plusargs("vcd=%s", vcdfile)) begin
41
                        $dumpfile(vcdfile);
42
                        $dumpvars(0, testbench);
43
                end
44
        end
45
 
46
        initial begin
47
    reset = 0;
48
                repeat (2) @(posedge clk);
49
    reset = 1;
50
                repeat (2000) @(posedge clk);
51
                $finish;
52
        end
53
endmodule

powered by: WebSVN 2.1.0

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