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

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [VHDL/] [Open8_pkg.vhd] - Diff between revs 188 and 189

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

Rev 188 Rev 189
Line 33... Line 33...
-- Seth Henry      03/12/20 Rationalized the naming of the CPU flags to match
-- Seth Henry      03/12/20 Rationalized the naming of the CPU flags to match
--                           the assembler names. Also removed superfluous
--                           the assembler names. Also removed superfluous
--                           signals in the ALU and PC records.
--                           signals in the ALU and PC records.
-- Seth Henry      03/17/20 Added new subtype and constants for external
-- Seth Henry      03/17/20 Added new subtype and constants for external
--                           GP flags.
--                           GP flags.
 
-- Seth Henry      03/18/20 Added the ceil_log2 function, since it is used in
 
--                           memory sizing calculations.
 
 
library ieee;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_arith.all;
 
 
Line 94... Line 96...
    Rd_Enable                : out std_logic;
    Rd_Enable                : out std_logic;
    Wr_Data                  : out DATA_TYPE;
    Wr_Data                  : out DATA_TYPE;
    Wr_Enable                : out std_logic );
    Wr_Enable                : out std_logic );
  end component;
  end component;
 
 
 
  -- This function is used to calculate RAM parameters, but is generally
 
  --  useful for making things more generic.
 
  function ceil_log2 (x : in natural) return natural;
 
 
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Internal constants and type declarations.
-- Internal constants and type declarations.
--
--
-- These are only used in the actual model, and aren't generally useful for
-- These are only used in the actual model, and aren't generally useful for
--  external application.
--  external application.
Line 266... Line 272...
  subtype FLAG_TYPE is DATA_TYPE;
  subtype FLAG_TYPE is DATA_TYPE;
 
 
end Open8_pkg;
end Open8_pkg;
 
 
package body Open8_pkg is
package body Open8_pkg is
 
 
 
  -- 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;
 
 
end package body;
end package body;
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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