Skip to content

Instantly share code, notes, and snippets.

@mithro
Created May 9, 2018 21:30
Show Gist options
  • Save mithro/d83777b61a881f326b402d9206974bce to your computer and use it in GitHub Desktop.
Save mithro/d83777b61a881f326b402d9206974bce to your computer and use it in GitHub Desktop.
class SwitchType(enum.Enum):
mux = "mux"
tristate = "tristate"
pass_gate = "pass_gate"
short = "short"
buffer = "buffer"
@property
def isolating(self):
"""If switch type is isolating.
Isolating switches include a buffer which partition their input and
output into separate DC-connected sub-circuits.
Non-isolating switch do not isolate their input and output, which can
increase RC wire delays.
"""
return self in (self.mux, self.tristate, self.buffer)
@property
def configurable(self):
"""If a switch type is configurable.
Configurable switches can be turned on/off at configuration time.
Non-configurable switches can not be controlled at configuration time.
These are typically used to model non-optional connections such as
electrical shorts and in-line buffers.
"""
return self in (self.mux, self.tristate, self.pass_gate)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment