From f6be505eba42a79c13766d37090bcc5b40b558d5 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Mon, 8 Feb 2010 07:08:32 +0000 Subject: [PATCH] - added f_syscll_hz generic Committed on the Free edition of March Hare Software CVSNT Server. Upgrade to CVS Suite for more features and support: http://march-hare.com/cvsnt/ git-svn-id: http://moon:8086/svn/vhdl/trunk@732 cc03376c-175c-47c8-b038-4cd826a8556b --- lib/misc/gpio_wb.vhd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/misc/gpio_wb.vhd b/lib/misc/gpio_wb.vhd index 6df62c0..20cdfa0 100644 --- a/lib/misc/gpio_wb.vhd +++ b/lib/misc/gpio_wb.vhd @@ -3,6 +3,10 @@ USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.NUMERIC_STD.ALL; ENTITY gpio_wb IS + Generic + ( + f_sysclk_hz : natural := 100E6 + ); Port ( CLK_I : in STD_LOGIC; @@ -30,13 +34,14 @@ END gpio_wb; ARCHITECTURE behavior OF gpio_wb IS constant num_timers : natural := 2; + constant ncycles_usec : natural := f_sysclk_hz/1E6; signal gpo0_reg : unsigned(31 downto 0); signal gpo1_reg : unsigned(31 downto 0); signal gpi0_reg : unsigned(31 downto 0); signal gpi1_reg : unsigned(31 downto 0); -- Signals to form an timer generating an interrupt every microsecond - subtype tick_usec_t is natural range 0 to 99; + subtype tick_usec_t is natural range 0 to ncycles_usec-1; signal tick_usec : tick_usec_t; signal cnt_usec : unsigned(31 downto 0); signal cnt_sec : unsigned(31 downto 0);