add (disabled) tri-state GPIO
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 19 Sep 2020 13:36:25 +0000 (14:36 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 19 Sep 2020 13:36:25 +0000 (14:36 +0100)
src/soc/litex/florent/libresoc/ls180.py
src/soc/litex/florent/ls180soc.py

index 5b392ef89121a3b338bc3838f9a4a46f9308df45..c77644ba1bac4f12a96a113e64f2adc9f4095af3 100644 (file)
@@ -73,6 +73,17 @@ _io = [
 
 ]
 
+if False:
+    pinbank1 = []
+    pinbank2 = []
+    for i in range(8):
+        pinbank1.append("X%d" % i)
+        pinbank2.append("Y%d" % i)
+    pins = ' '.join(pinbank1 + pinbank2)
+
+    # 16 GPIOs
+    _io.append( ("gpio", 16, Pins(pins), IOStandard("LVCMOS33")) )
+
 pinsin = []
 pinsout = []
 for i in range(8):
index 67f87fde2f2adfcf7040226cd5637be8975b6782..66d1864df5d606d559aba7e787b2feaf20502df3 100755 (executable)
@@ -20,7 +20,7 @@ from litedram import modules as litedram_modules
 from litedram.phy.model import SDRAMPHYModel
 from litedram.phy.gensdrphy import GENSDRPHY, HalfRateGENSDRPHY
 
-from litex.soc.cores.gpio import GPIOInOut, GPIOIn, GPIOOut
+from litex.soc.cores.gpio import GPIOInOut, GPIOIn, GPIOOut, GPIOTristate
 from litex.soc.cores.spi import SPIMaster
 
 from litex.tools.litex_sim import sdram_module_nphases, get_sdram_phy_settings
@@ -189,6 +189,10 @@ class LibreSoCSim(SoCCore):
         self.submodules.gpio_out = GPIOIn(platform.request("gpio_out"))
         self.add_csr("gpio_out")
 
+        if False:
+            self.submodules.gpio = GPIOTristate(platform.request("gpio"))
+            self.add_csr("gpio")
+
         # SPI Master
         self.submodules.spi_master = SPIMaster(
             pads         = platform.request("spi_master"),