blob: c76e7c2ca523e70f7c17b66da4c8771942e2b281 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
library ieee;
use ieee.std_logic_1164.all;
entity testit is
port (
aclk : in std_logic;
aresetn :in std_logic;
d: in std_logic;
q: out std_logic
);
end entity;
architecture rtl of testit is
-- shouldn't GHDL at least generate a warn about these conflicting with entity inputs?
-- Currrently, it doesn't warn then you get x's in simulation...
signal aclk :std_logic;
signal aresetn :std_logic;
begin
process(aclk, aresetn)
begin
if (aresetn = '0') then
q <= '0';
elsif (rising_edge(aclk)) then
q <= d;
end if;
end process;
end architecture;
library ieee;
use ieee.std_logic_1164.all;
entity testbench is
end entity;
architecture sim of testbench is
signal aclk :std_logic;
signal aresetn :std_logic;
signal d :std_logic;
signal q :std_logic;
begin
aclk <= '0';
aresetn <= '0';
d <= '0';
testit: entity work.testit
port map (
aclk => aclk,
aresetn => aresetn,
d => d,
q => q
);
end architecture;
|