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

Extend component #185

Merged
merged 9 commits into from
Mar 22, 2023
Merged

Extend component #185

merged 9 commits into from
Mar 22, 2023

Conversation

jevillegasd
Copy link
Contributor

Changes in SPICE netlist generation and SPICE parameters handling.

  • If the component model is between double quotes, SIEPIC will not replace the space character for undersocres (_) when exporting the netlist.
  • Get and Set methods for SPICE parameters (to allow overwriting a components SPICE params). Specifically useful to change model parameters of a waveguide from the PDK (since these are set by SiEPIC.utils.layout.layoutwaveguide3)
  • Change for net labels of electrical pins to use Cell Name instead of Component Name (just makes the generated netlist cleaner when the components use long names)

I was thinking of options to set and get SPICE parameters in a way that is less manual than directly writing the text labels only. So I thought of extending the Component class to allow to do so.  This is with reference to the discussion # 249 in the EBeam PDK (SiEPIC/SiEPIC_EBeam_PDK#249).

The get method here basically is just a wrapper of the params property, but the set method checks if there is a Text cell with the SPICE parameters, changes that text  and updates the component.param property. If no TextCell is found, then it just creates one.

If this function is called outside of a PCell declaration itself, then whatever it's done is basically replaced or erased by the original cell information when it gets re-instantiated, so it would only be permanent on static cells. Still, I think it would be a useful method to for example update the waveguide parameters in the Waveguide PCell (usually this is defined in the PDK, but the SPICE parameters are defined inside the SiEPIC.utils layout calls).

This shouldn't have any compatibility issues since they are new methods. Although I did add a semicolon erasing to the params_dict method.
fix pdic2str to follow SPICE format specifications and always adds a  quotes on the parameters names, to allow for labels with spaces.
Update to not always put double quotes in the parameters naming
fix other 'dcsource' labels to 'dc source' and changed the SPICE component name to replace space characters to '_' only if the component model is **not** put in double quotes.
Update to use 'u' for small numbers in the SPICE params string
Copy link
Contributor Author

@jevillegasd jevillegasd left a comment

Choose a reason for hiding this comment

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

Compared to SiEPIC tools:master on 21/03/23 and no issues were found with this commit.

@lukasc-ubc lukasc-ubc merged commit 3564217 into SiEPIC:master Mar 22, 2023
@lukasc-ubc
Copy link
Member

Thank you very much!

@jevillegasd jevillegasd deleted the extend_component branch March 22, 2023 12:13
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