Ejemplo n.º 1
0
    def __init__(self, file_path):
        DataFile.__init__(self, file_path)
        self.hspo = HSPICEOutput(self.file_path, True)

        # build hierarcical signal list
        self.circuit = Circuit(self.hspo.title, self)
        indep_name = self.hspo.signalnames[0]
        indep_type = self.hspo.get_signal_type(0)
        indep_signal = Signal(indep_name, indep_name, None, indep_type)
        indep_signal._set_parent(self.circuit)
        for i in range(len(self.hspo.get_signal_names()[1:])):
            signal_name = self.hspo.get_signal_name(i+1)
            signal_type = types[self.hspo.get_signal_type(i+1)]
            currentSubckt = self.circuit
            if signal_type == type.V:
                node_name = signal_name[2:-1]
                levels = node_name.split(".")
                if len(levels) > 1:
                    for level in levels[:-1]:
                        try:
                            currentSubckt = currentSubckt[level]
                        except:
                            newSubckt = Subcircuit(level)
                            currentSubckt.add_subcircuit(newSubckt)
                            currentSubckt = newSubckt
                signal = Signal("v(" + levels[-1] + ")", signal_name, indep_signal, signal_type)
            else:
                signal = Signal(signal_name, signal_name, indep_signal, signal_type)
            currentSubckt.add_signal(signal)
Ejemplo n.º 2
0
    def __init__(self, file_path):
        DataFile.__init__(self, file_path)
        dir, file = os.path.split(file_path)
        self.name = dir.split(os.sep)[-1]
        self.prs = PSFResultSet(dir)
        self.rootItem = None

        # build hierarchical signal list
        self.circuit = Circuit(self.name, self)
        self.circuit._sweep_set = SweepSet([])
        self.circuit._sweep_set.add_point([])
        for key in self.prs.keys():
            currentSubckt = Subcircuit(key)
            self.circuit.add_subcircuit(currentSubckt)
            result = self.prs[key]
            top_circuit = currentSubckt
            for name in result.keys():
                currentSubckt = top_circuit
                levels = str(name).split(".")
                if len(levels) > 1:
                    for level in levels[:-1]:
                        try:
                            currentSubckt = currentSubckt[level]
                        except:
                            newSubckt = Subcircuit(level)
                            currentSubckt.add_subcircuit(newSubckt)
                            currentSubckt = newSubckt
                signal_full_name = str(key) + "___" + str(name)
                try:
                    indep_type = types['unknown']
                except KeyError:
                    indep_type = type.default
                indep_name = 'unknown'
                indep_full_name = signal_full_name + "____XValues"
                indep_signal = Signal(indep_name, indep_full_name, None, indep_type)
                indep_signal._set_parent(self.circuit)
                
                try:
                    signal_type = types['unknown']
                except KeyError:
                    signal_type = type.default
                signal = Signal(levels[-1], signal_full_name, indep_signal, signal_type)
                indep_signal._data_source_info['values'] = signal
                signal._data_source_info['set'] = key
                currentSubckt.add_signal(signal)
Ejemplo n.º 3
0
    def __init__(self, file_path):
        DataFile.__init__(self, file_path)
        self._citi = citi.read(self.file_path, True)
        self.rootItem = None

        # build hierarchical signal list
        self.circuit = Circuit("CITI", self)
        indep_name = "frequency"
        indep_type = signaltype.f
        indep_signal = Signal(indep_name, indep_name, None, indep_type)
        indep_signal._set_parent(self.circuit)
        for i in range(self._citi.ports):
            for j in range(self._citi.ports):
                signal_name = "S(%d,%d)" % (i + 1, j + 1)
                signal_type = signaltype.Spar
                signal = Signal(signal_name, signal_name, indep_signal, signal_type)
                signal._data_source_info['port1'] = i + 1
                signal._data_source_info['port2'] = j + 1
                self.circuit.add_signal(signal)
Ejemplo n.º 4
0
    def __init__(self, file_path):
        DataFile.__init__(self, file_path)
        self._touchstone = touchstone.read(self.file_path, True)
        self.rootItem = None

        # build hierarchical signal list
        self.circuit = Circuit("Touchstone", self)
        indep_name = "frequency"
        indep_type = signaltype.f
        indep_signal = Signal(indep_name, indep_name, None, indep_type)
        indep_signal._set_parent(self.circuit)
        for i in range(self._touchstone.ports):
            for j in range(self._touchstone.ports):
                signal_name = "S(%d,%d)" % (i + 1, j + 1)
                signal_type = signaltype.Spar
                signal = Signal(signal_name, signal_name, indep_signal,
                                signal_type)
                signal._data_source_info['port1'] = i + 1
                signal._data_source_info['port2'] = j + 1
                self.circuit.add_signal(signal)