aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/examples/dff/adff.vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-15 07:37:15 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-15 07:37:52 +0200
commitd941c8f65bbbb90f97c17e26b5610624c2198b10 (patch)
tree59f5a31839273b345e2eba52f15c3dc073ccba45 /testsuite/examples/dff/adff.vhdl
parent81bb4346368e4769251e66ec0e43e2d1d17c2c45 (diff)
downloadghdl-yosys-plugin-d941c8f65bbbb90f97c17e26b5610624c2198b10.tar.gz
ghdl-yosys-plugin-d941c8f65bbbb90f97c17e26b5610624c2198b10.tar.bz2
ghdl-yosys-plugin-d941c8f65bbbb90f97c17e26b5610624c2198b10.zip
Add tests/examples for dff (both pos and neg edge).
Diffstat (limited to 'testsuite/examples/dff/adff.vhdl')
-rw-r--r--testsuite/examples/dff/adff.vhdl23
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/examples/dff/adff.vhdl b/testsuite/examples/dff/adff.vhdl
new file mode 100644
index 0000000..f5638b8
--- /dev/null
+++ b/testsuite/examples/dff/adff.vhdl
@@ -0,0 +1,23 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity adff is
+ port(
+ clk : in std_logic;
+ rst : in std_logic;
+ d : in std_logic;
+ q : out std_logic
+ );
+end entity;
+
+architecture arch of adff is
+begin
+ process (clk, rst)
+ begin
+ if rst = '1' then
+ q <= '1';
+ elsif rising_edge(clk) then
+ q <= d;
+ end if;
+ end process;
+end architecture;