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

Subversion Repositories t48

[/] [t48/] [tags/] [rel_1_0/] [rtl/] [vhdl/] [t48_pack-p.vhd] - Blame information for rev 292

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 arniml
-------------------------------------------------------------------------------
2
--
3
-- $Id: t48_pack-p.vhd,v 1.1 2004-03-23 21:31:53 arniml Exp $
4
--
5
-- Copyright (c) 2004, Arnim Laeuger (arniml@opencores.org)
6
--
7
-- All rights reserved
8
--
9
-------------------------------------------------------------------------------
10
 
11
library ieee;
12
use ieee.std_logic_1164.all;
13
 
14
package t48_pack is
15
 
16
  -----------------------------------------------------------------------------
17
  -- Global constants
18
  -----------------------------------------------------------------------------
19
 
20
  -- clock active level
21
  constant clk_active_c      : std_logic := '1';
22
  -- reset active level
23
  constant res_active_c      : std_logic := '0';
24
  -- idle level on internal data bus
25
  constant bus_idle_level_c  : std_logic := '1';
26
 
27
  -- global data word width
28
  constant word_width_c      : natural := 8;
29
 
30
  -- data memory address width
31
  constant dmem_addr_width_c : natural := 8;
32
  -- program memory address width
33
  constant pmem_addr_width_c : natural := 12;
34
 
35
 
36
  -----------------------------------------------------------------------------
37
  -- Global data types
38
  -----------------------------------------------------------------------------
39
 
40
  -- the global data word width type
41
  subtype word_t   is std_logic_vector(word_width_c-1 downto 0);
42
  subtype nibble_t is std_logic_vector(word_width_c/2-1 downto 0);
43
  -- the global data memory address type
44
  subtype dmem_addr_t is std_logic_vector(dmem_addr_width_c-1 downto 0);
45
  -- the global program memory address type
46
  subtype pmem_addr_t is std_logic_vector(pmem_addr_width_c-1 downto 0);
47
  subtype page_t      is std_logic_vector(pmem_addr_width_c-1 downto word_width_c);
48
 
49
  -- the machine states
50
  type mstate_t is (MSTATE1, MSTATE2, MSTATE3, MSTATE4, MSTATE5);
51
 
52
 
53
  -----------------------------------------------------------------------------
54
  -- Global functions
55
  -----------------------------------------------------------------------------
56
 
57
  function to_stdLogic(input: boolean) return std_logic;
58
  function to_boolean(input: std_logic) return boolean;
59
 
60
end t48_pack;
61
 
62
package body t48_pack is
63
 
64
  function to_stdLogic(input: boolean) return std_logic is
65
  begin
66
    if input then
67
      return '1';
68
    else
69
      return '0';
70
    end if;
71
  end to_stdLogic;
72
 
73
  function to_boolean(input: std_logic) return boolean is
74
  begin
75
    if input = '1' then
76
      return true;
77
    else
78
      return false;
79
    end if;
80
  end to_boolean;
81
 
82
end t48_pack;

powered by: WebSVN 2.1.0

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