-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
examples: ice_makefile_blinky: allow blinking with R, G or B easily
- Loading branch information
Showing
2 changed files
with
12 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
set_io --warn-no-port led_green 39 | ||
set_io --warn-no-port clk 35 | ||
set_io -nowarn LED_G 39 # active-low | ||
set_io -nowarn LED_B 40 # active-low | ||
set_io -nowarn LED_R 41 # active-low | ||
set_io -nowarn CLK 35 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
|
||
module top ( | ||
input clk, | ||
output led_green, | ||
input CLK, | ||
output LED_R, | ||
output LED_G, | ||
output LED_B, | ||
); | ||
|
||
localparam N = 22; | ||
|
||
reg [N:0] counter; | ||
|
||
always @(posedge clk) begin | ||
always @(posedge CLK) begin | ||
counter <= counter + 1; | ||
end | ||
|
||
assign led_green = counter[N]; | ||
assign LED_R = 1'b1; | ||
assign LED_G = counter[N]; | ||
assign LED_B = 1'b1; | ||
|
||
endmodule |