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
b18df73e
Commit
b18df73e
authored
Jan 24, 2017
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testbench/wr_minic: add simple SV functional coverage analysis
parent
0ac188c8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
.gitignore
.gitignore
+1
-0
main.sv
testbench/wr_minic/main.sv
+23
-0
run_ci.do
testbench/wr_minic/run_ci.do
+1
-0
No files found.
.gitignore
View file @
b18df73e
...
...
@@ -15,4 +15,5 @@ doc/
*.o
*.bin
*.elf
*.ucdb
Makefile
testbench/wr_minic/main.sv
View file @
b18df73e
...
...
@@ -12,6 +12,21 @@
module
main
;
//-------------------------------------------
// Functional coverage analysis
//-------------------------------------------
reg
txp_cg_newframe
,
rxp_cg_newframe
;
int
txp_cg_size
,
rxp_cg_size
;
covergroup
cg
@
(
txp_cg_newframe
==
1
or
rxp_cg_newframe
==
1
)
;
coverpoint
txp_cg_size
iff
(
txp_cg_newframe
==
1
)
{
bins
pkt_sizes
[
1440
]
=
{
[
60
:
1500
]
};
}
coverpoint
rxp_cg_size
iff
(
rxp_cg_newframe
==
1
)
{
bins
pkt_sizes
[
1440
]
=
{
[
60
:
1500
]
};
}
endgroup
cg
cover_group
=
new
;
reg
clk_sys
=
1'b0
;
reg
rst_n
=
1'b0
;
...
...
@@ -176,6 +191,7 @@ module main;
// 1st process, Minic operations, sending and receiving frames
forever
begin
minic
.
run
()
;
txp_cg_newframe
=
0
;
// TEST_RX Minic: receive frame
if
(
`TEST_RX
&&
minic
.
poll
())
begin
...
...
@@ -205,7 +221,11 @@ module main;
minic
.
send
(
tx_pkt
)
;
tx_frames
.
push_back
(
tx_pkt
)
;
txp_minic_frames
+=
1
;
txp_cg_newframe
=
1
;
txp_cg_size
=
tx_pkt
.
size
;
end
else
txp_cg_newframe
=
0
;
#
1
;
end
...
...
@@ -232,15 +252,18 @@ module main;
// 3rd: Send frames to Minic
if
(
`TEST_RX
)
begin
#
40
ns
;
rxp_cg_newframe
=
1
;
for
(
i
=
0
;
i
<
`NFRAMES
;
i
++
)
begin
rx_pkt
=
gen_rx
.
gen
()
;
rx_pkt
.
payload
[
0
]
=
i
&
'hff
;
rx_pkt
.
payload
[
1
]
=
(
i
&
'hff00
)
>>
8
;
rxp_cg_size
=
rx_pkt
.
size
;
wrf_src
.
send
(
rx_pkt
)
;
rx_frames
.
push_back
(
rx_pkt
)
;
rxp_src_frames
+=
1
;
#
45u
s
;
end
rxp_cg_newframe
=
0
;
end
join
...
...
testbench/wr_minic/run_ci.do
View file @
b18df73e
...
...
@@ -6,4 +6,5 @@ set NumericStdNoWarnings 1
do wave.do
run 200ms
#runStatus -full
coverage save coverage.ucdb
quit -code [coverage attribute -name TESTSTATUS -concise]
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