Test Case
In this test case, the top-level module named top instantiates a module named test twice with the instance names test_inst and test_inst1. This source file also has a substitute module named test_sbst as shown in the following code:
// basic.v
module test(input bit bm,logic lm,output bit bto,logic lto);
endmodule
module top();
bit bt,bto,bt1;
logic lt,lto,lt1;
test test_inst( .bm(bt),.lm(lt),.bto(bto),.lto(lto));
test test_inst1( .bm(bt1),.lm(lt1),.bto(bto1),.lto(lto1));
endmodule
module test_sbst(input bit bm,logic lm,
output bit bto,logic lto);
endmodule
Figure 23-2 Test Case
The compile-time configuration file lists the modules whose instances you might replace along with their corresponding substitute modules.
In this test case, the compile-time configuration file is named as config.txt:
//config.txt
replace module {test} with module {test_sbst};
This configuration file specifies the possible replacement of an instance of module test with an instance of module test_sbst.
The compile-time command-line is as follows:
% vcs basic.v +optconfigfile+config.txt
VCS MX displays the following information message from dynamic reconfiguration:
DYNAMIC RECONFIG> Replacing test With test_sbst Enabled
You have enabled replacing instances of module test with instances of module test_sbst at runtime.
So at runtime, you must first write another configuration file specifying, by hierarchical name, the module instances you want to replace. In this test case, the configuration file is named as runconfig.txt:
//runconfig.txt
top.test_inst
This configuration file specifies that you want the module instance with the hierarchical name top.test_inst to be replaced. The other instance of module test, with the hierarchical name top.test_inst1, is not replaced.
Figure 23-3 Diagram of the Dynamically Reconfigured Test Case
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 the simulation, VCS MX displays the following information message:
DYNAMIC RECONFIG: Instance top.test_inst is replaced with module (test_sbst)
Comments
Post a Comment