https://open-source-silicon.dev logo
#magic
Title
# magic
j

Juan Andres

03/11/2023, 7:40 PM
Does anyone know how I can correct my test bench to simulate a design taken from magic with a subcircuit?
l

Luis Henrique Rodovalho

03/11/2023, 8:21 PM
Where is the inverter subcircuit's spice file?
j

Juan Andres

03/11/2023, 8:21 PM
as the subcircuit is flattened, the transistors appear in the spice
l

Luis Henrique Rodovalho

03/11/2023, 8:23 PM
The subcircuit has only two terminals, VDD and GND. The other terminals aren't listed.
It seems it is a ring oscillator...
j

Juan Andres

03/11/2023, 8:24 PM
It is connected inside
Yes
l

Luis Henrique Rodovalho

03/11/2023, 8:27 PM
Copy code
X0 vout1 vout3 GND GND inverter_blo
X1 vout2 vout1 GND GND inverter_blo
X2 vout3 vout2 GND GND inverter_blo
X3 vout3 vout2 VDD VDD inverter_blo
X4 vout1 vout3 VDD VDD inverter_blo
X5 vout2 vout1 VDD VDD inverter_blo
It has four terminals here in your testbench file. That is why it doesn't run.
You should use
X0 VDD GND inverter_blo
j

Juan Andres

03/11/2023, 8:28 PM
if I just call GND and VDD, which I think is what comes out of the block, it simulates but everything stays at 0, even though I initialize to 0
what could be the error?
l

Luis Henrique Rodovalho

03/11/2023, 8:29 PM
You should start any inner node with a preset voltage. Use
Copy code
.ic X0.vout1 = 1
Your transient command should be:
Copy code
tran 0.1n 50n 0.1n uic
j

Juan Andres

03/11/2023, 8:31 PM
what is uic?
l

Luis Henrique Rodovalho

03/11/2023, 8:31 PM
use initial condition
j

Juan Andres

03/11/2023, 8:43 PM
Yes that worked, but this command "nodeset x2.vout3=0" its same?
l

Luis Henrique Rodovalho

03/11/2023, 8:45 PM
I don't know if it works for transient simulations. It should. But it should not be set as 0, I think. nodeset and ic act different. Nodeset is too find the solution for OP and DC, but I don't know if it works as a initial condition for transient sims.
j

Juan Andres

03/11/2023, 8:46 PM
Well, I used nodeset with conditional 0, and it also works
l

Luis Henrique Rodovalho

03/11/2023, 8:48 PM
Good. Just be aware that for a real design, you must consider the width of the metal tracks, as they may not be able to handle the current.
j

Juan Andres

03/11/2023, 8:51 PM
thanks
@Luis Henrique Rodovalho Do you know how I can instantiate the block, taking into account that it has 9 outputs?
l

Luis Henrique Rodovalho

03/12/2023, 8:37 AM
it is the name of the instance, begining with x, then the names of each node at each pin, then the name of the subcircuit.
2 Views