-
Notifications
You must be signed in to change notification settings - Fork 17
add jsonGetBooleanArray and jsonGetRealArray #8
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
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.
|
@Paebbels is this still active? A wish for this PR from Trumpf XD. Also wishes for real and integer type |
|
@yangyt96 I know, the repository isn't broken and it's actively used e.g. by VUnit. I'm open for contributions and updates. There is also a potential request by OSVVM, if a protected type based variant could be added usable in simulation with better speed and resource usage. (In the synthesizable variant, all data structures are pre-allocated to limit the maximum usage.) For which tool do you need it?
|
|
Currently we don't use it for synthesis, only for simulation. I use intensively with riviera-pro. |
jsonGetBooleanArrayandjsonGetRealArrayare added, with the same implementation approach asjsonGetIntegerArray: see #7.However, there is an issue with the current implementation:
boolean'valueandreal'valueare used. As explained in #7 (comment), this is not supported by Vivado. Therefore,to_boolean(str : STRING) return BOOLEANandto_real(str : STRING) return REALneed to be written.to_natural_deccan be used as a reference.Furthermore, since
time_vectoris 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 REALfunction, along withjsonIsTime(JSONContext : T_JSON; Path : STRING) return BOOLEAN(which does not exist, yet).