From: Cesar Strauss Date: Mon, 15 Apr 2024 21:57:35 +0000 (-0300) Subject: UART demo: add Nexys Video support X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1ed2c3bef98679fd5368fe6785b86b13143bd07b;p=utils.git UART demo: add Nexys Video support --- diff --git a/uart_demo.py b/uart_demo.py index 76a8b09..05aa40c 100755 --- a/uart_demo.py +++ b/uart_demo.py @@ -3,6 +3,12 @@ import itertools import sys import unittest from nmigen_boards.arty_a7 import ArtyA7_100Platform +# TODO: remove the try..catch guards below when Nexys Video support is +# merged into nmigen-boards +try: + from nmigen_boards.nexys_video import NexysVideoPlatform +except ImportError: + NexysVideoPlatform = None from nmigen.hdl.dsl import Elaboratable, Module from nmigen.hdl.ast import Signal, Array, Const from nmigen.hdl.mem import Memory @@ -243,6 +249,10 @@ PLATFORMS = { "ArtyA7_100": ArtyA7_100Platform, # TODO: add more } +# TODO: remove the guard below when Nexys Video support is +# merged into nmigen-boards, and add it to the list above +if NexysVideoPlatform is not None: + PLATFORMS["Nexys_Video"] = NexysVideoPlatform DEFAULT_PLATFORM = next(iter(PLATFORMS.keys())) DEFAULT_TOOLCHAIN = "yosys_nextpnr"