Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
printemps
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MINOTAuR
printemps
Commits
0e066983
Commit
0e066983
authored
4 years ago
by
Nils Wistoff
Committed by
Florian Zaruba
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
tb_read/writeport: add set and constant seq modes
Signed-off-by:
Nils Wistoff
<
nwistoff@iis.ee.ethz.ch
>
parent
2b760a26
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tb/common/tb_dcache_pkg.sv
+1
-1
1 addition, 1 deletion
tb/common/tb_dcache_pkg.sv
tb/common/tb_readport.sv
+34
-0
34 additions, 0 deletions
tb/common/tb_readport.sv
tb/common/tb_writeport.sv
+31
-0
31 additions, 0 deletions
tb/common/tb_writeport.sv
with
66 additions
and
1 deletion
tb/common/tb_dcache_pkg.sv
+
1
−
1
View file @
0e066983
...
...
@@ -36,7 +36,7 @@ package tb_pkg;
parameter
ERROR_CNT_STOP_LEVEL
=
1
;
// use 1 for debugging. 0 runs the complete simulation...
// tb_readport sequences
typedef
enum
logic
[
2
:
0
]
{
RANDOM_SEQ
,
LINEAR_SEQ
,
BURST_SEQ
,
IDLE_SEQ
,
WRAP_SEQ
}
seq_t
;
typedef
enum
logic
[
2
:
0
]
{
RANDOM_SEQ
,
LINEAR_SEQ
,
BURST_SEQ
,
IDLE_SEQ
,
WRAP_SEQ
,
SET_SEQ
,
CONST_SEQ
}
seq_t
;
///////////////////////////////////////////////////////////////////////////////
// progress
...
...
This diff is collapsed.
Click to expand it.
tb/common/tb_readport.sv
+
34
−
0
View file @
0e066983
...
...
@@ -218,6 +218,33 @@ program tb_readport import tb_pkg::*; import ariane_pkg::*; #(
dut_req_port_o
.
kill_req
=
'0
;
endtask
:
genSeqRead
// Generate a sequence of reads to the same set (constant index)
task
automatic
genSetSeqRead
();
automatic
logic
[
63
:
0
]
val
,
rnd
;
paddr
=
CachedAddrBeg
+
2
**
DCACHE_INDEX_WIDTH
;
dut_req_port_o
.
data_req
=
'0
;
dut_req_port_o
.
data_size
=
'0
;
dut_req_port_o
.
kill_req
=
'0
;
val
=
CachedAddrBeg
+
2
**
DCACHE_INDEX_WIDTH
;
while
(
~
seq_end_req
)
begin
void
'
(
randomize
(
rnd
)
with
{
rnd
>
0
;
rnd
<=
100
;
}
);
if
(
rnd
<
req_rate_i
)
begin
dut_req_port_o
.
data_req
=
1'b1
;
dut_req_port_o
.
data_size
=
2'b11
;
paddr
=
val
;
// generate linear read
`APPL_WAIT_COMB_SIG
(
clk_i
,
dut_req_port_i
.
data_gnt
)
// increment by set size
val
=
(
val
+
2
**
DCACHE_INDEX_WIDTH
)
%
(
MemWords
<<
3
);
end
`APPL_WAIT_CYC
(
clk_i
,
1
)
dut_req_port_o
.
data_req
=
'0
;
end
dut_req_port_o
.
data_req
=
'0
;
dut_req_port_o
.
data_size
=
'0
;
dut_req_port_o
.
kill_req
=
'0
;
endtask
:
genSetSeqRead
task
automatic
genWrapSeq
();
automatic
logic
[
63
:
0
]
val
;
paddr
=
CachedAddrBeg
;
...
...
@@ -278,6 +305,10 @@ program tb_readport import tb_pkg::*; import ariane_pkg::*; #(
$
display
(
"%s> start linear sequence with %04d responses and req_rate %03d"
,
PortName
,
seq_num_resp_i
,
req_rate_i
);
genSeqRead
();
end
SET_SEQ:
begin
$
display
(
"%s> start set sequence with %04d responses and req_rate %03d"
,
PortName
,
seq_num_resp_i
,
req_rate_i
);
genSetSeqRead
();
end
WRAP_SEQ:
begin
$
display
(
"%s> start wrapping sequence with %04d responses and req_rate %03d"
,
PortName
,
seq_num_resp_i
,
req_rate_i
);
genWrapSeq
();
...
...
@@ -288,6 +319,9 @@ program tb_readport import tb_pkg::*; import ariane_pkg::*; #(
BURST_SEQ:
begin
$
fatal
(
1
,
"Burst sequence not implemented for read port agent"
);
end
CONST_SEQ:
begin
$
fatal
(
1
,
"Constant sequence not implemented for read port agent."
);
end
endcase
// seq_type_i
seq_end_ack
=
1'b1
;
$
display
(
"%s> stop sequence"
,
PortName
);
...
...
This diff is collapsed.
Click to expand it.
tb/common/tb_writeport.sv
+
31
−
0
View file @
0e066983
...
...
@@ -149,6 +149,30 @@ program tb_writeport import tb_pkg::*; import ariane_pkg::*; #(
dut_req_port_o
.
data_wdata
=
'x
;
endtask
:
genSeqWrite
// Repeadedly write to the same address
task
automatic
genConstWrite
();
automatic
logic
[
63
:
0
]
val
;
paddr
=
CachedAddrBeg
;
dut_req_port_o
.
data_req
=
'0
;
dut_req_port_o
.
data_size
=
'0
;
dut_req_port_o
.
data_be
=
'0
;
dut_req_port_o
.
data_wdata
=
'x
;
repeat
(
seq_num_vect_i
)
begin
void
'
(
randomize
(
val
));
dut_req_port_o
.
data_req
=
1'b1
;
dut_req_port_o
.
data_size
=
2'b11
;
dut_req_port_o
.
data_be
=
'1
;
dut_req_port_o
.
data_wdata
=
val
;
`APPL_WAIT_COMB_SIG
(
clk_i
,
dut_req_port_i
.
data_gnt
)
`APPL_WAIT_CYC
(
clk_i
,
1
)
end
paddr
=
'0
;
dut_req_port_o
.
data_req
=
'0
;
dut_req_port_o
.
data_size
=
'0
;
dut_req_port_o
.
data_be
=
'0
;
dut_req_port_o
.
data_wdata
=
'x
;
endtask
:
genConstWrite
task
automatic
genWrapSeq
();
automatic
logic
[
63
:
0
]
val
;
void
'
($
urandom
(
RndSeed
));
...
...
@@ -258,6 +282,10 @@ program tb_writeport import tb_pkg::*; import ariane_pkg::*; #(
$
display
(
"%s> start linear sequence with %04d vectors and req_rate %03d"
,
PortName
,
seq_num_vect_i
,
req_rate_i
);
genSeqWrite
();
end
CONST_SEQ:
begin
$
display
(
"%s> start constant sequence with %04d vectors and req_rate %03d"
,
PortName
,
seq_num_vect_i
,
req_rate_i
);
genConstWrite
();
end
WRAP_SEQ:
begin
$
display
(
"%s> start wrapping sequence with %04d vectors and req_rate %03d"
,
PortName
,
seq_num_vect_i
,
req_rate_i
);
genWrapSeq
();
...
...
@@ -267,6 +295,9 @@ program tb_writeport import tb_pkg::*; import ariane_pkg::*; #(
$
display
(
"%s> start burst sequence with %04d vectors and req_rate %03d"
,
PortName
,
seq_num_vect_i
,
req_rate_i
);
genSeqBurst
();
end
SET_SEQ:
begin
$
fatal
(
1
,
"Set sequence not implemented for write port agent."
);
end
endcase
// seq_type_i
seq_done_o
=
1'b1
;
$
display
(
"%s> stop sequence"
,
PortName
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment