-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathram_generator.sv
More file actions
30 lines (27 loc) · 943 Bytes
/
Copy pathram_generator.sv
File metadata and controls
30 lines (27 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
`include "defines.sv"
class ram_generator;
//PROPERTIES
//Ram transaction class handle
ram_transaction blueprint;
//Mailbox for generator to driver connection
mailbox #(ram_transaction)mbx_gd;
//METHODS
//Explicitly overriding the constructor to make mailbox connection
//from generator to driver
function new(mailbox #(ram_transaction)mbx_gd);
this.mbx_gd=mbx_gd;
blueprint=new();
endfunction
//Task to generate the random stimuli
task start();
for(int i=0;i<`no_of_trans;i++)
begin
//Randomizing the inputs
blueprint.randomize();
//Putting the randomized inputs to mailbox
mbx_gd.put(blueprint.copy());
$display("GENERATOR Randomized transaction data_in=%d,write_enb=%d,read_enb=%d,address=%d",
blueprint.data_in,blueprint.write_enb,blueprint.read_enb,blueprint.address,$time);
end
endtask
endclass