`CedarEDA.configure_logging!`

— Method`configure_logging!(; log_level, log_file)`

Configures the global logger to log anything more severe than `log_level`

, and to also copy the logs into the `log_file`

, if provided. Default `log_level`

is `LogLevel(-1)`

for progress logging.

For more complex or custom usecases, configure the global logger directly. See the Logging and LoggingExtras packages for more details.

`CedarEDA.explore`

— Method`explore(sp::SimParameterization, as::ACSolutionType)`

Display a figure exploring the frequency response results from an `ac!()`

call. If solved across a parameter sweep, sliders allow exploration of the frequency response across different points along the sweep.

`CedarEDA.explore`

— Method`explore(sp::SimParameterization, as::NoiseSolutionType)`

Display a figure exploring the frequency response results from a `noise!()`

call. If solved across a parameter sweep, sliders allow exploration of the frequency response across different points along the sweep.

`CedarEDA.explore`

— Method`explore(sp::SimParameterization, ss::SensitivitySolutionType; with_transient = true)`

Display a figure exploring the sensitivity results from a `sensitivities!()`

call. If `with_transient`

is set to `true`

, also displays the transient solution. If solved across a parameter sweep, sliders allow exploration of the sensitivities across different points along the sweep.

`CedarEDA.explore`

— Method`explore(sp::SimParameterization, ts::TransientSolutionType)`

Display a figure exploring the sensitivity results from a `tran!()`

call. If solved across a parameter sweep, sliders allow exploration of the transients across different points along the sweep.

`CedarEDA.explore`

— Method`explore(sp::SimParameterization)`

`explore(sp)`

with no solution passed in will default to `explore(sp, tran!(sp))`

, see the documentation for the `explore(sp, ::TransientSolutionType)`

method for more details.

`CedarEDA.export_csv`

— Method`export_csv(file::String, sig::AbstractSignal)`

Export a single signal to `.csv`

, saving time values as the first column `t`

, and the amplitude values as the second column `y`

.

`CedarEDA.export_csvs`

— Method`export_csvs(dir::String, sp::SimParameterization)`

Perform transient analysis on the given `SimParameterization`

, then export all saved signals (set via `set_saved_signals!()`

) to `.csv`

, across all parameterization points, into the given output directory.

`CedarEDA.export_csvs`

— Method`export_csvs(dir::String, ss::SolutionSet, probe)`

Given a `SolutionSet`

and `probe`

, export the signal referred to by that `probe`

for all solutions contained within that `SolutionSet`

, naming each individual file based on its index within the `SolutionSet`

.

`CedarEDA.join_syms_split`

— Function`join_syms_split(refs, out_vars, out_obs, (vars_inds, obs_inds))`

Similar to DAECompiler's `join_syms()`

, but instead of copying `out_vars`

and `out_obs`

to a new `Matrix`

, returns a vector of views into those matrices. This can be thought of as a zero-copy version of `join_syms`

, meant to have these vectors inserted into a `SolutionSet`

's internal `reconstruction_caches`

object.

`CedarEDA.optimize`

— Method`optimize(loss, sp, p0; lb, ub, optimizer=LBFG())`

Optimize the circuit over the provided parameters for the given `loss`

, and return an updated SimParameterization with the optimal parameter values.

Information about the success/failure of optimization, convergence conditions, and loss per iteration can be found in the returned OptimizationInfo object.

**Examples**

```
julia> p0 = (c_match = 1.5e-12, l_match = 150e-9); # initial guess
julia> lb = (c_match = 1.0e-12, l_match = 1e-9); # lower-bound
julia> ub = (c_match = 1.0e-9, l_match = 1e-6); # upper-bound
julia> sp, sol_info = CedarEDA.optimize(loss, sp; lb, ub);
julia> sol_info.retcode
```

**Arguments**

`loss::Function`

: The objective function for the optimization. The optimizer will attempt to minimize the (scalar) output of this function.`sp::SimParameterization`

: The SimParameterization for the circuit to be optimized.`p0::NamedTuple`

: An initial guess for the optimal parameter values.`lb::NamedTuple`

: A lower-bound of the region to search for parameter values. Applies component-wise to each parameter.`ub::NamedTuple`

: An upper-bound of the region to search for parameter values. Applies component-wise to each parameter.`optimizer`

: The algorithm to use for optimization (e.g. BFGS, Gradient Descent, CG, etc.). May be any Gradient-Free or Gradient-Required algorithm from Optim.jl.

`CedarEDA.plot_check`

— Method`plot_check(sp, cs)`

Plot a single check along with all of the measures in a particular `sp`

`CedarEDA.sensitivities!`

— Method`sensitivities!(sm::SimManager, sp::SimParameterization)`

Performs Sensitivity analysis upon the specified parameterization. Returns a `SolutionSet`

object of the same shape as the parameterization.

`CedarEDA.set_checks!`

— Method`set_checks!(sp::SimParameterization; tran, dc, ac)`

Set the set of checks that will be applied to the given `SimParameterization`

when `check()`

is called. These checks are visualized within `explore()`

output.

`CedarEDA.set_saved_signals!`

