Skip to content

Draft: Chipathon2024 Mahowald-ers Regulated Cascoded Current Mirror block#349

Open
amisapta15 wants to merge 43 commits intoidea-fasoc:mainfrom
amisapta15:main
Open

Draft: Chipathon2024 Mahowald-ers Regulated Cascoded Current Mirror block#349
amisapta15 wants to merge 43 commits intoidea-fasoc:mainfrom
amisapta15:main

Conversation

@amisapta15
Copy link
Contributor

Team Mahowald-ers: PR for adding Regulated Cascoded Current Mirror block. This block will add a Cascode regulator block from this team's other PR for enhanced voltage swing.

Ref: DOI: 10.1109/AE54730.2022.9920096

This is an initial Commit and a Circuit (with description) will be added. Details of the goal of this PR can be found in this Gslides link presented in 05.09.2024 meeting

Current Status: A simple Current Mirror template is added. LVS is failing with Final result: Top level cell failed pin matching. Further comments will be added soon.

@amisapta15
Copy link
Contributor Author

Current LVS result

Contents of circuit 1:  Circuit: 'CM'
Circuit CM contains 6 device instances.
  Class: sky130_fd_pr__nfet_01v8 instances:   6
Circuit contains 4 nets.
Contents of circuit 2:  Circuit: 'CM'
Circuit CM contains 2 device instances.
  Class: sky130_fd_pr__nfet_01v8 instances:   2
Circuit contains 3 nets.

Circuit was modified by parallel/series device merging.
New circuit summary:

Contents of circuit 1:  Circuit: 'CM'
Circuit CM contains 3 device instances.
  Class: sky130_fd_pr__nfet_01v8 instances:   3
Circuit contains 4 nets.
Contents of circuit 2:  Circuit: 'CM'
Circuit CM contains 2 device instances.
  Class: sky130_fd_pr__nfet_01v8 instances:   2
Circuit contains 3 nets.

Circuit 1 contains 3 devices, Circuit 2 contains 2 devices. *** MISMATCH ***
Circuit 1 contains 4 nets,    Circuit 2 contains 3 nets. *** MISMATCH ***


Final result: 
Netlists do not match.
Logging to file "/tmp/tmptmfe16ns/CM_lvs.rpt" disabled
LVS Done.


Circuit 1 cell sky130_fd_pr__nfet_01v8 and Circuit 2 cell sky130_fd_pr__nfet_01v8 are black boxes.
Warning: Equate pins:  cell sky130_fd_pr__nfet_01v8 is a placeholder, treated as a black box.
Warning: Equate pins:  cell sky130_fd_pr__nfet_01v8 is a placeholder, treated as a black box.

Subcircuit pins:
Circuit 1: sky130_fd_pr__nfet_01v8         |Circuit 2: sky130_fd_pr__nfet_01v8         
-------------------------------------------|-------------------------------------------
1                                          |1                                          
2                                          |2                                          
3                                          |3                                          
4                                          |4                                          
---------------------------------------------------------------------------------------
Cell pin lists are equivalent.
Device classes sky130_fd_pr__nfet_01v8 and sky130_fd_pr__nfet_01v8 are equivalent.

Class CM (0):  Merged 3 parallel devices.
Subcircuit summary:
Circuit 1: CM                              |Circuit 2: CM                              
-------------------------------------------|-------------------------------------------
sky130_fd_pr__nfet_01v8 (6->3)             |sky130_fd_pr__nfet_01v8 (8->2) **Mismatch* 
Number of devices: 3 **Mismatch**          |Number of devices: 2 **Mismatch**          
Number of nets: 4 **Mismatch**             |Number of nets: 3 **Mismatch**             
---------------------------------------------------------------------------------------
NET mismatches: Class fragments follow (with fanout counts):
Circuit 1: CM                              |Circuit 2: CM                              

---------------------------------------------------------------------------------------
Net: VSS                                   |Net: VSS                                   
  sky130_fd_pr__nfet_01v8/(1|3) = 2        |  sky130_fd_pr__nfet_01v8/(1|3) = 2        
                                           |  sky130_fd_pr__nfet_01v8/4 = 2            
                                           |                                           
