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

Subversion Repositories core_arm

[/] [core_arm/] [trunk/] [vhdl/] [mem/] [cache/] [libs/] [genic_lib.vhd] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 tarookumic
-- $(lic)
2
-- $(help_generic)
3
-- $(help_local)
4
 
5
library ieee;
6
use ieee.std_logic_1164.all;
7
use work.config.all;
8
use work.cache_config.all;
9
use work.int.all;
10
use work.gencmem_lib.all;
11
 
12
-- PREFIX: kicl_xxx
13
package genic_lib is
14
 
15
type gicl_ctrl is record
16
  burst : std_logic;
17
end record;
18
 
19
-- icache tag layout
20
-- addr: |         tag         | (tag)addr | line | 00 |
21
--                                   |
22
--     +-----------------------------+
23
--     | +---------------------+---------+
24
--     +>|       CLTAG         | CLVALID |
25
--       +---------------------+---------+
26
 
27
-- addr to cmem-tag fields/access layout
28
constant GICL_TTAG_D : integer  :=  2 + GCML_IC_TLINE_BSZ + GCML_IC_TADDR_BSZ;
29
constant GICL_TTAG_U : integer  := (2 + GCML_IC_TLINE_BSZ + GCML_IC_TADDR_BSZ + GCML_IC_TTAG_BSZ) -1;
30
constant GICL_TADDR_D : integer :=  2 + GCML_IC_TLINE_BSZ;
31
constant GICL_TADDR_U : integer := (2 + GCML_IC_TLINE_BSZ + GCML_IC_TADDR_BSZ) -1;
32
constant GICL_TLINE_D : integer :=  2;
33
constant GICL_TLINE_U : integer := (2 + GCML_IC_TLINE_BSZ ) -1;
34
 
35
-- addr to cmem-data fields/access layout
36
constant GICL_DADDR_D : integer :=  2 + GCML_IC_DLINE_BSZ;
37
constant GICL_DADDR_U : integer := (2 + GCML_IC_DLINE_BSZ + GCML_IC_DADDR_BSZ) -1;
38
constant GICL_DLINE_D : integer :=  2;
39
constant GICL_DLINE_U : integer := (2 + GCML_IC_DLINE_BSZ ) -1;
40
 
41
function gicl_is_taghit (
42
  addr : std_logic_vector(31 downto 0);
43
  cline : gcml_ic_tline
44
) return boolean;
45
 
46
function gicl_is_linevalid (
47
  addr : std_logic_vector(31 downto 0);
48
  cline : gcml_ic_tline
49
) return boolean;
50
 
51
-- check weather next is last of line
52
function gicl_is_onetogo(
53
  addr : std_logic_vector(31 downto 0)
54
) return boolean;
55
 
56
end genic_lib;
57
 
58
package body genic_lib is
59
 
60
function gicl_is_taghit (
61
  addr : std_logic_vector(31 downto 0);
62
  cline : gcml_ic_tline
63
) return boolean is
64
  variable tmp : boolean;
65
  variable tag : std_logic_vector(GICL_TTAG_U downto GICL_TTAG_D);
66
begin
67
  tmp := false;
68
  tag := addr(GICL_TTAG_U downto GICL_TTAG_D);
69
  if (tag = cline.tag) then
70
    tmp := true;
71
  end if;
72
  return tmp;
73
end;
74
 
75
function gicl_is_linevalid (
76
  addr : std_logic_vector(31 downto 0);
77
  cline : gcml_ic_tline
78
) return boolean is
79
  variable tmp : boolean;
80
  variable line : std_logic_vector(GICL_TLINE_U downto GICL_TLINE_D);
81
begin
82
  tmp := false;
83
  line := addr(GICL_TLINE_U downto GICL_TLINE_D);
84
  if (cline.valid(lin_convint(line)) = '1')
85
  then
86
    tmp := true;
87
  end if;
88
  return tmp;
89
end;
90
 
91
constant lastaddr : std_logic_vector(GCML_IC_TLINE_BSZ-1 downto 0) := (others=>'1');
92
 
93
function gicl_is_onetogo (
94
  addr : std_logic_vector(31 downto 0)
95
) return boolean is
96
  variable tmp : boolean;
97
begin
98
  tmp := false;
99
  if addr(GICL_TLINE_U downto GICL_TLINE_D+1) = lastaddr(GCML_IC_TLINE_BSZ-1 downto 1) then
100
    tmp := true;
101
  end if;
102
  return tmp;
103
end;
104
 
105
end genic_lib;
106
 

powered by: WebSVN 2.1.0

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