Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
V
VME64x core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
VME64x core
Commits
6d2b770e
Commit
6d2b770e
authored
Jul 15, 2020
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hdl: improved static generation of ADER regsisters (non-64x mode with base address switch)
parent
ffa531dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
9 deletions
+22
-9
vme_funct_match.vhd
hdl/rtl/vme_funct_match.vhd
+4
-6
xvme64x_core.vhd
hdl/rtl/xvme64x_core.vhd
+18
-3
No files found.
hdl/rtl/vme_funct_match.vhd
View file @
6d2b770e
...
...
@@ -34,7 +34,8 @@ use work.vme64x_pkg.all;
entity
vme_funct_match
is
generic
(
g_DECODER
:
t_vme64x_decoder_arr
;
g_DECODE_AM
:
boolean
g_DECODE_AM
:
boolean
;
g_LAST_ADER
:
integer
);
port
(
clk_i
:
in
std_logic
;
...
...
@@ -47,7 +48,7 @@ entity vme_funct_match is
decode_start_i
:
in
std_logic
;
am_i
:
in
std_logic_vector
(
5
downto
0
);
ader_i
:
in
t_ader_array
;
ader_i
:
in
t_ader_array
(
0
to
g_LAST_ADER
)
;
-- Set when a function is selected.
decode_sel_o
:
out
std_logic
;
...
...
@@ -73,10 +74,7 @@ begin
-- True in case of match
s_function
(
i
)
<=
'1'
when
(((
addr_i
(
t_ADEM_M
)
and
g_DECODER
(
i
)
.
adem
(
t_ADEM_M
))
=
ader_i
(
i
)(
t_ADEM_M
))
and
((
am_i
=
ader_i
(
i
)(
t_ADER_AM
))
or
not
g_DECODE_AM
))
else
'0'
;
=
ader_i
(
i
)(
t_ADEM_M
)))
else
'0'
;
-- True if the AM is enabled by AMCAP
s_ader_am_valid
(
i
)
<=
g_DECODER
(
i
)
.
amcap
(
to_integer
(
unsigned
(
am_i
)));
...
...
hdl/rtl/xvme64x_core.vhd
View file @
6d2b770e
...
...
@@ -109,6 +109,7 @@ entity xvme64x_core is
g_USE_BASE_ADDR_SWITCH
:
boolean
:
=
FALSE
;
g_BASE_ADDR_BITS
:
integer
:
=
6
;
g_BASE_ADDR_SHIFT
:
integer
:
=
16
;
-- Function decoder parameters.
g_DECODER
:
t_vme64x_decoder_arr
:
=
c_vme64x_decoders_default
);
...
...
@@ -182,6 +183,8 @@ architecture rtl of xvme64x_core is
return
i
;
end
if
;
end
loop
;
return
0
;
end
least_set_bit
;
-- Compute the ADER for each function if CR/CSR is not used. For example:
...
...
@@ -190,11 +193,14 @@ architecture rtl of xvme64x_core is
function
compute_static_ader
(
ga
:
std_logic_vector
)
return
t_ader_array
is
variable
a
:
t_ader_array
(
0
to
c_last_ader
)
:
=
(
others
=>
x"0000_0000"
);
begin
report
"Last ADER: "
&
integer
'image
(
c_last_ader
)
severity
warning
;
for
i
in
a
'range
loop
if
g_DECODER
(
i
)
.
adem
/=
x"0000_0000"
then
a
(
i
)
:
=
std_logic_vector
(
resize
(
unsigned
(
ga
),
32
)
sll
least_set_bit
(
g_DECODER
(
i
)
.
adem
));
a
(
i
)
:
=
std_logic_vector
(
(
resize
(
unsigned
(
ga
),
32
)
sll
least_set_bit
(
g_DECODER
(
i
)
.
adem
)));
report
"ADER: "
&
integer
'image
(
i
)
&
" : "
&
integer
'image
(
to_integer
(
unsigned
(
a
(
i
))))
severity
warning
;
end
if
;
end
loop
;
return
a
;
end
compute_static_ader
;
...
...
@@ -245,7 +251,14 @@ architecture rtl of xvme64x_core is
16
#
2
d
#
|
16
#
29
#
=>
'1'
,
-- A16
16
#
08
#
to
16
#
0
f
#
=>
f_to_std_logic
(
g_VME32
),
-- A32
others
=>
'0'
);
signal
s_static_ader
:
std_logic_vector
(
31
downto
0
);
begin
s_static_ader
<=
std_logic_vector
(
(
resize
(
unsigned
(
base_addr_switch_i
),
32
)
sll
g_BASE_ADDR_SHIFT
));
assert
g_CLOCK_PERIOD
>
0
report
"g_CLOCK_PERIOD generic must be set"
severity
failure
;
...
...
@@ -397,7 +410,8 @@ begin
inst_vme_funct_match
:
entity
work
.
vme_funct_match
generic
map
(
g_DECODER
=>
g_DECODER
,
g_DECODE_AM
=>
g_DECODE_AM
and
g_ENABLE_CR_CSR
g_DECODE_AM
=>
g_DECODE_AM
and
g_ENABLE_CR_CSR
,
g_LAST_ADER
=>
c_last_ader
)
port
map
(
clk_i
=>
clk_i
,
...
...
@@ -513,6 +527,7 @@ begin
s_irq_level
<=
irq_level_i
(
2
downto
0
);
end
generate
;
end
generate
;
gen_disable_cr_csr
:
if
g_ENABLE_CR_CSR
=
false
generate
s_user_csr_data_i
<=
user_csr_data_i
;
s_cr_csr_data_o
<=
s_user_csr_data_i
;
...
...
@@ -528,7 +543,7 @@ begin
s_ader
<=
compute_static_ader
(
s_ga
)
when
not
g_USE_BASE_ADDR_SWITCH
else
compute_static_ader
(
base_addr_switch_i
);
else
(
others
=>
s_static_ader
);
end
generate
;
user_csr_addr_o
<=
s_user_csr_addr
;
...
...
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