Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
Resource Evaluation of WR switch HDL for Ultrascale Plus
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Resource Evaluation of WR switch HDL for Ultrascale Plus
Commits
5b468dec
Commit
5b468dec
authored
Aug 21, 2019
by
Marek Gumiński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing oneshot decode/encode functions.
parent
ece8fde7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
2 deletions
+43
-2
wr_softpll_ng.vhd
...es/wr-cores-local/modules/wr_softpll_ng/wr_softpll_ng.vhd
+21
-1
psu_announce_snooper.vhd
modules/wrsw_psu/psu_announce_snooper.vhd
+22
-1
No files found.
ip_cores/wr-cores-local/modules/wr_softpll_ng/wr_softpll_ng.vhd
View file @
5b468dec
...
...
@@ -347,6 +347,26 @@ architecture rtl of wr_softpll_ng is
attribute
keep
of
aligner_sample_cref
:
signal
is
"true"
;
attribute
keep
of
aligner_sample_cin
:
signal
is
"true"
;
function
f_onehot_encode
(
x
:
std_logic_vector
;
size
:
integer
)
return
std_logic_vector
is
variable
rv
:
std_logic_vector
(
size
-1
downto
0
);
begin
rv
:
=
(
others
=>
'0'
);
rv
(
to_integer
(
unsigned
(
x
)))
:
=
'1'
;
return
rv
;
end
f_onehot_encode
;
function
f_onehot_decode
(
x
:
std_logic_vector
)
return
integer
is
begin
for
i
in
0
to
x
'length
-1
loop
if
x
(
i
)
=
'1'
then
return
i
;
end
if
;
end
loop
;
-- i
return
0
;
end
f_onehot_decode
;
begin
-- rtl
U_Adapter
:
wb_slave_adapter
...
...
@@ -827,7 +847,7 @@ begin -- rtl
regs_out
.
trr_disc_i
<=
'0'
;
holdover_on_o
<=
regs_in
.
psu_holdover_o
;
psu_selected_ref_mask
<=
f_onehot_encode
(
regs_in
.
psu_selected_ref_id_o
);
psu_selected_ref_mask
<=
f_onehot_encode
(
regs_in
.
psu_selected_ref_id_o
,
psu_selected_ref_mask
'length
);
selected_ref_clk_o
<=
psu_selected_ref_mask
(
g_num_ref_inputs
-1
downto
0
);
regs_out
.
psu_rx_holdover_msg_i
<=
rx_holdover_msg_i
;
...
...
modules/wrsw_psu/psu_announce_snooper.vhd
View file @
5b468dec
...
...
@@ -167,6 +167,27 @@ architecture behavioral of psu_announce_snooper is
signal
snk_ack_drop
:
std_logic
;
signal
seq_id_d
:
std_logic_vector
(
15
downto
0
);
function
f_onehot_decode
(
x
:
std_logic_vector
)
return
integer
is
begin
for
i
in
0
to
x
'length
-1
loop
if
x
(
i
)
=
'1'
then
return
i
;
end
if
;
end
loop
;
-- i
return
0
;
end
f_onehot_decode
;
function
f_onehot_encode
(
x
:
std_logic_vector
;
size
:
integer
)
return
std_logic_vector
is
variable
rv
:
std_logic_vector
(
size
-1
downto
0
);
begin
rv
:
=
(
others
=>
'0'
);
rv
(
to_integer
(
unsigned
(
x
)))
:
=
'1'
;
return
rv
;
end
f_onehot_encode
;
begin
zeros
<=
(
others
=>
'0'
);
...
...
@@ -435,7 +456,7 @@ begin
snk_ack_drop
<=
'0'
;
if
(
g_snoop_mode
=
RX_CLOCK_CLASS_MODE
)
then
if
(
oob_valid
=
'1'
)
then
detect_mask
<=
f_onehot_encode
(
data
(
4
downto
0
));
detect_mask
<=
f_onehot_encode
(
data
(
4
downto
0
)
,
detect_mask
'length
);
else
detect_mask
<=
(
others
=>
'0'
);
end
if
;
...
...
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