// Testbench pour distance_ws2812_display
module tb_distance_ws2812_display;

    reg clk;
    reg [8:0] distance;
    wire ws2812_dout;

    // Instance du module à tester
    distance_ws2812_display uut (
        .clk(clk),
        .distance(distance),
        .ws2812_dout(ws2812_dout)
    );

    always #5 clk = ~clk;  
    integer i;
    initial begin
        // Initialiser les signaux
        clk = 0;
        distance = 0;

        $dumpfile("distance_ws2812_display.vcd");
        $dumpvars(0, tb_distance_ws2812_display);

        // Test de la conversion de distance en LED
        for (i = 0; i <= 380; i = i + 10) begin
            distance = i;
            #10;
            $display("Distance: %3d cm => dout: %b", distance, ws2812_dout);
        end
        
        #100 $stop; // Arrêter la simulation après un certain temps
    end
endmodule