Net: a_n1570_n931#                         |(no matching net)                          
  sky130_fd_pr__nfet_01v8/4 = 3            |                                           
  sky130_fd_pr__nfet_01v8/(1|3) = 2        |                                           
  sky130_fd_pr__nfet_01v8/2 = 1            |                                           
---------------------------------------------------------------------------------------
DEVICE mismatches: Class fragments follow (with node fanout counts):
Circuit 1: CM                              |Circuit 2: CM                              

---------------------------------------------------------------------------------------
Instance: sky130_fd_pr__nfet_01v8:3        |(no matching instance)                     
  (1,3) = (6,6)                            |                                           
  2 = 6                                    |                                           
  4 = 6                                    |                                           
                                           |                                           
---------------------------------------------------------------------------------------
Netlists do not match.

Subcircuit pins:
Circuit 1: CM                              |Circuit 2: CM                              
-------------------------------------------|-------------------------------------------
VSS                                        |VSS                                        
VCOPY                                      |VCOPY                                      
VREF                                       |VREF                                       
---------------------------------------------------------------------------------------
Cell pin lists are equivalent.
Device classes CM and CM are equivalent.

Final result: Netlists do not match.


@amisapta15
Copy link
Contributor Author

currentMirror

@amisapta15
Copy link
Contributor Author

Updated the Layout and decreased LVS Errors. Current LVS produces the following Errors

The error now comes from the labels 'VCOPYandVREF`, which seem to be floating. Not Sure How to connect the metal2 layer, metal 2 pin and metal2 labels

`
Logging to file "/tmp/tmpi4zjwy4q/CM_lvs.rpt" enabled
Circuit sky130_fd_pr__nfet_01v8 contains no devices.

Contents of circuit 1: Circuit: 'CM'
Circuit CM contains 6 device instances.
Class: sky130_fd_pr__nfet_01v8 instances: 6
Circuit contains 3 nets, and 2 disconnected pins.
Contents of circuit 2: Circuit: 'CM'
Circuit CM contains 3 device instances.
Class: sky130_fd_pr__nfet_01v8 instances: 3
Circuit contains 3 nets.

Circuit was modified by parallel/series device merging.
New circuit summary:

Contents of circuit 1: Circuit: 'CM'
Circuit CM contains 3 device instances.
Class: sky130_fd_pr__nfet_01v8 instances: 3
Circuit contains 3 nets, and 2 disconnected pins.
Contents of circuit 2: Circuit: 'CM'
Circuit CM contains 3 device instances.
Class: sky130_fd_pr__nfet_01v8 instances: 3
Circuit contains 3 nets.

Circuit 1 contains 3 devices, Circuit 2 contains 3 devices.
Circuit 1 contains 3 nets, Circuit 2 contains 3 nets.

Final result:
Top level cell failed pin matching.

Logging to file "/tmp/tmpi4zjwy4q/CM_lvs.rpt" disabled
LVS Done.

Circuit 1 cell sky130_fd_pr__nfet_01v8 and Circuit 2 cell sky130_fd_pr__nfet_01v8 are black boxes.
Warning: Equate pins: cell sky130_fd_pr__nfet_01v8 is a placeholder, treated as a black box.
Warning: Equate pins: cell sky130_fd_pr__nfet_01v8 is a placeholder, treated as a black box.

Subcircuit pins:

Circuit 1: sky130_fd_pr__nfet_01v8 Circuit 2: sky130_fd_pr__nfet_01v8
1 1
2 2
3 3
4 4

Cell pin lists are equivalent.
Device classes sky130_fd_pr__nfet_01v8 and sky130_fd_pr__nfet_01v8 are equivalent.

Cell CM (0) disconnected node: VCOPY
Cell CM (0) disconnected node: VREF
Class CM (0): Merged 3 parallel devices.
Cell CM (0) disconnected node: VCOPY
Cell CM (0) disconnected node: VREF
Subcircuit summary:

Circuit 1: CM Circuit 2: CM
sky130_fd_pr__nfet_01v8 (6->3) sky130_fd_pr__nfet_01v8 (6->3)
Number of devices: 3 Number of devices: 3
Number of nets: 3 Number of nets: 3

Netlists match uniquely with port errors.

Subcircuit pins:

Circuit 1: CM Circuit 2: CM
VSS VSS
(no matching pin) VREF
(no matching pin) VCOPY
VCOPY (no matching pin)
VREF (no matching pin)

Cell pin lists for CM and CM altered to match.
Device classes CM and CM are equivalent.

Final result: Top level cell failed pin matching.

`

@amisapta15
Copy link
Contributor Author

amisapta15 commented Nov 27, 2024

Finally Cleared LVS. Improvement suggestions on the layout (along with further technical checks) will be greatly appreciated. Specially need help with moving the components around to become DRC clean.

DRC is still being checked. Next Goal is to get the Spice SIm going to extract the IV curve of this CM

@amisapta15
Copy link
Contributor Author

current layout

currentMirror

@amisapta15
Copy link
Contributor Author

amisapta15 commented Dec 5, 2024

Schematic-wise, getting suggestions on the schematic code for these would be super helpful. Thanks in advance.

(a) I'm not sure what's going on there. The Via from licon to met1 doesn't encompass the finger and the via to met 2 doesn't line up. The finger should be extended to fully enclose the via to met 1 track (blue), and the via between met1 and met2 (the red line) should be aligned with the previous via. I'm not sure how to achieve that in code.

(b) We want to move the Vref pin and track to the other position. Not sure what port to use for that move.

(c) The positioning of the pins (Vref, Vopy, and Vss) isn't good. They don't produce errors but would be great to bring them outside the well and make their location aligned and parametrized proper way.

hope I am able to explain it in an understandable fashion.

390557065-39d9d398-0846-4977-97b8-9e04864d2a12

@harshkhandeparkar
Copy link
Collaborator

@amisapta15 any update on this?

@amisapta15
Copy link
Contributor Author

Hello! Thanks for the comments and sorry for the delay. I should be able to push an update by the weekend. Thanks

