1 ------------------------------------------------------------------------------- 2 -- File : DspCounter.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2013-07-12 5 -- Last update: 2013-08-02 6 ------------------------------------------------------------------------------- 7 -- Description: Example of Counter that infers a DSP48 via "use_dsp48" attribute 8 ------------------------------------------------------------------------------- 9 -- This file is part of 'SLAC Firmware Standard Library'. 10 -- It is subject to the license terms in the LICENSE.txt file found in the 11 -- top-level directory of this distribution and at: 12 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 13 -- No part of 'SLAC Firmware Standard Library', including this file, 14 -- may be copied, modified, propagated, or distributed except according to 15 -- the terms contained in the LICENSE.txt file. 16 ------------------------------------------------------------------------------- 19 use ieee.std_logic_1164.
all;
20 use ieee.std_logic_unsigned.
all;
21 use ieee.std_logic_arith.
all;
26 --! @ingroup base_general 49 attribute use_dsp48 : ;
50 attribute use_dsp48 of counter : signal is "yes";
54 -- INCREMENT_G range check 56 report "INCREMENT_G must be <= ((2**DATA_WIDTH_G)-1)" 65 counter <= (others => '0') after TPD_G;
66 elsif rising_edge(clk) then 69 counter <= (others => '0') after TPD_G;
72 counter <= counter + INCREMENT_C after TPD_G;
RST_ASYNC_Gboolean := false
DATA_WIDTH_Ginteger range 1 to 48:= 16
INCREMENT_Ginteger range 1 to 48:= 1
out cntslv( DATA_WIDTH_G- 1 downto 0)