sv_lab/0_test/rtl/tb.sv
2025-04-14 16:00:56 +08:00

59 lines
1.6 KiB
Systemverilog

//===========================================================================
// Organization : Individual developer
// Filename : tb.sv
// Author : Feng Bohan
// Create Time : 11:26:47 2025-03-18
// Last Modified: 11:27:17 2025-03-18
// Abstract :
//--------------------------------------------------------------------------
// Description:
//
//--------------------------------------------------------------------------
// Modification History:
//--------------------------------------------------------------------------
// Rev Date Who Description
// --- ---- --- -----------
// 0.0.01 2025-03-18 Feng Bohan initial version
//===========================================================================
module tb;
int a ;
task automatic stable_a( ref int a_ip );
bit change_;
fork
begin
fork
begin:T1
@(a_ip);
change_++;
end
begin:T2
#5ns;
end
join_any
disable fork;
if( !change_ )
$display("T:%0t Input arg. unchanged",$time); // Should observe this for +define+M1
else
$display("T:%0t Input arg. changed",$time); // Should observe this for +define+M2 / +define+M3
end
join
endtask
initial begin
stable_a(a);
end
initial begin
`ifdef M1
#6;
`elsif M2
#4 a = 10;
`elsif M3
#5 a = 20;
`endif
end
endmodule