Skip to content

Commit 32b86fa

Browse files
tasgomesLarsAsplund
authored andcommitted
Fix warning "(vcom-1246) Range 1 to 0 is null" for Modelsim/Questa.
1 parent e8a9a41 commit 32b86fa

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

vunit/vhdl/data_types/src/id_pkg.vhd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ package id_pkg is
2222
end record;
2323
constant null_id : id_t := (p_data => null_ptr);
2424
type id_vec_t is array (integer range <>) of id_t;
25-
constant null_id_vec : id_vec_t := (1 to 0 => null_id);
25+
constant null_string : string := "";
26+
constant null_id_vec : id_vec_t(null_string'range) := (others => null_id);
2627

2728
-- root_id is a nameless and predefined ID that is the parent to
2829
-- all user created top-level IDs (no parent was specified at creation)

vunit/vhdl/logging/src/log_levels_pkg.vhd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ package log_levels_pkg is
3232
custom_level8);
3333

3434
type log_level_vec_t is array (natural range <>) of log_level_t;
35-
constant null_vec : log_level_vec_t(1 to 0) := (others => info);
35+
constant null_string : string := "";
36+
constant null_vec : log_level_vec_t(null_string'range) := (others => info);
3637

3738
subtype alert_log_level_t is log_level_t range warning to failure;
3839
subtype legal_log_level_t is log_level_t range log_level_t'succ(null_log_level) to log_level_t'high;

0 commit comments

Comments
 (0)