ModelSim Leaf Instances

Hello group,

I ran into an ugly ModelSim6 warning saying that I had too many "leaf instances" or lines of code, and that my performance was going to be severly affected. Sure was. A simulation that normally runs in about a minute now takes an hour.

I traced the problem down to instantiated primitive FIFOs that I replaced with an inferred memory. Why does this work? Fewer instances to be sure, but not less hardware. This appears to be an arbitrary ceiling imposed by the marketing people at Mentor.

Although I have a temporary fix, questions arise:

1) What is a "Leaf" instance? 2) How do I know when I'm running out of room? 3) What are the best practices to get the most out of the ModelSim XE starter?

Thanks,

Brad Smallridge AiVision

Reply to
Brad Smallridge
Loading thread data ...

Brad Smallridge schrieb:

Hi Brad, leaf instances are the way modelsim counts the ammount of code you want to simulate. I'm not sure how it is done precisely, but the effect you have seen can be explained.

The instantiated primitive fifo consisted of eiter a netlist with many gate instances to simulate or a quite large (coregen?) simulation model. Your infered memory probably just had quite few lines of code.

Modelsim doesn't care how much hardware a synthesis tool will create. It's a simulator and therefore can just take the ammount of source code to simulate into account.

Older versions of Modelsim XE starter printed the maximum and/or the actual number of leaf instances in the transcript window. I can't find that anymore in the 6.2c version.

If your simulation time went up from minutes to about an hour the difference in leaf instances must be massive. My own experiences (even with large designs) never had such a drastic loss of performance.

Do you have a large number of FIFOs in your design? e.g. Basic design has 1000 leaf instances and uses 10 FIFOS. If each FIFO consists of 500 leaf instances itself you end up with 6000 leaf instances. If the infered memorys use 20 leaf instances you come up with

1200 leaf instances in the end.

6000 compared to 1200 needs a lot more calculations anyway, and if these are also slowed down by some factor...well just let's say it will take long.

What kind of computer du you have? Actual "over 2GHz" and "more than 512MB RAM" machines should perform quite well, even above the XE Startetr leaf instance limit.

have a nice simulation Eilert

Reply to
backhus

Hi Brad,

Please take a look at the MXE FAQ that Xilinx has on what the limits of the starter version is:

formatting link

If you are running into the leaf limit with Instantiated Xilinx FIFO and not when inferring, ensure that you are using the correct libraries. Xilinx marks the libraries such that each component is seen as only one line. Realize that the starter version is free and thus it does come with limits. One of the main limits is the number of lines and number of non-xilinx leaf instances. It should not tell you that you are reaching the max number of non-xilinx leaf limits if you are using the Xilinx components. Unless you are not using the pre-compiled libraries that are released by Xilinx.

Thanks Duth

Reply to
Duth

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.