sv_lab/1_hierarchy/testbench.sv
2024-12-02 14:34:53 +08:00

51 lines
1.2 KiB
Systemverilog

//===========================================================================
// Organization : Individual Developer
// Filename : testbench.sv
// Author : Feng Bohan
// Create Time : 16:44:54 2024-11-29
// Last Modified: 17:04:34 2024-11-29
// Abstract :
//--------------------------------------------------------------------------
// Description:
//
//--------------------------------------------------------------------------
// Modification History:
//--------------------------------------------------------------------------
// Rev Date Who Description
// --- ---- --- -----------
// 0.0.01 2024-11-29 Feng Bohan initial version
//===========================================================================
module B;
initial begin
$display("A.data = %0d", A.data);
end
endmodule
module A #(
parameter DATA = 0
)();
reg [31:0] data = DATA;
B b();
endmodule
module testbench;
A #(
.DATA(1)
)a1();
A #(
.DATA(2)
)a2();
A #(
.DATA(3)
)a3();
initial begin
$display("testbench.a1.data = %0d", testbench.a1.data);
$display("a1.data = %0d", a1.data);
end
endmodule