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
ae5ff9aa
Commit
ae5ff9aa
authored
11 years ago
by
Grzegorz Daniluk
Browse files
Options
Downloads
Patches
Plain Diff
[switch-optimization]: simplify wb_tics wishbone interface
parent
44f2ffea
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/wishbone/wb_simple_timer/wb_tics.vhd
+31
-56
31 additions, 56 deletions
modules/wishbone/wb_simple_timer/wb_tics.vhd
modules/wishbone/wb_simple_timer/xwb_tics.vhd
+2
-2
2 additions, 2 deletions
modules/wishbone/wb_simple_timer/xwb_tics.vhd
with
33 additions
and
58 deletions
modules/wishbone/wb_simple_timer/wb_tics.vhd
+
31
−
56
View file @
ae5ff9aa
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
-- Author : Grzegorz Daniluk
-- Author : Grzegorz Daniluk
-- Company : Elproma
-- Company : Elproma
-- Created : 2011-04-03
-- Created : 2011-04-03
-- Last update: 201
1-10-04
-- Last update: 201
3-09-13
-- Platform : FPGA-generics
-- Platform : FPGA-generics
-- Standard : VHDL'93
-- Standard : VHDL'93
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
-- Date Version Author Description
-- Date Version Author Description
-- 2011-04-03 1.0 greg.d Created
-- 2011-04-03 1.0 greg.d Created
-- 2011-10-04 1.1 twlostow added wishbone adapter
-- 2011-10-04 1.1 twlostow added wishbone adapter
-- 2013-09-13 1.2 greg.d removed widhbone adapter, dat_o wired with counter
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
library
ieee
;
library
ieee
;
...
@@ -57,41 +58,11 @@ architecture behaviour of wb_tics is
...
@@ -57,41 +58,11 @@ architecture behaviour of wb_tics is
constant
c_TICS_REG
:
std_logic_vector
(
1
downto
0
)
:
=
"00"
;
constant
c_TICS_REG
:
std_logic_vector
(
1
downto
0
)
:
=
"00"
;
signal
cntr_div
:
unsigned
(
23
downto
0
);
signal
cntr_div
:
unsigned
(
f_ceil_log2
(
g_period
)
-1
downto
0
);
signal
cntr_tics
:
unsigned
(
31
downto
0
);
signal
cntr_tics
:
unsigned
(
31
downto
0
);
signal
cntr_overflow
:
std_logic
;
signal
cntr_overflow
:
std_logic
;
signal
wb_in
:
t_wishbone_slave_in
;
signal
wb_out
:
t_wishbone_slave_out
;
signal
resized_addr
:
std_logic_vector
(
c_wishbone_address_width
-1
downto
0
);
begin
begin
resized_addr
(
3
downto
0
)
<=
wb_adr_i
;
resized_addr
(
c_wishbone_address_width
-1
downto
4
)
<=
(
others
=>
'0'
);
U_Adapter
:
wb_slave_adapter
generic
map
(
g_master_use_struct
=>
true
,
g_master_mode
=>
CLASSIC
,
g_master_granularity
=>
WORD
,
g_slave_use_struct
=>
false
,
g_slave_mode
=>
g_interface_mode
,
g_slave_granularity
=>
g_address_granularity
)
port
map
(
clk_sys_i
=>
clk_sys_i
,
rst_n_i
=>
rst_n_i
,
master_i
=>
wb_out
,
master_o
=>
wb_in
,
sl_adr_i
=>
resized_addr
,
sl_dat_i
=>
wb_dat_i
,
sl_sel_i
=>
wb_sel_i
,
sl_cyc_i
=>
wb_cyc_i
,
sl_stb_i
=>
wb_stb_i
,
sl_we_i
=>
wb_we_i
,
sl_dat_o
=>
wb_dat_o
,
sl_ack_o
=>
wb_ack_o
,
sl_stall_o
=>
wb_stall_o
);
process
(
clk_sys_i
)
process
(
clk_sys_i
)
begin
begin
...
@@ -124,29 +95,33 @@ begin
...
@@ -124,29 +95,33 @@ begin
end
process
;
end
process
;
--Wishbone interface
--Wishbone interface
process
(
clk_sys_i
)
wb_dat_o
<=
std_logic_vector
(
cntr_tics
);
begin
wb_ack_o
<=
'1'
;
if
rising_edge
(
clk_sys_i
)
then
wb_stall_o
<=
'0'
;
if
(
rst_n_i
=
'0'
)
then
wb_out
.
ack
<=
'0'
;
--process(clk_sys_i)
wb_out
.
dat
<=
(
others
=>
'0'
);
--begin
else
-- if rising_edge(clk_sys_i) then
if
(
wb_in
.
stb
=
'1'
and
wb_in
.
cyc
=
'1'
)
then
-- if(rst_n_i = '0') then
if
(
wb_in
.
we
=
'0'
)
then
-- wb_out.ack <= '0';
case
wb_in
.
adr
(
1
downto
0
)
is
-- wb_out.dat <= (others => '0');
when
c_TICS_REG
=>
-- else
wb_out
.
dat
<=
std_logic_vector
(
cntr_tics
);
-- if(wb_in.stb = '1' and wb_in.cyc = '1') then
when
others
=>
-- if(wb_in.we = '0') then
wb_out
.
dat
<=
(
others
=>
'0'
);
-- case wb_in.adr(1 downto 0) is
end
case
;
-- when c_TICS_REG =>
end
if
;
-- wb_out.dat <= std_logic_vector(cntr_tics);
wb_out
.
ack
<=
'1'
;
-- when others =>
else
-- wb_out.dat <= (others => '0');
wb_out
.
dat
<=
(
others
=>
'0'
);
-- end case;
wb_out
.
ack
<=
'0'
;
-- end if;
end
if
;
-- wb_out.ack <= '1';
end
if
;
-- else
end
if
;
-- wb_out.dat <= (others => '0');
end
process
;
-- wb_out.ack <= '0';
-- end if;
-- end if;
-- end if;
--end process;
end
behaviour
;
end
behaviour
;
This diff is collapsed.
Click to expand it.
modules/wishbone/wb_simple_timer/xwb_tics.vhd
+
2
−
2
View file @
ae5ff9aa
...
@@ -50,9 +50,9 @@ begin
...
@@ -50,9 +50,9 @@ begin
U_Tics
:
wb_tics
U_Tics
:
wb_tics
generic
map
(
generic
map
(
g_interface_mode
=>
g_interface_mode
,
g_interface_mode
=>
g_interface_mode
,
g_address_granularity
=>
g_address_granularity
,
g_address_granularity
=>
g_address_granularity
,
g_period
=>
g_period
)
g_period
=>
g_period
)
port
map
(
port
map
(
rst_n_i
=>
rst_n_i
,
rst_n_i
=>
rst_n_i
,
clk_sys_i
=>
clk_sys_i
,
clk_sys_i
=>
clk_sys_i
,
...
...
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