-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Follow the 6 steps to add support for a new target. Step 1: Locate input and output pins. Step 2: Add pin constraint file. This covers clock input, LED and UART output. Step 3: Create a clock generator. The chip has no internal clock generator so the external 12 MHz clock is used. Step 4: Add top level servant_ice40_cm36 which connects the one-wire output of servant to both the LED and UART pin. Step 5: Add fileset including the new top level and pin constraints. Step 6: Add target icesugar-nano.
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# 12 MHz external clock | ||
set_io i_clk D1 | ||
|
||
# LED | ||
set_io o_led B6 | ||
|
||
# UART | ||
set_io o_uart_tx B3 |
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
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
`default_nettype none | ||
module servant_ice40_cm36 ( | ||
input wire i_clk, | ||
output wire o_led, | ||
output wire o_uart_tx | ||
); | ||
|
||
parameter memfile = "blinky.hex"; | ||
parameter memsize = 7168; | ||
|
||
wire wb_clk; | ||
wire wb_rst; | ||
wire q; | ||
|
||
/* Duplicate the SERV output to both LED and UART pins. */ | ||
assign o_led = q; | ||
assign o_uart_tx = q; | ||
|
||
/* iCE40 CM36 has no PLL. Drive everything from the external clock. */ | ||
assign wb_clk = i_clk; | ||
|
||
/* Board has no button that can be used for reset. */ | ||
assign wb_rst = 1'b0; | ||
|
||
servant #( | ||
.memfile(memfile), | ||
.memsize(memsize) | ||
) servant ( | ||
.wb_clk(wb_clk), | ||
.wb_rst(wb_rst), | ||
.q (q) | ||
); | ||
|
||
endmodule |