I am wondering how to calculate the output resistance of a High-Swing Cascode Current Mirror from small-signal parameters, see question High-Swing Cascode Current Mirror for the circuit.
First I transformed the output stage of that circuit to a small-signal representative, see circuit below (only considering gm and gds, since they have by far the highest impact). Since the output resistance is measured by shorting the inputs, the voltage controlled current sources deliver actually zero current and play no further role in the analysis. Therefore, the output resistance should be R_DS4 + R_DS2.
I simulated the High-Swing Cascode Current Mirror and got the following small-signal parameters (bias voltage and output voltage of 1V):
\$ gm_4=297.8uS \\ gds_4=3.118uS \\ gm_2=290.8uS \\ gds_2=2.267uS \$
If I calculate now the output resistance as above, I get:
\$ 1/gds4 + 1/gds2 = 320718.4\Omega + 441111.6\Omega = 761830\Omega \$
But that seems totally different than what the simulation says, which is \$ 50M\Omega \$! I calculated this output resistance in cadence by typing 1/deriv(I_D4) in the calculator (Plotting I_D4 over V_OUT).
What am I doing wrong?