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
0
Merge Requests
0
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
6be7824c
Commit
6be7824c
authored
Nov 03, 2016
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sim: update packet sink/source to send/receive RX OOB
parent
adcb8584
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
6 deletions
+34
-6
eth_packet.svh
sim/eth_packet.svh
+18
-1
wb_packet_sink.svh
sim/wb_packet_sink.svh
+10
-5
wb_packet_source.svh
sim/wb_packet_source.svh
+6
-0
No files found.
sim/eth_packet.svh
View file @
6be7824c
...
...
@@ -64,7 +64,7 @@ class EthPacket;
is_hp
=
0
;
has_crc
=
0
;
oob_type
=
NONE
;
payload
=
new
[
size
](
payload
)
;
payload
=
new
[
size
](
payload
)
;
endfunction
// new
...
...
@@ -180,6 +180,10 @@ class EthPacket;
if
(
oob_type
==
TX_FID
&&
(
b
.
ts
.
frame_id
!=
ts
.
frame_id
))
return
0
;
if
(
oob_type
==
RX_TIMESTAMP
&&
(
b
.
ts
.
ts_r
!=
ts
.
ts_r
)
&&
(
b
.
ts
.
ts_f
!=
ts
.
ts_f
))
return
0
;
end
return
1
;
...
...
@@ -233,6 +237,10 @@ is_hp ? "H" : " ", has_crc ? "C" : " ");
$
sformat
(
tmp
,
"TxOOB: %x"
,
ts
.
frame_id
)
;
str
=
{
str
,
tmp
};
end
if
(
oob_type
==
RX_TIMESTAMP
)
begin
$
sformat
(
tmp
,
"RxOOB: %x, %x"
,
ts
.
ts_f
,
ts
.
ts_r
)
;
str
=
{
str
,
tmp
};
end
$
display
(
str
)
;
hexdump
(
payload
)
;
...
...
@@ -264,6 +272,7 @@ class EthPacketGenerator;
protected
int
r_flags
;
protected
int
m_current_frame_id
;
protected
int
current_ts
;
protected
int
cur_seq_id
;
function
new
()
;
...
...
@@ -271,6 +280,7 @@ class EthPacketGenerator;
min_size
=
64
;
max_size
=
128
;
m_current_frame_id
=
0
;
current_ts
=
0
;
template
=
new
;
cur_seq_id
=
0
;
...
...
@@ -361,6 +371,13 @@ class EthPacketGenerator;
pkt
.
oob_type
=
TX_FID
;
end
if
(
r_flags
&
RX_OOB
)
begin
pkt
.
oob_type
=
RX_TIMESTAMP
;
pkt
.
ts
.
port_id
=
0
;
pkt
.
ts
.
ts_r
=
++
current_ts
;
pkt
.
ts
.
ts_f
=
current_ts
;
end
pkt
.
size
=
len
+
14
;
//payload + header
return
pkt
;
...
...
sim/wb_packet_sink.svh
View file @
6be7824c
...
...
@@ -48,13 +48,18 @@ class WBPacketSink extends EthPacketSink;
pkt
.
oob_type
=
TX_FID
;
pkt
.
ts
.
frame_id
=
oob
&
'hffff
;
end
else
if
(
size
==
3
&&
(
oob
>>
4
6
)
==
WRF_OOB_RX_TIMESTAMP
)
else
if
(
size
==
3
&&
(
oob
>>
4
4
)
==
WRF_OOB_RX_TIMESTAMP
)
begin
// $display("GotRXOOB");
end
else
begin
$
error
(
"Invalid OOB!"
)
;
$
stop
;
pkt
.
oob_type
=
RX_TIMESTAMP
;
pkt
.
ts
.
port_id
=
(
oob
>>
32
)
&
'h1F
;
pkt
.
ts
.
ts_f
=
(
oob
>>
28
)
&
'h0F
;
pkt
.
ts
.
ts_r
=
oob
&
'h0FFFFFFF
;
end
else
begin
$
display
(
"Invalid OOB!"
)
;
//$error("Invalid OOB!");
//$stop;
end
...
...
sim/wb_packet_source.svh
View file @
6be7824c
...
...
@@ -43,6 +43,12 @@ class WBPacketSource extends EthPacketSource;
oob
[
0
]
=
{
WRF_OOB_TX_FID
,
12'b0
};
oob
[
1
]
=
pkt
.
ts
.
frame_id
;
end
RX_TIMESTAMP:
begin
oob
=
new
[
3
]
;
oob
[
0
]
=
{
WRF_OOB_RX_TIMESTAMP
,
1'b1
,
6'b0
,
pkt
.
ts
.
port_id
[
4
:
0
]
};
oob
[
1
]
=
{
pkt
.
ts
.
ts_f
,
pkt
.
ts
.
ts_r
[
27
:
16
]
};
oob
[
2
]
=
pkt
.
ts
.
ts_r
[
15
:
0
]
;
end
endcase
// case (pkt.oob_type)
return
oob
;
...
...
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