The code below, when checked in SystemModeler reports the following error message:
[133] 4:21:42 PM Validation of model test Validation of model test completed successfully. The model myCounter has 45 equations and 47 variables. 22 of these are non-trivial equations.
When I try to simulate this, the simulator reports:
Building "test" as experiment "test 1" started at 16:48:24 Error: [:0:0-0:0]Simulation model is not globally balanced, having 35 variables and 33 equations. Error: No executable generated C:/Users/fspagna/AppData/Local/Temp/3/sme.4.0.0141549410427740.exe Error: No settings file generated C:/Users/fspagna/AppData/Local/Temp/3/sme.4.0.0141549410427740_init.sim
It is not obvious (to me) what is wrong with this code so any help would be welcome. This also raises another more general question. How does one debug this kind of issued? The error messages are not very helpful and there does not seem to be any option to make them more verbose.
Thank you,
Fulvio
==========================================================
model test
import D = Modelica.Electrical.Digital; import L = Modelica.Electrical.Digital.Interfaces.Logic; import S = Modelica.Electrical.Digital.Interfaces.Strength; parameter Integer n=1; parameter Integer nn (min=1) = 2 "Number of bits"; parameter Modelica.SIunits.Time tHL = 0.1 "High->Low delay"; parameter Modelica.SIunits.Time tLH = 0.1 "Low->High delay"; parameter D.Interfaces.Strength strength = S.'S_X01' "output strength"; D.Registers.DFFREG FF[nn]; D.Basic.Not INV; D.Interfaces.DigitalInput reset; D.Interfaces.DigitalInput clock; D.Interfaces.DigitalOutput q[nn] ;
equation connect(clock, FF[1].clock); connect(reset, FF[1].reset); connect(FF[1].dataOut[1], q[1]); connect(FF[1].dataOut[1], FF[2].dataIn[1]);
connect(clock, FF[2].clock); connect(reset, FF[2].reset); connect(FF[2].dataOut[1], q[2]);
connect(FF[2].dataOut[1], INV.x); connect(INV.y, FF[1].dataIn[1]);
end test;