diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/zybo/flash_help.md b/zybo/flash_help.md new file mode 100644 index 0000000..1bebf6b --- /dev/null +++ b/zybo/flash_help.md @@ -0,0 +1,10 @@ +## +# Pour version Mac, vivado tourne dans un conteneur docker +## + +# Chercher où le bitstream est +docker cp vivado-docker-vivado-run-15b5f3ed8d35:/workspace/zybo_hello_world/zybo_hello_world.runs/impl_1/top.bit ./top.bit + +# Flasher le bitstream avec openFPGALoader +openFPGALoader -b zybo_z7_10 ./top.bit + diff --git a/zybo/hello_world/constraints/zybo_pins.xdc b/zybo/hello_world/constraints/zybo_pins.xdc new file mode 100644 index 0000000..473eb65 --- /dev/null +++ b/zybo/hello_world/constraints/zybo_pins.xdc @@ -0,0 +1,15 @@ +## Horloge 125 MHz (Ethernet PHY Clock vers PL) +set_property -dict { PACKAGE_PIN L16 IOSTANDARD LVCMOS33 } [get_ports { clk }]; +create_clock -add -name sys_clk_pin -period 8.00 -waveform {0 4} [get_ports { clk }]; + +## Switchs (SW0..SW3) +set_property -dict { PACKAGE_PIN G15 IOSTANDARD LVCMOS33 } [get_ports { sw[0] }]; +set_property -dict { PACKAGE_PIN P15 IOSTANDARD LVCMOS33 } [get_ports { sw[1] }]; +set_property -dict { PACKAGE_PIN W13 IOSTANDARD LVCMOS33 } [get_ports { sw[2] }]; +set_property -dict { PACKAGE_PIN T16 IOSTANDARD LVCMOS33 } [get_ports { sw[3] }]; + +## LEDs (LD0..LD3) +set_property -dict { PACKAGE_PIN M14 IOSTANDARD LVCMOS33 } [get_ports { led[0] }]; +set_property -dict { PACKAGE_PIN M15 IOSTANDARD LVCMOS33 } [get_ports { led[1] }]; +set_property -dict { PACKAGE_PIN G14 IOSTANDARD LVCMOS33 } [get_ports { led[2] }]; +set_property -dict { PACKAGE_PIN D18 IOSTANDARD LVCMOS33 } [get_ports { led[3] }]; \ No newline at end of file diff --git a/zybo/hello_world/src/top.sv b/zybo/hello_world/src/top.sv new file mode 100644 index 0000000..8e35d38 --- /dev/null +++ b/zybo/hello_world/src/top.sv @@ -0,0 +1,40 @@ +`timescale 1ns / 1ps +////////////////////////////////////////////////////////////////////////////////// +// Company: +// Engineer: +// +// Create Date: 12/02/2026 08:24:56 PM +// Design Name: +// Module Name: top +// Project Name: +// Target Devices: +// Tool Versions: +// Description: +// +// Dependencies: +// +// Revision: +// Revision 0.01 - File Created +// Additional Comments: +// +////////////////////////////////////////////////////////////////////////////////// + + +module top ( + input logic clk, // Horloge 125 MHz (broche L16) + input logic [3:0] sw, // 4 switchs + output logic [3:0] led // 4 LEDs +); + + // 125 MHz -> 2^26 ticks ≈ 0.536s (clignotement ~0.93 Hz) + logic [26:0] counter = '0; + + always_ff @(posedge clk) begin + counter <= counter + 1'b1; + end + + // LD0 clignote, LD1..LD3 suivent SW1..SW3 (sauf si SW0 coupe le clignotement) + assign led[0] = sw[0] ? 1'b1 : counter[26]; + assign led[3:1] = sw[3:1]; + +endmodule