diff options
author | James McKenzie <root@ka-ata-killa.panaceas.james.local> | 2025-04-26 20:19:15 +0100 |
---|---|---|
committer | James McKenzie <root@ka-ata-killa.panaceas.james.local> | 2025-04-26 20:19:15 +0100 |
commit | 21b3664768402f2448e0be56b69c0e98481ac9df (patch) | |
tree | 27cbe3f06e8d2c25904923c241874a779c0a1ed8 /spartan6/hp_lcd_driver/synchronizer.vhdl | |
parent | bc8dbcd5202f33f4771e4093c929e92f147d3549 (diff) | |
download | hp_instrument_lcds-21b3664768402f2448e0be56b69c0e98481ac9df.tar.gz hp_instrument_lcds-21b3664768402f2448e0be56b69c0e98481ac9df.tar.bz2 hp_instrument_lcds-21b3664768402f2448e0be56b69c0e98481ac9df.zip |
before tidy
Diffstat (limited to 'spartan6/hp_lcd_driver/synchronizer.vhdl')
-rw-r--r-- | spartan6/hp_lcd_driver/synchronizer.vhdl | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spartan6/hp_lcd_driver/synchronizer.vhdl b/spartan6/hp_lcd_driver/synchronizer.vhdl new file mode 100644 index 0000000..99618b9 --- /dev/null +++ b/spartan6/hp_lcd_driver/synchronizer.vhdl @@ -0,0 +1,26 @@ +library IEEE; +use IEEE.STD_LOGIC_1164.all; + +entity synchronizer is + generic (stages : natural := 2); + port (clk : in std_logic; + i : in std_logic; + o : out std_logic); +end synchronizer; + +architecture Behavioral of synchronizer is + signal flipflops : std_logic_vector(stages-1 downto 0) := (others => '0'); + attribute ASYNC_REG : string; + attribute ASYNC_REG of flipflops : signal is "true"; +begin + + o <= flipflops(flipflops'high); + + clk_proc : process(clk,flipflops,i) + begin + if rising_edge(clk) then + flipflops <= flipflops(flipflops'high-1 downto 0) & i; + end if; + end process; + +end Behavioral; |