-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
truner: adding Sparcv8Leon3 target support #334
base: master
Are you sure you want to change the base?
Conversation
cf48f91
to
dad2d59
Compare
please use imperative mood in commit message ("add" instead of "adding") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trunner
instead truner
in commit msg
JIRA: CI-249
dad2d59
to
7cdfd6c
Compare
Unit Test Results7 156 tests - 98 6 454 ✅ - 89 36m 53s ⏱️ - 1m 20s For more details on these failures, see this check. Results for commit 7cdfd6c. ± Comparison against base commit 609cb06. This pull request removes 99 and adds 1 tests. Note that renamed tests count towards both.
|
return builder.get_harness() | ||
|
||
|
||
class MimasSparcV8EvkTarget(GR716Target): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, if I understand correctly, the target is not Sparcv8Leon3, but GR716, which is based on the Sparcv8Leon3 architecture. So, shouldn't it be the other way around, something like GR716-mimas-EvkTarget(SparcV8Target)
while True: | ||
inChar = self.dut.read() | ||
inChar += inChar | ||
|
||
if "Bootloader" in inChar: | ||
with open(f"{boot_dir}/{image}", "rb") as fd: | ||
filebuff = fd.read() | ||
time.sleep(1) | ||
self.dut.serial.write(filebuff) | ||
|
||
try: | ||
self.dut.expect_exact("(psh)%", timeout=80) | ||
fd.close() | ||
break | ||
|
||
except pexpect.TIMEOUT as e: | ||
fd.close() | ||
raise FlashError( | ||
msg=str(e), | ||
output=e.stdout.decode("ascii") if e.stdout else None, | ||
) from e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can simplify this by knowing that dut is a wrapper around pexpect. For example, by expecting the appearance of the Bootloader instead of catching each character.
Example of simplified code that should work:
with open(f"{boot_dir}/{image}", "rb") as fd:
try:
self.dut.expect_exact("Bootloader", timeout=60)
time.sleep(1)
self.dut.serial.write(fd.read())
self.dut.expect_exact("(psh)%", timeout=80)
except pexpect.TIMEOUT as e:
raise FlashError(
msg="Timeout waiting for boatloader prompt or psh prompt.",
output=e.stdout.decode("ascii") if e.stdout else None,
) from e
Remember also that when you use a context manager in Python, it automatically handles the closing of resources opened within it, so you don't need to manually close them with fd.close()
JIRA: CI-249
Description
Motivation and Context
Types of changes
How Has This Been Tested?
Checklist:
Special treatment
requirements: add library to detect & reset USB devices #333
(It also needs to update docker images in order to run GH Actions)
add DMA configuration for
gr716-mimas
phoenix-rtos-project#1018sparcv8leon3: add DMA support to uart driver phoenix-rtos-devices#469