Skip to content

Commit a5cd552

Browse files
author
1138-4EB
committed
add json_ctx
1 parent 8a33745 commit a5cd552

File tree

3 files changed

+57
-5
lines changed

3 files changed

+57
-5
lines changed

Examples/Boards_VUnit.vhdl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
library vunit_lib;
22
context vunit_lib.vunit_context;
33

4-
use work.json.T_JSON;
5-
use work.json.jsonLoad;
6-
use work.json.jsonGetString;
4+
library JSON;
5+
context JSON.json_ctx;
76

87
entity tb_boards is
98
generic (

VUnit/run.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55

66
vu = VUnit.from_argv()
77

8+
lib = vu.add_library("JSON")
9+
lib.add_source_files(join(root, "..", "vhdl", "*.vhdl"))
810
lib = vu.add_library("lib")
9-
lib.add_source_files(join(root, "../vhdl/JSON.pkg.vhdl"))
10-
lib.add_source_files(join(root, "../Examples/Boards_VUnit.vhdl"))
11+
lib.add_source_files(join(root, "..", "Examples", "Boards_VUnit.vhdl"))
1112

1213
vu.set_generic('tb_cfg_file', '../Data/Boards2.json')
1314

vhdl/JSON.ctx.vhdl

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
-- EMACS settings: -*- tab-width: 2; indent-tabs-mode: t -*-
2+
-- vim: tabstop=2:shiftwidth=2:noexpandtab
3+
-- kate: tab-width 2; replace-tabs off; indent-width 2;
4+
--
5+
-- =============================================================================
6+
-- _ ____ ___ _ _ __ __ ___ _ ____ _
7+
-- | / ___| / _ \| \ | | / _| ___ _ __ \ \ / / | | | _ \| |
8+
-- _ | \___ \| | | | \| |_____| |_ / _ \| '__|___\ \ / /| |_| | | | | |
9+
-- | |_| |___) | |_| | |\ |_____| _| (_) | | |_____\ V / | _ | |_| | |___
10+
-- \___/|____/ \___/|_| \_| |_| \___/|_| \_/ |_| |_|____/|_____|
11+
--
12+
-- =============================================================================
13+
-- Authors: 1138-4EB [GitHub User]
14+
--
15+
-- Package: JSON context and public API
16+
--
17+
-- Description:
18+
-- ------------------------------------
19+
-- For detailed documentation see below.
20+
--
21+
-- License:
22+
-- ============================================================================
23+
-- Copyright 2007-2018 Patrick Lehmann - Dresden, Germany
24+
--
25+
-- Licensed under the Apache License, Version 2.0 (the "License");
26+
-- you may not use this file except in compliance with the License.
27+
-- You may obtain a copy of the License at
28+
--
29+
-- http://www.apache.org/licenses/LICENSE-2.0
30+
--
31+
-- Unless required by applicable law or agreed to in writing, software
32+
-- distributed under the License is distributed on an "AS IS" BASIS,
33+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34+
-- See the License for the specific language governing permissions and
35+
-- limitations under the License.
36+
-- ============================================================================
37+
38+
context json_ctx is
39+
library JSON;
40+
use JSON.json.T_JSON;
41+
use JSON.json.jsonLoad;
42+
use JSON.json.jsonNoParserError;
43+
use JSON.json.jsonGetErrorMessage;
44+
use JSON.json.jsonGetContent;
45+
use JSON.json.jsonGetString;
46+
use JSON.json.jsonGetBoolean;
47+
use JSON.json.jsonIsBoolean;
48+
use JSON.json.jsonIsNull;
49+
use JSON.json.jsonIsString;
50+
use JSON.json.jsonIsNumber;
51+
-- use JSON.json.jsonGetIntArray;
52+
end context;

0 commit comments

Comments
 (0)