From: Luke Kenneth Casson Leighton Date: Fri, 6 Nov 2020 11:48:01 +0000 (+0000) Subject: sigh sorting out litex pin-connections to sdram X-Git-Tag: 24jan2021_ls180~113 X-Git-Url: https://git.libre-soc.org/?p=soc.git;a=commitdiff_plain;h=e0656b1de657370bdff0cb7a1466f4b50f002b38 sigh sorting out litex pin-connections to sdram --- diff --git a/libreriscv b/libreriscv index 91e6ce17..a4c2bff3 160000 --- a/libreriscv +++ b/libreriscv @@ -1 +1 @@ -Subproject commit 91e6ce1716c6bf1fd30c66f012db81b661b5dfc4 +Subproject commit a4c2bff3d2f51f4feab0a1fb7624c5f94e80b60a diff --git a/pinmux b/pinmux index 24c4414d..18409e43 160000 --- a/pinmux +++ b/pinmux @@ -1 +1 @@ -Subproject commit 24c4414dee7455efbdbafb555517020fa405a4f4 +Subproject commit 18409e43e4385b4c78eeceb5c875153a85a958cb diff --git a/src/soc/litex/florent/libresoc/core.py b/src/soc/litex/florent/libresoc/core.py index d56a5249..728034de 100644 --- a/src/soc/litex/florent/libresoc/core.py +++ b/src/soc/litex/florent/libresoc/core.py @@ -38,6 +38,7 @@ def make_wb_slave(prefix, obj): return res def make_pad(res, dirn, name, suffix, cpup, iop): + print ("make pad", dirn, name, suffix, cpup, iop) cpud, iod = ('i', 'o') if dirn else ('o', 'i') res['%s_%s__core__%s' % (cpud, name, suffix)] = cpup res['%s_%s__pad__%s' % (iod, name, suffix)] = iop @@ -99,13 +100,19 @@ def make_jtag_ioconn(res, pin, cpupads, iopads): elif iotype == IOType.InTriOut: if fn == 'gpio': # sigh decode GPIO special-case idx = int(pin[1:]) + oe_idx = idx + elif fn == 'sdr': # sigh + idx = int(pin.split('_')[-1]) + oe_idx = 0 else: idx = 0 + oe_idx = 0 + print ("gpio tri", fn, pin, iotype, pin_name, scan_idx, idx) cpup, iop = get_field(cpu, "i")[idx], get_field(io, "i")[idx] make_pad(res, False, name, "i", cpup, iop) cpup, iop = get_field(cpu, "o")[idx], get_field(io, "o")[idx] make_pad(res, True, name, "o", cpup, iop) - cpup, iop = get_field(cpu, "oe")[idx], get_field(io, "oe")[idx] + cpup, iop = get_field(cpu, "oe")[oe_idx], get_field(io, "oe")[oe_idx] make_pad(res, True, name, "oe", cpup, iop) if iotype in (IOType.In, IOType.InTriOut): @@ -150,6 +157,11 @@ class LibreSoC(CPU): self.platform = platform self.variant = variant self.reset = Signal() + # used by coriolis2 to connect up IO VSS/VDD to niolib GPIO cell lib + if False: + self.io_in = Signal() + self.io_out = Signal() + irq_en = "noirq" not in variant if irq_en: @@ -205,6 +217,8 @@ class LibreSoC(CPU): o_memerr_o = Signal(), # not connected o_pc_o = Signal(64), # not connected + #o_io_in = 0, # set io_in signal to False (for niolib) + #o_io_out = 1, # set io_in signal to True (for niolib) ) if irq_en: diff --git a/src/soc/litex/florent/ls180soc.py b/src/soc/litex/florent/ls180soc.py index 4279effc..93ed3890 100755 --- a/src/soc/litex/florent/ls180soc.py +++ b/src/soc/litex/florent/ls180soc.py @@ -372,6 +372,14 @@ class LibreSoCSim(SoCCore): #ram_init = [] + if False: + # for niolib temporary hack + io_in = Signal() + io_out = Signal() + + self.comb += io_in.eq(self.cpu.io_in) + self.comb += io_out.eq(self.cpu.io_out) + # SDRAM ---------------------------------------------------- if with_sdram: sdram_clk_freq = int(100e6) # FIXME: use 100MHz timings