Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
mock-turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
hdl-core-lib
mock-turtle
Commits
1c362003
Commit
1c362003
authored
Aug 07, 2018
by
Dimitris Lampridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hdl: add generics to initialize IRAMs
parent
71f76b73
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
7 deletions
+45
-7
general-cores
hdl/ip_cores/general-cores
+1
-1
mt_cpu_cb.vhd
hdl/rtl/cpu/mt_cpu_cb.vhd
+2
-0
mt_urv_wrapper.vhd
hdl/rtl/cpu/mt_urv_wrapper.vhd
+3
-1
mock_turtle_core.vhd
hdl/rtl/mock_turtle_core.vhd
+31
-5
mock_turtle_pkg.vhd
hdl/rtl/mock_turtle_pkg.vhd
+8
-0
No files found.
general-cores
@
a50772ea
Subproject commit
1d8a2e8a31c0e5f7c6bd14a42f2251e4d4c3ecc0
Subproject commit
a50772ea3d4687226fbb6339bd951137946c7ad5
hdl/rtl/cpu/mt_cpu_cb.vhd
View file @
1c362003
...
...
@@ -39,6 +39,7 @@ entity mt_cpu_cb is
generic
(
g_CPU_ID
:
integer
;
g_CPU_CONFIG
:
t_mt_cpu_config
;
g_CPU_IRAM_INIT
:
string
;
g_SYSTEM_CLOCK_FREQ
:
integer
;
g_WITH_WHITE_RABBIT
:
boolean
);
port
(
...
...
@@ -307,6 +308,7 @@ begin -- arch
U_TheCoreCPU
:
entity
work
.
mt_urv_wrapper
generic
map
(
g_IRAM_SIZE
=>
g_CPU_CONFIG
.
memsize
,
g_IRAM_INIT
=>
g_CPU_IRAM_INIT
,
g_CPU_ID
=>
g_CPU_ID
)
port
map
(
clk_sys_i
=>
clk_sys_i
,
...
...
hdl/rtl/cpu/mt_urv_wrapper.vhd
View file @
1c362003
...
...
@@ -34,6 +34,7 @@ use work.mt_per_cpu_csr_pkg.all;
entity
mt_urv_wrapper
is
generic
(
g_IRAM_SIZE
:
integer
;
g_IRAM_INIT
:
string
;
g_CPU_ID
:
integer
);
port
(
clk_sys_i
:
in
std_logic
;
...
...
@@ -155,7 +156,8 @@ begin
g_SIZE
=>
g_IRAM_SIZE
,
g_WITH_BYTE_ENABLE
=>
TRUE
,
g_ADDR_CONFLICT_RESOLUTION
=>
"dont_care"
,
g_INIT_FILE
=>
""
,
g_INIT_FILE
=>
g_IRAM_INIT
,
g_FAIL_IF_FILE_NOT_FOUND
=>
FALSE
,
g_DUAL_CLOCK
=>
FALSE
)
port
map
(
rst_n_i
=>
rst_n_i
,
...
...
hdl/rtl/mock_turtle_core.vhd
View file @
1c362003
...
...
@@ -42,6 +42,17 @@ entity mock_turtle_core is
g_CONFIG
:
t_mt_config
:
=
c_DEFAULT_MT_CONFIG
;
-- Frequency of clk_i, in Hz
g_SYSTEM_CLOCK_FREQ
:
integer
:
=
62500000
;
-- Optional instruction memory init files. Unfortunately prior to VHDL2008,
-- strings are not allowed within records, otherwise these could be embedded
-- in g_CONFIG.cpu_config.
g_CPU0_IRAM_INITF
:
string
:
=
"none"
;
g_CPU1_IRAM_INITF
:
string
:
=
"none"
;
g_CPU2_IRAM_INITF
:
string
:
=
"none"
;
g_CPU3_IRAM_INITF
:
string
:
=
"none"
;
g_CPU4_IRAM_INITF
:
string
:
=
"none"
;
g_CPU5_IRAM_INITF
:
string
:
=
"none"
;
g_CPU6_IRAM_INITF
:
string
:
=
"none"
;
g_CPU7_IRAM_INITF
:
string
:
=
"none"
;
-- Enables/disables WR support
g_WITH_WHITE_RABBIT
:
boolean
:
=
FALSE
);
port
(
...
...
@@ -73,9 +84,23 @@ end mock_turtle_core;
architecture
arch
of
mock_turtle_core
is
------------------------------------------
-- CONSTANTS DECLARATION
------------------------------------------
-- Not elegant at all. Unfortunately, prior to VHDL2008, strings are not allowed
-- within records, otherwise these could be embedded in g_CONFIG.cpu_config.
function
f_mt_cpu_iram_init_pick
(
idx
:
integer
)
return
string
is
begin
case
idx
is
when
0
=>
return
g_CPU0_IRAM_INITF
;
when
1
=>
return
g_CPU1_IRAM_INITF
;
when
2
=>
return
g_CPU2_IRAM_INITF
;
when
3
=>
return
g_CPU3_IRAM_INITF
;
when
4
=>
return
g_CPU4_IRAM_INITF
;
when
5
=>
return
g_CPU5_IRAM_INITF
;
when
6
=>
return
g_CPU6_IRAM_INITF
;
when
7
=>
return
g_CPU7_IRAM_INITF
;
when
others
=>
return
"none"
;
end
case
;
end
function
f_mt_cpu_iram_init_pick
;
constant
c_SMEM_REMAP_BASE_IN
:
t_wishbone_address_array
(
0
to
2
)
:
=
(
0
=>
x"00000000"
,
...
...
@@ -369,6 +394,7 @@ begin -- arch
generic
map
(
g_CPU_ID
=>
i
,
g_CPU_CONFIG
=>
c_CFG
,
g_CPU_IRAM_INIT
=>
f_mt_cpu_iram_init_pick
(
i
),
g_WITH_WHITE_RABBIT
=>
g_WITH_WHITE_RABBIT
,
g_SYSTEM_CLOCK_FREQ
=>
g_SYSTEM_CLOCK_FREQ
)
port
map
(
...
...
hdl/rtl/mock_turtle_pkg.vhd
View file @
1c362003
...
...
@@ -144,6 +144,14 @@ package mock_turtle_pkg is
generic
(
g_CONFIG
:
t_mt_config
:
=
c_DEFAULT_MT_CONFIG
;
g_SYSTEM_CLOCK_FREQ
:
integer
:
=
62500000
;
g_CPU0_IRAM_INITF
:
string
:
=
"none"
;
g_CPU1_IRAM_INITF
:
string
:
=
"none"
;
g_CPU2_IRAM_INITF
:
string
:
=
"none"
;
g_CPU3_IRAM_INITF
:
string
:
=
"none"
;
g_CPU4_IRAM_INITF
:
string
:
=
"none"
;
g_CPU5_IRAM_INITF
:
string
:
=
"none"
;
g_CPU6_IRAM_INITF
:
string
:
=
"none"
;
g_CPU7_IRAM_INITF
:
string
:
=
"none"
;
g_WITH_WHITE_RABBIT
:
boolean
:
=
FALSE
);
port
(
clk_i
:
in
std_logic
;
...
...
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