Skip to content

Commit 45c5c95

Browse files
authored
Merge pull request #1 from RISCY-Lib/config_macro
Created config macro and bld file
2 parents 8e8ab94 + bc60749 commit 45c5c95

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

config_macro.svh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//==============================================================================
2+
// A Collection of Useful UVM Helper Macros and Classes
3+
// Copyright (C) 2023 RISCY-Lib Contributors
4+
//
5+
// This library is free software; you can redistribute it and/or
6+
// modify it under the terms of the GNU Lesser General Public
7+
// License as published by the Free Software Foundation; either
8+
// version 2.1 of the License, or (at your option) any later version.
9+
//
10+
// This library is distributed in the hope that it will be useful,
11+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
// Lesser General Public License for more details.
14+
//
15+
// You should have received a copy of the GNU Lesser General Public
16+
// License along with this library; If not, see <https://www.gnu.org/licenses/>.
17+
//==============================================================================
18+
19+
`define get_config(cfg_type, cfg_handle, cfg_name) \
20+
if (``cfg_handle`` == null) \
21+
if ( !uvm_config_db #(``cfg_type``)::get(this, "", ``cfg_name``, ``cfg_handle``) ) \
22+
`uvm_fatal("CONFIG_LOAD", $sformatf("Cannot get() configuration %s from uvm_config_db. Have you set() it?", ``cfg_name``))

uvm_utils.bld

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include:
2+
- '.'

0 commit comments

Comments
 (0)