mirror of
https://github.com/verilator/verilator.git
synced 2025-05-04 14:36:55 +00:00
Configure time unit/time precision in the Sym constructor.
This used to be done in the constructor of the top module, but there is no reason to do it there. Internals are cleaner with this in the Sym constructor. No functional change intended.
This commit is contained in:
parent
19398efc4c
commit
f064a94f1d
@ -2549,14 +2549,6 @@ void EmitCImp::emitConfigureImp(AstNodeModule* modp) {
|
||||
if (v3Global.opt.coverage()) {
|
||||
puts(modName + "__" + protect("_configure_coverage") + "(this, first);\n");
|
||||
}
|
||||
if (modp->isTop() && !v3Global.rootp()->timeunit().isNone()) {
|
||||
puts("vlSymsp->_vm_contextp__->timeunit("
|
||||
+ cvtToStr(v3Global.rootp()->timeunit().powerOfTen()) + ");\n");
|
||||
}
|
||||
if (modp->isTop() && !v3Global.rootp()->timeprecision().isNone()) {
|
||||
puts("vlSymsp->_vm_contextp__->timeprecision("
|
||||
+ cvtToStr(v3Global.rootp()->timeprecision().powerOfTen()) + ");\n");
|
||||
}
|
||||
puts("}\n");
|
||||
splitSizeInc(10);
|
||||
}
|
||||
|
@ -704,6 +704,18 @@ void EmitCSyms::emitSymImp() {
|
||||
}
|
||||
}
|
||||
|
||||
puts("// Configure time unit / time precision\n");
|
||||
if (!v3Global.rootp()->timeunit().isNone()) {
|
||||
puts("_vm_contextp__->timeunit(");
|
||||
puts(cvtToStr(v3Global.rootp()->timeunit().powerOfTen()));
|
||||
puts(");\n");
|
||||
}
|
||||
if (!v3Global.rootp()->timeprecision().isNone()) {
|
||||
puts("_vm_contextp__->timeprecision(");
|
||||
puts(cvtToStr(v3Global.rootp()->timeprecision().powerOfTen()));
|
||||
puts(");\n");
|
||||
}
|
||||
|
||||
puts("// Setup each module's pointer back to symbol table (for public functions)\n");
|
||||
puts("TOPp->" + protect("__Vconfigure") + "(this, true);\n");
|
||||
for (const auto& i : m_scopes) {
|
||||
|
Loading…
Reference in New Issue
Block a user