Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paebbels/json-for-vhdl
A JSON library implemented in VHDL.
https://github.com/paebbels/json-for-vhdl
fileformat fpga ghdl json lattice modelsim parser questasim simulation synthesis vhdl xilinx
Last synced: 3 months ago
JSON representation
A JSON library implemented in VHDL.
- Host: GitHub
- URL: https://github.com/paebbels/json-for-vhdl
- Owner: Paebbels
- License: other
- Created: 2015-09-01T16:41:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-09-05T07:38:35.000Z (over 2 years ago)
- Last Synced: 2024-10-24T23:38:31.422Z (3 months ago)
- Topics: fileformat, fpga, ghdl, json, lattice, modelsim, parser, questasim, simulation, synthesis, vhdl, xilinx
- Language: VHDL
- Size: 138 KB
- Stars: 77
- Watchers: 14
- Forks: 16
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
JSON-for-VHDL
================================================================================[![CLA assistant](https://cla-assistant.io/readme/badge/Paebbels/JSON-for-VHDL)](https://cla-assistant.io/Paebbels/JSON-for-VHDL)
JSON-for-VHDL is a library to parse and query JSON data structures in VHDL. The
complete functionality is hosted in a single VHDL package, without special
dependencies.Table of Content:
================================================================================
1. [Overview](#1-overview)
2. [JSON - JavaScript Object Notation](#2-json---javascript-object-notation)
3. [Short Example](#2-short-example)
4. [Download](#3-download)1 Overview
================================================================================The JSON-for-VHDL library can be used to parse and query JSON data structures, which
are read from disk. The data structure is read via VHDL file I/O functions and
procedures and parsed into a internal compressed representation. While the parsing is
done, a lightwight index is created to ease the navigation on the data structure.Values can be selected by simple path expressions.
2 JSON - JavaScript Object Notation
================================================================================**JavaScript Object Notation (JSON) Data Interchange Format** is specified in
[RFC 7159](https://tools.ietf.org/html/rfc7159).3 Short Example
================================================================================Here is a short example *.json file, which describes two common FPGA boards.
{ "ML505": {
"FPGA": "XC5VLX50T-1FF1136",
"Eth": [{
"PHY-Int": "GMII",
"Device": "MARVEL_88E1111",
"Address": "0x74"
}]
},
"KC705": {
"FPGA": "XC7K325T-2FFG900C",
"Eth": [{
"PHY-Int": "GMII",
"Device": "MARVEL_88E1111",
"Address": "0x74"
}],
"IIC": [{
"Type": "Switch",
"Adr": "0x85",
"Devices": [{
"Name": "Si570",
"Address": "0x3A"
}]
}]
}
}Reference the JSON package in VHDL:
use work.json.all;
Load a external *.json file, parse the data structure and select a value:
architecture rtl of Test is
constant ConfigFile : STRING := "Boards.json";
constant JSONContent : T_JSON := jsonLoad(ConfigFile);
begin
assert (JSONContent.Error(1) = C_JSON_NUL)
report "Error: " & JSONContent.Error
severity ERROR;
assert FALSE
report "Query='KC705/Eth/0/Address' Value='" & jsonGetString(JSONContent, "KC705/Eth/0/Address") & "'"
severity NOTE;-- print the compressed file content
-- assert FALSE
-- report "JSON: " & JSONContent.Content severity NOTE;
end architecture;4 Download
================================================================================
The library can be [downloaded][31] as a zip-file (latest 'master' branch) or
cloned with `git` from GitHub. GitHub offers HTTPS and SSH as transfer protocols.For SSH protocol use the URL `ssh://[email protected]:Paebbels/JSON-for-VHDL.git` or command
line instruction:cd
git clone ssh://[email protected]:Paebbels/JSON-for-VHDL.git JSONFor HTTPS protocol use the URL `https://github.com/Paebbels/JSON-for-VHDL.git` or command
line instruction:cd
git clone https://github.com/Paebbels/JSON-for-VHDL.git JSON[31]: https://github.com/Paebbels/JSON-for-VHDL/archive/master.zip