Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Gateware
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
12
Issues
12
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Gateware
Commits
2e8c4e9e
Commit
2e8c4e9e
authored
Feb 22, 2013
by
Maciej Lipinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swcore: cleaning output_block_new (moving functions to pkg
parent
f228f16e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
44 deletions
+46
-44
swc_swcore_pkg.vhd
modules/wrsw_swcore/swc_swcore_pkg.vhd
+19
-0
xswc_output_block_new.vhd
modules/wrsw_swcore/xswc_output_block_new.vhd
+27
-44
No files found.
modules/wrsw_swcore/swc_swcore_pkg.vhd
View file @
2e8c4e9e
...
...
@@ -714,6 +714,8 @@ component swc_multiport_pck_pg_free_module is
resource
:
std_logic_vector
;
queue_full
:
std_logic_vector
;
queue_num
:
integer
)
return
std_logic_vector
;
function
f_slv_resize
(
x
:
std_logic_vector
;
len
:
natural
)
return
std_logic_vector
;
function
f_onehot_decode
(
x
:
std_logic_vector
)
return
std_logic_vector
;
end
swc_swcore_pkg
;
package
body
swc_swcore_pkg
is
...
...
@@ -819,5 +821,22 @@ package body swc_swcore_pkg is
-- return std_logic_vector(tmp);
end
function
;
function
f_slv_resize
(
x
:
std_logic_vector
;
len
:
natural
)
return
std_logic_vector
is
variable
tmp
:
std_logic_vector
(
len
-1
downto
0
);
begin
tmp
:
=
(
others
=>
'0'
);
tmp
(
x
'length
-1
downto
0
)
:
=
x
;
return
tmp
;
end
f_slv_resize
;
function
f_onehot_decode
(
x
:
std_logic_vector
)
return
std_logic_vector
is
variable
tmp
:
std_logic_vector
(
2
**
x
'length
-1
downto
0
);
begin
tmp
:
=
(
others
=>
'0'
);
tmp
(
to_integer
(
unsigned
(
x
)))
:
=
'1'
;
return
tmp
;
end
function
f_onehot_decode
;
end
swc_swcore_pkg
;
modules/wrsw_swcore/xswc_output_block_new.vhd
View file @
2e8c4e9e
...
...
@@ -176,33 +176,33 @@ architecture behavoural of xswc_output_block_new is
S_WAIT_FREE_PCK
);
function
f_prepstate_2_slv
(
arg
:
t_prep_to_send
)
return
std_logic_vector
is
begin
case
arg
is
when
S_IDLE
=>
return
"000"
;
when
S_NEWPCK_PAGE_READY
=>
return
"001"
;
when
S_NEWPCK_PAGE_SET_IN_ADVANCE
=>
return
"010"
;
when
S_NEWPCK_PAGE_USED
=>
return
"011"
;
when
S_RETRY_PREPARE
=>
return
"100"
;
when
S_RETRY_READY
=>
return
"101"
;
when
others
=>
return
"111"
;
end
case
;
return
"111"
;
end
f_prepstate_2_slv
;
function
f_sendstate_2_slv
(
arg
:
t_send_pck
)
return
std_logic_vector
is
begin
case
arg
is
when
S_IDLE
=>
return
"000"
;
when
S_DATA
=>
return
"001"
;
when
S_FLUSH_STALL
=>
return
"010"
;
when
S_FINISH_CYCLE
=>
return
"011"
;
when
S_EOF
=>
return
"100"
;
when
S_RETRY
=>
return
"101"
;
when
S_WAIT_FREE_PCK
=>
return
"110"
;
end
case
;
return
"111"
;
end
f_sendstate_2_slv
;
--
function f_prepstate_2_slv (arg : t_prep_to_send) return std_logic_vector is
--
begin
--
case arg is
--
when S_IDLE => return "000";
--
when S_NEWPCK_PAGE_READY => return "001";
--
when S_NEWPCK_PAGE_SET_IN_ADVANCE => return "010";
--
when S_NEWPCK_PAGE_USED => return "011";
--
when S_RETRY_PREPARE => return "100";
--
when S_RETRY_READY => return "101";
--
when others => return "111";
--
end case;
--
return "111";
--
end f_prepstate_2_slv;
--
--
function f_sendstate_2_slv (arg : t_send_pck) return std_logic_vector is
--
begin
--
case arg is
--
when S_IDLE => return "000";
--
when S_DATA => return "001";
--
when S_FLUSH_STALL => return "010";
--
when S_FINISH_CYCLE => return "011";
--
when S_EOF => return "100";
--
when S_RETRY => return "101";
--
when S_WAIT_FREE_PCK => return "110";
--
end case;
--
return "111";
--
end f_sendstate_2_slv;
signal
s_send_pck
:
t_send_pck
;
...
...
@@ -270,23 +270,6 @@ architecture behavoural of xswc_output_block_new is
signal
cycle_frozen
:
std_logic
;
signal
cycle_frozen_cnt
:
unsigned
(
5
downto
0
);
function
f_slv_resize
(
x
:
std_logic_vector
;
len
:
natural
)
return
std_logic_vector
is
variable
tmp
:
std_logic_vector
(
len
-1
downto
0
);
begin
tmp
:
=
(
others
=>
'0'
);
tmp
(
x
'length
-1
downto
0
)
:
=
x
;
return
tmp
;
end
f_slv_resize
;
function
f_onehot_decode
(
x
:
std_logic_vector
)
return
std_logic_vector
is
variable
tmp
:
std_logic_vector
(
2
**
x
'length
-1
downto
0
);
begin
tmp
:
=
(
others
=>
'0'
);
tmp
(
to_integer
(
unsigned
(
x
)))
:
=
'1'
;
return
tmp
;
end
function
f_onehot_decode
;
begin
-- behavoural
...
...
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