mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02: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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user