build/efinity: assert DRIVE_STRENGTH is valid

With invalid drive strength Efinity 2021.2 fails with an unhelpful message:
 "WARNING: Fail to generate summary report file"

 Efinity 2022.2 does report DRIVE_STRENGTH is invalid
This commit is contained in:
Andrew Dennison 2023-05-22 15:19:28 +10:00 committed by Florent Kermarrec
parent 8066a9e265
commit f8a604e0fa
1 changed files with 3 additions and 0 deletions

View File

@ -144,6 +144,9 @@ class EfinityToolchain(GenericToolchain):
if "DRIVE_STRENGTH" in c.misc:
prop = "DRIVE_STRENGTH"
val = c.misc.split("=")[1]
valid = ["1", "2", "3", "4"] if self.platform.family == "Trion" else [
"2", "4", "6", "8", "10", "12", "16" ]
assert val in valid, f"DRIVE_STRENGTH {val} is not in {valid}"
if "SLEWRATE" in c.misc:
prop = "SLEW_RATE"