Xcos closes when I simulate my block

Hello, if you may, I need help with this. Every time I run my simulation the XCos closes. I just wanna ask what the problem of my block arrangement.


ece107-finalPrjct-test.zcos (6.0 KB)

Basically, what I want to achieve is a PWM Demodulation. Im trying to trigger the sawtooth to produce a ramp signal just like the image below.

PWM Modulation and Demodulation

Please precise what version of Scilab you are using and the operating system. On my computer with scilab 2023.1.0 your diagram runs fine with the following output: