aboutsummaryrefslogtreecommitdiff
path: root/nmigen_boards/dev/flash.py
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2019-10-03 05:54:12 +0000
committerwhitequark <whitequark@whitequark.org>2019-10-03 06:16:18 +0000
commitc7c637043817eae6f48c33b707b40c9c1b20f199 (patch)
tree3fa379b97128ad93a7c98c5da7e578605828cd6c /nmigen_boards/dev/flash.py
parentb033d53db305eb3f0aef336568cd69f8e8c536e1 (diff)
Reorganize resource taxonomy.
The current hierarchy isn't particularly well suited to resources like SDRAM or NOR flash, so make it much less fine-grained but easier to use and less nitpicky.
Diffstat (limited to 'nmigen_boards/dev/flash.py')
-rw-r--r--nmigen_boards/dev/flash.py38
1 files changed, 0 insertions, 38 deletions
diff --git a/nmigen_boards/dev/flash.py b/nmigen_boards/dev/flash.py
deleted file mode 100644
index 817b6d4..0000000
--- a/nmigen_boards/dev/flash.py
+++ /dev/null
@@ -1,38 +0,0 @@
-from nmigen.build import *
-
-
-__all__ = ["SPIFlashResources"]
-
-
-def SPIFlashResources(*args, cs, clk, mosi, miso, wp=None, hold=None, attrs=None):
- resources = []
-
- io_all = []
- if attrs is not None:
- io_all.append(attrs)
- io_all.append(Subsignal("cs", PinsN(cs, dir="o")))
- io_all.append(Subsignal("clk", Pins(clk, dir="o", assert_width=1)))
-
- io_1x = list(io_all)
- io_1x.append(Subsignal("mosi", Pins(mosi, dir="o", assert_width=1)))
- io_1x.append(Subsignal("miso", Pins(miso, dir="i", assert_width=1)))
- if wp is not None and hold is not None:
- io_1x.append(Subsignal("wp", PinsN(wp, dir="o", assert_width=1)))
- io_1x.append(Subsignal("hold", PinsN(hold, dir="o", assert_width=1)))
- resources.append(Resource.family(*args, default_name="spi_flash", ios=io_1x,
- name_suffix="1x"))
-
- io_2x = list(io_all)
- io_2x.append(Subsignal("dq", Pins(" ".join([mosi, miso]), dir="io",
- assert_width=2)))
- resources.append(Resource.family(*args, default_name="spi_flash", ios=io_2x,
- name_suffix="2x"))
-
- if wp is not None and hold is not None:
- io_4x = list(io_all)
- io_4x.append(Subsignal("dq", Pins(" ".join([mosi, miso, wp, hold]), dir="io",
- assert_width=4)))
- resources.append(Resource.family(*args, default_name="spi_flash", ios=io_4x,
- name_suffix="4x"))
-
- return resources