-
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 jsonGetBooleanArray and jsonGetRealArray #8
base: master
Are you sure you want to change the base?
Conversation
|
0549653
to
f783619
Compare
data/Boards0.json
Outdated
@@ -1 +1 @@ | |||
["test",[true,false,18,null,"hello"],[9,8],3324.34,832432,"world"] | |||
["test",[true,false,18,null,"hello"],[9,8],3324.34,832432,[2.5, 3.33, 5.25],"world"] |
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.
Please remove 2.5,
.
Boards0.json
was derived from Boards1.json as the maximum possible JSON example, that doesn't cause Vivado to explode. Synthesis time was exponentially growing by each character in the string.
If you need more complex test, please extend other files or create a new input file. I would like to keep this string short and simple until Vivado can handle strings efficiently.
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.
Done. Nonetheless, note that this PR won't work in Vivado as is. See first comment above.
jsonGetBooleanArray
andjsonGetRealArray
are added, with the same implementation approach asjsonGetIntegerArray
: see #7.However, there is an issue with the current implementation:
boolean'value
andreal'value
are used. As explained in #7 (comment), this is not supported by Vivado. Therefore,to_boolean(str : STRING) return BOOLEAN
andto_real(str : STRING) return REAL
need to be written.to_natural_dec
can be used as a reference.Furthermore, since
time_vector
is also defined in VHDL 2008, the same approach can be followed to implementjsonGetTimeArray(JSONContext : T_JSON; Path : string) return time_vector
. This would require ato_real(str : STRING) return REAL
function, along withjsonIsTime(JSONContext : T_JSON; Path : STRING) return BOOLEAN
(which does not exist, yet).