diff options
author | Pavel V. Shatov (Meister) <meisterpaul1@yandex.ru> | 2021-09-13 11:27:48 +0300 |
---|---|---|
committer | Pavel V. Shatov (Meister) <meisterpaul1@yandex.ru> | 2021-09-13 11:27:48 +0300 |
commit | 8979966af45953008f8f41c0b91e5baef42f8e91 (patch) | |
tree | 3db08e060ca57441ca35eddb4d22c6cf865e2e89 | |
parent | 69eda72fa8db3e332de6a66a92f994dfed99de94 (diff) |
Minimalistic blinking LED design to check whether iCE40 is operational.mkm_test1
-rw-r--r-- | src/mkm_test1.pcf | 5 | ||||
-rw-r--r-- | src/mkm_test1.sdc | 1 | ||||
-rw-r--r-- | src/mkm_test1.v | 28 |
3 files changed, 34 insertions, 0 deletions
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 |