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
2015a6b3
Commit
2015a6b3
authored
13 years ago
by
Tomasz Wlostowski
Committed by
Tomasz Wlostowski
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
wb_gpio_port: now supports more than 32 pins
parent
6123bc56
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/wishbone/wb_gpio_port/wb_gpio_port.vhd
+79
-0
79 additions, 0 deletions
modules/wishbone/wb_gpio_port/wb_gpio_port.vhd
with
79 additions
and
0 deletions
modules/wishbone/wb_gpio_port/wb_gpio_port.vhd
+
79
−
0
View file @
2015a6b3
...
...
@@ -164,3 +164,82 @@ begin
end
behavioral
;
f
(
ddr_wr
(
i
)
=
'1'
)
then
dir_reg
(
i
*
32
+
31
downto
i
*
32
)
<=
wb_dat_i
;
end
if
;
end
if
;
end
if
;
end
process
;
end
generate
gen_banks_wr
;
p_wb_reads
:
process
(
clk_sys_i
)
begin
if
rising_edge
(
clk_sys_i
)
then
if
rst_n_i
=
'0'
then
wb_dat_o
<=
(
others
=>
'0'
);
else
wb_dat_o
<=
(
others
=>
'X'
);
case
wb_adr_i
(
2
downto
0
)
is
when
c_GPIO_REG_DDR
=>
for
i
in
0
to
c_NUM_BANKS
-1
loop
if
(
to_integer
(
unsigned
(
wb_adr_i
(
5
downto
3
)))
=
i
)
then
wb_dat_o
<=
dir_reg
(
32
*
i
+
31
downto
32
*
i
);
end
if
;
end
loop
;
-- i
when
c_GPIO_REG_PSR
=>
for
i
in
0
to
c_NUM_BANKS
-1
loop
if
(
to_integer
(
unsigned
(
wb_adr_i
(
5
downto
3
)))
=
i
)
then
wb_dat_o
<=
gpio_in_synced
(
32
*
i
+
31
downto
32
*
i
);
end
if
;
end
loop
;
-- i
when
others
=>
null
;
end
case
;
end
if
;
end
if
;
end
process
;
p_gen_ack
:
process
(
clk_sys_i
)
begin
if
rising_edge
(
clk_sys_i
)
then
if
rst_n_i
=
'0'
then
ack_int
<=
'0'
;
else
if
(
ack_int
=
'1'
)
then
ack_int
<=
'0'
;
elsif
(
wb_cyc_i
=
'1'
)
and
(
wb_sel_i
=
'1'
)
and
(
wb_stb_i
=
'1'
)
then
ack_int
<=
'1'
;
end
if
;
end
if
;
end
if
;
end
process
;
gen_with_tristates
:
if
(
g_with_builtin_tristates
)
generate
gpio_out_tristate
:
process
(
out_reg
,
dir_reg
)
begin
for
i
in
0
to
g_num_pins
-1
loop
if
(
dir_reg
(
i
)
=
'1'
)
then
gpio_b
(
i
)
<=
out_reg
(
i
);
else
gpio_b
(
i
)
<=
'Z'
;
end
if
;
end
loop
;
end
process
gpio_out_tristate
;
gpio_in
<=
gpio_b
;
end
generate
gen_with_tristates
;
gen_without_tristates
:
if
(
not
g_with_builtin_tristates
)
generate
gpio_out_o
<=
out_reg
;
gpio_in
<=
gpio_in_i
;
gpio_oen_o
<=
dir_reg
;
end
generate
gen_without_tristates
;
wb_ack_o
<=
ack_int
;
end
behavioral
;
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