5
8
Fork
You've already forked lctime
5

Fix crash when starting DFF characterization. #16

Closed
TholinVali wants to merge 19 commits from TholinVali/lctime:main into main
pull from: TholinVali/lctime:main
merge into: librecell:main
librecell:main
librecell:dev-dff-inverted-outputs
librecell:dev
First-time contributor
Copy link

This fixes a AttributeError: 'list' object has no attribute 'args' crash for me when trying to run the DFF characterization.

This fixes a `AttributeError: 'list' object has no attribute 'args'` crash for me when trying to run the DFF characterization.
Owner
Copy link

Thanks for the pull request! I'll soon give it a look and probably come back to you tomorrow.
I might come with another proposal for handling the unateness (already started something).

Thanks for the pull request! I'll soon give it a look and probably come back to you tomorrow. I might come with another proposal for handling the unateness (already started something).
Author
First-time contributor
Copy link

Please note that this pull request was not intended to contain the commits past adding the sky130 example (54791d1383). My bad.

I did find another crash, though, which occurs when a DFF cell does not contain both a preset and clear input. Having only one or none used to crash because a None would pop up, but all possible scenarios should now be fine and handled correctly. This change is meant to be part of the PR.

Please note that this pull request was not intended to contain the commits past adding the sky130 example (54791d1383). My bad. I did find another crash, though, which occurs when a DFF cell does not contain both a preset and clear input. Having only one or none used to crash because a `None` would pop up, but all possible scenarios should now be fine and handled correctly. This change is meant to be part of the PR.
Owner
Copy link

Okay, thanks for the clarification!
Do you plan to continue work on the unateness thing? Does your version already do the job for you?

Okay, thanks for the clarification! Do you plan to continue work on the unateness thing? Does your version already do the job for you?
Author
First-time contributor
Copy link

My code generates the output required for non-unate cases, but its not particularly pretty is all.

My code generates the output required for non-unate cases, but its not particularly pretty is all.
Owner
Copy link

The issue with preset/clear for flip-flops can be solved neatly when preset/clear are set to sympy.false in the case where there is no preset/clear. sympy.false is the actual default value for them but it looks like that got overwritten somewhere.

I tried to fix it in an alternative way. See 396e906077 and 826f6c3b75

Did you run into this issue with the DFF example you propose here? I think needs some testing from my side.

The issue with preset/clear for flip-flops can be solved neatly when preset/clear are set to `sympy.false` in the case where there is no preset/clear. `sympy.false` is the actual default value for them but it looks like that got overwritten somewhere. I tried to fix it in an alternative way. See https://codeberg.org/librecell/lctime/commit/396e90607709c0123ebf27f6b97bc53d1613aef8 and https://codeberg.org/librecell/lctime/commit/826f6c3b75178643b14d8c5f131e57af4b36e02d Did you run into this issue with the DFF example you propose here? I think needs some testing from my side.
Author
First-time contributor
Copy link

The included DFF example replicates the problem because it has neither a preset or a clear input.

The included DFF example replicates the problem because it has neither a preset or a clear input.
Owner
Copy link

I see you're working on support for inverted outputs of DFFs. I just pushed a suggestion here, based on your first commit on the topic: https://codeberg.org/librecell/lctime/src/branch/dev-dff-inverted-outputs

I did some renaming of arguments to make it easier to understand their purpose (timing_sequential.py).

Then in flipflop.py I added the part to find out if the output is inverted or not regarding the data input. This depends on both, the 'next_state' expression and also the output function.

Good question why there's duplicate code for finding observer outputs :)

I see you're working on support for inverted outputs of DFFs. I just pushed a suggestion here, based on your first commit on the topic: https://codeberg.org/librecell/lctime/src/branch/dev-dff-inverted-outputs I did some renaming of arguments to make it easier to understand their purpose (timing_sequential.py). Then in flipflop.py I added the part to find out if the output is inverted or not regarding the data input. This depends on both, the 'next_state' expression and also the output function. Good question why there's duplicate code for finding observer outputs :)
Author
First-time contributor
Copy link

Note I had to split my code changes for inverted outputs into two commits, when I decided to merge your changes back into my fork.

