OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [VHDL/] [o8_sys_timer.vhd] - Diff between revs 184 and 189

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 184 Rev 189
Line 76... Line 76...
  signal Rd_En_q        : std_logic;
  signal Rd_En_q        : std_logic;
 
 
  signal Interval       : DATA_TYPE;
  signal Interval       : DATA_TYPE;
  signal Timer_Cnt      : DATA_TYPE;
  signal Timer_Cnt      : DATA_TYPE;
 
 
  -- The ceil_log2 function returns the minimum register width required to
 
  --  hold the supplied integer.
 
  function ceil_log2 (x : in natural) return natural is
 
    variable retval          : natural;
 
  begin
 
    retval                   := 1;
 
    while ((2**retval) - 1) < x loop
 
      retval                 := retval + 1;
 
    end loop;
 
    return retval;
 
  end ceil_log2;
 
 
 
  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);
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.