### Author Topic: Find out all paths between two nets  (Read 3439 times)

0 Members and 1 Guest are viewing this topic.

#### max.wwwang

• Frequent Contributor
• Posts: 411
• Country:
##### Find out all paths between two nets
« on: February 26, 2023, 01:24:40 am »
Again as a new user, starting from 7.0, I'm learning this amazing free tool by using it --- though not by designing a circuit, but rather as a tool in reverse engineering a circuit in a repair project.

A need now arises in this project of mine --- I want to find out the dependency of one signal on another one (obviously both are nets), which is not very straightforward. So is there a way in KiCad to list, draw, or highlight, all the paths that exist in the schematics between two given nets?

In a (relatively) complex circuit, with multiple sheets as well as many connections with nets names without wires across multiple sheets, this function would be handy in analysing a circuit and troubleshooting.

From an algorithmic or mathematical perspective, this is not difficult at all given all the existing topological information between the components (pins) --- particularly if the input/output properties of the pins are assigned (I might be wrong). But I wonder if this function has been realised.

Thanks.
« Last Edit: February 26, 2023, 02:17:06 am by max.wwwang »
Neutral | grounded

#### Doctorandus_P

• Super Contributor
• Posts: 3080
• Country:
##### Re: Find out all paths between two nets
« Reply #1 on: March 01, 2023, 10:12:37 am »
So is there a way in KiCad to list, draw, or highlight, all the paths that exist in the schematics between two given nets?

I think there is a misunderstanding here, and this makes it a bit confusing what you want.
A "Net" is the list of connections between pins. Everything connected by copper (on the PCB) is a single net. That means there is never a connection between "two given nets". That would be an DRC violation.

That said (written),
I guess what you want is the highlight function. Just hover over a pin or a wire and then hit the backtick key.
This highlighting works across multiple schematic files in a hierarchy. It also works both on the schematic and PCB simultaneously. If you highlight track segment on the PCB, then the corresponding net in the schematic is also highlighted.

Also note that this function is persistent. You can keep a net highlighted while modifying the schematic or PCB. To "undo" the highlighting, just depress the backtick key when the mouse cursor is in an empty area.

#### hpw

• Regular Contributor
• Posts: 246
• Country:
##### Re: Find out all paths between two nets
« Reply #2 on: March 01, 2023, 01:00:55 pm »

>> Just hover over a pin or a wire and then hit the backtick key.

Well, as this SW is given / configured for an English keypad many hotkey combinations has to be altered as for Swiss German / German keypad layout completely.

Also strange why curved / edged traces results in partial parts. So a simple trace selection between / within pin's & via's would be nice to have or I am missing something.

#### Doctorandus_P

• Super Contributor
• Posts: 3080
• Country:
##### Re: Find out all paths between two nets
« Reply #3 on: March 01, 2023, 02:34:34 pm »
Well, as this SW is given / configured for an English keypad many hotkey combinations has to be altered as for Swiss German / German keypad layout completely.

It's not fair to blame KiCad for that. KiCad has many more possibilities for Hotkeys (I guess around 600) then there are keys on a keyboard, and a lot of them do not even have a key assigned because of this.
You can configure them in Preferences / Preferences / Hotkeys There is also an option to Import Hotkeys I don't see an option to export them. There is a user.hotkeys file in KiCad's configuration directory, and it's an easy to understand and modify text format.

#### SiliconWizard

• Super Contributor
• Posts: 12957
• Country:
##### Re: Find out all paths between two nets
« Reply #4 on: March 01, 2023, 09:24:16 pm »
What do you want to do exactly?
I guess you want to determine all paths between any two nodes of the graph that makes up a schematic?

This will give you an idea of the underlying problem: https://stackoverflow.com/questions/9535819/find-all-paths-between-two-graph-nodes

#### max.wwwang

• Frequent Contributor
• Posts: 411
• Country:
##### Re: Find out all paths between two nets
« Reply #5 on: March 09, 2023, 04:59:50 am »
Thanks for all the input here. My apology if my question was not clear, or not clear enough!

What I want is to find out the possible path of signal (not a direct electrical connection, of course!) between two nets. I don't think I misunderstood the term net in this context.

