Skip to content
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

Sky130: Add lib to contain all logic libraries, add hd low leakage logic library #28

Merged
merged 8 commits into from
Mar 8, 2024

Conversation

ubfx
Copy link
Contributor

@ubfx ubfx commented Mar 7, 2024

This is my attempt at starting to move in more Sky130 logic libraries (low leakage, high speed, low speed, etc).

I figured there's so much infrastructure built on top of the current sky130hd library that we shouldn't change it straight away, but on the other hand, we have to start somewhere moving in the other logic libs. This patch adds a new library sky130sc, sc for standard cells, which could become the umbrella library for all sky130 logic libraries (hd, hdll, hs, ...) at some point, just like gf180mcu is for gf180. But for now, it can coexist with the tried and tested sky130hd.

The idea would be to add a temporary/development target (skywater130_demo_devel or so) to siliconcompiler which would allow us to add some testing without touching the good old skywater130_demo. (Also, we need a target for the lambdalib generating step).

For now, the new sky130sc setup will load the existing sky130hd, but also the newly added sky130hdll (high density low leakage). A few notes on the sky130hdll:

  1. All files were taken from open_pdks, as described in the Readme, but there are some small changes to lefs and libs:
  2. The lambdalib was "generated" by substituting _hd__ for _hdll__ for now. When we have the siliconcompiler target, we should be able to just generate it normally.
  3. Yosys techmapping files were produced the same way.

I know patching the LEFs and libs is not ideal, but I assume there will be some more patches necessary until we get all of the different logic libraries working. And maybe I will be able to upstream some of these patches with open_pdks until then. I would suggest doing a more thorough review of all necessary patches when we get all of the libraries working.

@gadfort
Copy link
Contributor

gadfort commented Mar 7, 2024

@ubfx to generate the lambdalib information just use: https://github.com/siliconcompiler/lambdapdk/blob/main/scripts/generate_lamdbalib.py

If you just want to do some testing, you can always create a temporary target on a branch here:

... sky130_dev.py
(copy in regular setup or import it and call it)
chip.use(sky130sc)
chip.set('asic', 'logiclib', '...')

And use it like:

sc -target lambdapdk.sky130.target.sky130_dev

or

from lambdapdk.sky130.target import sky130_dev

...
  chip.load_target(sky130_dev)
...

If you want to check against a broader set of designs you can also try out: https://github.com/siliconcompiler/scgallery

@ubfx
Copy link
Contributor Author

ubfx commented Mar 7, 2024

I tested the new lib locally on yosys+OpenROAD and Cadence on a few designs, but thought we would probably want to some in-tree testing (on CI) before moving the main target over to the new lib. Especially since all the tests on siliconcompiler just use the hd library currently.

Are you against having two targets in-tree for a transitionary period?

@gadfort
Copy link
Contributor

gadfort commented Mar 8, 2024

@ubfx I would prefer to no have a temporary target in SC. We could switch the target in SC to point to this file instead (and remove the old file), if the default behavior is the hd lib nothing should change and that would make it possible to do some testing without adding a target.

Copy link
Contributor

@gadfort gadfort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I don't think there is too much to address, so should be fairly easy.

lambdapdk/sky130/libs/sky130sc.py Show resolved Hide resolved
lambdapdk/sky130/libs/sky130sc.py Outdated Show resolved Hide resolved
lambdapdk/sky130/libs/sky130hdll/apr/openroad/pdngen.tcl Outdated Show resolved Hide resolved
lambdapdk/sky130/__init__.py Outdated Show resolved Hide resolved
lambdapdk/sky130/README.md Show resolved Hide resolved
lambdapdk/sky130/README.md Show resolved Hide resolved
Copy link
Contributor

@gadfort gadfort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears there are no full or half adders in the hdll library, please remove that enablement and it should be good to merge.

@gadfort
Copy link
Contributor

gadfort commented Mar 8, 2024

@ubfx looks great, just need to redo the lambdalib generation since the files have references to the half and full adders.

@ubfx
Copy link
Contributor Author

ubfx commented Mar 8, 2024

@ubfx looks great, just need to redo the lambdalib generation since the files have references to the half and full adders.

For the ICGC and the p-latch, I'm now getting something like this:

module la_latq(d, clk, q);
  input clk;
  wire clk;
  input d;
  wire d;
  output q;
  wire q;
  \$_DLATCH_P_  q_reg /* _0_ */ (
    .D(d),
    .E(clk),
    .Q(q)
  );
endmodule

Should I add a techmapping of DLATCH_P to an inverter + the negative-gate latch?

@gadfort
Copy link
Contributor

gadfort commented Mar 8, 2024

@ubfx yeah, I think that would be correct.

@gadfort gadfort self-requested a review March 8, 2024 22:52
Copy link
Contributor

@gadfort gadfort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. looks good.

@gadfort gadfort merged commit eb7ba22 into siliconcompiler:main Mar 8, 2024
3 checks passed
@ubfx ubfx deleted the sky130-modernize branch March 9, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants