Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 2cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
FMC DEL 1ns 2cha
Commits
1f9e5784
Commit
1f9e5784
authored
Jul 25, 2016
by
Jan Pospisil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reporting improved
parent
ab21bab9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
10 deletions
+41
-10
.gitignore
.gitignore
+1
-0
FfpgFmcPackage.sv
hdl/ffpg/sim/testbench/FfpgFmcPackage.sv
+5
-3
TestbenchPackage.sv
hdl/ffpg/sim/testbench/TestbenchPackage.sv
+35
-7
No files found.
.gitignore
View file @
1f9e5784
...
...
@@ -10,3 +10,4 @@
/hdl/ffpg/sim/testbench/uvm.log
/hdl/ffpg/sim/testbench/vsim.wlf
/hdl/ffpg/sim/testbench/wlf*
/hdl/ffpg/sim/testbench/*.vstf
hdl/ffpg/sim/testbench/FfpgFmcPackage.sv
View file @
1f9e5784
...
...
@@ -31,10 +31,11 @@ package FfpgFmcPackage;
constraint
ClockPeriodConstrain
{
ClockPeriod
inside
{
[
2
:
200
]
};
ClockPeriod
%
2
==
0
;
}
constraint
TriggerPeriodicityConstrain
{
TriggerPeriodicity
inside
{
[
10
:
5
0
]
};
TriggerPeriodicity
inside
{
[
10
:
100
0
]
};
}
constraint
TriggerPhaseConstrain
{
...
...
@@ -42,7 +43,7 @@ package FfpgFmcPackage;
}
constraint
CyclesConstraint
{
Cycles
inside
{
[
20
:
10
0
]
};
Cycles
inside
{
[
20
:
7
0
]
};
}
function
new
(
string
name
=
""
)
;
...
...
@@ -51,7 +52,7 @@ package FfpgFmcPackage;
function
string
convert2string
;
return
$
sformatf
(
"Clock period: %
d ns (%f MHz), Trigger periodicity: %d cycles, Trigger phase: %
d ns"
,
"Clock period: %
0d ns (%.3f MHz), Trigger periodicity: %0d cycles, Trigger phase: %0
d ns"
,
this
.
ClockPeriod
,
1000.0
/
this
.
ClockPeriod
,
this
.
TriggerPeriodicity
,
this
.
TriggerPhase
)
;
endfunction
...
...
@@ -130,6 +131,7 @@ package FfpgFmcPackage;
int
Bunch
;
seq_item_port
.
get_next_item
(
tx
)
;
`uvm_info
(
"FMCGEN"
,
$
sformatf
(
"Parameters of the generated sequence: %s"
,
tx
.
convert2string
())
,
UVM_NONE
)
;
if
(
tx
.
Cycles
>
0
)
phase
.
raise_objection
(
this
)
;
if
(
tx
.
ClockPeriod
%
2
)
...
...
hdl/ffpg/sim/testbench/TestbenchPackage.sv
View file @
1f9e5784
...
...
@@ -21,9 +21,9 @@ package TestbenchPackage;
endfunction
function
void
write
(
T
t
)
;
`uvm_info
(
"UNISUBS"
,
$
sformatf
(
"Transaction
\"
%s
\"
receiv
ed: %s"
,
t
.
get_type_name
()
,
t
.
convert2string
())
,
UVM_NONE
)
;
`uvm_info
(
"UNISUBS"
,
$
sformatf
(
"Transaction
\"
%s
\"
process
ed: %s"
,
t
.
get_type_name
()
,
t
.
convert2string
())
,
UVM_NONE
)
;
endfunction
endclass
// adopted from https://verificationacademy.com/cookbook/scoreboards
...
...
@@ -179,8 +179,20 @@ package TestbenchPackage;
endfunction
endclass
class
ReportingSequence
#(
type
T
)
extends
uvm_sequence
#(
T
)
;
function
new
(
string
name
)
;
super
.
new
(
name
)
;
endfunction
virtual
task
pre_body
()
;
`uvm_info
(
"REPSEQ"
,
$
sformatf
(
"Sequence
\"
%s
\"
is being processed: %s"
,
this
.
get_type_name
()
,
this
.
convert2string
())
,
UVM_NONE
)
;
endtask
endclass
class
SeqSetDac
extends
uvm_s
equence
#(
td_wb_tx
)
;
class
SeqSetDac
extends
ReportingS
equence
#(
td_wb_tx
)
;
`uvm_object_utils
(
SeqSetDac
)
rand
int
VoltageRegister
;
...
...
@@ -241,7 +253,7 @@ package TestbenchPackage;
endclass
class
SeqSetDelay
extends
uvm_s
equence
#(
td_wb_tx
)
;
class
SeqSetDelay
extends
ReportingS
equence
#(
td_wb_tx
)
;
`uvm_object_utils
(
SeqSetDelay
)
typedef
enum
{
CH1_SET
,
CH1_RESET
,
CH2_SET
,
CH2_RESET
}
t_Output
;
...
...
@@ -258,6 +270,10 @@ package TestbenchPackage;
super
.
new
(
name
)
;
endfunction
function
string
convert2string
;
return
$
sformatf
(
"Setting of delay for output %0d: delay = %0d (0x%H), repeat count = %0d."
,
this
.
ActiveOutput
,
this
.
Delay
,
this
.
Delay
,
this
.
RepeatCount
)
;
endfunction
task
body
;
td_wb_tx
tx
;
bit
busy
=
0
;
...
...
@@ -306,7 +322,7 @@ package TestbenchPackage;
endclass
class
SeqSetChannel
extends
uvm_s
equence
#(
td_wb_tx
)
;
class
SeqSetChannel
extends
ReportingS
equence
#(
td_wb_tx
)
;
`uvm_object_utils
(
SeqSetChannel
)
rand
int
Channel
;
...
...
@@ -332,6 +348,10 @@ package TestbenchPackage;
super
.
new
(
name
)
;
endfunction
function
string
convert2string
;
return
$
sformatf
(
"Setting for channel %0d: overflow = %0d (0x%H), trigger latency = %0d (0x%H)."
,
this
.
Channel
,
this
.
Overflow
,
this
.
Overflow
,
this
.
TriggerLatency
,
this
.
TriggerLatency
)
;
endfunction
task
body
;
td_wb_tx
tx
;
int
SetMemBaseAddress
=
(
Channel
==
1
)
?
`GET_WB_WORD_ADDR
(
`BASE_FFPG_CH1_SET_MEM
)
:
`GET_WB_WORD_ADDR
(
`BASE_FFPG_CH2_SET_MEM
)
;
...
...
@@ -386,7 +406,7 @@ package TestbenchPackage;
endclass
class
SeqStartChannel
extends
uvm_s
equence
#(
td_wb_tx
)
;
class
SeqStartChannel
extends
ReportingS
equence
#(
td_wb_tx
)
;
`uvm_object_utils
(
SeqStartChannel
)
rand
int
Channel
;
...
...
@@ -399,6 +419,10 @@ package TestbenchPackage;
super
.
new
(
name
)
;
endfunction
function
string
convert2string
;
return
$
sformatf
(
"Starting channel %0d."
,
this
.
Channel
)
;
endfunction
task
body
;
td_wb_tx
tx
;
int
Position
=
(
Channel
==
1
)
?
`FFPG_CONTROL_CH1_MODE_OFFSET
:
`FFPG_CONTROL_CH2_MODE_OFFSET
;
...
...
@@ -415,13 +439,17 @@ package TestbenchPackage;
endclass
class
SeqGenerateBeamSignals
extends
uvm_s
equence
#(
FfpgFmcDriverTransaction
)
;
class
SeqGenerateBeamSignals
extends
ReportingS
equence
#(
FfpgFmcDriverTransaction
)
;
`uvm_object_utils
(
SeqGenerateBeamSignals
)
function
new
(
string
name
=
""
)
;
super
.
new
(
name
)
;
endfunction
function
string
convert2string
;
return
"Beam signal is being generated."
;
endfunction
task
body
;
FfpgFmcDriverTransaction
tx
;
...
...
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