Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Parameterized subsample/supersample

Parameterized subsample/supersample

Hi,

I noticed that subsampling and supersampling factors in the subsample and supersample functions must be final integer parameters instead of just integer parameters.
For example the below code: as it is it runs fine, but without either of the two final keywords, the compiler refuses, saying:

[1] 15:10:51 Translation Error
pre-optimization module clockPartitioning (simulation) failed.

The code:

Code:


model test_sampling
  /*Define the clock structure*/
  final parameter Integer AD_oversampling = 20;
  final parameter Integer mpx_factor = 2;
  Clock Clk_row = Clock(1, 6250000) "Base row clock = 6.25MHz.";
  Clock Clk_AD = superSample(Clk_row, AD_oversampling) "AD converter samples each row signal 20x.";
  Clock Clk_frame = subSample(Clk_row, mpx_factor) "Number of rows per frame (=oversampling factor).";
initial equation

equation

end test_sampling;

I never saw this documented. The examples are all with fixed numbers.
Is this intentional, missing documentation or a bug?
At the least, the error message is non-specific.

Best regards,
Paul

There are 0 guests and 0 other users also viewing this topic
You are here: