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

feat: add trace width #101

Merged
merged 8 commits into from
Aug 13, 2024
Merged

feat: add trace width #101

merged 8 commits into from
Aug 13, 2024

Conversation

imrishabh18
Copy link
Member

Closes - tscircuit/tscircuit#264

  • refactored the type trace_width_props with the @tscircuit/props

@imrishabh18 imrishabh18 requested review from seveibar and a team as code owners August 12, 2024 20:44
@@ -52,7 +52,6 @@ export class NetBuilderClass implements NetBuilder {
is_digital_signal: this.props.is_digital_signal,
is_power: this.props.is_power,
is_ground: this.props.is_ground,
trace_width: this.props.trace_width,
Copy link
Contributor

Choose a reason for hiding this comment

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

nets should also have a trace width!

Copy link
Contributor

Choose a reason for hiding this comment

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

basically there's a priority system, net comes last in priorities

Copy link
Contributor

Choose a reason for hiding this comment

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

this is so you can say "the 5V net should generally have this traceWidth, but this hint should override that because this point gets hot..."

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, yeah! this was giving type error and to fix that I removed it for a while. I think because of some version mismatch. I will add this back

@@ -113,6 +106,7 @@ class TraceHintBuilderClass {
pcb_port_id: pcb_port.pcb_port_id,
pcb_component_id: pcb_port.pcb_component_id,
route,
trace_width: this.props.traceWidth ?? 0.1,
Copy link
Contributor

Choose a reason for hiding this comment

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

we shouldn't give trace hints a default width

Copy link
Contributor

Choose a reason for hiding this comment

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

(because we want to have the priority system- if a trace hint width isn't defined then we'll use the default for the net, or the pad type etc.)

Copy link
Member Author

@imrishabh18 imrishabh18 Aug 12, 2024

Choose a reason for hiding this comment

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

@seveibar What is the difference between the net and pad type? And how are they coming into the picture while we are manually adding trace hint?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yea good question, a "net" is really generally, like "the 5v net" usually refers to any connection that makes contact with a 5v line. Usually that's going to be like every chip that has power. Lowest priority for trace width

Then there's a trace, which refers to the full set of lines/route that connect two or more pads together.

Then theres a "tracehint point" which refers to a single point along a tracehint. Each of these points can individually have an associated width.

Will draw up a diagram in a moment

Copy link
Contributor

Choose a reason for hiding this comment

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

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Is trace only between the chip and power? then for ex. what are those between two resistors or a chip and resistor?

We use these trace_hints to make a optimised trace and optimised width usage for trace?

Copy link
Contributor

Choose a reason for hiding this comment

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

generally you don't need to vary the trace width for non-power traces, but a circuit will often have 2-5 different traces that represent some kind of power at different voltage levels or "noise levels"

Not every trace will have an explicitly defined net too. If you don't have an explicit net then you just use the "board's default trace width". An explicit net is a net that's actually written in the code. Most nets are not explicit, they're created "on the fly" or "as needed"

A trace that isn't connected to power is generally called a "signal trace" because it carries either data or a signal related to data.

@imrishabh18
Copy link
Member Author

The type and build check is failing, so do I need to add the latest version of the soup and props to make these pass or it should be handled automatically? @seveibar

@seveibar
Copy link
Contributor

@imrishabh18 yep you should add them manually to get the PR to pass

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