SKILL limitations or wrong usage?

M

mm77

Guest
I have a skill script with two nested foreach loops.
In the inner loop I run() simulations, get some results, plot to a
window and compute some quantities from the results which are put in a
vector.
In the outer loop I use the output of the vector (there are actually
four vectors), which are transformed into waveforms and plotted into
another window

I put a portion of the code inside a let statement and I get:
*Error* eval: branch distance too far in the generated code

If I put these two foreach loops in a let() statement (where those
vectors variables are declared in the let), I get:
*Error* eval: code size too big inside a construct (32767 max; 33341
given)!

Note that just commenting out one (just one!) line of code (I have 300
with more than more than 3/5 comments) make the script work! (and the
line is correct, just commenting out any line will work)
What's causing those messages?
How can solve this?
The script is not so large. Is SKILL/OCEAN expected to work with very
small script, or am I doing something wrong? For example all the
variables are global (simply because it's not convenient having to
declare all the used variable: it would much more convenient to have
to declare global variables instead). Is that because of this?

Thanks for any suggestion,
Marco
 
On Jan 9, 7:35 pm, mm77 <marcoball...@gmail.com> wrote:

I put a portion of the code inside a let statement and I get:
*Error* eval: branch distance too far in the generated code
Sorry wrong copy/paste: I get this message *without* the let wrapping
the foreach loops.
Marco
 
On Jan 9, 10:35 am, mm77 <marcoball...@gmail.com> wrote:
I have a skill script with two nested foreach loops.
In the inner loop I run() simulations, get some results, plot to a
window and compute some quantities from the results which are put in a
vector.
In the outer loop I use the output of the vector (there are actually
four vectors), which are transformed into waveforms and plotted into
another window

I put a portion of the code inside a let statement and I get:
*Error* eval: branch distance too far in the generated code

If I put these two foreach loops in a let() statement (where those
vectors variables are declared in the let), I get:
*Error* eval: code size too big inside a construct (32767 max; 33341
given)!

Note that just commenting out one (just one!) line of code (I have 300
with more than more than 3/5 comments) make the script work! (and the
line is correct, just commenting out any line will work)
What's causing those messages?
How can solve this?
The script is not so large. Is SKILL/OCEAN expected to work with very
small script, or am I doing something wrong? For example all the
variables are global (simply because it's not convenient having to
declare all the used variable: it would much more convenient to have
to declare global variables instead). Is that because of this?

Thanks for any suggestion,
Marc
I have used a foreach within a foreach with no problems. I would have
just put both inside the one let. I bet if you put both foreach inside
the let, and double check your code, it should work fine.
 
layoutDesign wrote, on 01/09/09 21:07:
On Jan 9, 10:35 am, mm77 <marcoball...@gmail.com> wrote:
I have a skill script with two nested foreach loops.
In the inner loop I run() simulations, get some results, plot to a
window and compute some quantities from the results which are put in a
vector.
In the outer loop I use the output of the vector (there are actually
four vectors), which are transformed into waveforms and plotted into
another window

I put a portion of the code inside a let statement and I get:
*Error* eval: branch distance too far in the generated code

If I put these two foreach loops in a let() statement (where those
vectors variables are declared in the let), I get:
*Error* eval: code size too big inside a construct (32767 max; 33341
given)!

Note that just commenting out one (just one!) line of code (I have 300
with more than more than 3/5 comments) make the script work! (and the
line is correct, just commenting out any line will work)
What's causing those messages?
How can solve this?
The script is not so large. Is SKILL/OCEAN expected to work with very
small script, or am I doing something wrong? For example all the
variables are global (simply because it's not convenient having to
declare all the used variable: it would much more convenient to have
to declare global variables instead). Is that because of this?

Thanks for any suggestion,
Marc

I have used a foreach within a foreach with no problems. I would have
just put both inside the one let. I bet if you put both foreach inside
the let, and double check your code, it should work fine.
You've probably hit the problem described in my sourcelink solution number
11496302. This can happen quite easily if you use the plot() function several
times within a foreach. The plot function is actually a macro (since IC5141
USR1) which was expanding to quite a lot of code - causing the code to end up
being rather large, despite the fact that you had written not that much code.
Normally this limits only gets reached in machine-generated code.

The problem was fixed in 5.10.41.500.5.124 - it's still a macro, but much
smaller in size, so the limit is unlikely to be reached now.

You could use this as a workaround:

procedure(MYplot(a) plot(a))

and then use MYplot() instead - this would only work with a single argument call
to plot - you might want to expand it a bit to take care of your usage. Or just
install an ISR later than the one above. Note I think it may have just missed
IC5141 USR6 (I've not checked, but from reading the CCR, I think that's the case).

Regards,

Andrew.
 

Welcome to EDABoard.com

Sponsor

Back
Top