-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add package 'Encodings' #9
Merged
Merged
Conversation
This file contains 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
|
Paebbels
requested changes
Jan 12, 2020
When editing files to reflect the reviews above, please do also these minor changes:
|
eine
force-pushed
the
encodings
branch
3 times, most recently
from
January 12, 2020 23:26
eaebf6d
to
19ec558
Compare
Paebbels
reviewed
Jan 12, 2020
eine
force-pushed
the
encodings
branch
3 times, most recently
from
January 13, 2020 00:13
df837ff
to
3288575
Compare
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.
Coming from VUnit/vunit#588 and VUnit/vunit#595, the main purpose of this PR is to add the possibility to encode generic strings, in order to work around the limitations of some simulators which do not accept all the symbols.
This is achieved by adding a new package (
Encodings
). Currently, it contains functionsb16encode
andb16decode
only. Nonetheless, it can be extended in the future to support other encodings such as base32 or base64. Precisely, the naming of the functions mimicks https://docs.python.org/3/library/base64.html.A function named
decode
is used injsonLoad
to detect and decode the input, if required. As a result, users don't need to change their VHDL code to use new feature. Decoding is done before loading the JSON file. Hence, it is possible to encode the path to the JSON file, should any simulator have issues with\
,/
,:
, etc. and should the length also be limited. The detection logic can be significantly improved: https://stackoverflow.com/questions/18419428/what-is-the-minimum-valid-jsonA new testbench (
Examples/Encodings_VUnit.vhdl
) is added, where encoding/decoding functions are tested independently from JSON features. Apart from that, exampleBoards_VUnit.vhdl
is extended:stringified JSON generic
,b16encoded stringified JSON generic
,JSON file path generic
andb16encoded JSON file path generic
.test_board0
andtest_board1
are described. These can be potentially saved in a separate package, to be used in other testbenches.run.py
file,from base64 import b16encode
is used to encode the stringified JSON/object.Apart from adding 'Encodings', since this projects has not been updated in 1.5y, I added other modifications to this PR:
jsonLoadFile
was merged intojsonLoad
, but the former is still shown in the README and used in Boards2. It is fixed.Boards.cmd
file is added.Tests/VUnit
andTests/ghdl
are executed..travis.yml
is removed./cc @LarsAsplund @felixn