Line 67... |
Line 67... |
|
|
architecture behave of o8_sys_timer is
|
architecture behave of o8_sys_timer is
|
|
|
constant User_Addr : ADDRESS_TYPE := Address;
|
constant User_Addr : ADDRESS_TYPE := Address;
|
alias Comp_Addr is Bus_Address(15 downto 0);
|
alias Comp_Addr is Bus_Address(15 downto 0);
|
signal Addr_Match : std_logic;
|
signal Addr_Match : std_logic := '0';
|
signal Wr_En : std_logic;
|
signal Wr_En : std_logic := '0';
|
signal Wr_Data_q : DATA_TYPE;
|
signal Wr_Data_q : DATA_TYPE := OPEN8_NULLBUS;
|
signal Rd_En : std_logic;
|
signal Rd_En : std_logic := '0';
|
signal Rd_En_q : std_logic;
|
signal Rd_En_q : std_logic := '0';
|
|
|
signal Interval : DATA_TYPE;
|
signal Interval : DATA_TYPE := x"00";
|
signal Timer_Cnt : DATA_TYPE;
|
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 :=
|
conv_std_logic_vector(DLY_1USEC_VAL - 1, DLY_1USEC_WDT);
|
conv_std_logic_vector(DLY_1USEC_VAL - 1, DLY_1USEC_WDT);
|
|
|
signal uSec_Cntr : std_logic_vector( DLY_1USEC_WDT - 1 downto 0 )
|
signal uSec_Cntr : std_logic_vector( DLY_1USEC_WDT - 1 downto 0 )
|
:= (others => '0');
|
:= (others => '0');
|
signal uSec_Tick_i : std_logic;
|
signal uSec_Tick_i : std_logic := '0';
|
begin
|
begin
|
|
|
uSec_Tick <= uSec_Tick_i;
|
uSec_Tick <= uSec_Tick_i;
|
Addr_Match <= '1' when Comp_Addr = User_Addr else '0';
|
Addr_Match <= '1' when Comp_Addr = User_Addr else '0';
|
|
|
Line 95... |
Line 95... |
begin
|
begin
|
if( Reset = Reset_Level )then
|
if( Reset = Reset_Level )then
|
Wr_En <= '0';
|
Wr_En <= '0';
|
Wr_Data_q <= x"00";
|
Wr_Data_q <= x"00";
|
Rd_En <= '0';
|
Rd_En <= '0';
|
Rd_Data <= x"00";
|
Rd_Data <= OPEN8_NULLBUS;
|
Interval <= x"00";
|
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;
|
if( Wr_En = '1' )then
|
if( Wr_En = '1' )then
|