Find out all paths between two nets - Page 1
Forum section: electronics / general

author: max.wwwang
author_rank: Frequent Contributor
timestamp: February 26, 2023, 01:24:40 am
content: 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 arepair 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.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: March 01, 2023, 10:12:37 am
content: Quote from: max.wwwang on February 26, 2023, 01:24:40 amI 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.

author: hpw
author_rank: Frequent Contributor
timestamp: March 01, 2023, 01:00:55 pm
content: >> Just hover over a pin or a wire and then hit the backtick key.Well, as this SW is given / configured for an English keypadmany 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.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: March 01, 2023, 02:34:34 pm
content: Quote from: hpw on March 01, 2023, 01:00:55 pmIt'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 inPreferences / Preferences / HotkeysThere is also an option toImport HotkeysI don't see an option to export them. There is auser.hotkeysfile in KiCad's configuration directory, and it's an easy to understand and modify text format.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 01, 2023, 09:24:16 pm
content: 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

author: max.wwwang
author_rank: Frequent Contributor
timestamp: March 09, 2023, 04:59:50 am
content: 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 ofsignal(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 highlightingonenet (i.e. highlighting everything in the schematic that is electrically connected to a selected point). Unfortunately, that's not what I need.

author: ebastler
author_rank: Super Contributor
timestamp: March 09, 2023, 04:55:48 pm
content: Quote from: max.wwwang on March 09, 2023, 04:59:50 amI'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.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 10, 2023, 03:06:38 am
content: 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.

author: Chat GPT
author_rank: Contributor
timestamp: March 10, 2023, 10:08:47 am
content: 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.

author: max.wwwang
author_rank: Frequent Contributor
timestamp: March 10, 2023, 09:42:29 pm
content: Quote from: llanosperezluis41 on March 10, 2023, 10:08:47 amYou 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!

author: Doctorandus_P
author_rank: Super Contributor
timestamp: March 11, 2023, 02:12:03 am
content: Quote from: max.wwwang on March 10, 2023, 09:42:29 pmHuh, 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 atKicad / Preferences / Preferences / Hotkeysand 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.

author: max.wwwang
author_rank: Frequent Contributor
timestamp: March 11, 2023, 02:34:52 am
content: Quote from: llanosperezluis41 on March 10, 2023, 10:08:47 amNow I came across a problem --- no "Highlight net" in the context menu when I right click a net.I'm using KiCad 7.0.

author: max.wwwang
author_rank: Frequent Contributor
timestamp: March 11, 2023, 02:40:32 am
content: 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!

author: ebastler
author_rank: Super Contributor
timestamp: March 11, 2023, 06:18:25 am
content: Quote from: llanosperezluis41 on March 10, 2023, 10:08:47 amYou 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 allpartswhich are connected to both nets? Could you post an example screenshot? Thanks!

author: max.wwwang
author_rank: Frequent Contributor
timestamp: March 11, 2023, 07:27:49 am
content: Quote from: ebastler on March 11, 2023, 06:18:25 amJust to add on what you have said --- it's the same in V7.0 that I'm using.

author: 2N3055
author_rank: Super Contributor
timestamp: March 11, 2023, 09:06:56 am
content: Quote from: ebastler on March 11, 2023, 06:18:25 amI 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.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: March 11, 2023, 11:46:53 am
content: Quote from: 2N3055 on March 11, 2023, 09:06:56 amYeah, 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).

author: ebastler
author_rank: Super Contributor
timestamp: March 11, 2023, 07:50:54 pm
content: Quote from: Doctorandus_P on March 11, 2023, 11:46:53 amI 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.

author: 2N3055
author_rank: Super Contributor
timestamp: March 12, 2023, 09:52:15 am
content: Quote from: max.wwwang on March 09, 2023, 04:59:50 amI reread this and answer is very easy...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.

author: max.wwwang
author_rank: Frequent Contributor
timestamp: March 12, 2023, 07:10:01 pm
content: Quote from: 2N3055 on March 12, 2023, 09:52:15 amThis 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!

author: ebastler
author_rank: Super Contributor
timestamp: March 12, 2023, 08:03:20 pm
content: Quote from: max.wwwang on March 12, 2023, 07:10:01 pmLook -- 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.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: March 12, 2023, 08:28:06 pm
content: 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.Quote from: ebastler on March 12, 2023, 08:03:20 pmGo to:Schematic Editor / Preferences / Preferences / Schematic Editor / Colorsand you can adjust the color of the highlighting. I have V7, but this should work in V6 too.

author: ebastler
author_rank: Super Contributor
timestamp: March 12, 2023, 08:36:55 pm
content: Quote from: Doctorandus_P on March 12, 2023, 08:28:06 pmThanks! 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?

author: pcprogrammer
author_rank: Super Contributor
timestamp: March 12, 2023, 08:37:25 pm
content: Darned, I can't recall the name of the project and the thread it was mentioned in, but it had to do with reversing FPGA net lists into verilog. My google foo did not bring it back either.Sure not the same as this, but it did traverse the net list to find relations through the logic, so it is something a computer can do, but it needs to be programmed for it. For every object in the schematic the in and out's need to be defined with their interconnecting relationship.It might be possible to use such a net list project to work with an export of a net list from Kicad, but it will involve quite a bit of work, and probably not worth the effort.Like 2N3055 wrote, it is knowing your schematic that teaches you the most.@max.wwwang, there is a saying "Don't byte the hand that feeds you". A lot of the senior members here help out of free will. You might not always agree with them, but being snarky about it will lead to them not helping you anymore.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: March 12, 2023, 08:47:15 pm
content: Quote from: ebastler on March 12, 2023, 08:36:55 pmNo, I don't thing that is configurable (without modifying the source code, KiCad is an Open Source program after all...) But you can keep the highlight key depressed, then the highlighting will start blinking and that is almost guaranteed to catch some attention.

author: 2N3055
author_rank: Super Contributor
timestamp: March 12, 2023, 09:27:44 pm
content: Quote from: max.wwwang on March 12, 2023, 07:10:01 pmReading this back (and reading the answer by Ebastler, thanks buddy!) i realize it came out cynical.Sorry for not being more PC.Let me explain better.Yes I use highlight NET. It is a great visual aid.But you want software to analyze (think) for you. It cannot do that. It would be nice, but it cannot.You can use simulators (I use LtSpice for analog, there are digital simulators too) to help you understand the circuit, I.E. "where signal goes". What do you mean by signal by the way? It is obvious what a signal is in an amplifier, for instance.. But what is signal in a power supply (current and voltage regulator)? How do you follow the signal in mixed signal design that takes analog input , digitizes it through the ADC, transforms it in DSP and then converts with DAC back to analog output.. What are the possible signal paths there?And to answer to you, I can, and in fact did, for many years, analyze schematics on paper without any computer help.. This how it was done for many years. We all did. You would use magic markers and "highlight net". Pun intended.So yeah, I can understand "where signal goes" just by looking into schematics... Also can cursory look at the board and quickly analyze what basic blocks are and general block diagram.Having intuition of how something works from schematics is a skill well worth developing...That was my point and not trying to be snarky..

author: max.wwwang
author_rank: Frequent Contributor
timestamp: March 12, 2023, 10:10:59 pm
content: Thanks for all the good inputon the subject(as always!), cynical or not.