Modify and save database after simulation #783
-
I want to convert the I have inserted an additional step after VCS's However, when I use How can I make my changes permanent or is there a better way? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
If I'm not mistaken, I think you're using Hammer within Chipyard. A couple answers:
|
Beta Was this translation helpful? Give feedback.
-
I tried all the combinations :)
I think it is due to my flow. Maybe it was also just an artifact of me testing the method repeatedly. In any case, the current workaround is good enough for now. For completeness, I put the code here if anybody experiences the same problem: import pathlib
def vpd2vcd_gz(x: HammerTool) -> bool:
try:
waveforms = x.get_setting("sim.outputs.waveforms")
except KeyError:
return True
for waveform in waveforms:
waveform = pathlib.Path(waveform)
if waveform.suffix == '.vpd' and waveform.exists():
vcd = waveform.with_suffix('.vcd')
subprocess.run(['vcsplit', '-o', vcd, '-scope', x.get_setting('sim.inputs.tb_dut'), '-full64', waveform])
subprocess.run(['gzip', vcd])
waveform.unlink()
return True
def vpd2vcd_path_fixes(x: HammerTool) -> bool:
x.waveforms = [waveform.removesuffix('vpd') + ('vcd.gz') for waveform in x.waveforms]
return True
class ExampleDriver(CLIDriver):
def get_extra_sim_hooks(self) -> List[HammerToolHookAction]:
extra_hooks = [
HammerTool.make_post_insertion_hook("run_simulation", vpd2vcd_gz),
]
return extra_hooks
def get_extra_power_hooks(self) -> List[HammerToolHookAction]:
extra_hooks = [
HammerTool.make_pre_insertion_hook("init_technology", vpd2vcd_path_fixes),
]
return extra_hooks If you are using Chipyard, merge the code with the existing example-vlsi. |
Beta Was this translation helpful? Give feedback.
I tried all the combinations :)
I think it is due to my flow. Maybe it was also just an artifact of me testing the method repeatedly. In any case, the current workaround is good enough for now.
For completeness, I put the code here if anybody experiences the same problem: