Closed AdriPWS closed 10 months ago
For the issue 2) moyenne: You need to edit the code with "for(int i=0;i<4;i++)" into the "void initialize()" part. This is the final code to use !
Issue 1 is fixed. External C code and internal c code are compiled differently. Also in this C code, the variable "out" is not initialized. This created a different behavior between both cases. Adding an initialization (out = 0) makes both c code block behaviors identical.
The crash is fixed in this release:
https://aesimtech.s3.us-east-1.amazonaws.com/artifacts/8MiAE6Rsr4POgq20ogQgkqsrVmv80Q2n/simba.exe pip install aesim.simba==2023.10.17a1
@jcornau, you can check that it works and if it is the case you can close this issue.
Describe the bug I use the SIMBA 23.9 version for describing the following bugs and crash: Monostable_moyenne.zip See attached the "zip" folder to reproduce the 2 issues:
If you open the zip folder and run the .jsimba file, you'll obtain 2 designs: "monostable" & "moyenne".
Issue 1: 1) For "monostable" design: run the circuit and the 2 outputs for each C block don't provide the same results. Of course the C code is the same. You need to put a "sample time" value inside the " C block (external)" to make it run with same results. see the gif: "C_code_bug"![C_code_bug](https://github.com/aesim-tech/simba-project/assets/115028249/21bc6923-e0cc-4f7e-b706-02f9cf73a836)
2 For "moyenne" design: The bug/crash could be reproduced by following the "gif": "c_code_bug5".![C_code_bug5](https://github.com/aesim-tech/simba-project/assets/115028249/6c1ba9f2-eeb9-4f0d-aa95-0e3ed6467755)
In deed, SIMBA crashes when the 2 C blocks are into the same design for this case. If you delete the "external one" or "normal", crash is avoided but it may happen randomly. And finally results check will provide a crash.