Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get simple blinky firmware running on Icebreaker!
Required some tweaks to the design to get the size down: - Configure Ibex to use FPGA-optimized register file (implements RF as block RAM) - Configure Ibex to remove optional performance counters - Reduce size of RAM - Reduce # of outstanding requests for TLUL RAM adapter - Modify uart_core.sv to reduce size of UART FIFOs
- Loading branch information
Showing
10 changed files
with
2,719 additions
and
34 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,9 @@ | ||
zerosoc.v | ||
zerosoc.vcd | ||
|
||
# SC build dir | ||
build/ | ||
|
||
# FPGA build outputs | ||
*.asc | ||
*.bit |
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
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,66 @@ | ||
## Source: https://github.com/icebreaker-fpga/icebreaker-examples/blob/master/icebreaker.pcf | ||
|
||
# 12 MHz clock | ||
set_io -nowarn CLK 35 | ||
|
||
# RS232 | ||
set_io -nowarn RX 6 | ||
set_io -nowarn TX 9 | ||
|
||
# LEDs and Button | ||
set_io -nowarn BTN_N 10 | ||
set_io -nowarn LEDR_N 11 | ||
set_io -nowarn LEDG_N 37 | ||
|
||
# RGB LED Driver | ||
set_io -nowarn LED_RED_N 39 | ||
set_io -nowarn LED_GRN_N 40 | ||
set_io -nowarn LED_BLU_N 41 | ||
|
||
# SPI Flash | ||
set_io -nowarn FLASH_SCK 15 | ||
set_io -nowarn FLASH_SSB 16 | ||
set_io -nowarn FLASH_IO0 14 | ||
set_io -nowarn FLASH_IO1 17 | ||
set_io -nowarn FLASH_IO2 12 | ||
set_io -nowarn FLASH_IO3 13 | ||
|
||
# PMOD 1A | ||
set_io -nowarn P1A1 4 | ||
set_io -nowarn P1A2 2 | ||
set_io -nowarn P1A3 47 | ||
set_io -nowarn P1A4 45 | ||
set_io -nowarn P1A7 3 | ||
set_io -nowarn P1A8 48 | ||
set_io -nowarn P1A9 46 | ||
set_io -nowarn P1A10 44 | ||
|
||
# PMOD 1B | ||
set_io -nowarn P1B1 43 | ||
set_io -nowarn P1B2 38 | ||
set_io -nowarn P1B3 34 | ||
set_io -nowarn P1B4 31 | ||
set_io -nowarn P1B7 42 | ||
set_io -nowarn P1B8 36 | ||
set_io -nowarn P1B9 32 | ||
set_io -nowarn P1B10 28 | ||
|
||
# PMOD 2 | ||
set_io -nowarn P2_1 27 | ||
set_io -nowarn P2_2 25 | ||
set_io -nowarn P2_3 21 | ||
set_io -nowarn P2_4 19 | ||
set_io -nowarn P2_7 26 | ||
set_io -nowarn P2_8 23 | ||
set_io -nowarn P2_9 20 | ||
set_io -nowarn P2_10 18 | ||
|
||
# LEDs and Buttons (PMOD 2) | ||
set_io -nowarn LED1 26 | ||
set_io -nowarn LED2 27 | ||
set_io -nowarn LED3 25 | ||
set_io -nowarn LED4 23 | ||
set_io -nowarn LED5 21 | ||
set_io -nowarn BTN1 20 | ||
set_io -nowarn BTN2 19 | ||
set_io -nowarn BTN3 18 |
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,54 @@ | ||
module top_icebreaker ( | ||
input CLK, | ||
input BTN_N, | ||
|
||
input RX, | ||
output TX, | ||
|
||
input BTN1, | ||
input BTN2, | ||
input BTN3, | ||
|
||
output LED1, | ||
output LED2, | ||
output LED3, | ||
output LED4, | ||
output LED5 | ||
); | ||
|
||
wire clk_6mhz; | ||
|
||
SB_HFOSC #( | ||
.CLKHF_DIV("0b11") // 6mhz | ||
) clock_gen ( | ||
.CLKHFPU(1'b1), | ||
.CLKHFEN(1'b1), | ||
.CLKHF(clk_6mhz) | ||
); | ||
|
||
wire [2:0] gpio_in; | ||
assign gpio_in[0] = BTN1; | ||
assign gpio_in[1] = BTN2; | ||
assign gpio_in[2] = BTN3; | ||
|
||
wire [31:0] gpio_out; | ||
assign LED1 = gpio_out[0]; | ||
assign LED2 = gpio_out[1]; | ||
assign LED3 = gpio_out[2]; | ||
assign LED4 = gpio_out[3]; | ||
assign LED5 = gpio_out[4]; | ||
|
||
zerosoc soc( | ||
.clk_i(clk_6mhz), | ||
.rst_ni(BTN_N), | ||
|
||
.uart_rx_i(RX), | ||
.uart_tx_o(TX), | ||
.uart_tx_en_o(), | ||
|
||
.gpio_i({29'b0, gpio_in}), | ||
.gpio_o(gpio_out), | ||
.gpio_en_o() | ||
); | ||
|
||
endmodule |
Oops, something went wrong.