Skip to content

Commit ff161f2

Browse files
committed
Fix to do everything modern CSR way
1 parent 9f050cf commit ff161f2

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

amaranth_orchard/base/gpio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __init__(self, *, pins: GPIOPins):
5757
All pins default to input at power up.
5858
"""
5959
self.width = pins.width
60-
self.pins = pins
60+
self.pins = pins
6161

6262
regs = csr.Builder(addr_width=4, data_width=8)
6363

amaranth_orchard/memory/spimemio.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def __init__(self, mem_name=("mem",), cfg_name=("cfg",), *, flash):
6262
size_words = (self.size * 8) // 32
6363

6464
super().__init__({
65+
"qspi": Out(QSPIPins.Signature()),
6566
"ctrl_bus": In(csr.Signature(addr_width=exact_log2(4), data_width=8)),
6667
"data_bus": In(wishbone.Signature(addr_width=exact_log2(size_words), data_width=32,
6768
granularity=8)),
@@ -91,17 +92,17 @@ def elaborate(self, platform):
9192
"o_ready": spi_ready,
9293
"i_addr": Cat(Const(0, 2), self.data_bus.adr), # Hack to force a 1MB offset
9394
"o_rdata": self.data_bus.dat_r,
94-
"o_flash_csb": self.flash.csn.o,
95-
"o_flash_clk": self.flash.clk.o,
95+
"o_flash_csb": self.qspi.csn.o,
96+
"o_flash_clk": self.qspi.clk.o,
9697
"i_cfgreg_we": ctrl_bridge.cfgreg_we,
9798
"i_cfgreg_di": ctrl_bridge.cfgreg_di,
9899
"o_cfgreg_do": ctrl_bridge.cfgreg_do,
99100
} | {
100-
f"o_flash_io{n}_oe": getattr(self.flash, f"d{n}").oe for n in range(4)
101+
f"o_flash_io{n}_oe": getattr(self.qspi, f"d{n}").oe for n in range(4)
101102
} | {
102-
f"o_flash_io{n}_o": getattr(self.flash, f"d{n}").o for n in range(4)
103+
f"o_flash_io{n}_o": getattr(self.qspi, f"d{n}").o for n in range(4)
103104
} | {
104-
f"o_flash_io{n}_i": getattr(self.flash, f"d{n}").i for n in range(4)
105+
f"o_flash_io{n}_i": getattr(self.qspi, f"d{n}").i for n in range(4)
105106
}
106107

107108
m.submodules.spimemio = Instance("spimemio", **verilog_map)

0 commit comments

Comments
 (0)