Skip to content

Commit 183e653

Browse files
committed
entity attributes
1 parent fd4f484 commit 183e653

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

entity-attributes/test.vhd

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
library ieee;
2+
use ieee.std_logic_1164.all;
3+
4+
5+
-- Parent component.
6+
entity test is
7+
end entity;
8+
9+
10+
architecture tb of test is
11+
12+
signal end_simulation : boolean := true;
13+
signal d : std_logic;
14+
15+
begin
16+
17+
-- Instantiate component which will print entity attributes.
18+
mock1: entity work.mock port map(d);
19+
20+
end_simulation <= false after 1 ps;
21+
assert end_simulation
22+
report "simulation ended"
23+
severity failure;
24+
25+
end architecture;
26+
27+
28+
29+
library ieee;
30+
use ieee.std_logic_1164.all;
31+
32+
33+
-- Child component.
34+
entity mock is
35+
port (d : out std_logic);
36+
end entity;
37+
38+
39+
architecture tb_mock of mock is
40+
begin
41+
-- Entity attributes can be applied to all entity classes in VHDL.
42+
-- These are entities, architectures, configurations, procedures, functions,
43+
-- packages, types, subtypes, constants, signals, variables, components,
44+
-- labels, literals, units, groups and files.
45+
46+
-- instance_name: :test(tb):mock1@mock(tb_mock):
47+
assert false report "instance_name: " & tb_mock'instance_name severity note;
48+
-- path_name: :test:mock1:
49+
assert false report "path_name: " & tb_mock'path_name severity note;
50+
-- simple_name: tb_mock
51+
assert false report "simple_name: " & tb_mock'simple_name severity note;
52+
53+
-- signal: :test(tb):mock1@mock(tb_mock):d
54+
assert false report "mock: " & d'instance_name severity note;
55+
d <= '1';
56+
57+
end architecture;

entity-attributes/vimhdl.prj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
builder = msim
2+
target_dir = .build
3+
4+
vhdl work test.vhd -2002

0 commit comments

Comments
 (0)