Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
euro-adc-65m-14b-40cha-gw
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
eurocard
euro-adc-65m-14b-40cha
euro-adc-65m-14b-40cha-gw
Commits
42803a4b
Commit
42803a4b
authored
Jul 12, 2017
by
Dave Newbold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addr tab update
parent
78d7d4e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
ipbus_decode_top.vhd
projects/timing/firmware/hdl/ipbus_decode_top.vhd
+54
-0
No files found.
projects/timing/firmware/hdl/ipbus_decode_top.vhd
0 → 100644
View file @
42803a4b
-- Address decode logic for ipbus fabric
--
-- This file has been AUTOGENERATED from the address table - do not hand edit
--
-- We assume the synthesis tool is clever enough to recognise exclusive conditions
-- in the if statement.
--
-- Dave Newbold, February 2011
library
IEEE
;
use
IEEE
.
STD_LOGIC_1164
.
all
;
use
ieee
.
numeric_std
.
all
;
package
ipbus_decode_top
is
constant
IPBUS_SEL_WIDTH
:
positive
:
=
5
;
-- Should be enough for now?
subtype
ipbus_sel_t
is
std_logic_vector
(
IPBUS_SEL_WIDTH
-
1
downto
0
);
function
ipbus_sel_top
(
addr
:
in
std_logic_vector
(
31
downto
0
))
return
ipbus_sel_t
;
-- START automatically generated VHDL the Wed Jul 12 14:14:22 2017
constant
N_SLV_CSR
:
integer
:
=
0
;
constant
N_SLV_I2C
:
integer
:
=
1
;
constant
N_SLV_FREQ_CTR
:
integer
:
=
2
;
constant
N_SLAVES
:
integer
:
=
3
;
-- END automatically generated VHDL
end
ipbus_decode_top
;
package
body
ipbus_decode_top
is
function
ipbus_sel_top
(
addr
:
in
std_logic_vector
(
31
downto
0
))
return
ipbus_sel_t
is
variable
sel
:
ipbus_sel_t
;
begin
-- START automatically generated VHDL the Wed Jul 12 14:14:22 2017
if
std_match
(
addr
,
"---------------------------00---"
)
then
sel
:
=
ipbus_sel_t
(
to_unsigned
(
N_SLV_CSR
,
IPBUS_SEL_WIDTH
));
-- csr / base 0x00000000 / mask 0x00000018
elsif
std_match
(
addr
,
"---------------------------01---"
)
then
sel
:
=
ipbus_sel_t
(
to_unsigned
(
N_SLV_I2C
,
IPBUS_SEL_WIDTH
));
-- i2c / base 0x00000008 / mask 0x00000018
elsif
std_match
(
addr
,
"---------------------------10---"
)
then
sel
:
=
ipbus_sel_t
(
to_unsigned
(
N_SLV_FREQ_CTR
,
IPBUS_SEL_WIDTH
));
-- freq_ctr / base 0x00000010 / mask 0x00000018
-- END automatically generated VHDL
else
sel
:
=
ipbus_sel_t
(
to_unsigned
(
N_SLAVES
,
IPBUS_SEL_WIDTH
));
end
if
;
return
sel
;
end
function
ipbus_sel_top
;
end
ipbus_decode_top
;
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