Skip to content

Commit d2267df

Browse files
authored
feat(docs): documentation on sky130spconv (#572)
1 parent a705a71 commit d2267df

File tree

3 files changed

+81
-1
lines changed

3 files changed

+81
-1
lines changed

bins/sky130spconv/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "sky130spconv"
33
version = "0.0.0"
44
edition = "2021"
5+
readme = "README.md"
56

67
[dependencies]
78
anyhow = "1"

bins/sky130spconv/README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# sky130spconv
2+
3+
A command line utility for converting SPICE netlists between
4+
different flavors ("schemas") of the SKY130 PDK.
5+
6+
## Installation
7+
8+
Clone the [`substrate2`](https://github.com/ucb-substrate/substrate2) repository,
9+
`cd` to the root of the cloned repository,
10+
then run the following in your terminal:
11+
12+
```bash
13+
cd bins/sky130spconv
14+
cargo install --path .
15+
```
16+
17+
This will typically install `sky130spconv` to `~/.cargo/bin`.
18+
Ensure that you have your `~/.cargo/bin` directory added to `$PATH`
19+
if you wish to invoke this tool from the command line.
20+
21+
## Usage
22+
23+
```
24+
Aggregate a SPICE netlist (with potentially many include statements) into one file, converting to the desired schema
25+
26+
Usage: sky130spconv [OPTIONS] <INPUT>
27+
28+
Arguments:
29+
<INPUT>
30+
The input netlist file
31+
32+
Options:
33+
-d, --dialect <DIALECT>
34+
The SPICE dialect
35+
36+
[default: spice]
37+
38+
-s, --schema <SCHEMA>
39+
The desired output SKY130 schema (open, cds, or src-nda)
40+
41+
[default: open]
42+
43+
-o, --out <OUT>
44+
The path where the output SPICE file should be saved.
45+
46+
The file and its parent directories will be created if necessary. If the file already exists, it will be overwritten.
47+
48+
If unspecified, the output will be written to stdout.
49+
50+
-h, --help
51+
Print help (see a summary with '-h')
52+
53+
-V, --version
54+
Print version
55+
```
56+
57+
## Schemas
58+
59+
In Substrate jargon, schemas are a set of primitives.
60+
61+
This tool supports three schemas:
62+
* `open`: this schema is compatible with open-source tools (Magic, netgen, etc.)
63+
* `cds`: this schema is compatible with Cadence tools (Spectre, Pegasus, Quantus, etc.)
64+
* `src-nda`: this schema is compatible with the NDA PDK decks for Spectre and Calibre.
65+
66+
All three schemas support the same fundamental devices, but they have slight differences.
67+
For example, `sky130_fd_pr__nfet_01v8` in the `open` schema is equivalent to
68+
`nfet_01v8` in the `cds` schema and
69+
`nshort` in the `src-nda` schema.
70+
Additionally, MOS devices in SPICE netlists of the `src-nda` schema are `M`-class instances,
71+
whereas they are `X`-class instances in the `cds` and `open` schemas.
72+
73+
This tool takes care of the quirks of each schema,
74+
allowing you to convert SKY130 netlists between any of the three supported schemas.
75+
76+
## Limitations
77+
78+
This tool is meant for simple SPICE netlists, such as those generated by Substrate.
79+
It does not support more advanced SPICE features, such as assigning mathematical expressions to subcircuit parameters.

bins/sky130spconv/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn main() -> anyhow::Result<()> {
3535
#[command(
3636
version,
3737
about,
38-
long_about = "Aggregate a SPICE netlist (with potentially many include statements) into one file"
38+
long_about = "Aggregate a SPICE netlist (with potentially many include statements) into one file, converting to the desired schema"
3939
)]
4040
pub struct Args {
4141
/// The SPICE dialect.

0 commit comments

Comments
 (0)