Skip to content

Commit d4d0c5d

Browse files
committed
Add Nexys A7 support for SPI Flash
1 parent 9b22a00 commit d4d0c5d

File tree

3 files changed

+56
-5
lines changed

3 files changed

+56
-5
lines changed

data/swervolf_nexys.xdc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ set_property -dict { PACKAGE_PIN C4 IOSTANDARD LVCMOS33 } [get_ports i_uart_r
2222
set_property -dict { PACKAGE_PIN D4 IOSTANDARD LVCMOS33 } [get_ports o_uart_tx]
2323

2424
set_property -dict { PACKAGE_PIN J15 IOSTANDARD LVCMOS33 } [get_ports { sw0 }];
25+
26+
set_property -dict { PACKAGE_PIN K17 IOSTANDARD LVCMOS33 } [get_ports o_flash_mosi]; #IO_L1P_T0_D00_MOSI_14 Sch=qspi_dq[0]
27+
set_property -dict { PACKAGE_PIN K18 IOSTANDARD LVCMOS33 } [get_ports i_flash_miso]; #IO_L1N_T0_D01_DIN_14 Sch=qspi_dq[1]
28+
#set_property -dict { PACKAGE_PIN L14 IOSTANDARD LVCMOS33 } [get_ports { QSPI_DQ[2] }]; #IO_L2P_T0_D02_14 Sch=qspi_dq[2]
29+
#set_property -dict { PACKAGE_PIN M14 IOSTANDARD LVCMOS33 } [get_ports { QSPI_DQ[3] }]; #IO_L2N_T0_D03_14 Sch=qspi_dq[3]
30+
set_property -dict { PACKAGE_PIN L13 IOSTANDARD LVCMOS33 } [get_ports o_flash_cs_n];
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
interface ftdi
2+
ftdi_device_desc "Digilent USB Device"
3+
ftdi_vid_pid 0x0403 0x6010
4+
ftdi_channel 0
5+
ftdi_layout_init 0x0088 0x008b
6+
reset_config none
7+
adapter_khz 10000
8+
9+
transport select jtag
10+
11+
source [find cpld/xilinx-xc7.cfg]
12+
source [find cpld/jtagspi.cfg]
13+
14+
if { [info exists BINFILE] } {
15+
set _BINFILE $BINFILE
16+
} else {
17+
set _BINFILE boot.bin
18+
}
19+
20+
init
21+
jtagspi_init 0 bscan_spi_xc7a100t.bit
22+
jtagspi_program $_BINFILE 0x0
23+
shutdown
24+

rtl/swervolf_nexys.v

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
`default_nettype none
2525
module swervolf_nexys_a7
26-
#(parameter bootrom_file = "blinky.vh")
26+
#(parameter bootrom_file = "spi_uimage_loader.vh")
2727
(input wire clk,
2828
input wire rstn,
2929
output wire [12:0] ddram_a,
@@ -41,6 +41,9 @@ module swervolf_nexys_a7
4141
output wire ddram_cke,
4242
output wire ddram_odt,
4343
input wire sw0,
44+
output wire o_flash_cs_n,
45+
output wire o_flash_mosi,
46+
input wire i_flash_miso,
4447
input wire i_uart_rx,
4548
output wire o_uart_tx,
4649
output reg led0);
@@ -156,6 +159,24 @@ module swervolf_nexys_a7
156159
wire [31:0] dmi_reg_rdata;
157160
wire dmi_hard_reset;
158161

162+
wire flash_sclk;
163+
164+
STARTUPE2 STARTUPE2
165+
(
166+
.CFGCLK (),
167+
.CFGMCLK (),
168+
.EOS (),
169+
.PREQ (),
170+
.CLK (1'b0),
171+
.GSR (1'b0),
172+
.GTS (1'b0),
173+
.KEYCLEARB (1'b1),
174+
.PACK (1'b0),
175+
.USRCCLKO (flash_sclk),
176+
.USRCCLKTS (1'b0),
177+
.USRDONEO (1'b1),
178+
.USRDONETS (1'b0));
179+
159180
bscan_tap tap
160181
(.clk (clk_core),
161182
.rst (rst_core),
@@ -182,10 +203,10 @@ module swervolf_nexys_a7
182203
.dmi_reg_en (dmi_reg_en ),
183204
.dmi_reg_wr_en (dmi_reg_wr_en),
184205
.dmi_hard_reset (dmi_hard_reset),
185-
.o_flash_sclk (),
186-
.o_flash_cs_n (),
187-
.o_flash_mosi (),
188-
.i_flash_miso (1'b0),
206+
.o_flash_sclk (flash_sclk),
207+
.o_flash_cs_n (o_flash_cs_n),
208+
.o_flash_mosi (o_flash_mosi),
209+
.i_flash_miso (i_flash_miso),
189210
.i_uart_rx (i_uart_rx),
190211
.o_uart_tx (cpu_tx),
191212
.o_ram_awid (cpu.aw_id),

0 commit comments

Comments
 (0)