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
fd467fd2
Commit
fd467fd2
authored
Oct 29, 2015
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update wrpc testbench
parent
9211cad9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5332 additions
and
2188 deletions
+5332
-2188
functions.svh
testbench/wrc_core/main_tb/functions.svh
+109
-0
main.sv
testbench/wrc_core/main_tb/main.sv
+320
-164
run.do
testbench/wrc_core/main_tb/run.do
+3
-1
wrc.ram
testbench/wrc_core/main_tb/sw/wrc.ram
+4794
-1877
wave.do
testbench/wrc_core/main_tb/wave.do
+106
-146
No files found.
testbench/wrc_core/main_tb/functions.svh
0 → 100644
View file @
fd467fd2
`define
WIRE_VHD_SV_WRFSRC
(
vhd_dst
,
sv_src
)
\
assign
vhd_dst
`
`_i
.
cyc
=
sv_src
.
cyc
;
\
assign
vhd_dst
`
`_i
.
stb
=
sv_src
.
stb
;
\
assign
vhd_dst
`
`_i
.
adr
=
sv_src
.
adr
;
\
assign
vhd_dst
`
`_i
.
dat
=
sv_src
.
dat_o
;
\
assign
vhd_dst
`
`_i
.
sel
=
sv_src
.
sel
;
\
assign
vhd_dst
`
`_i
.
we
=
sv_src
.
we
;
\
assign
sv_src
.
ack
=
vhd_dst
`
`_o
.
ack
;
\
assign
sv_src
.
err
=
vhd_dst
`
`_o
.
err
;
\
assign
sv_src
.
stall
=
vhd_dst
`
`_o
.
stall
;
`define
WIRE_VHD_SV_WRFSNK
(
sv_dst
,
vhd_src
)
\
assign sv_dst
.
cyc
=
vhd_src
``
_o
.
cyc
;
\
assign sv_dst
.
stb
=
vhd_src
``
_o
.
stb
;
\
assign sv_dst
.
adr
=
vhd_src
``
_o
.
adr
;
\
assign sv_dst
.
dat_o
=
vhd_src
``
_o
.
dat
;
\
assign sv_dst
.
sel
=
vhd_src
``
_o
.
sel
;
\
assign sv_dst
.
we
=
vhd_src
``
_o
.
we
;
\
assign vhd_src
``
_i
.
ack
=
sv_dst
.
ack
;
\
assign vhd_src
``
_i
.
err
=
sv_dst
.
err
;
\
assign vhd_src
``
_i
.
stall
=
sv_dst
.
stall
;
`define
WIRE_VHD_SV_WBM
(
vhd_dst
,
sv_src
)
\
assign vhd_dst
``
_o
.
cyc
=
sv_src
.
cyc
;
\
assign vhd_dst
``
_o
.
stb
=
sv_src
.
stb
;
\
assign vhd_dst
``
_o
.
adr
=
sv_src
.
adr
;
\
assign vhd_dst
``
_o
.
dat
=
sv_src
.
dat_o
;
\
assign vhd_dst
``
_o
.
sel
=
sv_src
.
sel
;
\
assign vhd_dst
``
_o
.
we
=
sv_src
.
we
;
\
assign sv_src
.
ack
=
vhd_dst
``
_i
.
ack
;
\
assign sv_src
.
err
=
vhd_dst
``
_i
.
err
;
\
assign sv_src
.
dat_i
=
vhd_dst
``
_i
.
dat
;
\
assign sv_src
.
stall
=
vhd_dst
``
_i
.
stall
;
int
tx_sizes
[$]
,
tx_padded
[$]
;
//////////////////////////////////////////////////////////
task
send_frames
(
WBPacketSource
src
,
int
n_packets
)
;
int
i
,
seed
=
0
,
n1
=
0
,
n2
=
0
;
int
cur_size
,
dir
;
EthPacket
pkt
,
tmpl
;
EthPacket
to_ext
[$]
,
to_minic
[$]
;
EthPacketGenerator
gen
=
new
;
tmpl
=
new
;
tmpl
.
src
=
'
{
22
,
33
,
44
,
44
,
55
,
66
};
tmpl
.
dst
=
'
{
'hff
,
'hff
,
'hff
,
'hff
,
'hff
,
'hff
};
//tmpl.dst = '{'h01,'h1b,'h19,'h00,'h00,'h00}; // PTP dst MAC
tmpl
.
has_smac
=
1
;
tmpl
.
is_q
=
0
;
tmpl
.
ethertype
=
{
'h0800
};
//tmpl.ethertype = {'hdbff};
//tmpl.ethertype = {'h88f7};
//gen.set_randomization(EthPacketGenerator::SEQ_PAYLOAD | EthPacketGenerator::ETHERTYPE /*| EthPacketGenerator::RX_OOB*/) ;
gen
.
set_randomization
(
EthPacketGenerator
::
SEQ_PAYLOAD
)
;
gen
.
set_template
(
tmpl
)
;
gen
.
set_size
(
1
,
1500
)
;
cur_size
=
60
;
dir
=
1
;
for
(
i
=
0
;
i
<
n_packets
;
i
++
)
begin
/* switch between incrementing/decrementing */
if
(
cur_size
==
1495
)
dir
=
0
;
if
(
cur_size
==
1
)
dir
=
1
;
/* increment/decrement frame size, based on dir */
if
(
dir
==
1
)
cur_size
+=
1
;
else
cur_size
-=
1
;
pkt
=
gen
.
gen
(
cur_size
)
;
//pkt = gen.gen();
tx_sizes
=
{
tx_sizes
,
pkt
.
size
};
tx_padded
=
{
tx_padded
,
padded_size
(
pkt
)
};
src
.
send
(
pkt
)
;
#
100u
s
;
end
endtask
function
int
nopad_size
(
EthPacket
pkt
)
;
int
i
;
if
(
pkt
.
size
>
64
)
nopad_size
=
pkt
.
size
;
else
begin
nopad_size
=
1
;
for
(
i
=
1
;
i
<
pkt
.
size
;
i
++
)
begin
if
(
pkt
.
payload
[
i
]
==
0
)
break
;
nopad_size
=
nopad_size
+
1
;
end
nopad_size
=
nopad_size
+
14
;
//+header
end
endfunction
;
function
int
padded_size
(
EthPacket
pkt
)
;
if
(
pkt
.
size
<
60
)
padded_size
=
60
;
else
padded_size
=
pkt
.
size
;
endfunction
;
function
int
find_pkt_size
(
EthPacket
pkt
,
int
start
,
int
limit
)
;
int
i
;
for
(
i
=
start
;
i
<
start
+
limit
;
i
++
)
begin
if
(
pkt
.
size
==
tx_sizes
[
i
])
return
i
;
end
return
-
1
;
endfunction
;
testbench/wrc_core/main_tb/main.sv
View file @
fd467fd2
This diff is collapsed.
Click to expand it.
testbench/wrc_core/main_tb/run.do
View file @
fd467fd2
#vlog -dpiheader dpi/minic_dpi.h -sv main.sv +incdir+"." +incdir+../../../sim
vlog -sv main.sv +incdir+"." +incdir+../../../sim
make -f Makefile
#vsim -sv_lib dpi/minic -L unisim -t 10fs work.main -voptargs="+acc"
vsim -L unisim -t 10fs work.main -voptargs="+acc"
set StdArithNoWarnings 1
set NumericStdNoWarnings 1
do wave.do
radix -hexadecimal
run 2
5
ms
run 2
00
ms
wave zoomfull
radix -hexadecimal
testbench/wrc_core/main_tb/sw/wrc.ram
View file @
fd467fd2
This diff is collapsed.
Click to expand it.
testbench/wrc_core/main_tb/wave.do
View file @
fd467fd2
This diff is collapsed.
Click to expand it.
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