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
b8ce9f54
Commit
b8ce9f54
authored
Jan 29, 2014
by
Maciej Lipinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[testbench+EP] added simulation of hw-based generation of test frames in EP
parent
ead28df0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
1 deletion
+64
-1
wr-cores
ip_cores/wr-cores
+1
-1
simdrv_wr_endpoint.svh
testbench/scb_top/simdrv_wr_endpoint.svh
+62
-0
main.sv
testbench/swcore/allocator/main.sv
+1
-0
No files found.
wr-cores
@
f6bed246
Subproject commit
9b98461623871b2d3d5691b6d948af96cd51f009
Subproject commit
f6bed2462d3f6b8beb937ca545cd8ee45b932161
testbench/scb_top/simdrv_wr_endpoint.svh
View file @
b8ce9f54
...
...
@@ -54,7 +54,14 @@ class CSimDrv_WR_Endpoint;
if
(
data
.
size
()
&
1
)
$
fatal
(
"CSimDrv_WR_Endpoint::write_template(): data size must be even"
)
;
if
(
user_offset
>=
data
.
size
()
-
2
)
$
fatal
(
"CSimDrv_WR_Endpoint::write_template(): user_offset cannot be set to the last word of the template"
)
;
if
(
user_offset
&
1
)
$
fatal
(
"CSimDrv_WR_Endpoint::write_template(): user_offset must be even"
)
;
$
display
(
"write_template: size %d"
,
data
.
size
())
;
for
(
i
=
0
;
i
<
data
.
size
()
;
i
+=
2
)
...
...
@@ -74,6 +81,41 @@ class CSimDrv_WR_Endpoint;
end
endtask
// write_template
task
write_inj_gen_frame
(
byte
header
[]
,
int
frame_size
)
;
int
i
;
int
slot
=
0
;
if
(
header
.
size
()
&
1
)
$
fatal
(
"CSimDrv_WR_Endpoint::write_inj_gen_frame(): header size must be even"
)
;
if
(
frame_size
<
64
)
$
fatal
(
"CSimDrv_WR_Endpoint::write_inj_gen_frame(): frame size needs to be greater than 64"
)
;
$
display
(
"write_template: size %d"
,
frame_size
)
;
frame_size
=
frame_size
-
4
;
//CRC which is automaticly suffixed
for
(
i
=
0
;
i
<
frame_size
;
i
+=
2
)
begin
uint64_t
v
=
0
;
if
(
i
<
header
.
size
())
v
=
((
header
[
i
]
<<
8
)
|
header
[
i
+
1
])
&
64'h0000FFFF
;
else
v
=
0
;
if
(
i
==
0
)
v
|=
(
1
<<
16
)
;
// start of template
if
((
frame_size
&
1
)
&&
(
i
==
(
frame_size
-
1
)))
// end of template with odd size
v
|=
(
1
<<
16
)
|
(
1
<<
17
)
;
else
if
(
i
==
(
frame_size
-
2
))
// end of template with even size
v
|=
(
1
<<
16
)
;
if
(
i
==
header
.
size
())
v
|=
(
1
<<
17
)
;
// place for frame ID
vcr1_buffer_write
(
0
,
slot
*
64
+
i
/
2
,
v
)
;
end
endtask
// write_template
task
pfilter_load_microcode
(
uint64_t
mcode
[])
;
int
i
;
...
...
@@ -171,6 +213,26 @@ class CSimDrv_WR_Endpoint;
txpause_802_3
,
rxpause_802_3
,
txpause_802_1q
,
rxpause_802_1q
)
;
endtask
// automatic
task
automatic
inject_gen_ctrl_config
(
int
interframe_gap
,
int
sel_id
)
;
uint64_t
wval
=
0
;
wval
=
(
interframe_gap
<<
`EP_INJ_CTRL_PIC_CONF_IFG_OFFSET
)
&
`EP_INJ_CTRL_PIC_CONF_IFG
|
(
sel_id
<<
`EP_INJ_CTRL_PIC_CONF_SEL_OFFSET
)
&
`EP_INJ_CTRL_PIC_CONF_SEL
|
`EP_INJ_CTRL_PIC_VALID
;
m_acc
.
write
(
m_base
+
`ADDR_EP_INJ_CTRL
,
wval
)
;
$
display
(
"INJ ctrl cofig: interframe gap=%1d, pattern sel id=%1d"
,
interframe_gap
,
sel_id
)
;
endtask
// automatic
task
automatic
inject_gen_ctrl_enable
()
;
uint64_t
wval
=
0
;
wval
=
`EP_INJ_CTRL_PIC_ENA
;
m_acc
.
write
(
m_base
+
`ADDR_EP_INJ_CTRL
,
wval
)
;
$
display
(
"INJ ctrl cofig: enabled"
)
;
endtask
// automatic
task
automatic
inject_gen_ctrl_disable
()
;
uint64_t
wval
=
0
;
m_acc
.
write
(
m_base
+
`ADDR_EP_INJ_CTRL
,
wval
)
;
$
display
(
"INJ ctrl cofig: disabled"
)
;
endtask
// automatic
endclass
// CSimDrv_WR_Endpoint
...
...
testbench/swcore/allocator/main.sv
View file @
b8ce9f54
...
...
@@ -14,6 +14,7 @@ typedef struct {
int
page
;
}
alloc_request_t
;
function
automatic
int
first_free
(
int
tab
[])
;
int
i
;
...
...
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