python/src/netlist.py
def persist(self, file: File) -> None:
        """Writes netlist to new file located via path string."""

        netlist_str = self.base_netlist_file.contents()

        # Update old name to self.cell_name
        old_cell_name = _extract(netlist_str, SUBCIRKT_NAME_REGEX, str)
        new_netlist_str = netlist_str.replace(old_cell_name, self.cell_name)

        lines = new_netlist_str.split("\n")

        current_device = 0
        for i in range(len(lines)):
            device_line = lines[i] + " "
            if len(device_line) == 0 or not device_line[0].isalpha():
                continue

            device_line = _replace(
                regex=WIDTH_REGEX, new=f"W={self.device_widths[current_device]} ", text=device_line
            )
            device_line = _replace(
                regex=LENGTH_REGEX,
                new=f"L={self.device_lengths[current_device]} ",
                text=device_line,
            )
            device_line = _replace(
                regex=FINGERS_REGEX,
                new=f"M={self.device_fingers[current_device]} ",
                text=device_line,
            )

            lines[i] = device_line.rstrip()
            current_device += 1

        file.write("\n".join(lines))
Writes netlist to new file located via path string.
Writes netlist to new file located via path string.
Writes netlist to new file located via path string .
def persist(self, file: File) -> None:
        netlist_str = self.base_netlist_file.contents()
        old_cell_name = _extract(netlist_str, SUBCIRKT_NAME_REGEX, str)
        new_netlist_str = netlist_str.replace(old_cell_name, self.cell_name)
        lines = new_netlist_str.split("\n")
        current_device = 0
        for i in range(len(lines)):
            device_line = lines[i] + " "
            if len(device_line) == 0 or not device_line[0].isalpha():
                continue
            device_line = _replace(
                regex=WIDTH_REGEX, new=f"W={self.device_widths[current_device]} ", text=device_line
            )
            device_line = _replace(
                regex=LENGTH_REGEX,
                new=f"L={self.device_lengths[current_device]} ",
                text=device_line,
            )
            device_line = _replace(
                regex=FINGERS_REGEX,
                new=f"M={self.device_fingers[current_device]} ",
                text=device_line,
            )
            lines[i] = device_line.rstrip()
            current_device += 1
        file.write("\n".join(lines))
def persist ( self , file : File ) -> None : netlist_str = self . base_netlist_file . contents ( ) old_cell_name = _extract ( netlist_str , SUBCIRKT_NAME_REGEX , str ) new_netlist_str = netlist_str . replace ( old_cell_name , self . cell_name ) lines = new_netlist_str . split ( "\n" ) current_device = 0 for i in range ( len ( lines ) ) : device_line = lines [ i ] + " " if len ( device_line ) == 0 or not device_line [ 0 ] . isalpha ( ) : continue device_line = _replace ( regex = WIDTH_REGEX , new = f"W={self.device_widths[current_device]} " , text = device_line ) device_line = _replace ( regex = LENGTH_REGEX , new = f"L={self.device_lengths[current_device]} " , text = device_line , ) device_line = _replace ( regex = FINGERS_REGEX , new = f"M={self.device_fingers[current_device]} " , text = device_line , ) lines [ i ] = device_line . rstrip ( ) current_device += 1 file . write ( "\n" . join ( lines ) )
Writes netlist to new file located via path string.
Writes netlist to new file located via path string .
"""Writes netlist to new file located via path string.""" # Update old name to self.cell_name
self
file
File