AnsweredAssumed Answered

Switching different ports

Question asked by ren_zokuken01 on Mar 20, 2016
Latest reply on Mar 23, 2016 by ren_zokuken01
I happen to be working on a circuit with 3 ports, for checking the limits of it's operation, I need to switch 3 different inputs on these 3 ports. So 3! = 6 permutations.

I thought I could simply make the 3 inputs be connected to output ports, then assign the individual port names to variables inside a VAR (multiplexed by conditional if-else):

PORT1=if (mode == 1) then IN1 elseif (mode == 2) then IN2 else IN3 endif
PORT2=if (mode == 1) then IN2 elseif (mode == 2) then IN1 else IN3 endif
PORT3=if (mode == 1) then IN3 elseif (mode == 2) then IN2 else IN1 endif
/* ^only a shortened example, not actual declaration */
/* "mode" is "Parameter Sweep"-ed */

These variables PORT1, PORT2, PORT3 are then the same name as the input ports (there's really no parameter in input ports to assign these values). So the intended effect is mapping the IN1, IN2, IN3 to PORT1, PORT2, PORT3 with the permutations afforded by the conditionals.

I quickly found out that that could never work as these are Simulator Expressions -- processes that happen before the numerical calculations are done, simply used as initial starting values for everything else.

Seems like I have to rely on Symbolically Defined Devices. I skimmed through the help file and realized that it a little bit too much to learn in a few day's time. So I was wondering if there was a more direct way of doing this?

Edited by: ren_zokuken01 on Mar 20, 2016 9:47 AM