sispeed_tang_nano: Add simple UART loopback test... (Not working...)

This commit is contained in:
Florent Kermarrec 2021-09-16 19:34:48 +02:00
parent 5955a35372
commit 28571308bc
2 changed files with 14 additions and 2 deletions

View file

@ -26,8 +26,15 @@ _io = [
("user_led", 2, Pins("18"), IOStandard("LVCMOS33")),
# Buttons.
("user_btn", 0, Pins("15"), IOStandard("LVCMOS18")),
("user_btn", 0, Pins("14"), IOStandard("LVCMOS18")),
("user_btn", 0, Pins("15"), IOStandard("LVCMOS33")),
("user_btn", 0, Pins("14"), IOStandard("LVCMOS33")),
# Serial
("serial", 0,
Subsignal("tx", Pins("8")),
Subsignal("rx", Pins("9")),
IOStandard("LVCMOS33")
),
]
# Connectors ---------------------------------------------------------------------------------------
@ -42,6 +49,7 @@ class Platform(GowinPlatform):
def __init__(self):
GowinPlatform.__init__(self, "GW1N-LV1QN48C6/I5", _io, _connectors, toolchain="gowin", devicename="GW1N-1")
self.toolchain.options["use_done_as_gpio"] = 1
def create_programmer(self):
return OpenFPGALoader("tangnano")

View file

@ -44,6 +44,10 @@ class BaseSoC(SoCCore):
kwargs["cpu_type"] = None
kwargs["with_uart"] = False
# UART loopback.
serial_pads = platform.request("serial")
self.comb += serial_pads.tx.eq(serial_pads.rx)
# SoCCore ----------------------------------------------------------------------------------
SoCCore.__init__(self, platform, sys_clk_freq,
ident = "LiteX SoC on Tang Nano",