From 49e0497c57d70a77c83b1594588a8f00791038a7 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 23 Apr 2022 14:59:57 +0100 Subject: [PATCH] add baud arg to UartDemo so that sim can run it at 9600 --- uart_demo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.30.2