Skip to content

Conversation

@AnanthaKrishnan63
Copy link

I have broken down the current_mirror function into multiple smaller functions as this will improve readability and re-usability of the smaller function. Also added docstrings to the functions to make them more clear to users.

I have broken down the current_mirror function into multiple smaller functions as this will improve readability and re-usability of the smaller function. Also added docstrings to the functions to make them more clear to users.
Copy link
Collaborator

@harshkhandeparkar harshkhandeparkar left a comment

Choose a reason for hiding this comment

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

Left a few comments but this looks good otherwise



#@cell
def create_interdigitized_fets(pdk: MappedPDK, device: str, numcols: int, with_dummy: bool, **kwargs) -> Component:
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 pattern used elsewhere, in other circuits perhaps? If yes, then this function can be reused there as well.

Copy link
Author

Choose a reason for hiding this comment

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

I do not know repo well enough right now, but yes if this pattern is being used elsewhere then it can be replaced

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's fine. Let it be for now.

raise ValueError(f"Invalid device type: {device}. Must be 'nfet' or 'pfet'.")


def route_interdigitized_fets(pdk: MappedPDK, interdigitized_fets: Component) -> Component:
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 prefix the function name with an _ or __ since it is only used as a subfunction in this file.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, I agree with that. I'll make the changes.

)

return top_level
"""An instantiable current mirror Component.
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems some of the documentation was removed. Is there a reason why it was shortened?

Copy link
Author

Choose a reason for hiding this comment

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

I thought this would be better but in hindsight I think the initial documentation is a better choice.

Copy link
Collaborator

Choose a reason for hiding this comment

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

More elaborate documentation never hurts.

return component


def 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.

Have you tested if this function still works the same? For a temporary check, you can instantiate a few current mirrors and compare the results to the older function and ensure they are the same.

However, it would be really good if you add a test in the CI. You can take a look at this file as an example.

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