From 8979966af45953008f8f41c0b91e5baef42f8e91 Mon Sep 17 00:00:00 2001 From: "Pavel V. Shatov (Meister)" Date: Mon, 13 Sep 2021 11:27:48 +0300 Subject: Minimalistic blinking LED design to check whether iCE40 is operational. --- src/mkm_test1.pcf | 5 +++++ src/mkm_test1.sdc | 1 + src/mkm_test1.v | 28 ++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 src/mkm_test1.pcf create mode 100644 src/mkm_test1.sdc create mode 100644 src/mkm_test1.v (limited to 'src') diff --git a/src/mkm_test1.pcf b/src/mkm_test1.pcf new file mode 100644 index 0000000..cfdac09 --- /dev/null +++ b/src/mkm_test1.pcf @@ -0,0 +1,5 @@ +set_io leds[0] 45 -io_std SB_LVCMOS +set_io leds[1] 48 -io_std SB_LVCMOS +set_io leds[2] 47 -io_std SB_LVCMOS +set_io leds[3] 46 -io_std SB_LVCMOS + diff --git a/src/mkm_test1.sdc b/src/mkm_test1.sdc new file mode 100644 index 0000000..c1dfc34 --- /dev/null +++ b/src/mkm_test1.sdc @@ -0,0 +1 @@ +create_clock -period 20.83 -name {clk_osc_hf} [get_nets {clk_osc_hf}] diff --git a/src/mkm_test1.v b/src/mkm_test1.v new file mode 100644 index 0000000..64f1b5d --- /dev/null +++ b/src/mkm_test1.v @@ -0,0 +1,28 @@ +module mkm_test1 +( + output [3:0] leds // {red, yellow, green, blue} + // PCB: | BLUE | RED | YELLOW | GREEN | +); + + wire clk_osc_hf; // 48 MHz + + SB_HFOSC # + ( + .CLKHF_DIV ("0b00") + ) + SB_HFOSC_inst + ( + .CLKHFPU (1'b1), + .CLKHFEN (1'b1), + .CLKHF (clk_osc_hf) + ) /* synthesis ROUTE_THROUGH_FABRIC = 0 */; + + reg [26:0] cnt = 27'd0; + + always @(posedge clk_osc_hf) + // + cnt <= cnt + 1'b1; + + assign leds = cnt[26:23]; + +endmodule -- cgit v1.2.3