Conversation
3e9a005 to
826995d
Compare
| end; | ||
|
|
||
| architecture a of tb_encodings is | ||
| constant str: string := "[""test"",[true,false,18,null,""hello""],[9,8],3324.34,832432,""world""]"; |
There was a problem hiding this comment.
Maybe making str and enc generics of tb_encodings and passing them in from run.py tests more / closer to the json usecase? It would also make it very easy to use this to test maximum generic string lengths of various simulators.
There was a problem hiding this comment.
The tests in tb_encodings are to test encoding/decoding functions/procedures, which we should be able to do independently of the generic support of the simulator. I think that what you suggest belongs to example json4vhdl.
There was a problem hiding this comment.
I now extended the existing tb_set_generic acceptance test, to pass a long generic string. The content is created repeating 0123456789abcdef str_long_num times. Now, it is set to 512; hence, the length of the string is 512*16=8192. We should set str_long_num to the minimum length that we want any simulator to support. Do you have any reference of which is a sensible value?
Moreover, if other encondings are added, I believe that this testbench can be extended to test the character sets used in other encodings (b32, b64).
eb8f741 to
8cc3201
Compare
56793c2 to
8c4d8fb
Compare
4036c8b to
0b1a5f4
Compare
|
This PR is now based on Paebbels/JSON-for-VHDL#9. |
8740f16 to
85b3a73
Compare
3f482fd to
3198655
Compare
|
Paebbels/JSON-for-VHDL#9 is now merged upstream. |
3198655 to
7317e63
Compare
7b62e57 to
63aee0c
Compare
63aee0c to
f2b0e08
Compare
Close #588
This is a proof of concept to encode stringified JSON generics in Python and decode them in VHDL. Example json4vhdl is reworked to handle three separate tests: stringified JSON, stringified and b16encoded JSON, and path to a JSON file.
In the current implementation, a package named
encodingsis added to VUnit. This includesb16decodeandb16encodeonly, for now. Nonetheless, as commented in #588, this package might be merged into JSON-for-VHDL, instead of being added to VUnit.