Debian Codegraph @

hdl/fpga/ip/altera/clk_ctrl/clk_ctrl.vhd

raw
1 -- Copyright (c) 2024 Nuand LLC
2 --
3 -- Permission is hereby granted, free of charge, to any person obtaining a copy
4 -- of this software and associated documentation files (the "Software"), to deal
5 -- in the Software without restriction, including without limitation the rights
6 -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 -- copies of the Software, and to permit persons to whom the Software is
8 -- furnished to do so, subject to the following conditions:
9 --
10 -- The above copyright notice and this permission notice shall be included in
11 -- all copies or substantial portions of the Software.
12 --
13 -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 -- THE SOFTWARE.
20
21 library ieee;
22 use ieee.std_logic_1164.all;
23 use ieee.math_real.all;
24
25 entity clk_ctrl is
26 port (
27 inclk :in std_logic;
28 ena :in std_logic;
29 outclk :out std_logic
30 );
31 end entity clk_ctrl;
32
33 architecture rtl of clk_ctrl is
34
35 component altclkctrl
36 generic (
37 clock_type : string := "Auto";
38 ena_register_mode : string := "none";
39 number_of_clocks : integer := 1
40 );
41 port (
42 inclk : in std_logic_vector(0 downto 0);
43 ena : in std_logic;
44 outclk : out std_logic
45 );
46 end component;
47
48 signal clk_ctrl_out : std_logic;
49
50 begin
51
52 clkctrl : altclkctrl
53 port map (
54 inclk => (0 => inclk),
55 ena => ena,
56 outclk => clk_ctrl_out
57 );
58
59 outclk <= clk_ctrl_out;
60
61 end architecture rtl;