-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1138-4EB
committed
May 21, 2018
1 parent
60b7106
commit 4e05f13
Showing
10 changed files
with
149 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "vunit/vhdl/osvvm"] | ||
path = vunit/vhdl/osvvm | ||
url = https://github.com/OSVVM/OSVVM.git | ||
url = https://github.com/OSVVM/OSVVM.git | ||
[submodule "vunit/vhdl/JSON-for-VHDL"] | ||
path = vunit/vhdl/JSON-for-VHDL | ||
url = https://github.com/Paebbels/JSON-for-VHDL.git |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
# You can obtain one at http://mozilla.org/MPL/2.0/. | ||
# | ||
# Copyright (c) 2014-2018, Lars Asplund lars.anders.asplund@gmail.com | ||
|
||
from os.path import join, dirname | ||
from vunit import VUnit | ||
|
||
root = dirname(__file__) | ||
|
||
vu = VUnit.from_argv() | ||
|
||
vu.add_json4vhdl() | ||
|
||
lib = vu.add_library("test") | ||
lib.add_source_files(join(root, "src/test/*.vhd")) | ||
|
||
import json | ||
generics = json.loads(open(join(root, "src/test/data/data.json"), 'r').read()) | ||
vu.set_json_generic("tb_cfg", generics ) | ||
|
||
vu.main() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"Image": [640, 480], | ||
"Platform": { | ||
"ML505": { | ||
"FPGA": "XC5VLX50T-1FF1136" | ||
}, | ||
"KC705": { | ||
"FPGA": "XC7K325T-2FFG900C", | ||
"IIC": [{ | ||
"Type": "Switch", | ||
"Adr": "0x85", | ||
"Devices": [{ | ||
"Name": "Si570", | ||
"Address": "0x3A" | ||
}] | ||
}] | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
-- This Source Code Form is subject to the terms of the Mozilla Public | ||
-- License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
-- You can obtain one at http://mozilla.org/MPL/2.0/. | ||
-- | ||
-- Copyright (c) 2014-2018, Lars Asplund lars.anders.asplund@gmail.com | ||
library vunit_lib; | ||
context vunit_lib.vunit_context; | ||
|
||
library vunit_lib; | ||
use vunit_lib.json.T_JSON; | ||
use vunit_lib.json.jsonLoad; | ||
use vunit_lib.json.jsonGetString; | ||
|
||
entity tb_json_gens is | ||
generic ( | ||
runner_cfg : string; | ||
tb_path : string; | ||
tb_cfg : string; | ||
tb_cfg_file : string := "data/data.json" | ||
); | ||
end entity; | ||
|
||
architecture tb of tb_json_gens is | ||
constant JSONContent : T_JSON := jsonLoad(tb_cfg); | ||
constant JSONFileContent : T_JSON := jsonLoad(tb_path & tb_cfg_file); | ||
begin | ||
main: process | ||
begin | ||
test_runner_setup(runner, runner_cfg); | ||
while test_suite loop | ||
if run("test") then | ||
info("JSONContent: " & lf & JSONContent.Content); | ||
info("Image: " & jsonGetString(JSONContent, "Image/0") & ',' & jsonGetString(JSONContent, "Image/1")); | ||
info("Platform/ML505/FPGA: " & jsonGetString(JSONContent, "Platform/ML505/FPGA")); | ||
info("Platform/KC705/IIC/0/Devices/0/Name: " & jsonGetString(JSONContent, "Platform/KC705/IIC/0/Devices/0/Name")); | ||
|
||
info("tb_path & tb_cfg_file: " & tb_path & tb_cfg_file); | ||
info("JSONFileContent: " & lf & JSONFileContent.Content); | ||
info("Image: " & jsonGetString(JSONFileContent, "Image/0") & ',' & jsonGetString(JSONFileContent, "Image/1")); | ||
info("Platform/ML505/FPGA: " & jsonGetString(JSONFileContent, "Platform/ML505/FPGA")); | ||
info("Platform/KC705/IIC/0/Devices/0/Name: " & jsonGetString(JSONFileContent, "Platform/KC705/IIC/0/Devices/0/Name")); | ||
end if; | ||
end loop; | ||
test_runner_cleanup(runner); | ||
wait; | ||
end process; | ||
end architecture; |
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
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
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
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
Submodule JSON-for-VHDL
added at
8a3374