1
0
forked from tanchou/Verilog

Add testbench for top_ultrasonic_led module

- Created a new testbench file `top_ultrasonic_led_tb.vvp` to simulate the `top_ultrasonic_led` module.
- Defined the necessary signals and events for testing the ultrasonic sensor functionality.
- Implemented the main test sequence including triggering the ultrasonic sensor and monitoring the output LEDs based on distance measurements.
- Included timing and state management for accurate simulation of the ultrasonic sensor behavior.
This commit is contained in:
Gamenight77
2025-04-16 14:23:18 +02:00
parent 079159bdb8
commit 7a2fbc0195
12 changed files with 8335 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
module top_ultrasonic_led (
input wire clk,
input wire rst,
input wire start, // bouton ou signal de départ
input wire echo, // signal du capteur
output wire trig, // vers le capteur
output wire [5:0] leds // sorties LED
);
wire [8:0] distance;
// Module de mesure de distance
ultrasonic_fpga ultrasonic_inst (
.clk(clk),
.rst(rst),
.start(start),
.echo(echo),
.trig_out(trig),
.distance(distance)
);
// Module d'affichage leds
distance_display_led led_display_inst (
.distance(distance),
.leds(leds)
);
endmodule