I am done with code changes for now and am just going to commit more examples for both combinatorial and sequential cells in the sky130 PDK.

Note I had to split my code changes for inverted outputs into two commits, when I decided to merge your changes back into my fork. I am done with code changes for now and am just going to commit more examples for both combinatorial and sequential cells in the sky130 PDK.
Owner
Copy link

Cool, thank you! :)

Can you manage to include some instructions on how to setup the PDK for running the examples? Or best include the required spice models directly (if they are not too large). That would be great :)

Cool, thank you! :) Can you manage to include some instructions on how to setup the PDK for running the examples? Or best include the required spice models directly (if they are not too large). That would be great :)
Author
First-time contributor
Copy link

You pretty much have to set up the PDK, since its not just one .spice file, but a whole network of them.

Volare is the PDK version manager that can install the sky130 PDK.

I use the iic-osic-tools docker environment, but it comes with its own installation of lctime, so you’ll need to override that somehow.

You pretty much have to set up the PDK, since its not just one .spice file, but a whole network of them. [Volare](https://aibolem.github.io/volare/) is the PDK version manager that can install the sky130 PDK. I use the [iic-osic-tools](https://github.com/iic-jku/iic-osic-tools) docker environment, but it comes with its own installation of lctime, so you’ll need to override that somehow.
Owner
Copy link

Which PDK version are you using ? I tried to set it up with volare, but the most recent version does not contain the combined folder that you use in the examples. Somewhere in your volare directory there is a file current it contains the hash of the PDK. That would be great to know :)

Which PDK version are you using ? I tried to set it up with volare, but the most recent version does not contain the `combined` folder that you use in the examples. Somewhere in your volare directory there is a file `current` it contains the hash of the PDK. That would be great to know :)
Author
First-time contributor
Copy link

Use the path sky130A/libs.tech/ngspice/sky130.lib.spice tt instead. "combined" appears to be a thing specific to the IIC-tools container which contains shortcuts to various things.

Use the path `sky130A/libs.tech/ngspice/sky130.lib.spice tt` instead. "combined" appears to be a thing specific to the IIC-tools container which contains shortcuts to various things.
First-time contributor
Copy link

Hi, great to see that lctime is being improved to work with sky130!

The "combined" models are not specific to the IIC-OSIC-tools. They are rather a combination of the discrete and continuous models. The continuous models have been added at a later time to the open PDK and are superior to the discrete models. But they do not cover the complete operating range over various parameters (such as W), thus the combined models were created.

@tok it seems that your version of the PDK is not recent enough.

I have installed the following version of the PDK via volare which contains the combined models.

a918dc7c8e474a99b68c85eb3546b4ed91fe9e7b (2024年10月08日) (enabled)
Hi, great to see that lctime is being improved to work with sky130! The "combined" models are not specific to the IIC-OSIC-tools. They are rather a combination of the discrete and continuous models. The continuous models have been added at a later time to the open PDK and are superior to the discrete models. But they do not cover the complete operating range over various parameters (such as W), thus the combined models were created. @tok it seems that your version of the PDK is not recent enough. I have installed the following version of the PDK via volare which contains the `combined` models. ``` a918dc7c8e474a99b68c85eb3546b4ed91fe9e7b (2024年10月08日) (enabled) ```
Owner
Copy link

Thanks @mole99 !
Indeed, with this version the combined folder is there now :)

Thanks @mole99 ! Indeed, with this version the `combined` folder is there now :)
Owner
Copy link

I'd like to better understand the issue with the DFFs with inverted output. Do you have in mind to characterize both outputs in one go? Or just trying to get it to work at all? :)

I'd like to better understand the issue with the DFFs with inverted output. Do you have in mind to characterize both outputs in one go? Or just trying to get it to work at all? :)
Author
First-time contributor
Copy link

Trying to get it to work at all right now. Finally got it, and been using the code in my fork for a few days now.

Trying to get it to work at all right now. Finally got it, and been using the code in my fork for a few days now.

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
librecell/lctime!16
Reference in a new issue
librecell/lctime
No description provided.
Delete branch "TholinVali/lctime:main"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?