Esempio n. 1
0
    def __init__(self, circuit, direct=False, executable=None):
        ## If circuit is a string, assume it's a netlist and create a circuit
        if type(circuit) == types.StringType:
            circuit = Circuit(circuit)

        super(Simulation, self).__init__(circuit)

        if direct:
            self.session = GnucapSessionDirect()
        else:
            self.session = GnucapSessionPexpect(executable)

        if circuit is not None and not isinstance(circuit, Circuit):
            raise ValueError('Circuit instance must be a %s instance' %
                             str(Circuit))

        if circuit is not None:
            self.update_netlist()