|
|
@@ -160,6 +160,7 @@ module motor_engine_tb;
|
|
|
endtask
|
|
|
|
|
|
task ctl(input [2:0] op, input [15:0] mask, input [7:0] flags, input [31:0] value);
|
|
|
+ integer control_axis;
|
|
|
begin
|
|
|
@(negedge clk);
|
|
|
ctl_op = op; ctl_axis_mask = mask; ctl_flags = flags; ctl_value = value;
|
|
|
@@ -168,6 +169,9 @@ module motor_engine_tb;
|
|
|
ctl_valid = 1'b0;
|
|
|
wait (ctl_accept);
|
|
|
@(negedge clk);
|
|
|
+ if(op==4 && ctl_status==0)for(control_axis=0;control_axis<3;control_axis=control_axis+1)
|
|
|
+ if(mask[control_axis] && dut.u_axes.r_position[control_axis]!==value)
|
|
|
+ $fatal(1,"SET_POSITION acknowledged before consuming the shared value");
|
|
|
end
|
|
|
endtask
|
|
|
|