Darius wrote on Jun 12th, 2007, 2:58am:1)how to plot the outputs of single mosfet like each gate current or charges?
This is a simulator-specific implementation detail; your simulator may or may not provide access to that information, and you'll have to read the documentation to find out how to get it.
Quote:2)how is possible to decide from simulator netlist if to connect 2 or 3 mosfets in the chain?(I'm thinking about if or case statement but this block is outside the "analog begin" and this solution doesn't work.
I think what you want is presently not possible within the language (there's ongoing work in the committee to permit the "generate" construct to do this).
However, you might be able to get similar behavior by setting up the chain for the longest length you might want, and then use a parameter to select how to short out the chain.
Code:module moschain(drain, gate, source);
//...
parameter integer short_to = 0 from [0:2];
mos m1 (.g(gate), .d(d1), .s(source));
mos m2 (.g(gate), .d(d2), .s(d1));
mos m3 (.g(gate), .d(drain), .s(d2));
analog begin
if (short_to == 1)
V(d1,source) <+ 0;
else if (short_to == 2)
V(d2, source) <+ 0;
end
endmodule
If short_to == 2, then d2 will short to source, and only "m3" will be active. If short_to == 0, then the LRM specifies that the default for the branches is zero flow, meaning that there are no shorts, and the current has to flow through all 3 mosfets.