Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions data/icesugar_nano.pcf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 12 MHz external clock
set_io i_clk D1

# LED
set_io o_led B6

# UART
set_io i_uart_rx A3
set_io o_uart_tx B3
13 changes: 13 additions & 0 deletions doc/servant.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,19 @@ serial console will show up.

fusesoc run --target=icesugar servant

iCESugar-nano
^^^^^^^^^^^^^

Pin B3 is used for LED output. As the default clock of 12 MHz is rather slow
the LED only toggles every 9 seconds with the default blinky example.

Thanks to the onboard debugger, you can just connect the USB Type-C connector
to the PC, and a serial console will show up. However, the device doesn't have
enough RAM to run the Zephyr hello-world example so the UART pins are not
connect but they are defined in the PCF for easy reference.

fusesoc run --target=icesugar-nano servant

ICE-V Wireless
^^^^^^^^^^^^^^

Expand Down
16 changes: 16 additions & 0 deletions servant.core
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ filesets:

icesugar : {files: [data/icesugar.pcf : {file_type : PCF}]}

icesugar_nano:
files:
- data/icesugar_nano.pcf : {file_type : PCF}
- servant/servant_ice40_cm36.v : {file_type : verilogSource}

icev_wireless : {files: [data/icev_wireless.pcf : {file_type : PCF}]}

gmm7550:
Expand Down Expand Up @@ -441,6 +446,17 @@ targets:
pnr: next
toplevel : service

icesugar-nano:
default_tool : icestorm
description : iCE40LP1K Development Board by MuseLab
filesets : [mem_files, soc, icesugar_nano]
parameters : [memfile=blinky.hex, memsize=7168]
tools:
icestorm:
nextpnr_options: [--lp1k, --package, cm36, --freq, 12]
pnr: next
toplevel : servant_ice40_cm36

icev_wireless:
default_tool : icestorm
description: ICE-V Wireless
Expand Down
41 changes: 41 additions & 0 deletions servant/servant_ice40_cm36.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
`default_nettype none
module servant_ice40_cm36 (
input wire i_clk,
output wire o_led
);

parameter memfile = "blinky.hex";
parameter memsize = 7168;

wire wb_clk;
reg wb_rst;

/* 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, but blinky doesn't
* work at all if the reset isn't enabled for at least 25 clocks.
*
* This will generate a reset signal at power on.
*/
reg [7:0] rst_cnt = '0;

always @(posedge i_clk) begin
if (rst_cnt < 255) begin
rst_cnt <= rst_cnt + 1;
wb_rst <= 1;
end else begin
wb_rst <= 0;
end
end

servant #(
.memfile(memfile),
.memsize(memsize)
) servant (
.wb_clk(wb_clk),
.wb_rst(wb_rst),
.q (o_led)
);

endmodule