-
Notifications
You must be signed in to change notification settings - Fork 8
feat: multi sram generation and open source lib generation #509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
a832cf8
0b237eb
f43a206
8e48a8d
e3680a2
c78ad3c
2b555d9
264e4c8
c45f53c
ab4b599
bf68ef4
ff27331
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,4 +44,3 @@ paste = "1" | |
|
|
||
| [features] | ||
| default = [] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,8 @@ If you have BWRC access, you can install all features of SRAM22. Make sure that | |
| ``` | ||
| [net] | ||
| git-fetch-with-cli = true | ||
| [registries] | ||
| substrate = { index = "https://github.com/substrate-labs/crates-index" } | ||
| ``` | ||
|
|
||
| You can then install SRAM22 using the following commands: | ||
|
|
@@ -61,38 +63,45 @@ Options: | |
| -c, --config <CONFIG> Path to TOML configuration file [default: sram22.toml] | ||
| -o, --output-dir <OUTPUT_DIR> Directory to which output files should be saved | ||
| --lef Generate LEF (used in place and route) | ||
| --lib Generate LIB (setup, hold, and delay timing information) | ||
| --liberate Generate LIB with Liberate MX instead of the interpolation model | ||
| --drc Run DRC using Calibre | ||
| --lvs Run LVS using Calibre | ||
| --pex Run PEX using Calibre | ||
| -a, --all Run all available steps | ||
| -h, --help Print help information | ||
| -V, --version Print version information | ||
| ``` | ||
|
|
||
| `--liberate`, `--drc`, `--lvs`, and `--all` are only available with a full (commercial) installation. | ||
|
|
||
| ### Configuration | ||
|
|
||
| SRAM22 generates memory blocks based on a TOML configuration file. An example configuration, showing all the available options, is shown below: | ||
| SRAM22 generates memory blocks based on a TOML configuration file. Configurations are specified | ||
| as an array of `[[sram]]` configurations, allowing up to multiple SRAMs to be generated. | ||
|
|
||
| ```toml | ||
| [[sram]] | ||
| num_words = 64 | ||
| data_width = 32 | ||
| mux_ratio = 4 | ||
| write_size = 8 | ||
|
|
||
| [[sram]] | ||
| num_words = 256 | ||
| data_width = 64 | ||
| mux_ratio = 4 | ||
| write_size = 8 | ||
| # The `pex_level` flag is only available with a full installation. | ||
| pex_level = "rcc" | ||
|
rohanku marked this conversation as resolved.
|
||
| ``` | ||
|
|
||
| To generate an SRAM using this configuration, put the above text into a file called | ||
| `sram22_64x32m4w8/sram22.toml`, then run: | ||
| Save this as `sram22.toml` and run: | ||
|
|
||
| ``` | ||
| cd sram22_64x32m4w8 | ||
| sram22 | ||
| ``` | ||
|
|
||
| Add additional flags depending on what views you want to generate and what verification you want to run. | ||
| If you do not have access to BWRC servers, most flags will not be available. | ||
| Each `[[sram]]` block is generated independently. Output files are placed in subdirectories | ||
| named after the SRAM (e.g. `build/sram22_64x32m4w8/`) | ||
|
|
||
| The number of rows in the SRAM bitcell array is `num_words / mux_ratio`. | ||
| The number of columns in the array is `data_width * mux_ratio`. | ||
|
|
@@ -103,7 +112,20 @@ A valid configuration must have: | |
| * A power-of-two number of rows | ||
| * At least 16 rows | ||
| * At least 16 columns | ||
| * `pex_level`: Must be `"r"`, `"c"`, `"rc"`, or `"rcc"`. If you do not have commercial plugins enabled, this option will be ignored. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you take this out? |
||
| * `pex_level` (optional): Must be `"r"`, `"c"`, `"rc"`, or `"rcc"`. Only available with a full installation. When set, PEX runs automatically — no additional flag required. Each `[[sram]]` block sets its own `pex_level` independently; SRAMs without it skip PEX. The extracted netlist is only consumed by Liberate MX (see below). | ||
|
|
||
| ### LIB generation | ||
|
|
||
| SRAM22 always generates Liberty (.lib) timing files for the tt/ss/ff PVT corners — no flag | ||
| is required. By default the LIB is produced by an open-source interpolation model; | ||
| interpolated LIBs carry a conservative overestimate of up to 2% for SRAM configurations | ||
| with `data_width` between 8 and 128. `data_width` outside that range is not supported by | ||
| the open-source model and will produce an error. | ||
|
|
||
| With a full BWRC installation, passing `--liberate` (or `--all`) instead characterizes the | ||
| LIB with Liberate MX running SPICE simulation; interpolation is skipped in that case. If a | ||
| config also has `pex_level` set, Liberate MX uses the extracted netlist; otherwise it falls | ||
| back to the plain SPICE netlist. | ||
|
|
||
| ### Contribution | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,10 +21,11 @@ pub struct Args { | |
| #[arg(short, long)] | ||
| pub output_dir: Option<PathBuf>, | ||
|
|
||
| /// Generate LIB (setup, hold, and delay timing information). | ||
| /// Generate LIB timing using Liberate MX SPICE characterization instead of | ||
| /// the open-source interpolation model (requires a full installation). | ||
| #[cfg(feature = "commercial")] | ||
| #[arg(long)] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should generate LIB by interpolation by default, there should be a flag to choose to generate using liberate that is only available on the commercial feature flag.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By this I meant you should delete this flag and only have the liberate flag. It always produces a LIB, but only invokes liberate if --liberate is specified. Interpolation shouldn't run if liberate is being used to generate the lib. |
||
| pub lib: bool, | ||
| pub liberate: bool, | ||
|
|
||
| /// Run DRC using Calibre. | ||
| #[cfg(feature = "commercial")] | ||
|
|
@@ -36,11 +37,6 @@ pub struct Args { | |
| #[arg(long)] | ||
| pub lvs: bool, | ||
|
|
||
| /// Run PEX using Calibre. | ||
| #[cfg(feature = "commercial")] | ||
| #[arg(long)] | ||
| pub pex: bool, | ||
|
|
||
| #[cfg(feature = "commercial")] | ||
| /// Run all available steps. | ||
| #[arg(short, long)] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this deleted from the docs?