Working on my first 4 layer board and routing a USB3 chip (WQFN-100) is taking forever with all of the bypass caps and such. Thing is this board has 4 of these chips and other associated components. Drawing duplicate schematics is easy, just broke the whole mess into it’s own sheet, copied the sheet 3 times and annotated.
Having to place all of these components 3 more times and routing them is gonna take forever. Was curious if there were any tricks to duplicating a specific section of a layout so it can be repeated
Euhm, oops.
That is not the way you should do it. (We’ve all been there and made those mistakes).
KiCad can work very nicely with Hierarchical sheets.
With Hierarchical sheets you have a “main” or “top” sheet, and you put the stuff you want duplicated on a separate page.
Then you simply make 4 links to that separate page from your “top” sheet.
It’s explained in much more detail in:
If you’re using Hierarchical sheets, then you can also use the “Replicate Layout” plugin (Search this forum and/or github for it).
With the Replicate Layout plugin, you design the part for one of the 4 sheets on the PCB, and you place a reference Footprint for the other parts, and then the plugin replicates the layout for the other instances of your hierarchical sheet.
You can run the plugin multiple times. This is especially handy when you make revisions of your PCB, or when you’re learning to work with the plugin.
When I said “copied sheets” I meant, copied Hierarchical sheets". I sort of misspoke by saying copied, I figured it would be apparent. Once I made a sheet that was to be replicated I saved it and "appended schematic sheet content into another hierarchical sheet.
I will try the script, sounds exactly like what I’m trying to do. Thanks
We get all sorts of people here from all over the world and with different experience levels, languages and assumptions.
But what you (apparently) did is not the way it should be done.
Your “USB3_controller” sheets each have a separate file name ("_C1" through “_C4”). The intention is that you only have one physical sheet, (and thus one file name) and then use four instances of that sheet on the “top” schematic. If you then make changes during revisions, then you only have to make the change once for each of the USB controllers.
Then you make the different connections to each instance (of the same) sheet by importing hierarchical sheet labels. It’s a bit complex at first to get the concept into your head, but once you understand it, it works quite good.
This workflow is also mandatory if you want to use the “Replicate Layout” plugin.
But what you (apparently) did is not the way it should be done.
I use different sheet files because I honestly never felt like figuring out how hierarchical labels work. …You can’t be a wizard at every piece of software you use. I just use global labels with different names, that['s obviously not gonna work if using multiple instances of the same sheet file.I typically don’t do 100pin packages and ~200 bypass caps so it hasn’t really mattered much.
I’ll spend some time looking into it since this replicator script is a thing.
Here is a simple example hierarchical project for you to play with. Not only do I re-use the same schematic file twice in the root schematic, but there are two levels. A total of 7 pages with 4 schematic files. Yes, it is an over-use of hierarchical sheets, but that was done for example reasons. KiCad5TestNewHierarchical.zip (3.4 MB)
I did not (though probably should have for practice reasons) use the Replicate Layout, so feel free to rip up the board and re-layout using that plugin for practice.
I think I have the idea of the hierarchical labels, Not sure how other EDA software does this but it seems kind of odd, basically turning the sheet into a component.
One question, does a hierarchical label create a local net within a sheet if used twice inside the sheet? I’ve avoided doing that since I wasn’t sure.
There’s probably about 70 components and 150 pins in use, maybe 200 pins including the dead pins on the package.
I backed up the old project directory before I started converting this. One thing I’m not sure about is I already laid out one chip in PCBNew. I’m not sure how the components are linked, but the sheet I used as the new hierarchical sheet was the one I already laid out. When I’m done here I’ll annotate and I’m hoping that that set of components doesn’t get wiped.
That sure looks like it’s worth to learn the Replicate Layout plugin.
And after that you can also use it for your new projects.
It is probably easier if you first start with a simpler project, or with 1/4 of the footprints from this design, unless you manage to re-use both the schematic and PCB layout of what you already made (It can be done, it may need Eeschema / Tools / Update PCB from Schematic / Match Method: Re-associate footprints by reference.
But whatever you do. Try to do it in steps. First get to know the plugin with some simple experiments, and only then use it for more serious work. If you try to do it all at once, (and “perfect” the first time) then there is a big chance that you spend a lot of time on some detail, which later turns out to be a dead-end and you have to re do it.
I know that this might come across as nagging, but I’d rather see that we call the Replication Layout a plugin and not a script. While the installation involves copying a folder containting .py files, the code presents itself to the user through GUI only. There is no activity in terminal involved to use the code. By calling it a script some KiCad users might be discouraged to try it.
With computer magic witchcraft, which some people who consider themself normal, I have edited all my posts in this tread and changed “script” to “plugin”.
I wasn’t able so save the layout completely after converting the schematic to a fully hierarchical design. Luckily most of the traces were still there and most of the nets stayed the same so I just dropped new footprints on top of tracks. Once that was done with the reference set of components, I used the “replicate layout” plugin and it worked great. I was a little worried with all the mention of “try something simple first”…sounded like it was gonna break something.
Still took forever to finish laying out and routing this thing, probably the most complicated thing I’ve done personally…Off to the fab…