Skip to content

Commit 05d55fe

Browse files
committed
Add a test case for issue #1030
1 parent 167ad9b commit 05d55fe

File tree

4 files changed

+60
-4
lines changed

4 files changed

+60
-4
lines changed

src/rt/wave.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -782,8 +782,8 @@ static void fst_create_record_array_var(wave_dumper_t *wd, tree_t d,
782782
}
783783
}
784784

785-
static void fst_alias_var(wave_dumper_t *wd, tree_t d, rt_signal_t *s,
786-
text_buf_t *tb)
785+
static void fst_alias_var(wave_dumper_t *wd, tree_t d, rt_scope_t *scope,
786+
rt_signal_t *s, text_buf_t *tb)
787787
{
788788
rt_watch_t *w = find_watch(&(s->nexus), fst_event_cb);
789789
if (w == NULL)
@@ -800,7 +800,7 @@ static void fst_alias_var(wave_dumper_t *wd, tree_t d, rt_signal_t *s,
800800
if (type_is_array(type)) {
801801
int64_t left, right, length;
802802
range_kind_t dir;
803-
fst_get_array_range(wd, type, s->parent, s->where, 0,
803+
fst_get_array_range(wd, type, scope, d, 0,
804804
&left, &right, &dir, &length);
805805

806806
tb_printf(tb, "[%"PRIi64":%"PRIi64"]", left, right);
@@ -829,7 +829,7 @@ static void fst_process_signal(wave_dumper_t *wd, rt_scope_t *scope, tree_t d,
829829
if (s == NULL)
830830
return;
831831
else if (s->where != d)
832-
fst_alias_var(wd, d, s, tb); // Collapsed with another signal
832+
fst_alias_var(wd, d, scope, s, tb); // Collapsed with another signal
833833
else if (type_is_array(type))
834834
fst_create_array_var(wd, d, s, type, tb);
835835
else

test/regress/gold/issue1030.dump

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
$comment issue1030.b.p[7:0] is aliased to z[1:8] $end
2+
#0 issue1030.s[2].f.z[1:8] 00000000
3+
#0 issue1030.s[2].f.y[7:0] 00000000
4+
#0 issue1030.s[2].f.x 0
5+
#0 issue1030.s[1].f.z[1:8] 00000000
6+
#0 issue1030.s[1].f.y[7:0] 00000000
7+
#0 issue1030.s[1].f.x 0
8+
#1000000 issue1030.s[1].f.x 1
9+
#1000000 issue1030.s[1].f.y[7:0] 00000001
10+
#1000000 issue1030.s[1].f.z[1:8] 00000010

test/regress/issue1030.vhd

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package pack is
2+
generic ( N : natural );
3+
4+
type t_rec is record
5+
x : bit;
6+
y : bit_vector(7 downto 0);
7+
z : bit_vector(1 to N);
8+
end record;
9+
10+
type t_rec2 is record
11+
f : t_rec;
12+
end record;
13+
14+
type t_array is array (natural range <>) of t_rec2;
15+
16+
impure function get_width return integer;
17+
end package;
18+
19+
package body pack is
20+
impure function get_width return integer is
21+
begin
22+
return N;
23+
end function;
24+
end package body;
25+
26+
package pack8 is new work.pack generic map (8);
27+
28+
entity issue1030 is
29+
end entity;
30+
31+
use work.pack8.all;
32+
33+
architecture test of issue1030 is
34+
signal s : t_array(1 to 2);
35+
begin
36+
37+
b: block is
38+
port ( p : in bit_vector(get_width - 1 downto 0) );
39+
port map ( s(1).f.z );
40+
begin
41+
end block;
42+
43+
s(1) <= (f => ('1', X"01", X"02")) after 1 ns;
44+
45+
end architecture;

test/regress/testlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,3 +1065,4 @@ psl12 normal,2008
10651065
psl13 fail,gold,psl
10661066
issue1045 normal,vhpi
10671067
issue1044 mixed
1068+
issue1030 wave,2008,dump-arrays

0 commit comments

Comments
 (0)