applet.interface.uart: add multiple interfaces test#841
Open
AaronJackson wants to merge 1 commit intoGlasgowEmbedded:mainfrom
Open
applet.interface.uart: add multiple interfaces test#841AaronJackson wants to merge 1 commit intoGlasgowEmbedded:mainfrom
AaronJackson wants to merge 1 commit intoGlasgowEmbedded:mainfrom
Conversation
a34345e to
4dd69cb
Compare
4dd69cb to
4d5ff12
Compare
Contributor
Author
|
hmm, actually, I suspect there may be an issue with fifo in simulation diff --git a/software/glasgow/applet/interface/uart/test.py b/software/glasgow/applet/interface/uart/test.py
index 0bc45962..e169365b 100644
--- a/software/glasgow/applet/interface/uart/test.py
+++ b/software/glasgow/applet/interface/uart/test.py
@@ -41,9 +41,11 @@ class UARTAppletTestCase(GlasgowAppletV2TestCase, applet=UARTApplet):
await iface0.set_baud(9600)
await iface1.set_baud(9600)
await iface0.write(b'Hello')
+ self.assertEqual(await iface0.read(5), b'World')
async def read_testbench(ctx):
self.assertEqual(await iface1.read(5), b'Hello')
+ await iface1.write(b'World')
assembly.add_testbench(write_testbench)
assembly.run(read_testbench, vcd_file="uart_multi.vcd")adding this will cause it to lock up again. Similarly, if you swap the read and write testbenches around, it'll break, which doesn't seem right to me. diff --git a/software/glasgow/applet/interface/uart/test.py b/software/glasgow/applet/interface/uart/test.py
index 0bc45962..6348a445 100644
--- a/software/glasgow/applet/interface/uart/test.py
+++ b/software/glasgow/applet/interface/uart/test.py
@@ -45,5 +45,5 @@ class UARTAppletTestCase(GlasgowAppletV2TestCase, applet=UARTApplet):
async def read_testbench(ctx):
self.assertEqual(await iface1.read(5), b'Hello')
- assembly.add_testbench(write_testbench)
- assembly.run(read_testbench, vcd_file="uart_multi.vcd")
+ assembly.add_testbench(read_testbench)
+ assembly.run(write_testbench, vcd_file="uart_multi.vcd") |
Member
|
Thanks for the PR with a testcase! It's entirely possile that the Glasgow simulator has a bug as it hasn't been tested much yet. I'll take a look shortly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Took me a while to get the ordering right for this, but multiple fifo in a simulation assembly does work! 🎉