— Method`set_saved_signals!(sp::SimParameterization, saved_signals::Vector{Probe})`

Defines the set of signals that are plotted via `explore()`

or saved to `.csv`

via `export_csvs()`

by default. Signals can always be extracted from `SolutionSet`

objects, this usage is merely a convenience for marking certain signals that will be commonly plotted or exported.

`CedarEDA.value_and_params_gradient`

— Method`value_and_params_gradient(loss, sp)`

Given an arbitary loss function, which likely calls `measure(sp)`

for some measure) compute its value and its gradient with respect to each parameter specified in `sp`

.

`CedarEDA.warmup_problem!`

— Method`warmup_problem!(prob)`

Because we have JITOpaqueClosures sitting around, we need to ensure that the specialization for our problems is properly cached before we start multithreading `solve()`

calls that would all hit the JIT cache.

`CedarSim.ac!`

— Method`ac!(sm::SimManager, sp::SimParameterization, frequencies::Vector{Float64})`

Performs AC analysis upon the specified parameterization, evaluated at the given frequencies. See `acdec`

for one convenient method of selecting frequencies to evaluate at. Returns a `SolutionSet`

object of the same shape as the parameterization.

`CedarSim.dc!`

— Method`dc!(sm::SimManager, sp::SimParameterization)`

Performs DC analysis upon the specified parameterization. Returns a `SolutionSet`

object of the same shape as the parameterization.

`CedarSim.noise!`

— Method`noise!(sm::SimManager, sp::SimParameterization, frequencies::Vector{Float64})`

Performs noise analysis upon the specified parameterization, evaluated at the given frequencies. See `acdec`

for one convenient method of selecting frequencies to evaluate at. Returns a `SolutionSet`

object of the same shape as the parameterization.

`CedarSim.sweepvars`

— Method`sweepvars(sp::SimParameterization)`

Return a `Set{Symbol}`

of the parameters that are swept over in the given `SimParameterization`

object.

`CedarSim.tran!`

— Method`tran!(sm::SimManager, sp::SimParameterization)`

Performs Transient analysis upon the specified parameterization. Returns a `SolutionSet`

object of the same shape as the parameterization.

`CedarEDA.FunctionCheck`

— Type`FunctionCheck(measure, fn)`

A definition of a check to be executed in the future on the `measure`

, applying the `fn`

to the

`CedarEDA.FunctionMeasure`

— Type`FunctionMeasure(probes, callback, measure_name)`

A generic helper type to define a measure as a function of another measure; can take in potentially multiple source measures (typically a `Probe`

or another `FunctionMeasure`

) and invokes the wrapped function upon those probes.

`M`

is the type of the measure that this function returns; e.g. `DxMeasure`

`CedarEDA.ILSSlice`

— Type`ILSSlice`

Helper for tran-like solutions to slice an ILS across a few u indices.

`CedarEDA.OptimizationInfo`

— Type`OptimizationInfo`

A struct to contain the results of a circuit optimization.

Contains two fields:

`history`

: A vector of NamedTuples containing the parameters and loss seen at each iteration.`sol`

: The OptimizationSolution object from Optimization.jl returned from Optimization.jl

`CedarEDA.SimManager`

— Type`SimManager`

Top-level simulation manager; Load your netlist into this object, then create a parameterization from it via `SimParameterization`

. That parameterization can then be used to run various simulations.

`CedarEDA.SimParameterization`

— Type`SimParameterization`

General struct representing the parameterization of a simulation; which parameters are swept over, the tolerance of the simulation, etc... Changing these values will generally require the problem to be re-compiled.

`CedarEDA.SolutionSet`

— Type`SolutionSet`

A structure representing a set of solutions, typically from a `tran!()`

, `sensitivities!()`

, `ac!()`

or `dc!()`

call. Holds outputs in such a way as to make it easy to access probe points across the entire sweep of solves as well as single parameter points.

Different analyses result in `SolutionSet`

objects with different properties:

A

`tran!()`

solution contains`op`

,`tran`

and`parameters`

properties, which hold the DC operating point, transient signal, and simulation parameters, respectively.A [

`dc!()`

])(@ref) solution contains just`op`

and`parameters`

.An

`ac!()`

solution contains`op`

,`ac`

and`parameters`

, where`ac`

holds the frequency response curves.A

`sensitivities!()`

solution contains`op`

,`tran`

,`sensitivities`

and`parameters`

properties, where`sensitivities`

are indexed first by the parameter the sensitivities are calculated with respect to, then the signal to probe for sensitivities.

Example usage:

```
ts = tran!(sp)
# This returns an array of solutions for the `node_vout` probe
ss.tran.node_vout
# Index into it to get a single solution
ss.tran.node_vout[1]
# Transient analysis requires an initial DC operating point,
# which you can obtain via the following:
ss.dc.node_vout[2:5]
# Similarly, we can collect parameters from the solution
ss.parameters.cload[end]
```

`CedarSim.acdec`

— Function`acdec(nd, fstart, fstop)`

Generate a logarithmically spaced frequency vector from `fstart`

to `fstop`

with `nd`

points per decade. Equivalent to the SPICE command:

`.ac dec nd fstart fstop`

Return value is a vector in radians per second.