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

Allowing spice primtives to be defined directly from Hdl21 #65

Closed
aviralpandey opened this issue Nov 15, 2022 · 2 comments
Closed

Allowing spice primtives to be defined directly from Hdl21 #65

aviralpandey opened this issue Nov 15, 2022 · 2 comments
Assignees

Comments

@aviralpandey
Copy link
Collaborator

So far we support external modules with parameters, those parameters just have to be key-value only.

I propose we allow external modules to optionally specify their parameters text as they need to be netlisted, and their spice prefix. This will essentially turn all of our primitives into external modules, which could be simpler than our current approach of writing down how to netlist every spice primitive we could ever run into.

So the new external module would look like:

message ExternalModule {
  // Qualified External Module Name
  vlsir.utils.QualifiedName name = 1;
  // Description
  string desc = 2;
  // Port Definitions
  // Ordered as they will be in order-sensitive formats, such as typical netlist formats. 
  repeated Port ports = 3;
  // Signal Definitions, limited to those used by external-facing ports.
  repeated Signal signals = 4;
  // Params
  repeated vlsir.utils.Param parameters = 5;
  // Spice types
  optional string spicetype = 6;
  // Spice Parameter netlist
  optional string paramnetlist = 7;
}

The netlister would then behave the same way it has, but instead of trying to netlist the parameters by mapping them itself, it would simply write the passed paramnetlist.

@aviralpandey aviralpandey self-assigned this Nov 15, 2022
@dan-fritchman
Copy link
Owner

This was a central topic in a recent meeting.
Despite not thinking so at the time - I now think we probably want to have the "full-blown" escape hatch: a Literal type in both hdl21.Module and vlsir.circuit.Module.

@dan-fritchman
Copy link
Owner

vlsir.ExternalModule and hdl21.ExternalModule both now include a SpiceType enum-valued field which should support this.

And if not, re-open away.

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

No branches or pull requests

2 participants