I do understand the modelling of this, with graph theory, that was exactly in my mind when saying "this should not be a difficult problem for a computer to solve" (or something like that).

I was aware of the tool highlighting one net (i.e. highlighting everything in the schematic that is electrically connected to a selected point). Unfortunately, that's not what I need.
« Last Edit: March 09, 2023, 05:21:51 am by max.wwwang »
Neutral | grounded

#### ebastler

• Super Contributor
• Posts: 4907
• Country:
##### Re: Find out all paths between two nets
« Reply #6 on: March 09, 2023, 04:55:48 pm »
What I want is to find out the possible path of signal (not a direct electrical connection, of course!) between two nets. I don't think I misunderstood the term net in this context.

I do understand the modelling of this, with graph theory, that was exactly in my mind when saying "this should not be a difficult problem for a computer to solve" (or something like that).

I'm afraid KiCad does not have the information required to do this. While (for a carefully defined library part) it knows which pins of an IC are inputs and outputs respectively, it does not necessarily know which outputs depend on which inputs.

For many programmable parts it would be impossible to know these dependencies without detailed information of the programming. And even for non-programmable parts there is no need to describe the dependencies in detail. KiCad's limited knowledge of signals, inputs, and outputs allows it to perform plausibility checks whether each signal is driven by one (and only one) output. Your "reverse engineering" use case is not covered, I'm afraid.

The following users thanked this post: max.wwwang

#### karpouzi9

• Frequent Contributor
• Posts: 286
• Country:
##### Re: Find out all paths between two nets
« Reply #7 on: March 10, 2023, 03:01:18 am »
What I want is to find out the possible path of signal (not a direct electrical connection, of course!) between two nets. I don't think I misunderstood the term net in this context.

You could always write the plugin for this

#### SiliconWizard

• Super Contributor
• Posts: 12957
• Country:
##### Re: Find out all paths between two nets
« Reply #8 on: March 10, 2023, 03:06:38 am »
This requires a full graph exploration, it's not difficult but can lead to pretty huge lists if the circuit is non-trivial.

You also have to define what constitutes a valid path to you. Because strictly speaking, in any well-formed circuit, there will be a path between any two nodes (nets) of the schematic, except for the nets/pins that are unconnected. Even if said path is just via ground and/or one power rail.

So, in the general case, that would have little benefit. What is more common is to get the list of *shortest paths*, something commonly done as a preliminary step for circuit analysis.
But then you don't have an exhaustive list.
« Last Edit: March 10, 2023, 03:08:27 am by SiliconWizard »

The following users thanked this post: max.wwwang

#### Chat GPT

• Contributor
• !
• Posts: 17
• Country:
##### Re: Find out all paths between two nets
« Reply #9 on: March 10, 2023, 10:08:47 am »
Yes, KiCad does have a feature called "Highlight Net" that allows you to highlight all the paths between two given nets in your schematic. Here's how you can use this feature:

Open your schematic in KiCad and locate the two nets you want to analyze.
Right-click on the first net and select "Highlight Net" from the context menu.
In the "Highlight Net" dialog box, select the second net from the drop-down list.
Click "OK" to highlight all the paths between the two nets in your schematic.
You can also use the "Find Similar Objects" feature in KiCad to locate all instances of a particular net name in your schematic, even if they are not connected with wires. To do this:

Right-click on the net you want to find and select "Find Similar Objects" from the context menu.
In the "Find Similar Objects" dialog box, select "Net Name" from the drop-down list.
Click "OK" to see a list of all instances of the net name in your schematic, including instances that are not connected with wires.
Using these features together can help you analyze the connectivity of your circuit and troubleshoot any issues you may be having.

The following users thanked this post: max.wwwang

#### max.wwwang

• Frequent Contributor
• Posts: 411
• Country:
##### Re: Find out all paths between two nets
« Reply #10 on: March 10, 2023, 09:42:29 pm »
Yes, KiCad does have a feature called "Highlight Net" that allows you to highlight all the paths between two given nets in your schematic. Here's how you can use this feature:

Open your schematic in KiCad and locate the two nets you want to analyze.
Right-click on the first net and select "Highlight Net" from the context menu.
In the "Highlight Net" dialog box, select the second net from the drop-down list.
Click "OK" to highlight all the paths between the two nets in your schematic.
You can also use the "Find Similar Objects" feature in KiCad to locate all instances of a particular net name in your schematic, even if they are not connected with wires. To do this:

Right-click on the net you want to find and select "Find Similar Objects" from the context menu.
In the "Find Similar Objects" dialog box, select "Net Name" from the drop-down list.
Click "OK" to see a list of all instances of the net name in your schematic, including instances that are not connected with wires.
Using these features together can help you analyze the connectivity of your circuit and troubleshoot any issues you may be having.
You are my man today! Just was about to conclude that this feature probably does not exist because of low demand. Will try that out (KiCad is installed on another computer)!

Although my need only came up really randomly and was not a big deal if there was nothing like this (after all it was only a small reverse engineering project, primarily driven by curiosity and the desire to figure out things --- nothing hi-tech!), at least it's a good-to-have!

By the way, thanks to all the other input above as well --- as always!
« Last Edit: March 11, 2023, 02:28:13 am by max.wwwang »
Neutral | grounded

#### Doctorandus_P

• Super Contributor
• Posts: 3080
• Country:
##### Re: Find out all paths between two nets
« Reply #11 on: March 11, 2023, 02:12:03 am »
You are my man today!

Huh, yes, the highlight funciton. That is what I wrote 10 days ago.
KiCad does have several different highlight functions that (of course) work slightly different.
One is to just hover over any object and then hit the backtick key (or assign it to some other key).

For the other functions, Have a look at Kicad / Preferences / Preferences / Hotkeys and then search for "Highlight". This will show a list of options and a bunch of them do not have any key assigned. This may be worth experimenting a a bit.

The following users thanked this post: max.wwwang

#### max.wwwang

• Frequent Contributor
• Posts: 411
• Country:
##### Re: Find out all paths between two nets
« Reply #12 on: March 11, 2023, 02:34:52 am »
Right-click on the first net and select "Highlight Net" from the context menu.
Now I came across a problem --- no "Highlight net" in the context menu when I right click a net.

Neutral | grounded

#### max.wwwang

• Frequent Contributor
• Posts: 411
• Country:
##### Re: Find out all paths between two nets
« Reply #13 on: March 11, 2023, 02:40:32 am »
If you say what I clicked is a label not a net, this is what I get after clicked a net. Still no "Highlight net".

Am I missing anything that is very obvious? That is too easy to happen!
« Last Edit: March 11, 2023, 02:55:23 am by max.wwwang »
Neutral | grounded

The following users thanked this post: karpouzi9

#### ebastler

• Super Contributor
• Posts: 4907
• Country:
##### Re: Find out all paths between two nets
« Reply #14 on: March 11, 2023, 06:18:25 am »
Yes, KiCad does have a feature called "Highlight Net" that allows you to highlight all the paths between two given nets in your schematic. Here's how you can use this feature:

Open your schematic in KiCad and locate the two nets you want to analyze.
Right-click on the first net and select "Highlight Net" from the context menu.
In the "Highlight Net" dialog box, select the second net from the drop-down list.
Click "OK" to highlight all the paths between the two nets in your schematic.

You lost me there. Which version of KiCad are you using? In V6, the schematic editor has a "Highlight Net" tool in the toolbar, but to my knowledge it can only highlight a single net at a time. And I am not aware of any "Highlight Net dialog".

Menu or dialog location aside -- what are "the paths between two nets"? Would this be all parts which are connected to both nets? Could you post an example screenshot? Thanks!

#### max.wwwang

• Frequent Contributor
• Posts: 411
• Country:
##### Re: Find out all paths between two nets
« Reply #15 on: March 11, 2023, 07:27:49 am »
... In V6, the schematic editor has a "Highlight Net" tool in the toolbar, but to my knowledge it can only highlight a single net at a time. ...
Just to add on what you have said --- it's the same in V7.0 that I'm using.
Neutral | grounded

#### 2N3055

• Super Contributor
• Posts: 5648
• Country:
##### Re: Find out all paths between two nets
« Reply #16 on: March 11, 2023, 09:06:56 am »
Yes, KiCad does have a feature called "Highlight Net" that allows you to highlight all the paths between two given nets in your schematic. Here's how you can use this feature:

