dan-fritchman / Hdl21

Hardware Description Library
BSD 3-Clause "New" or "Revised" License
69 stars 16 forks source link

Add Signal Save and Save All Support #226

Open curtisma opened 6 months ago

curtisma commented 6 months ago

The Sim.Save command isn't currently implemented but is necessary to select data when simulating. Currently, I'm trying to get it to work with ngspice.

The first spot that needs to be updated: https://github.com/Vlsir/Vlsir/blob/8f866930a09309292e578559c1bb0a1ce63c919f/VlsirTools/vlsirtools/netlist/spice.py#L519

    def write_save(self, save: vsp.Save) -> None:
        txt = f".save v({save.signal})"
        return self.writeln(txt)

However self.signal is just the signal name, but actually needs to be hieratchy path to the signal. Seems this will need to be elaborated to include the hierarchy above the signal. Maybe before creation of the vlsir protocal buffer objects?

.save xtop.vbg for a top-level signal .save xtop.xdut.vbg for a signal inside the dut.

While we're add it we should include the SaveAll save mode which needs to elaborate into .save all.

dan-fritchman commented 6 months ago

That would be a great addition!

First-class support for this will start in Vlsir. Looking through open issues I don't see one for it.

Couple other thoughts: