Commit 47c50607 authored by Jan Pospisil's avatar Jan Pospisil

make channel random in pulse generation tests

parent 587ad118
......@@ -48,11 +48,15 @@ package FfpgFmcPackage;
class FfpgFmcPulseTransaction extends uvm_sequence_item;
`uvm_object_utils(FfpgFmcPulseTransaction)
int Channel;
int BunchCount;
rand int Channel;
rand int StartBunch;
rand int StopBunch;
constraint ChannelConstraint {
Channel inside {[1:2]};
}
constraint StartBunchConstrain {
StartBunch >= 0;
StartBunch < BunchCount;
......
......@@ -565,13 +565,8 @@ package TestbenchPackage;
uvm_analysis_port #(FfpgFmcPulseTransaction) GenerationPort;
int TriggerLatency;
int TriggerPeriodicity;
rand int Channel;
rand int RepeatCount;
constraint ChannelConstraint {
Channel inside {[1:2]};
}
constraint CountConstraint {
RepeatCount inside {[1:20]};
}
......@@ -581,7 +576,7 @@ package TestbenchPackage;
endfunction
function string convert2string;
return $sformatf("Generating %0d pulses on channel %0d.", this.RepeatCount, this.Channel);
return $sformatf("Generating %0d pulses.", this.RepeatCount);
endfunction
task body;
......@@ -589,15 +584,16 @@ package TestbenchPackage;
SeqSetChannel SeqSet;
SeqStartChannel SeqStart;
SeqGenerateBeamSignals SeqGenerate;
int Channel;
int OverflowInWords;
int SetDataOffset, ResDataOffset;
int SetDataMask, ResDataMask;
repeat (RepeatCount) begin
PulseTx = FfpgFmcPulseTransaction::type_id::create("PulseTx");
PulseTx.Channel = this.Channel;
PulseTx.BunchCount = this.TriggerPeriodicity;
assert(PulseTx.randomize());
Channel = PulseTx.Channel;
GenerationPort.write(PulseTx);
// configure channel
......@@ -605,7 +601,7 @@ package TestbenchPackage;
SeqSet.TriggerLatency = this.TriggerLatency;
SeqSet.TriggerPeriodicity = this.TriggerPeriodicity;
assert(SeqSet.randomize() with {Overflow == TriggerPeriodicity;});
SeqSet.Channel = this.Channel;
SeqSet.Channel = Channel;
OverflowInWords = SeqSet.getOverflowInWords();
// clear Set and Res data
for (int i = 0; i < OverflowInWords; i++) begin
......@@ -624,7 +620,7 @@ package TestbenchPackage;
// start channel
SeqStart = SeqStartChannel::type_id::create("SeqStart");
assert(SeqStart.randomize());
SeqStart.Channel = this.Channel;
SeqStart.Channel = Channel;
SeqStart.start(WbSequencer, this);
// generate FMC input signals
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment