Note - this spice netlist is generated in .xschem/simulations (.xschem is a hidden folder which can be seen after you enable view hidden files in home gui or using the command ls -aslrt in terminal, here option a gives you the hidden files)
When spice is imported the topmost cell( a black box with all the FETs and PINs inside is seen).
You can use two ways to go to the bottom hierarchy to perform layout
- place user controlled box over the black box(visible top level cell) and go to edit->select area. This selects the topmost cell now go to windows and then down hierarchy. You can see the cells and fets.
- hover over the topmost cell and press i to select and x to go to bottom hierarchy.
Now, it might happens that only pins are imported and not the fets, this seems to be a magic error. It is recommeneded to close magic. Delete the .mag file created in this process as it will interefere when you try to import spice again. In my case inverter.mag is deleted Now re-import spice, and go to bottom hierarchy. To move the cells, hover over the fets and press i to select and take the cursor where you want to move the fets and press m. This method might not work instantly, but after zomming in and out and trying it multiple times it works. To move the pins, try the above method- If it doesn't work, try the following:
- make a user controlled slightly larger than the pins over the pins and select area. Now place the user box to the location where you want to place the pins and press m
click on edit->select select area option->click on delete
ALIGN has been dealt with in detail in week2. ALIGN is looking for patterns in .sp file to generate the layout. It will generate different layouts for different order of FETs in the .sp irrespective of them corresponding to the same circuit. The order of fets in .spice depends on the order in which you import fets to make the schematic in xschem.