Quantcast
Channel: Cadence Custom IC Skill Forum
Viewing all articles
Browse latest Browse all 5201

buildString using a ForLoop to load and delete data on the fly

$
0
0

Hello, I'm trying to create a list() using the function buildString and a loop, then destroy the elements when the operation ends. The reason is because a stack overflow occurs when my list() has nearly 200k elements. I have a schematic with a circuit that contains roughly 200k instance pCells, and I want to save the voltage of each pCell when the simulation is done. For that in my ocean.ocn script i have these lines.

Out = outfile("text.txt" "w")

Volt = list( "/I1/Vp" "/I2/Vp" "/I3/Vp" .....)

  foreach(j VoltocnPrint(?output Out value(VT(j) 30m))

)

close(Out)

It's not efficient, but works when the elements of Volt are few. When the list reaches the 140k elements, stack overflow happens and the script doesnt launch. I was looking for a fix; first trying to add a table (using readTable() in a ocean script doesnt work), then I tought of using a for loop that creates an element in a list, "VoltocnPrint()" takes place, then the element is deleted, so stack overflow doesnt happen. For that I was looking for a function like buildString and by my surprise it doesnt work with a for loop. I'm not sure why. The code is the following.

Volt= list()
sum = 5
for( i 5
     sum = sum - 1
     g = buildString( '("/" "I" sum "/" "Vp") "")  ;I want to add the number where sum is
     Volt= xcons(Volt g)
     foreach(j Volt
          ocnPrint(?output Out value(VT(j) 30m))
    setq Volt remove(nth(0 Volt))
)

This creates a list, a loop in which the list is fille, then for each element of the list, the first one created is saved in the output, after that I eliminate that element and repeat the process. But for some strange reason the buildString doesnt add the number, maybe because it has to be a string too (hence why it is build string), so what should I change in order to fix this? 

Thanks, Yass


Viewing all articles
Browse latest Browse all 5201

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>