Test Case
In this test case, the top-level module named top instantiates a module named test with the instance names inst_test and a module another module named dut with the instance name inst_dut. The module dut which instantiates twice a module named pe_main with the instance names inst_pe_main1 and inst_pe_man2. This source file also has a substitute module named pe_sub as shown in the following code:
//basic.v
module pe_main;
bit b;
logic l;
endmodule
module dut;
pe_main inst_pe_main1();
pe_main inst_pe_main2();
bit out;
endmodule
module top;
dut inst_dut();
test inst_test();
endmodule
module test;
initial begin
#10 top.inst_dut.inst_pe_main1.b=1'b1;
#10 top.inst_dut.inst_pe_main2.l=1'b1;
#100 $finish();
end
endmodule
module pe_sub;
endmodule
In this test case, the compile-time configuration file is named config.txt:
//config.txt
replace module {pe_main} with module {pe_sub};
This configuration file specifies the possible replacement of an instance of module pe_main with an instance of module pe_sub.
The compile-time command lines are as follows:
% vlogan –sverilog basic.v –work lib1
% vcs –genip lib1.dut -allxmrs +optconfigfile+config.txt
% vcs –integ lib1.top -allxmrs +optconfigfile+config.txt
VCS MX displays the following information message from dynamic reconfiguration:
DYNAMIC RECONFIG> Replacing tpe_main With pe_sub Enabled
At runtime, write another configuration file by specifying the hierarchical name and the module instances that you want to replace. In this test case, the configuration file is named runconfig.txtas shown:
//runconfig.txt
top.inst_dut.inst_pe_main2
This configuration file specifies that you want the module instance with the hierarchical name to be top.inst_dut.inst_pe_main2 replaced. The other instance of module pe_main, with the hierarchical name top.inst_dut.inst_pe_main1 is not replaced.
The runtime command line for this dynamic reconfiguration is as follows:
% simv -dynaconfig runconfig.txt
Before simulation, VCS MX replaces this instance with an instance of the substitute module specified in the compile-time configuration file, an instance of module test_sbst.
Also, before simulation VCS MX displays the following information message:
DYNAMIC RECONFIG: Instance top.inst_dut.inst_pe_main2 is replaced with module (pe_sub)
Comments
Post a Comment