This fix re-does pull request #155, which should not have been made (#314)

against the main branch.  Solves caravel issue #140.
This commit is contained in:
R. Timothy Edwards 2022-10-20 17:33:33 -04:00 committed by GitHub
parent bdc2667911
commit 6d3cfe66c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -158,7 +158,10 @@ if __name__ == '__main__':
if tokens[0] == '`define': if tokens[0] == '`define':
if tokens[2][0] == '`': if tokens[2][0] == '`':
# If definition is nested, substitute value. # If definition is nested, substitute value.
tokens[2] = kvpairs[tokens[2]] try:
tokens[2] = kvpairs[tokens[2]]
except:
print('Error: Used unknown definition ' + tokens[2])
kvpairs['`' + tokens[1]] = tokens[2] kvpairs['`' + tokens[1]] = tokens[2]
else: else:
print('Error: No user_defines.v file found.') print('Error: No user_defines.v file found.')