From: Luke Kenneth Casson Leighton Date: Sat, 23 Apr 2022 13:59:57 +0000 (+0100) Subject: add baud arg to UartDemo so that sim can run it at 9600 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=49e0497c57d70a77c83b1594588a8f00791038a7;p=utils.git add baud arg to UartDemo so that sim can run it at 9600 --- diff --git a/uart_demo.py b/uart_demo.py index 22eecaf..cf318d5 100755 --- a/uart_demo.py +++ b/uart_demo.py @@ -100,8 +100,8 @@ class SimpleUART(Elaboratable): class UartDemo(Elaboratable): - def __init__(self, text): - self.simple_uart = SimpleUART() + def __init__(self, text, baud=115200): + self.simple_uart = SimpleUART(baud_rate=baud) self.text = str(text) self.text_bytes = list(self.text.encode()) @@ -152,7 +152,7 @@ class TestUartDemo(unittest.TestCase): STOP = enum.auto() m = Module() - dut = UartDemo("test text") + dut = UartDemo("test text", baud=9600) sample_event = Signal() expected_state = Signal(ExpectedState) m.submodules.dut = dut