CedarEDA / CedarSim.jl

Analog Circuit Simulator
Other
12 stars 0 forks source link

CedarSim Logo

🌶 Very SPICE-y

[!WARNING] The public release of Cedar is ongoing. You are welcome to look around, but things will be unstable and various pieces may be missing. If you are not feeling adventurous, please check back in a few weeks.

CedarSim is a modern, high-performance analog circuit simulator written in the Julia programming language.

CedarSim is part of the full Cedar EDA EDA platform. This package contains the implementation and documentation of the simulator component only. If you are an end user, please see https://help.juliahub.com/cedareda/ to get started.

In the current version of CedarSim, you can expect the following features:

However, please note that CedarSim is still early release software. Please be aware of the following limitations (we're actively working on them, they are immuturity constraints, not design restrictions):

License / Contributing

The Cedar EDA platform is dual-licensed under a commercial license and CERN-OHL-S v2. In addition, some packages (including this one) are also available under the MIT license. Please see the LICENSE file for more information and the LICENSE.FAQ.md file for more information on how to use Cedar under the CERN-OHL-S v2 license.

We are accepting PRs on all Cedar repositories, although you must sign the Cedar Contributor License Agreement (CLA) for us to be able to incorporate your changes into the upstream repository. Additionally, if you would like to make major or architectural changes, please discuss this with us before doing the work. Cedar is a complicated piece of software, with many moving pieces, not all of which are publicly available. Because of this, we may not be able to take your changes, even if they are correct and useful (so again, please talk to us first).

Getting started

There are several ways to get Cedar:

For end users who are primarily analog designers, we recommend the hosted version on juliahub.com (preferably) or the pre-compiled binaries. These versions undergo additional manual QA, have known-compatible versions of other parts of the Julia ecosystem and are compiled into a single system image for a slightly snappier experience.

Using CedarSim as a julia package

For those who are interested in building on top of Cedar, have more complicated use cases or want to contribute to Cedar, the julia package workflow is recommended. Please see https://pkgdocs.julialang.org/v1/ for documentation on using the julia package manager. All Cedar packages are managed through the Cedar public registry.

Once you have added the Cedar public registry, obtaining CedarSim should be as easy as:

pkg> add CedarSim

However, please note that Cedar makes heavy use of julia compiler internals, and a pre-release version of Julia may be required. We keep a record of which julia version (knwon as Cedar blessed) is currently known to work well with the current version of Cedar and provide special binary builds for this version (which is also used for pre-built workflows mentioned above).

You may set up the blessed version of julia via running bash contrib/julia_build/juliaup_cedar.sh to get a +cedar channel available in juliaup. Then start julia via julia +cedar --project=. to run that blessed release with CedarSim as the current project.

For more information on modifying the blessed version of Julia see the documentation in in contrib/julia_build/.

Additional development tips

CedarSim has long precompilation times. You may disable precompilation of the project you're actively working on. If you're updating dependencies a lot, you might also want to disable some other packages that take a long time.

LocalPreferences.toml example when working on CedarSim:

[SnoopPrecompile]
skip_precompile = ["OrdinaryDiffEq", "CedarSim"]

This file can also be edited with set_preferences!(SnoopPrecompile, "skip_precompile" => pkg_names)

Development buils of Julia frequently break VSCode integration, so it's often not possible to use the integrated REPL. A hack to give this a slightly better chance of working is to go to settings and set the julia binary to point to the following script. This uses release julia for the language server and cedar julia for running your code. See https://github.com/julia-vscode/julia-vscode/issues/3160

#!/usr/bin/env bash
set -e
if [ -z "$JULIA_LANGUAGESERVER" ]; then
    exec julia +cedar "$@"
else
    exec julia +release "$@"
fi