diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2022-12-19 22:11:44 +0100 |
---|---|---|
committer | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2022-12-23 23:44:14 +0100 |
commit | 633373d0054f551158cdf668c464646bb9e6af27 (patch) | |
tree | bc989fb2ce39865cb529ea1aa2fd957ec2d0310f /testsuite/pyunit/dom/examples/StopWatch/toplevel.Encoder.vhdl | |
parent | 5853a37df7c9468a01d62f7b2eeee7d9773e72ca (diff) | |
download | ghdl-633373d0054f551158cdf668c464646bb9e6af27.tar.gz ghdl-633373d0054f551158cdf668c464646bb9e6af27.tar.bz2 ghdl-633373d0054f551158cdf668c464646bb9e6af27.zip |
Added StopWatch example for DOM and documentation testing.
Diffstat (limited to 'testsuite/pyunit/dom/examples/StopWatch/toplevel.Encoder.vhdl')
-rw-r--r-- | testsuite/pyunit/dom/examples/StopWatch/toplevel.Encoder.vhdl | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/testsuite/pyunit/dom/examples/StopWatch/toplevel.Encoder.vhdl b/testsuite/pyunit/dom/examples/StopWatch/toplevel.Encoder.vhdl new file mode 100644 index 000000000..7775a6eb6 --- /dev/null +++ b/testsuite/pyunit/dom/examples/StopWatch/toplevel.Encoder.vhdl @@ -0,0 +1,42 @@ +-- Author: Patrick Lehmann +-- License: MIT +-- +-- A generic counter module used in the StopWatch example. +-- +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.numeric_std.all; + +use work.Utilities.all; +use work.StopWatch_pkg.all; + + +entity toplevel is + port ( + NexysA7_GPIO_Switch : in std_logic_vector(3 downto 0); + + NexysA7_GPIO_Seg7_Cathode_n : out std_logic_vector(7 downto 0); + NexysA7_GPIO_Seg7_Anode_n : out std_logic_vector(7 downto 0) + ); +end entity; + + +architecture rtl of toplevel is + signal Cathode : std_logic_vector(7 downto 0); + signal Anode : std_logic_vector(7 downto 0); + +begin + + -- 7-segment encoder + encoder: entity work.seg7_Encoder + port map ( + BCDValue => unsigned(NexysA7_GPIO_Switch), + Dot => '1', + + Seg7Code => Cathode + ); + + -- convert low-active outputs + NexysA7_GPIO_Seg7_Cathode_n <= not Cathode; + NexysA7_GPIO_Seg7_Anode_n <= not x"01"; +end architecture; |