Skip to content

Commit

Permalink
pass Stringified tb_cfg from VUnit, declare jsonLoadStringified (dummy)
Browse files Browse the repository at this point in the history
  • Loading branch information
1138-4EB committed Apr 15, 2018
1 parent 0d8df31 commit 2b95ff2
Show file tree
Hide file tree
Showing 3 changed files with 182 additions and 168 deletions.
13 changes: 7 additions & 6 deletions Examples/Boards_VUnit.vhdl
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@ entity tb_boards is
generic (
runner_cfg : string;
tb_path : string;
filename : string
tb_cfg : string
);
end entity;

architecture tb of tb_boards is
constant JSONContent : T_JSON := jsonLoadFile(tb_path & filename);
constant JSONContent : T_JSON := jsonLoadStringified(tb_cfg);
begin
main: process
begin
test_runner_setup(runner, runner_cfg);
while test_suite loop
if run("test") then
info(tb_path&filename);
info("KC705/FPGADevice: " & jsonGetString(JSONContent, "KC705/FPGADevice"));
info("KC705/IIC/0/Devices/1/Type: " & jsonGetString(JSONContent, "KC705/IIC/0/Devices/1/Type"));
info("DE4/Ethernet/2/PHY_ManagementInterface: " & jsonGetString(JSONContent, "DE4/Ethernet/2/PHY_ManagementInterface"));
info(tb_cfg);
--info(tb_path&filename);
--info("KC705/FPGADevice: " & jsonGetString(JSONContent, "KC705/FPGADevice"));
--info("KC705/IIC/0/Devices/1/Type: " & jsonGetString(JSONContent, "KC705/IIC/0/Devices/1/Type"));
--info("DE4/Ethernet/2/PHY_ManagementInterface: " & jsonGetString(JSONContent, "DE4/Ethernet/2/PHY_ManagementInterface"));
end if;
end loop;
test_runner_cleanup(runner);
Expand Down
8 changes: 7 additions & 1 deletion VUnit/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
lib.add_source_files(join(root, "../vhdl/JSON.pkg.vhdl"))
lib.add_source_files(join(root, "../Examples/Boards_VUnit.vhdl"))

vu.set_generic("filename","../Data/Boards2.json")
import json

file = open('../Data/Boards2.json', 'r')

generics = json.loads(file.read())

vu.set_generic("tb_cfg", json.dumps(generics, separators=(',', ':')) )

vu.main()
Loading

0 comments on commit 2b95ff2

Please sign in to comment.