…` in regulated_cascoded_current_mirror.py

The main component name was generic. It is updated as per the suggestion provided by the maintainer.
@amisapta15
Copy link
Contributor Author

amisapta15 commented Jan 29, 2025

@harshkhandeparkar Kindly see my responses in your comments. Also, please see my request for help in placing the nodes

Schematic-wise, getting suggestions on the schematic code for these would be super helpful. Thanks in advance.

(a) I'm not sure what's going on there. The Via from licon to met1 doesn't encompass the finger and the via to met 2 doesn't line up. The finger should be extended to fully enclose the via to met 1 track (blue), and the via between met1 and met2 (the red line) should be aligned with the previous via. I'm not sure how to achieve that in code.

(b) We want to move the Vref pin and track to the other position. Not sure what port to use for that move.

(c) The positioning of the pins (Vref, Vopy, and Vss) isn't good. They don't produce errors but would be great to bring them outside the well and make their location aligned and parametrized proper way.

hope I am able to explain it in an understandable fashion.

390557065-39d9d398-0846-4977-97b8-9e04864d2a12

Please note aside from this, following Mehedi's comment (from back before Holidays) a new code will be pushed for a non-uniform current mirror component generation code, utilising the two_transistor_place and common_centroid_ab_ba.py and four_trasistors_interdigitized function will be pushed.

@harshkhandeparkar
Copy link
Collaborator

@harshkhandeparkar Kindly see my responses in your comments.

I can't see any replies to my comments. Did you reply on a different platform?

Schematic-wise, getting suggestions on the schematic code for these would be super helpful. Thanks in advance.

(a) I'm not sure what's going on there. The Via from licon to met1 doesn't encompass the finger and the via to met 2 doesn't line up. The finger should be extended to fully enclose the via to met 1 track (blue), and the via between met1 and met2 (the red line) should be aligned with the previous via. I'm not sure how to achieve that in code.

Can you send the gds for this? Also, can you highlight(or tell line nos) this part of your code?

(b) We want to move the Vref pin and track to the other position. Not sure what port to use for that move.

Which other position?

dummy=with_dummy,with_substrate_tap=with_substrate_tap,with_tie=with_tie,tie_layers=tie_layers)
elif type.lower() =="nfet" or type.lower() =="nmos":
currm= two_nfet_interdigitized(pdk,numcols=num_cols,width=Width,length=Length,fingers=fingers,dummy=with_dummy,
with_substrate_tap=with_substrate_tap,with_tie=with_tie,tie_layers=tie_layers)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what's going on there. The Via from licon to met1 doesn't encompass the finger and the via to met 2 doesn't line up. The finger should be extended to fully enclose the via to met 1 track (blue), and the via between met1 and met2 (the red line) should be aligned with the previous via. I'm not sure how to achieve that in code.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Has this been fixed now?

"pad_label" : (76, 5),
"pwell_pin" : (122, 16),
"pwell_label" : (122, 5)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the new addition to the pdk for making the labelling pdk agonastic. Not sure How to tell Glayout to use this file instead of what is installed in the miniconda folder

@amisapta15
Copy link
Contributor Author

amisapta15 commented Feb 6, 2025

@harshkhandeparkar Kindly see my responses in your comments.

I can't see any replies to my comments. Did you reply on a different platform?

I had commented on Github itself. There were some wrongly set settings. It should be visible to you now. Please let me know if it isn't.

Schematic-wise, getting suggestions on the schematic code for these would be super helpful. Thanks in advance.
(a) I'm not sure what's going on there. The Via from licon to met1 doesn't encompass the finger and the via to met 2 doesn't line up. The finger should be extended to fully enclose the via to met 1 track (blue), and the via between met1 and met2 (the red line) should be aligned with the previous via. I'm not sure how to achieve that in code.

Can you send the gds for this? Also, can you highlight(or tell line nos) this part of your code?

Yes and Yes. The GDS is added here

This particular problem comes directly from the two_n/pfet_interdigitized function. I have added a comment (with the question above) for that portion of the code. Hope that helps.

(b) We want to move the Vref pin and track to the other position. Not sure what port to use for that move.

Which other position?

Please see this earlier comment

or The following picture with red highlights!

image1

@msaligane
Copy link
Member

@alibillalhammoud Can you please take a look at this issue?

@amisapta15
Copy link
Contributor Author

Dear @harshkhandeparkar, both issues are opened in appropriate places, as we discussed in the comments.

A helper function is added and all unnecessary things have been shifted. Another GitHub action run will be very helpful.

New commit forward from this, add new regulated cascade blocks and begin prep for integration of the whole project (CM+regulated cascade) for tape-out. Please ignore all other files currently except the one we are discussing.

Kindly note the positioning issues with the pins aren't solved. But we can address this later when the whole block is integrated.

@harshkhandeparkar
Copy link
Collaborator

harshkhandeparkar commented Mar 28, 2025

Dear @harshkhandeparkar, both issues are opened in appropriate places, as we discussed in the comments.

A helper function is added and all unnecessary things have been shifted. Another GitHub action run will be very helpful.

New commit forward from this, add new regulated cascade blocks and begin prep for integration of the whole project (CM+regulated cascade) for tape-out. Please ignore all other files currently except the one we are discussing.

Kindly note the positioning issues with the pins aren't solved. But we can address this later when the whole block is integrated.

@amisapta15 can you rebase your branch so the new workflow can run on this?
Edit: Once this is done, the new blocks can be easily added to the CI to run DRC and LVS on.

@@ -0,0 +1,126 @@
import sys
sys.path.append('../../elementary/current_mirror/')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this required?

return CMS.flatten()


comp = current_mirror(sky130, numcols=2, device='nfet')
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be better to add these commands to a function or under if __name__ == "__main__" so it doesn't accidentally run as a side-effect of importing the file.

@@ -0,0 +1,17 @@
from os import path, rename, environ , listdir, remove, chmod

def delete_files_in_directory(directory_path):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is this used? Does os.rmtree not do the same?

return reg_casc_netlist


# def regulated_cascode_netlist(
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this code is unused, it would be better to delete it. If it is old code, it would remain in the git history.

print(netgen_lvs_result['result_str'])


## Will be used in future for simulation
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here.


from glayout.flow.pdk.util.comp_utils import prec_ref_center, prec_center, movey, evaluate_bbox, align_comp_to_port

# def cascode_common_source_netlist(
Copy link
Collaborator

Choose a reason for hiding this comment

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

This, too.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be better to remove this file as it can be generated.

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.

3 participants