Open your schematic in KiCad and locate the two nets you want to analyze.
Right-click on the first net and select "Highlight Net" from the context menu.
In the "Highlight Net" dialog box, select the second net from the drop-down list.
Click "OK" to highlight all the paths between the two nets in your schematic.

You lost me there. Which version of KiCad are you using? In V6, the schematic editor has a "Highlight Net" tool in the toolbar, but to my knowledge it can only highlight a single net at a time. And I am not aware of any "Highlight Net dialog".

Menu or dialog location aside -- what are "the paths between two nets"? Would this be all parts which are connected to both nets? Could you post an example screenshot? Thanks!

I am also really confused..

In schematic here is only toolbar command that works only for a single net and doesn't allow for multiselecting.
And it does not open any dialogs.
Also there is no Net Inspector tool whatsoever in schematic editor. In either v6 or v7..

There is Net Inspector tool in PCB editor though where you can select any combination of highlighted nets.

And I'm also really confused about "the paths between two nets" question by OP.
Nets are not connected and there are no paths (electrical paths) between them.

Is this about net ties, where you need to connect two different net classes together (like analog and digital ground )?
For that in Kicad you can use component that does it. In which case component is a link.

#### Doctorandus_P

• Super Contributor
• Posts: 3080
• Country:
##### Re: Find out all paths between two nets
« Reply #17 on: March 11, 2023, 11:46:53 am »
I am also really confused..

Yeah, me too.
Different functions for highlighting in KiCad V7, several different questions around net highlighting, and answers that only work in older versions. That makes it really confusing which parts fit together...

Oh, and here is another one:
In KiCad V7, the second icon from the top in the toolbar on the right side attaches a net highlight function to the cursor. Then it highlights whatever net you click on (but only a single net at a time).

The following users thanked this post: 2N3055

#### ebastler

• Super Contributor
• Posts: 4907
• Country:
##### Re: Find out all paths between two nets
« Reply #18 on: March 11, 2023, 07:50:54 pm »
I am also really confused..
Yeah, me too.
Different functions for highlighting in KiCad V7, several different questions around net highlighting, and answers that only work in older versions. That makes it really confusing which parts fit together...

I have no complaints about KiCad here. (Except for the usual "Consistency between the schematics and layout editor could do with further improvements".  ) It is reply #9 by llanosperezluis41 which causes the confusion, by stating what appears to be wrong advice.

Upon re-reading his post, as well as other recent posts by llanosperezluis41, I am now pretty much convinced that he is posting ChatGPT replies without telling us so.

I think posting ChatGPT stuff without context should be considered trolling, and the user be banned. I have brought that up in the Supporter's Lounge, since it is OT here. Also discussing the giveaway signs of a ChatGPT message there; I don't want to make that discussion visible to the present and future trolls.
« Last Edit: March 11, 2023, 08:17:14 pm by ebastler »

The following users thanked this post: I wanted a rude username

#### karpouzi9

• Frequent Contributor
• Posts: 286
• Country:
##### Re: Find out all paths between two nets
« Reply #19 on: March 11, 2023, 11:26:14 pm »
Yes, KiCad does have a feature called "Highlight Net" that allows you to highlight all the paths between two given nets in your schematic. Here's how you can use this feature:

Open your schematic in KiCad and locate the two nets you want to analyze.
Right-click on the first net and select "Highlight Net" from the context menu.
In the "Highlight Net" dialog box, select the second net from the drop-down list.
Click "OK" to highlight all the paths between the two nets in your schematic.
You can also use the "Find Similar Objects" feature in KiCad to locate all instances of a particular net name in your schematic, even if they are not connected with wires. To do this:

Right-click on the net you want to find and select "Find Similar Objects" from the context menu.
In the "Find Similar Objects" dialog box, select "Net Name" from the drop-down list.
Click "OK" to see a list of all instances of the net name in your schematic, including instances that are not connected with wires.
Using these features together can help you analyze the connectivity of your circuit and troubleshoot any issues you may be having.

I'm going to ask for a source, and llanosperezluis41 is going to tell me that his source is that he made it the fuck up. This feature does not exist.

ChatGPT, as ebastler points out, has hallucinated such a feature for Luis and he didn't bother fact checking it despite the fact that installing KiCAD costs \$0.

#### 2N3055

• Super Contributor
• Posts: 5648
• Country:
##### Re: Find out all paths between two nets
« Reply #20 on: March 12, 2023, 09:52:15 am »

What I want is to find out the possible path of signal (not a direct electrical connection, of course!) between two nets. I don't think I misunderstood the term net in this context.

You already have it on screen all the time.

It is called the schematic..
THAT is the purpose of it's existence, to show interconnection of components and allows us to figure out how it works..

The whole knowledge of electronics is about looking at the schematics and figuring out what it does... OR inventing something and making a schematic that does it..
You need to learn and work to be smart and knowledgeable. You can't fake it.

#### max.wwwang

• Frequent Contributor
• Posts: 411
• Country:
##### Re: Find out all paths between two nets
« Reply #21 on: March 12, 2023, 07:10:01 pm »

What I want is to find out the possible path of signal (not a direct electrical connection, of course!) between two nets. I don't think I misunderstood the term net in this context.

You already have it on screen all the time.

It is called the schematic..
THAT is the purpose of it's existence, to show interconnection of components and allows us to figure out how it works..

The whole knowledge of electronics is about looking at the schematics and figuring out what it does... OR inventing something and making a schematic that does it..
You need to learn and work to be smart and knowledgeable. You can't fake it.
This is brilliant. Thanks.

Please don’t use the net highlight function. That’s the purpose of schematics, labels and other convenient facilities. You can figure it all out!
Neutral | grounded

#### ebastler

• Super Contributor
• Posts: 4907
• Country:
##### Re: Find out all paths between two nets
« Reply #22 on: March 12, 2023, 08:03:20 pm »
This is brilliant. Thanks.

Please don’t use the net highlight function. That’s the purpose of schematics, labels and other convenient facilities. You can figure it all out!

Look -- 2N3055's advice may have come across as cynical, but he has a point.

The "highlight net" function can indeed be helpful while you are looking at a schematic. With the modern style of schematics, where the majority of "connections" are made by putting the same label onto several different pins, it can help you with finding all the points which are connected to the net. (1) (2)

But figuring out which upstream signals affect a given net, and which downstream signals are in turn affected by it, will remain your responsibility and manual work. KiCad will only highlight a single net at a time; it knows which output pin drives this net, but does not know how this pin is affected by upstream signals. Understanding those relationships requires an understanding of the circuit, which for the time being is still for humans to provide. Which is what 2N3055 was saying, I think.

(1) I only wish nets were more clearly highlighted in the schematic editor. At least with Kicad v6, which I am still using, they appear in a magenta color which does not stand out much, at least not for me.

(2) Just to make sure we are using the same nomenclature: Placing the same label on several different pins, but not connecting them by lines, still creates one "net" in KiCad terminology.

The following users thanked this post: 2N3055, pcprogrammer

#### Doctorandus_P

• Super Contributor
• Posts: 3080
• Country:
##### Re: Find out all paths between two nets
« Reply #23 on: March 12, 2023, 08:28:06 pm »
Highlighting is just a tool, and it can be useful, either for checking your own schematic, or to get an idea quicker of how somebody else's schematic is put together. KiCad only highlights a single net at a time, but it can do so when connections are only with labels, and also over multiple sheets though the hierarchy.

(1) I only wish nets were more clearly highlighted in the schematic editor. At least with Kicad v6, which I am still using, they appear in a magenta color which does not stand out much, at least not for me.

Go to: Schematic Editor / Preferences / Preferences / Schematic Editor / Colors and you can adjust the color of the highlighting. I have V7, but this should work in V6 too.

The following users thanked this post: 2N3055

#### ebastler

• Super Contributor
• Posts: 4907
• Country:
##### Re: Find out all paths between two nets
« Reply #24 on: March 12, 2023, 08:36:55 pm »
Go to: Schematic Editor / Preferences / Preferences / Schematic Editor / Colors and you can adjust the color of the highlighting. I have V7, but this should work in V6 too.

Thanks! Yes, I had played with the colors a while ago, but did not find anything much better. I guess the thin lines just don't convey color very strongly to me.

Something like the "glow" effect used for the currently selected items would be nice, but that is not user-configurable I believe?

Smf