iam beginner at sv test bench enviroment blocks
here in this piece of code the driver class pass the data to the interface through the virtual interface
my first question , when we need to verify a design should we randomize the valid bit “as it may be a test-case to cover”
my second question , the values of the input signals should be initialized in the generator class or it can be initialized in the driver as follows
driver piece of code :
task drive;
transaction trans;
gen2driv.get(trans);
@(posedge vif.clk);
vif.valid <= 1;
vif.a <= trans.a;
vif.b <= trans.b;
@(posedge vif.clk);
vif.valid <= 0;
trans.c <= vif.c;
@(posedge vif.clk);
trans.display("[ Driver ]");
no_transactions++;
end
endtask