Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Platform-independent core collection
Manage
Activity
Members
Labels
Plan
Issues
15
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
Platform-independent core collection
Commits
a4fe2bdc
Commit
a4fe2bdc
authored
13 years ago
by
Tomasz Wlostowski
Browse files
Options
Downloads
Patches
Plain Diff
wishbone_pkg: updated package with new modules and types
parent
b5517dfd
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/wishbone/wishbone_pkg.vhd
+54
-76
54 additions, 76 deletions
modules/wishbone/wishbone_pkg.vhd
with
54 additions
and
76 deletions
modules/wishbone/wishbone_pkg.vhd
+
54
−
76
View file @
a4fe2bdc
...
...
@@ -22,6 +22,7 @@ package wishbone_pkg is
std_logic_vector
(
1
downto
0
);
type
t_wishbone_interface_mode
is
(
CLASSIC
,
PIPELINED
);
type
t_wishbone_address_granularity
is
(
BYTE
,
WORD
);
type
t_wishbone_master_out
is
record
cyc
:
std_logic
;
...
...
@@ -39,102 +40,79 @@ package wishbone_pkg is
err
:
std_logic
;
rty
:
std_logic
;
stall
:
std_logic
;
int
:
std_logic
;
int
:
std_logic
;
dat
:
t_wishbone_data
;
end
record
t_wishbone_slave_out
;
subtype
t_wishbone_master_in
is
t_wishbone_slave_out
;
subtype
t_wishbone_device_descriptor
is
std_logic_vector
(
255
downto
0
);
type
t_wishbone_address_array
is
array
(
integer
range
<>
)
of
t_wishbone_address
;
type
t_wishbone_master_out_array
is
array
(
natural
range
<>
)
of
t_wishbone_master_out
;
type
t_wishbone_slave_out_array
is
array
(
natural
range
<>
)
of
t_wishbone_slave_out
;
type
t_wishbone_slave_out_array
is
array
(
natural
range
<>
)
of
t_wishbone_slave_out
;
type
t_wishbone_master_in_array
is
array
(
natural
range
<>
)
of
t_wishbone_master_in
;
type
t_wishbone_slave_in_array
is
array
(
natural
range
<>
)
of
t_wishbone_slave_in
;
type
t_wishbone_slave_in_array
is
array
(
natural
range
<>
)
of
t_wishbone_slave_in
;
constant
cc_dummy_address
:
std_logic_vector
(
c_wishbone_address_width
-1
downto
0
):
=
(
others
=>
'X'
);
constant
cc_dummy_data
:
std_logic_vector
(
c_wishbone_address_width
-1
downto
0
)
:
=
(
others
=>
'X'
);
constant
cc_dummy_sel
:
std_logic_vector
(
c_wishbone_data_width
/
8-1
downto
0
)
:
=
(
others
=>
'X'
);
constant
cc_dummy_slave_in
:
t_wishbone_slave_in
:
=
(
'X'
,
'X'
,
cc_dummy_address
,
cc_dummy_sel
,
'X'
,
cc_dummy_data
);
constant
cc_dummy_slave_out
:
t_wishbone_slave_out
:
=
(
'X'
,
'X'
,
'X'
,
'X'
,
'X'
,
cc_dummy_data
);
------------------------------------------------------------------------------
-- Components declaration
-------------------------------------------------------------------------------
component
xwb_i2c_master
generic
(
g_interface_mode
:
t_wishbone_interface_mode
:
=
CLASSIC
);
port
(
clk_sys_i
:
in
std_logic
;
rst_n_i
:
in
std_logic
;
slave_i
:
in
t_wishbone_slave_in
;
slave_o
:
out
t_wishbone_slave_out
;
desc_o
:
out
t_wishbone_device_descriptor
;
scl_pad_i
:
in
std_logic
;
scl_pad_o
:
out
std_logic
;
scl_padoen_o
:
out
std_logic
;
sda_pad_i
:
in
std_logic
;
sda_pad_o
:
out
std_logic
;
sda_padoen_o
:
out
std_logic
);
end
component
;
component
x
wb_s
pi
component
wb_s
lave_adapter
generic
(
g_interface_mode
:
t_wishbone_interface_mode
:
=
CLASSIC
);
g_master_use_struct
:
boolean
;
g_master_mode
:
t_wishbone_interface_mode
;
g_master_granularity
:
t_wishbone_address_granularity
;
g_slave_use_struct
:
boolean
;
g_slave_mode
:
t_wishbone_interface_mode
;
g_slave_granularity
:
t_wishbone_address_granularity
);
port
(
clk_sys_i
:
in
std_logic
;
rst_n_i
:
in
std_logic
;
slave_i
:
in
t_wishbone_slave_in
;
sl_adr_i
:
in
std_logic_vector
(
c_wishbone_address_width
-1
downto
0
)
:
=
cc_dummy_address
;
sl_dat_i
:
in
std_logic_vector
(
c_wishbone_data_width
-1
downto
0
)
:
=
cc_dummy_data
;
sl_sel_i
:
in
std_logic_vector
(
c_wishbone_data_width
/
8-1
downto
0
)
:
=
cc_dummy_sel
;
sl_cyc_i
:
in
std_logic
:
=
'0'
;
sl_stb_i
:
in
std_logic
:
=
'0'
;
sl_we_i
:
in
std_logic
:
=
'0'
;
sl_dat_o
:
out
std_logic_vector
(
c_wishbone_data_width
-1
downto
0
);
sl_err_o
:
out
std_logic
;
sl_rty_o
:
out
std_logic
;
sl_ack_o
:
out
std_logic
;
sl_stall_o
:
out
std_logic
;
sl_int_o
:
out
std_logic
;
slave_i
:
in
t_wishbone_slave_in
:
=
cc_dummy_slave_in
;
slave_o
:
out
t_wishbone_slave_out
;
desc_o
:
out
t_wishbone_device_descriptor
;
pad_cs_o
:
out
std_logic_vector
(
7
downto
0
);
pad_sclk_o
:
out
std_logic
;
pad_mosi_o
:
out
std_logic
;
pad_miso_i
:
in
std_logic
);
ma_adr_o
:
out
std_logic_vector
(
c_wishbone_address_width
-1
downto
0
);
ma_dat_o
:
out
std_logic_vector
(
c_wishbone_data_width
-1
downto
0
);
ma_sel_o
:
out
std_logic_vector
(
c_wishbone_data_width
/
8-1
downto
0
);
ma_cyc_o
:
out
std_logic
;
ma_stb_o
:
out
std_logic
;
ma_we_o
:
out
std_logic
;
ma_dat_i
:
in
std_logic_vector
(
c_wishbone_data_width
-1
downto
0
)
:
=
cc_dummy_data
;
ma_err_i
:
in
std_logic
:
=
'0'
;
ma_rty_i
:
in
std_logic
:
=
'0'
;
ma_ack_i
:
in
std_logic
:
=
'0'
;
ma_stall_i
:
in
std_logic
:
=
'0'
;
ma_int_i
:
in
std_logic
:
=
'0'
;
master_i
:
in
t_wishbone_master_in
:
=
cc_dummy_slave_out
;
master_o
:
out
t_wishbone_master_out
);
end
component
;
component
xwb_onewire_master
generic
(
g_interface_mode
:
t_wishbone_interface_mode
:
=
CLASSIC
;
g_num_ports
:
integer
:
=
1
;
g_ow_btp_normal
:
string
:
=
"5.0"
;
g_ow_btp_overdrive
:
string
:
=
"1.0"
);
port
(
clk_sys_i
:
in
std_logic
;
rst_n_i
:
in
std_logic
;
slave_i
:
in
t_wishbone_slave_in
;
slave_o
:
out
t_wishbone_slave_out
;
desc_o
:
out
t_wishbone_device_descriptor
;
owr_pwren_o
:
out
std_logic_vector
(
g_num_ports
-1
downto
0
);
owr_en_o
:
out
std_logic_vector
(
g_num_ports
-1
downto
0
);
owr_i
:
in
std_logic_vector
(
g_num_ports
-1
downto
0
));
end
component
;
component
xwb_bus_fanout
generic
(
g_num_outputs
:
natural
;
g_bits_per_slave
:
integer
:
=
14
);
port
(
clk_sys_i
:
in
std_logic
;
rst_n_i
:
in
std_logic
;
slave_i
:
in
t_wishbone_slave_in
;
slave_o
:
out
t_wishbone_slave_out
;
master_i
:
in
t_wishbone_master_in_array
(
0
to
g_num_outputs
-1
);
master_o
:
out
t_wishbone_master_out_array
(
0
to
g_num_outputs
-1
));
end
component
;
component
xwb_gpio_port
generic
(
g_interface_mode
:
t_wishbone_interface_mode
:
=
CLASSIC
;
g_num_pins
:
natural
:
=
32
;
g_with_builtin_tristates
:
boolean
:
=
false
);
port
(
clk_sys_i
:
in
std_logic
;
rst_n_i
:
in
std_logic
;
slave_i
:
in
t_wishbone_slave_in
;
slave_o
:
out
t_wishbone_slave_out
;
desc_o
:
out
t_wishbone_device_descriptor
;
gpio_b
:
inout
std_logic_vector
(
g_num_pins
-1
downto
0
);
gpio_out_o
:
out
std_logic_vector
(
g_num_pins
-1
downto
0
);
gpio_in_i
:
in
std_logic_vector
(
g_num_pins
-1
downto
0
);
gpio_oen_o
:
out
std_logic_vector
(
g_num_pins
-1
downto
0
));
end
component
;
end
wishbone_pkg
;
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment