LTSPICE is offering very nice possibility to incorporate repeatable portions of schematic into simulation, that is not available in many other SPICE simulation programs- hierarchical blocks. Hierarchical blocks represent reusable portions of schematic, visible on higher level of schematic as a symbol. While LTSPICE is missing multipage schematic editor, hierarchical blocks are offering another simple way of creating complex schematics.
Hierarchical blocks have very much in common with subcircuits. The main difference is that hierarchical block in LTSPICE is schematic, not the netlist in the library.
The other difference is that you can pass different parameter values for different instances of the part, using the same subcircuit. You can pass parameters to hierarchical blocks also, but they would be the same for all different instances that you may have on main schematic.
One big advantage of hierarchical block is simplicity of probing internal nodes. Click on hierarchical block symbol opening schematic of hierarchical block, and probe any point of it’s schematic the same way as in main schematic. Just enable “Save Subcircuit Node Voltages” and ”Save Subcircuit Device Currents” in Tools –> Control Panel –> Save Defaults tab of control panel menu.
To create a hierarchical block :
To create a symbol, representing hierarchical block:
Important: Name of schematic, representing hierarchical block and name of it’s symbol should be the same. Just extensions are different. Otherwise, LTSPICE would not be able to establish relationships between them.
You are ready to use your new hierarchical block. Don’t forget to create a simple test-bench for your newly created hierarchical block to make sure it operate’s properly.
I made a couple of pictures illustrating creation of hierarchical block. I will use schematic of LM317, that I created by converting LM317 SPICE subcircuit model in this example. You can download example files LM317HB.
1. Create schematic of hierarchical block.
2. Label all nodes that should have outside visibility.
3. Create a symbol for hierarchical block.
4. Set symbol type as a block and save it withe same name as schematic it represents (just different extension).