Fixes #9.
attrs=Attrs(IO_STANDARD="SB_LVCMOS33", PULLUP="1")
),
- Resource("sram", 0,
- Subsignal("address", Pins(
- "137 138 139 141 142 42 43 44 73 74 75 76 115 116 117 118 119 78",
- dir="o"
- )),
- Subsignal("data", Pins(
- "135 134 130 128 125 124 122 121 61 60 56 55 52 49 48 47",
- dir="io"
- )),
- Subsignal("oe", PinsN("45", dir="o")),
- Subsignal("we", PinsN("120", dir="o")),
- Subsignal("cs", PinsN("136", dir="o")),
- Attrs(IO_STANDARD="SB_LVCMOS33"),
+ SRAMResource(0,
+ cs="136", oe="45", we="120",
+ a="137 138 139 141 142 42 43 44 73 74 75 76 115 116 117 118 119 78",
+ d="135 134 130 128 125 124 122 121 61 60 56 55 52 49 48 47",
+ attrs=Attrs(IO_STANDARD="SB_LVCMOS33"),
),
]
connectors = [
attrs=Attrs(IO_STANDARD="SB_LVCMOS33", PULLUP="1")
),
- Resource("sram", 0,
- Subsignal("address", Pins(
- "137 138 139 141 142 42 43 44 73 74 75 76 115 116 117 118 119 78",
- dir="o"
- )),
- Subsignal("data", Pins(
- "136 135 134 130 125 124 122 121 62 61 60 56 55 48 47 45",
- dir="io"
- )),
- Subsignal("oe", PinsN("29", dir="o")),
- Subsignal("we", PinsN("120", dir="o")),
- Subsignal("cs", PinsN("136", dir="o")),
- Subsignal("ub", PinsN("28", dir="o")),
- Subsignal("lb", PinsN("24", dir="o")),
- Attrs(IO_STANDARD="SB_LVCMOS33"),
+ SRAMResource(0,
+ cs="136", oe="29", we="120",
+ a="137 138 139 141 142 42 43 44 73 74 75 76 115 116 117 118 119 78",
+ d="136 135 134 130 125 124 122 121 62 61 60 56 55 48 47 45",
+ dm="24 28",
+ attrs=Attrs(IO_STANDARD="SB_LVCMOS33"),
),
]
connectors = [
from .uart import UARTResource
from .flash import SPIFlashResources
from .spi import SPIResource
+from .sram import SRAMResource
--- /dev/null
+from nmigen.build import *
+
+
+__all__ = ["SRAMResource"]
+
+
+def SRAMResource(*args, cs, oe, we, a, d, dm=None, attrs=None):
+ io = []
+ io.append(Subsignal("cs", PinsN(cs, dir="o")))
+ io.append(Subsignal("oe", PinsN(oe, dir="o")))
+ io.append(Subsignal("we", PinsN(we, dir="o")))
+ io.append(Subsignal("a", Pins(a, dir="o")))
+ io.append(Subsignal("d", Pins(d, dir="io")))
+ if dm is not None:
+ io.append(Subsignal("dm", PinsN(dm, dir="o"))) # dm="LB# UB#"
+ if attrs is not None:
+ io.append(attrs)
+ return Resource.family(*args, default_name="sram", ios=io)