Line 77... |
Line 77... |
signal Rd_En : std_logic := '0';
|
signal Rd_En : std_logic := '0';
|
signal Rd_En_q : std_logic := '0';
|
signal Rd_En_q : std_logic := '0';
|
|
|
signal Interval : DATA_TYPE := x"00";
|
signal Interval : DATA_TYPE := x"00";
|
signal Update_Interval : std_logic;
|
signal Update_Interval : std_logic;
|
signal New_Interval : DATA_TYPE := x"00";
|
|
signal Timer_Cnt : DATA_TYPE := x"00";
|
signal Timer_Cnt : DATA_TYPE := x"00";
|
|
|
constant DLY_1USEC_VAL : integer := integer(Sys_Freq / 1000000.0);
|
constant DLY_1USEC_VAL : integer := integer(Sys_Freq / 1000000.0);
|
constant DLY_1USEC_WDT : integer := ceil_log2(DLY_1USEC_VAL - 1);
|
constant DLY_1USEC_WDT : integer := ceil_log2(DLY_1USEC_VAL - 1);
|
constant DLY_1USEC : std_logic_vector :=
|
constant DLY_1USEC : std_logic_vector :=
|
Line 102... |
Line 101... |
Wr_Data_q <= x"00";
|
Wr_Data_q <= x"00";
|
Rd_En <= '0';
|
Rd_En <= '0';
|
Rd_Data <= OPEN8_NULLBUS;
|
Rd_Data <= OPEN8_NULLBUS;
|
Interval <= x"00";
|
Interval <= x"00";
|
Update_Interval <= '0';
|
Update_Interval <= '0';
|
New_Interval <= x"00";
|
|
elsif( rising_edge( Clock ) )then
|
elsif( rising_edge( Clock ) )then
|
Wr_En <= Addr_Match and Wr_Enable;
|
Wr_En <= Addr_Match and Wr_Enable;
|
Wr_Data_q <= Wr_Data;
|
Wr_Data_q <= Wr_Data;
|
Update_Interval <= '0';
|
Update_Interval <= '0';
|
if( Wr_En = '1' )then
|
if( Wr_En = '1' )then
|
New_Interval <= Wr_Data_q;
|
Interval <= Wr_Data_q;
|
Update_Interval <= '1';
|
Update_Interval <= '1';
|
end if;
|
end if;
|
|
|
Rd_Data <= (others => '0');
|
Rd_Data <= (others => '0');
|
Rd_En <= Addr_Match and Rd_Enable;
|
Rd_En <= Addr_Match and Rd_Enable;
|
Line 143... |
Line 141... |
Timer_Cnt <= x"00";
|
Timer_Cnt <= x"00";
|
Interrupt <= '0';
|
Interrupt <= '0';
|
elsif( rising_edge(Clock) )then
|
elsif( rising_edge(Clock) )then
|
Interrupt <= '0';
|
Interrupt <= '0';
|
Timer_Cnt <= Timer_Cnt - uSec_Tick_i;
|
Timer_Cnt <= Timer_Cnt - uSec_Tick_i;
|
if( or_reduce(Timer_Cnt) = '0' )then
|
if( Update_Interval = '1' )then
|
|
Timer_Cnt <= Interval;
|
|
elsif( or_reduce(Timer_Cnt) = '0' )then
|
Timer_Cnt <= Interval;
|
Timer_Cnt <= Interval;
|
Interrupt <= or_reduce(Interval); -- Only trigger on Int > 0
|
Interrupt <= or_reduce(Interval); -- Only trigger on Int > 0
|
end if;
|
end if;
|
end if;
|
end if;
|
end process;
|
end process;
|