Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pythondata-cpu-microwatt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kestrel Collaboration
Kestrel LiteX
pythondata-cpu-microwatt
Commits
419c9a68
Unverified
Commit
419c9a68
authored
Jun 30, 2020
by
Paul Mackerras
Committed by
GitHub
Jun 30, 2020
1
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #206 from Jbalkind/icachecleanup
Icache constants cleanup
parents
57604c1a
d9bda521
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
icache.vhdl
icache.vhdl
+10
-9
No files found.
icache.vhdl
View file @
419c9a68
...
...
@@ -32,6 +32,12 @@ entity icache is
SIM
:
boolean
:
=
false
;
-- Line size in bytes
LINE_SIZE
:
positive
:
=
64
;
-- BRAM organisation: We never access more than wishbone_data_bits at
-- a time so to save resources we make the array only that wide, and
-- use consecutive indices for to make a cache "line"
--
-- ROW_SIZE is the width in bytes of the BRAM (based on WB, so 64-bits)
ROW_SIZE
:
positive
:
=
wishbone_data_bits
/
8
;
-- Number of lines in a set
NUM_LINES
:
positive
:
=
32
;
-- Number of ways
...
...
@@ -65,19 +71,14 @@ entity icache is
end
entity
icache
;
architecture
rtl
of
icache
is
-- BRAM organisation: We never access more than wishbone_data_bits at
-- a time so to save resources we make the array only that wide, and
-- use consecutive indices for to make a cache "line"
--
-- ROW_SIZE is the width in bytes of the BRAM (based on WB, so 64-bits)
constant
ROW_SIZE
:
natural
:
=
wishbone_data_bits
/
8
;
constant
ROW_SIZE_BITS
:
natural
:
=
ROW_SIZE
*
8
;
-- ROW_PER_LINE is the number of row (wishbone transactions) in a line
constant
ROW_PER_LINE
:
natural
:
=
LINE_SIZE
/
ROW_SIZE
;
-- BRAM_ROWS is the number of rows in BRAM needed to represent the full
-- icache
constant
BRAM_ROWS
:
natural
:
=
NUM_LINES
*
ROW_PER_LINE
;
-- INSN_PER_ROW is the number of 32bit instructions per BRAM row
constant
INSN_PER_ROW
:
natural
:
=
wishbone_data_bits
/
32
;
constant
INSN_PER_ROW
:
natural
:
=
ROW_SIZE_BITS
/
32
;
-- Bit fields counts in the address
-- INSN_BITS is the number of bits to select an instruction in a row
...
...
@@ -118,7 +119,7 @@ architecture rtl of icache is
subtype
row_in_line_t
is
unsigned
(
ROW_LINEBITS
-1
downto
0
);
-- The cache data BRAM organized as described above for each way
subtype
cache_row_t
is
std_ulogic_vector
(
wishbone_data_bits
-1
downto
0
);
subtype
cache_row_t
is
std_ulogic_vector
(
ROW_SIZE_BITS
-1
downto
0
);
-- The cache tags LUTRAM has a row per set. Vivado is a pain and will
-- not handle a clean (commented) definition of the cache tags as a 3d
...
...
@@ -363,7 +364,7 @@ begin
way
:
entity
work
.
cache_ram
generic
map
(
ROW_BITS
=>
ROW_BITS
,
WIDTH
=>
wishbone_data_bits
WIDTH
=>
ROW_SIZE_BITS
)
port
map
(
clk
=>
clk
,
...
...
Timothy Pearson
@tpearson
mentioned in commit
088a19be
·
Jan 15, 2021
mentioned in commit
088a19be
mentioned in commit 088a19be4d39fa76108c421a4a816c3bbcfa465a
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment