You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We typically enable VCD dumping in the following manner:
model=MyModel( params )
model.vcd_file='filename.vcd'model.elaborate()
iftranslate_verilog:
model=TranslationTool( model )
sim=SimulationTool( model )
sim.cycle()
The above should dump two vcd files post simulation if translate_verilog == True:
filename.vcd: VCD dump from the PyMTL interface wrapper (top-level)
filename.verilator.vcd: VCD dump from Verilator simulation (all levels)
VerilogModels act a bit differently in that they do not need to be passed into the TranslationTool explicitly for simulation (although they can) in order to make them behave more like a normal PyMTL model. This is made possible by invisibly performing translation/verilation as soon as the Model is instantiated using metaclasses.
However, at instantiation time in the above code vcd_file is not defined yet, so the generated verilator code will have VCD dumping disabled.
Even if we try to remedy this situation by calling TranslationTool explicitly, we have already imported the shared library using CFFI and CFFI has an issue where you if you import shared libraries with the same name twice, it will only use the first version it imported.
The workaround is to set vcd_file as a class rather than instance attribute, like so:
MyModel.vcd_file='filename.vcd'# set the class attribute!model=MyModel( params )
model.elaborate()
iftranslate_verilog:
model=TranslationTool( model )
sim=SimulationTool( model )
sim.cycle()
This may not work when using parallel tests.
The text was updated successfully, but these errors were encountered:
We typically enable VCD dumping in the following manner:
The above should dump two vcd files post simulation if translate_verilog == True:
VerilogModels act a bit differently in that they do not need to be passed into the TranslationTool explicitly for simulation (although they can) in order to make them behave more like a normal PyMTL model. This is made possible by invisibly performing translation/verilation as soon as the Model is instantiated using metaclasses.
However, at instantiation time in the above code vcd_file is not defined yet, so the generated verilator code will have VCD dumping disabled.
Even if we try to remedy this situation by calling TranslationTool explicitly, we have already imported the shared library using CFFI and CFFI has an issue where you if you import shared libraries with the same name twice, it will only use the first version it imported.
The workaround is to set vcd_file as a class rather than instance attribute, like so:
This may not work when using parallel tests.
The text was updated successfully, but these errors were encountered: