Languages

CommunityCategory: XMODELSlow-down problem when modeling analog multiplexer with large input values using ‘switch’ primitives.

XMODEL

Slow-down problem when modeling analog multiplexer with large input values using ‘switch’ primitives.

SA Support Team Staff 2018-01-26

I have a model that selects one from multiple frequency values as controlled by digital inputs. When I described the model using a set of switch primitives in parallel, I found the simulation became rather slow with many events generated. Why is that?

1 Answers
Best Answer
SA Support Team Staff 2018-01-26

The problem is not with the switch primitives; it is with the very large input values you are feeding the switch-based multiplexer with. They are MHz range, larger than 1,000,000.

When XMODEL simulates circuit-level models like this one using switch primitives, it tries to suppress the occurrences of large numbers as they may result in loss of information contained in small numbers when they are combined together (e.g. adding a large number to a small number). In this case, XMODEL generates additional events to avoid such information loss.

One way to get around the problem is to feed scaled-down inputs to the switch-based multiplexer and scale the output up later using a scale primitive. The simpler way is to use a select primitive instead of the switch primitives, which is a function primitive that directly models an analog multiplexer.