Skip to content

Commit 0cb3a17

Browse files
author
Me
committed
Initial commit
0 parents  commit 0cb3a17

16 files changed

+3875
-0
lines changed

Makefile

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
################################################################################
2+
##
3+
## Filename: Makefile
4+
##
5+
## Project: SD-Card controller, using a shared SPI interface
6+
##
7+
## Purpose: Coordinate building the specification for this core, the
8+
## Verilator Verilog check, and any bench software.
9+
##
10+
## Creator: Dan Gisselquist, Ph.D.
11+
## Gisselquist Technology, LLC
12+
##
13+
################################################################################
14+
##
15+
## Copyright (C) 2016, Gisselquist Technology, LLC
16+
##
17+
## This program is free software (firmware): you can redistribute it and/or
18+
## modify it under the terms of the GNU General Public License as published
19+
## by the Free Software Foundation, either version 3 of the License, or (at
20+
## your option) any later version.
21+
##
22+
## This program is distributed in the hope that it will be useful, but WITHOUT
23+
## ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
24+
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25+
## for more details.
26+
##
27+
## You should have received a copy of the GNU General Public License along
28+
## with this program. (It's in the $(ROOT)/doc directory, run make with no
29+
## target there if the PDF file isn't present.) If not, see
30+
## <http://www.gnu.org/licenses/> for a copy.
31+
##
32+
## License: GPL, v3, as defined and found on www.gnu.org,
33+
## http://www.gnu.org/licenses/gpl.html
34+
##
35+
##
36+
################################################################################
37+
##
38+
##
39+
.PHONY: all
40+
all: verilated bench
41+
BENCH := `find bench -name Makefile` `find bench -name "*.cpp"` `find bench -name "*.h"`
42+
RTL := `find rtl -name "*.v"` `find rtl -name Makefile`
43+
NOTES := # `find . -name "*.txt"` `find . -name "*.html"`
44+
SW=
45+
#SW := `find sw -name "*.cpp"` `find sw -name "*.h"` \
46+
# `find sw -name "*.sh"` `find sw -name "*.py"` \
47+
# `find sw -name "*.pl"` `find sw -name Makefile`
48+
DEVSW=
49+
YYMMDD:=`date +%Y%m%d`
50+
51+
.PHONY: archive
52+
archive:
53+
tar --transform s,^,$(YYMMDD)-sdspi/, -chjf $(YYMMDD)-sdspi.tjz $(BENCH) $(SW) $(RTL) $(NOTES)
54+
55+
.PHONY: verilated
56+
verilated:
57+
cd rtl ; $(MAKE) --no-print-directory
58+
59+
# The documents target does not get, nor should it be, made automatically. This
60+
# is because the project is intended to be shipped with the documents
61+
# automatically built, and I don't necessarily expect all those who download
62+
# this "core" to have LaTeX distribution necessary to rebuild the specification
63+
# and GPL LaTeX documents into their PDF results.
64+
.PHONY: doc
65+
doc:
66+
cd doc ; $(MAKE) --no-print-directory
67+
68+
.PHONY: bench
69+
bench:
70+
cd bench/cpp ; $(MAKE) --no-print-directory
71+
72+
#.PHONY: sw
73+
# sw:
74+
# cd sw ; $(MAKE) --no-print-directory
75+

README.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# SD-Card controller, using a shared SPI interface
2+
3+
This Verilog core exports an SD card controller interface from internal to an
4+
FPGA to the rest of the FPGA core, while taking care of the lower level details
5+
internal to the interface. Unlike the [other OpenCores SD Card controller](http://www.opencores.org/project,sdcard_mass_storage_controller) which offers a full SD interface, this controller focuses on the SPI interface of the SD Card.
6+
While this is a slower interface, the SPI interface is
7+
necessary to access the card when using a [XuLA2 board](http://www.xess.com/shop/product/xula2-lx25/), or
8+
in general any time the full 9--bit, bi--directional interface to the SD card
9+
has not been implemented.
10+
Further, for those who are die--hard Verilog authors, this core is written in
11+
Verilog as opposed to the [XESS provided demonstration SD Card controller
12+
found on GitHub](https://github.com/xesscorp/VHDL\_Lib/SDCard.vhd), which was
13+
written
14+
in VHDL. For those who are not such die--hard Verilog authors, this controller
15+
provides a lower level interface to the card than these other controllers.
16+
Whereas the XESS controller will automatically start up the card and interact
17+
with it, this controller requires external software to be used when interacting
18+
with the card. This makes this SDSPI controller both more versatile, in the
19+
face of potential changes to the card interface, but also less--turn key.
20+
21+
While this core was written for the purpose of being used with the [ZipCPU](/../zipcpu),
22+
as enhanced by the Wishbone DMA controller used by the ZipCPU, nothing in this
23+
core prevents it from being used with any other architecture that supports
24+
the 32-bit Wishbone interface of this core.
25+
26+
This core has been written as a wishbone slave, not a master. Using the core
27+
together with a separate master, such as a CPU or a DMA controller, only makes
28+
sense. This design choice, however, also restricts the core from being able to
29+
use the multiple block write or multiple block read commands, restricting us to
30+
single block read and write commands alone.
31+
32+
For more information, please consult the specification document.

bench/cpp/Makefile

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
################################################################################
2+
##
3+
## Filename: Makefile
4+
##
5+
## Project: SD-Card controller, using a shared SPI interface
6+
##
7+
## Purpose: Nothing currently. Eventually, if I create a proper bench
8+
## test, rather than just running this on real hardware as part of
9+
## another project (XuLA2-LX25 SoC), this Makefile will coordinate the
10+
## building of that bench test software.
11+
##
12+
## Creator: Dan Gisselquist, Ph.D.
13+
## Gisselquist Technology, LLC
14+
##
15+
################################################################################
16+
##
17+
## Copyright (C) 2016, Gisselquist Technology, LLC
18+
##
19+
## This program is free software (firmware): you can redistribute it and/or
20+
## modify it under the terms of the GNU General Public License as published
21+
## by the Free Software Foundation, either version 3 of the License, or (at
22+
## your option) any later version.
23+
##
24+
## This program is distributed in the hope that it will be useful, but WITHOUT
25+
## ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
26+
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
27+
## for more details.
28+
##
29+
## You should have received a copy of the GNU General Public License along
30+
## with this program. (It's in the $(ROOT)/doc directory, run make with no
31+
## target there if the PDF file isn't present.) If not, see
32+
## <http://www.gnu.org/licenses/> for a copy.
33+
##
34+
## License: GPL, v3, as defined and found on www.gnu.org,
35+
## http://www.gnu.org/licenses/gpl.html
36+
##
37+
##
38+
################################################################################
39+
##
40+
##
41+
.PHONY: all
42+
all:
43+

0 commit comments

Comments
 (0)