Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit core collection
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
30
Issues
30
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit core collection
Commits
6f9e49f0
Commit
6f9e49f0
authored
Oct 18, 2011
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wr_tbi_phy (and other PHYs): added 8/16-bit disparity generator
parent
60e5dcd5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
0 deletions
+90
-0
ep_1000basex_pcs.vhd
modules/wr_endpoint/ep_1000basex_pcs.vhd
+0
-0
disparity_gen_pkg.vhd
modules/wr_tbi_phy/disparity_gen_pkg.vhd
+90
-0
No files found.
modules/wr_endpoint/ep_1000basex_pcs
_8bit
.vhd
→
modules/wr_endpoint/ep_1000basex_pcs.vhd
View file @
6f9e49f0
File moved
modules/wr_tbi_phy/disparity_gen_pkg.vhd
0 → 100644
View file @
6f9e49f0
-- 8b10b disparity generator, based on 8b10b encoder core (c) Mathias Kreider
library
ieee
;
use
ieee
.
std_logic_1164
.
all
;
use
ieee
.
numeric_std
.
all
;
package
disparity_gen_pkg
is
type
t_8b10b_disparity
is
(
RD_PLUS
,
RD_MINUS
);
function
f_next_8b10b_disparity8
(
cur_disp
:
t_8b10b_disparity
;
ctrl
:
std_logic
;
data
:
std_logic_vector
)
return
t_8b10b_disparity
;
function
f_next_8b10b_disparity16
(
cur_disp
:
t_8b10b_disparity
;
ctrl
:
std_logic_vector
;
data
:
std_logic_vector
)
return
t_8b10b_disparity
;
function
to_std_logic
(
t
:
t_8b10b_disparity
)
return
std_logic
;
end
disparity_gen_pkg
;
package
body
disparity_gen_pkg
is
function
f_next_8b10b_disparity8
(
cur_disp
:
t_8b10b_disparity
;
ctrl
:
std_logic
;
data
:
std_logic_vector
)
return
t_8b10b_disparity
is
constant
c_disPar_6b
:
std_logic_vector
(
0
to
31
)
:
=
(
"11101000100000011000000110010111"
);
constant
c_disPar_4b
:
std_logic_vector
(
0
to
7
)
:
=
(
"10001001"
);
variable
dp4bit
,
dp6bit
:
std_logic
;
variable
new_disp
:
t_8b10b_disparity
;
begin
-- use 3bit at 7-5 as index for 4bit code and disparity table \n
dp4bit
:
=
c_disPar_4b
(
to_integer
(
unsigned
(
data
(
7
downto
5
))));
dp6bit
:
=
c_disPar_6b
(
to_integer
(
unsigned
(
data
(
4
downto
0
))));
new_disp
:
=
cur_disp
;
case
cur_disp
is
when
RD_MINUS
=>
if
(
ctrl
xor
dp6bit
xor
dp4bit
)
/=
'0'
then
new_disp
:
=
RD_PLUS
;
end
if
;
when
RD_PLUS
=>
if
(
ctrl
xor
dp6bit
xor
dP4bit
)
/=
'0'
then
new_disp
:
=
RD_MINUS
;
end
if
;
end
case
;
if
(
data
(
1
downto
0
)
/=
"00"
and
ctrl
=
'1'
)
then
new_disp
:
=
cur_disp
;
end
if
;
return
new_disp
;
end
f_next_8b10b_disparity8
;
function
f_next_8b10b_disparity16
(
cur_disp
:
t_8b10b_disparity
;
ctrl
:
std_logic_vector
;
data
:
std_logic_vector
)
return
t_8b10b_disparity
is
variable
tmp
:
t_8b10b_disparity
;
variable
msb
:
std_logic_vector
(
7
downto
0
);
begin
msb
:
=
data
(
15
downto
8
);
tmp
:
=
f_next_8b10b_disparity8
(
cur_disp
,
ctrl
(
1
),
msb
);
tmp
:
=
f_next_8b10b_disparity8
(
tmp
,
ctrl
(
0
),
data
(
7
downto
0
));
return
tmp
;
end
f_next_8b10b_disparity16
;
function
to_std_logic
(
t
:
t_8b10b_disparity
)
return
std_logic
is
begin
if
(
t
=
RD_MINUS
)
then
return
'0'
;
else
return
'1'
;
end
if
;
end
to_std_logic
;
end
package
body
;
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