Skip to content

Commit

Permalink
Allow signal declarations in entity declarative part. Issue #547
Browse files Browse the repository at this point in the history
  • Loading branch information
nickg committed Oct 6, 2022
1 parent 26164d7 commit 67882f8
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -6933,9 +6933,14 @@ static void p_entity_declarative_item(tree_t entity)
p_variable_declaration(entity);
break;

case tSIGNAL:
p_signal_declaration(entity);
break;

default:
expect(tATTRIBUTE, tTYPE, tSUBTYPE, tCONSTANT, tFUNCTION, tPROCEDURE,
tIMPURE, tPURE, tALIAS, tUSE, tDISCONNECT, tGROUP, tSHARED);
tIMPURE, tPURE, tALIAS, tUSE, tDISCONNECT, tGROUP, tSHARED,
tSIGNAL);
}
}

Expand Down
40 changes: 40 additions & 0 deletions test/regress/issue547.vhd
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
entity sub is
signal x : bit;
end entity;

architecture test of sub is
begin

x <= '1';

process is
begin
assert x = '0';
wait for 0 ns;
assert x = '1';
wait;
end process;

end architecture;

-------------------------------------------------------------------------------

entity issue547 is
signal s : natural;
end entity;

architecture test of issue547 is
begin

u: entity work.sub;

p1: process is
begin
assert s = 0;
s <= 1;
wait for 1 ns;
assert s = 1;
wait;
end process;

end architecture;
1 change: 1 addition & 0 deletions test/regress/testlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -674,3 +674,4 @@ issue542 normal
issue540 normal,2008
guard3 normal
issue543 normal,2008
issue547 normal

0 comments on commit 67882f8

Please sign in to comment.