77
88from amaranth_soc import csr , wishbone
99from amaranth_soc .memory import MemoryMap
10+ from chipflow_lib .platforms import BidirPinSignature ,OutputPinSignature
1011
1112__all__ = ["QSPIPins" , "SPIMemIO" ]
1213
@@ -15,11 +16,9 @@ class QSPIPins(wiring.PureInterface):
1516 class Signature (wiring .Signature ):
1617 def __init__ (self ):
1718 super ().__init__ ({
18- "clk_o" : Out (1 ),
19- "csn_o" : Out (1 ),
20- "d_o" : Out (4 ),
21- "d_oe" : Out (4 ),
22- "d_i" : In (4 ),
19+ "clk" : Out (OutputPinSignature (1 )),
20+ "csn" : Out (OutputPinSignature (1 )),
21+ "d" : Out (BidirPinSignature (4 )),
2322 })
2423
2524 def create (self , * , path = (), src_loc_at = 0 ):
@@ -92,20 +91,20 @@ def elaborate(self, platform):
9291 o_ready = spi_ready ,
9392 i_addr = Cat (Const (0 , 2 ), self .data_bus .adr ), # Hack to force a 1MB offset
9493 o_rdata = self .data_bus .dat_r ,
95- o_flash_csb = self .flash .csn_o ,
96- o_flash_clk = self .flash .clk_o ,
97- o_flash_io0_oe = self .flash .d_oe [0 ],
98- o_flash_io1_oe = self .flash .d_oe [1 ],
99- o_flash_io2_oe = self .flash .d_oe [2 ],
100- o_flash_io3_oe = self .flash .d_oe [3 ],
101- o_flash_io0_do = self .flash .d_o [0 ],
102- o_flash_io1_do = self .flash .d_o [1 ],
103- o_flash_io2_do = self .flash .d_o [2 ],
104- o_flash_io3_do = self .flash .d_o [3 ],
105- i_flash_io0_di = self .flash .d_i [0 ],
106- i_flash_io1_di = self .flash .d_i [1 ],
107- i_flash_io2_di = self .flash .d_i [2 ],
108- i_flash_io3_di = self .flash .d_i [3 ],
94+ o_flash_csb = self .flash .csn . o ,
95+ o_flash_clk = self .flash .clk . o ,
96+ o_flash_io0_oe = self .flash .d . oe [0 ],
97+ o_flash_io1_oe = self .flash .d . oe [1 ],
98+ o_flash_io2_oe = self .flash .d . oe [2 ],
99+ o_flash_io3_oe = self .flash .d . oe [3 ],
100+ o_flash_io0_do = self .flash .d . o [0 ],
101+ o_flash_io1_do = self .flash .d . o [1 ],
102+ o_flash_io2_do = self .flash .d . o [2 ],
103+ o_flash_io3_do = self .flash .d . o [3 ],
104+ i_flash_io0_di = self .flash .d . i [0 ],
105+ i_flash_io1_di = self .flash .d . i [1 ],
106+ i_flash_io2_di = self .flash .d . i [2 ],
107+ i_flash_io3_di = self .flash .d . i [3 ],
109108 i_cfgreg_we = ctrl_bridge .cfgreg_we ,
110109 i_cfgreg_di = ctrl_bridge .cfgreg_di ,
111110 o_cfgreg_do = ctrl_bridge .cfgreg_do ,
0 commit comments