Skip to content

Commit

Permalink
have a look at the Ft board
Browse files Browse the repository at this point in the history
  • Loading branch information
dheijl committed Feb 11, 2025
1 parent 8a97511 commit 3ecdf6b
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 5 deletions.
10 changes: 6 additions & 4 deletions test0/constraint/SPI.acf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pin sck A5
pin sdi A6
pin sdo A9
pin cs A2
STANDARD(LVCMOS33) {
pin sck A5
pin sdi A6
pin sdo A9
pin cs A2
}
24 changes: 23 additions & 1 deletion test0/source/alchitry_top.luc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ module alchitry_top (
input sck, // spi clock
input sdi, // spi mosi
output sdo, // spi miso
input cs // spi slave select
input cs, // spi slave select
input ft_clk, // Ft 100MHz clock
input ft_rxf, // Ft Rx Full (0 = data in rx buffer)
input ft_txe, // Ft Tx Empty (0 = space in tx buffer)
inout ft_data[16], // Ft data bus
inout ft_be[2], // Ft byte enable
output ft_rd, // Ft read flag (0 = read)
output ft_wr, // Ft write flag (0 = write)
output ft_oe // Ft output enable (0 = Ft, 1 = FPGA drives bus)

) {
/*
SPI Mode 0 = CPOL 0 CPHA 0
Expand All @@ -30,6 +39,7 @@ module alchitry_top (
spi_peripheral spi (#CPOL(0), #CPHA(0), .cs(cs), .sck(sck), .sdi(sdi))
dff have_char[1]
dff next_char[8]
ft ft(#BUS_WIDTH(16), #TX_BUFFER(256), #RX_BUFFER(256), .ft_clk(ft_clk), .ft_data(ft_data), .ft_be(ft_be))
}
}

Expand All @@ -42,6 +52,18 @@ module alchitry_top (
rx.rx = usb_rx
usb_tx = tx.tx

ft.ft_rxf = ft_rxf
ft.ft_txe = ft_txe
ft_rd = ft.ft_rd
ft_wr = ft.ft_wr
ft_oe = ft.ft_oe

// echo data back
ft.ui_dout_get = !ft.ui_din_full
ft.ui_din_valid = !ft.ui_dout_empty
ft.ui_din = ft.ui_dout
ft.ui_din_be = ft.ui_dout_be

// connect spi
spi.data_in = 8h00
sdo = spi.sdo
Expand Down
18 changes: 18 additions & 0 deletions test0/test0.alp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@
"type": "DiskFile",
"path": "source/spi_peripheral.luc"
}
},
{
"file": {
"type": "Component",
"path": "Memory/async_fifo.luc"
}
},
{
"file": {
"type": "Component",
"path": "Interfaces/ft.luc"
}
}
],
"constraintFiles": [
Expand All @@ -132,6 +144,12 @@
"type": "DiskFile",
"path": "constraint/SPI.acf"
}
},
{
"file": {
"type": "Component",
"path": "Constraints/ft_v1.acf"
}
}
],
"ipCores": []
Expand Down

0 comments on commit 3ecdf6b

Please sign in to comment.