Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries --ompython_omhome=/usr Modelica_4.1.0-beta.om_Modelica.Electrical.Digital.Examples.FlipFlop.conf.json loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices trunk/package.mo", uses=false) loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex trunk/package.mo", uses=false) loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 4.1.0-beta.om/package.mo", uses=false) Using package Modelica with version 4.1.0 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 4.1.0-beta.om/package.mo) Using package Complex with version trunk (/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex trunk/package.mo) Using package ModelicaServices with version trunk (/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices trunk/package.mo) Running command: translateModel(Modelica.Electrical.Digital.Examples.FlipFlop,tolerance=1e-06,outputFormat="mat",numberOfIntervals=5000,variableFilter="time|FF.RS1.TD1.x|FF.RS2.TD1.x",fileNamePrefix="Modelica_4.1.0-beta.om_Modelica.Electrical.Digital.Examples.FlipFlop") translateModel(Modelica.Electrical.Digital.Examples.FlipFlop,tolerance=1e-06,outputFormat="mat",numberOfIntervals=5000,variableFilter="time|FF.RS1.TD1.x|FF.RS2.TD1.x",fileNamePrefix="Modelica_4.1.0-beta.om_Modelica.Electrical.Digital.Examples.FlipFlop") Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices trunk/package.mo): time 0.001355/0.001355, allocations: 105.8 kB / 18.3 MB, free: 4.887 MB / 14.72 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex trunk/package.mo): time 0.001355/0.001355, allocations: 207.8 kB / 19.25 MB, free: 3.941 MB / 14.72 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 4.1.0-beta.om/package.mo): time 1.486/1.486, allocations: 227.7 MB / 247.7 MB, free: 10.37 MB / 206.1 MB Warning: Requested package Modelica of version trunk, but this package was already loaded with version 4.1.0. OpenModelica cannot reason about compatibility between the two packages since they are not semantic versions. Warning: Requested package Complex of version 4.1.0, but this package was already loaded with version trunk. OpenModelica cannot reason about compatibility between the two packages since they are not semantic versions. Warning: Requested package ModelicaServices of version 4.1.0, but this package was already loaded with version trunk. OpenModelica cannot reason about compatibility between the two packages since they are not semantic versions. Notification: Performance of FrontEnd - loaded program: time 0.003053/0.003053, allocations: 71.83 kB / 307.9 MB, free: 0.5078 MB / 238.1 MB Notification: Performance of FrontEnd - Absyn->SCode: time 0.1069/0.1099, allocations: 50.54 MB / 358.4 MB, free: 13.96 MB / 302.1 MB Notification: Performance of NFInst.instantiate(Modelica.Electrical.Digital.Examples.FlipFlop): time 0.003384/0.1134, allocations: 2.142 MB / 360.6 MB, free: 11.8 MB / 302.1 MB Notification: Performance of NFInst.instExpressions: time 0.002401/0.1158, allocations: 1.158 MB / 361.7 MB, free: 10.64 MB / 302.1 MB Notification: Performance of NFInst.updateImplicitVariability: time 9.508e-05/0.1159, allocations: 4 kB / 361.7 MB, free: 10.63 MB / 302.1 MB Notification: Performance of NFTyping.typeComponents: time 0.0001739/0.1161, allocations: 47.58 kB / 361.8 MB, free: 10.59 MB / 302.1 MB Notification: Performance of NFTyping.typeBindings: time 0.0001119/0.1162, allocations: 47.58 kB / 361.8 MB, free: 10.54 MB / 302.1 MB Notification: Performance of NFTyping.typeClassSections: time 0.0004504/0.1167, allocations: 167.8 kB / 362 MB, free: 10.38 MB / 302.1 MB Notification: Performance of NFFlatten.flatten: time 0.0004985/0.1172, allocations: 463.6 kB / 362.4 MB, free: 9.922 MB / 302.1 MB Notification: Performance of NFFlatten.resolveConnections: time 0.0002683/0.1175, allocations: 164.8 kB / 362.6 MB, free: 9.762 MB / 302.1 MB Notification: Performance of NFEvalConstants.evaluate: time 0.0008831/0.1183, allocations: 0.8305 MB / 363.4 MB, free: 8.93 MB / 302.1 MB Notification: Performance of NFSimplifyModel.simplify: time 0.0003362/0.1187, allocations: 251 kB / 363.7 MB, free: 8.684 MB / 302.1 MB Notification: Performance of NFPackage.collectConstants: time 0.0001228/0.1188, allocations: 44 kB / 363.7 MB, free: 8.641 MB / 302.1 MB Notification: Performance of NFFlatten.collectFunctions: time 0.0001122/0.1189, allocations: 44 kB / 363.8 MB, free: 8.598 MB / 302.1 MB Notification: Performance of NFScalarize.scalarize: time 0.0002001/0.1192, allocations: 147.5 kB / 363.9 MB, free: 8.453 MB / 302.1 MB Notification: Performance of NFVerifyModel.verify: time 0.0002663/0.1194, allocations: 214.9 kB / 364.1 MB, free: 8.242 MB / 302.1 MB Notification: Performance of NFConvertDAE.convert: time 0.0008372/0.1203, allocations: 0.9151 MB / 365 MB, free: 7.324 MB / 302.1 MB Notification: Performance of FrontEnd - DAE generated: time 5.791e-06/0.1203, allocations: 7.984 kB / 365 MB, free: 7.316 MB / 302.1 MB Notification: Performance of FrontEnd: time 1.052e-06/0.1203, allocations: 0 / 365 MB, free: 7.316 MB / 302.1 MB Notification: Performance of Transformations before backend: time 7.074e-06/0.1203, allocations: 0 / 365 MB, free: 7.316 MB / 302.1 MB Notification: Model statistics after passing the front-end and creating the data structures used by the back-end: * Number of equations: 81 * Number of variables: 81 Notification: Performance of Generate backend data structure: time 0.001247/0.1216, allocations: 0.8687 MB / 365.9 MB, free: 6.383 MB / 302.1 MB Notification: Performance of prepare preOptimizeDAE: time 3.14e-05/0.1216, allocations: 8.031 kB / 365.9 MB, free: 6.375 MB / 302.1 MB Notification: Performance of preOpt normalInlineFunction (simulation): time 0.0001443/0.1217, allocations: 52.38 kB / 366 MB, free: 6.324 MB / 302.1 MB Notification: Performance of preOpt evaluateParameters (simulation): time 0.0004625/0.1222, allocations: 343.5 kB / 366.3 MB, free: 5.949 MB / 302.1 MB Notification: Performance of preOpt simplifyIfEquations (simulation): time 7.701e-05/0.1223, allocations: 29.22 kB / 366.3 MB, free: 5.922 MB / 302.1 MB Notification: Performance of preOpt expandDerOperator (simulation): time 9.745e-05/0.1224, allocations: 40.38 kB / 366.4 MB, free: 5.883 MB / 302.1 MB Notification: Performance of preOpt clockPartitioning (simulation): time 0.0009087/0.1233, allocations: 493.8 kB / 366.9 MB, free: 5.398 MB / 302.1 MB Notification: Performance of preOpt findStateOrder (simulation): time 1.211e-05/0.1233, allocations: 0 / 366.9 MB, free: 5.398 MB / 302.1 MB Notification: Performance of preOpt replaceEdgeChange (simulation): time 6.364e-05/0.1234, allocations: 12 kB / 366.9 MB, free: 5.387 MB / 302.1 MB Notification: Performance of preOpt inlineArrayEqn (simulation): time 1.543e-05/0.1234, allocations: 11.98 kB / 366.9 MB, free: 5.375 MB / 302.1 MB Notification: Performance of preOpt removeEqualRHS (simulation): time 0.0007903/0.1242, allocations: 374.4 kB / 367.2 MB, free: 5.008 MB / 302.1 MB Notification: Performance of preOpt removeSimpleEquations (simulation): time 0.001939/0.1262, allocations: 1.132 MB / 368.4 MB, free: 3.824 MB / 302.1 MB Notification: Performance of preOpt comSubExp (simulation): time 0.001107/0.1273, allocations: 431.5 kB / 368.8 MB, free: 3.395 MB / 302.1 MB Notification: Performance of preOpt resolveLoops (simulation): time 0.0003745/0.1277, allocations: 185.3 kB / 369 MB, free: 3.211 MB / 302.1 MB Notification: Performance of preOpt evalFunc (simulation): time 5.444e-05/0.1278, allocations: 4.281 kB / 369 MB, free: 3.207 MB / 302.1 MB Notification: Performance of preOpt encapsulateWhenConditions (simulation): time 0.000647/0.1284, allocations: 340.1 kB / 369.3 MB, free: 2.863 MB / 302.1 MB Notification: Performance of pre-optimization done (n=35): time 2.184e-06/0.1284, allocations: 0 / 369.3 MB, free: 2.863 MB / 302.1 MB Notification: Performance of matching and sorting (n=35): time 0.001546/0.13, allocations: 0.7382 MB / 370.1 MB, free: 2.105 MB / 302.1 MB Notification: Performance of inlineWhenForInitialization (initialization): time 8.701e-05/0.1301, allocations: 114.8 kB / 370.2 MB, free: 1.969 MB / 302.1 MB Notification: Performance of selectInitializationVariablesDAE (initialization): time 0.0003195/0.1304, allocations: 298.5 kB / 370.5 MB, free: 1.668 MB / 302.1 MB Notification: Performance of collectPreVariables (initialization): time 6.784e-05/0.1305, allocations: 41.7 kB / 370.5 MB, free: 1.621 MB / 302.1 MB Notification: Performance of collectInitialEqns (initialization): time 0.0001482/0.1306, allocations: 180.7 kB / 370.7 MB, free: 1.438 MB / 302.1 MB Notification: Performance of collectInitialBindings (initialization): time 0.0001195/0.1308, allocations: 86.94 kB / 370.8 MB, free: 1.352 MB / 302.1 MB Notification: Performance of simplifyInitialFunctions (initialization): time 0.0002937/0.1311, allocations: 186 kB / 370.9 MB, free: 1.164 MB / 302.1 MB Notification: Performance of setup shared object (initialization): time 0.0001698/0.1312, allocations: 338.8 kB / 371.3 MB, free: 0.8242 MB / 302.1 MB Notification: Performance of preBalanceInitialSystem (initialization): time 0.0004023/0.1317, allocations: 184.8 kB / 371.5 MB, free: 0.6406 MB / 302.1 MB Notification: Performance of partitionIndependentBlocks (initialization): time 0.0004444/0.1321, allocations: 236.5 kB / 371.7 MB, free: 404 kB / 302.1 MB Notification: Performance of analyzeInitialSystem (initialization): time 0.1458/0.2779, allocations: 0.5178 MB / 372.2 MB, free: 19.66 MB / 302.1 MB Notification: Performance of solveInitialSystemEqSystem (initialization): time 8.516e-06/0.278, allocations: 0.5938 kB / 372.2 MB, free: 19.66 MB / 302.1 MB Notification: Performance of matching and sorting (n=48) (initialization): time 0.00129/0.2793, allocations: 0.645 MB / 372.8 MB, free: 19.57 MB / 302.1 MB Notification: Performance of prepare postOptimizeDAE: time 4.476e-05/0.2793, allocations: 63.78 kB / 372.9 MB, free: 19.5 MB / 302.1 MB Notification: Performance of postOpt simplifyComplexFunction (initialization): time 8.236e-06/0.2794, allocations: 3.328 kB / 372.9 MB, free: 19.5 MB / 302.1 MB Notification: Performance of postOpt tearingSystem (initialization): time 2.144e-05/0.2794, allocations: 2.5 kB / 372.9 MB, free: 19.5 MB / 302.1 MB Notification: Performance of postOpt solveSimpleEquations (initialization): time 0.0001521/0.2795, allocations: 61.16 kB / 373 MB, free: 19.5 MB / 302.1 MB Notification: Performance of postOpt calculateStrongComponentJacobians (initialization): time 9.187e-06/0.2796, allocations: 4.844 kB / 373 MB, free: 19.5 MB / 302.1 MB Notification: Performance of postOpt simplifyAllExpressions (initialization): time 0.0002043/0.2798, allocations: 26.53 kB / 373 MB, free: 19.5 MB / 302.1 MB Notification: Performance of postOpt collapseArrayExpressions (initialization): time 0.0002692/0.28, allocations: 281.2 kB / 373.3 MB, free: 19.49 MB / 302.1 MB Notification: Model statistics after passing the back-end for initialization: * Number of independent subsystems: 5 * Number of states: 0 () * Number of discrete variables: 45 ($whenCondition1,$PRE.FF.And2.auxiliary_n,FF.RS2.TD1.x_delayed,$PRE.FF.RS2.TD1.x,FF.RS2.Nor2.auxiliary_n,FF.RS2.Nor2.auxiliary[2],FF.RS2.Nor2.x[2],FF.RS2.Nor2.x[1],$PRE.FF.And4.auxiliary_n,FF.RS1.TD1.x_delayed,$PRE.FF.RS1.TD1.x,FF.RS1.Nor2.auxiliary_n,FF.RS1.Nor2.auxiliary[2],FF.RS1.Nor2.x[2],FF.RS1.Nor2.x[1],$PRE.FF.Not1.auxiliary,FF.And4.auxiliary_n,FF.And4.x[1],FF.And3.auxiliary_n,FF.And3.x[2],$PRE.FF.And1.auxiliary_n,FF.And1.y,FF.RS2.TD1.x,$PRE.FF.RS2.Nor2.auxiliary_n,FF.RS2.Nor1.auxiliary_n,$PRE.FF.RS2.Nor1.auxiliary_n,FF.RS2.Nor1.auxiliary[2],K.y,J.y,CLK.t_i,$PRE.CLK.t_i,FF.Not1.auxiliary,$PRE.FF.And3.auxiliary_n,FF.And3.y,FF.And2.auxiliary_n,FF.And2.auxiliary[2],FF.And2.x[1],FF.And1.auxiliary_n,FF.And1.auxiliary[2],FF.And1.x[1],FF.RS1.TD1.x,$PRE.FF.RS1.Nor2.auxiliary_n,FF.RS1.Nor1.auxiliary_n,$PRE.FF.RS1.Nor1.auxiliary_n,FF.RS1.Nor1.auxiliary[2]) * Number of discrete states: 0 () * Number of clocked states: 0 () * Top-level inputs: 0 Notification: Strong component statistics for initialization (48): * Single equations (assignments): 46 * Array equations: 0 * Algorithm blocks: 2 * Record equations: 0 * When equations: 0 * If-equations: 0 * Equation systems (not torn): 0 * Torn equation systems: 0 * Mixed (continuous/discrete) equation systems: 0 Notification: Performance of prepare postOptimizeDAE: time 0.000327/0.2804, allocations: 293.6 kB / 373.6 MB, free: 19.31 MB / 302.1 MB Notification: Performance of postOpt lateInlineFunction (simulation): time 8.218e-05/0.2805, allocations: 28.69 kB / 373.6 MB, free: 19.31 MB / 302.1 MB Notification: Performance of postOpt wrapFunctionCalls (simulation): time 6.99e-05/0.2805, allocations: 37.2 kB / 373.6 MB, free: 19.3 MB / 302.1 MB Notification: Performance of postOpt inlineArrayEqn (simulation): time 5.05e-06/0.2806, allocations: 5.75 kB / 373.6 MB, free: 19.3 MB / 302.1 MB Notification: Performance of postOpt constantLinearSystem (simulation): time 6.622e-06/0.2806, allocations: 1.156 kB / 373.6 MB, free: 19.3 MB / 302.1 MB Notification: Performance of postOpt simplifysemiLinear (simulation): time 5.962e-06/0.2806, allocations: 4.5 kB / 373.6 MB, free: 19.3 MB / 302.1 MB Notification: Performance of postOpt removeSimpleEquations (simulation): time 0.0004916/0.2811, allocations: 482 kB / 374.1 MB, free: 19.12 MB / 302.1 MB Notification: Performance of postOpt simplifyComplexFunction (simulation): time 2.164e-06/0.2811, allocations: 0 / 374.1 MB, free: 19.12 MB / 302.1 MB Notification: Performance of postOpt solveSimpleEquations (simulation): time 0.0001017/0.2812, allocations: 53.88 kB / 374.2 MB, free: 19.12 MB / 302.1 MB Notification: Performance of postOpt tearingSystem (simulation): time 2.645e-06/0.2812, allocations: 1.844 kB / 374.2 MB, free: 19.12 MB / 302.1 MB Notification: Performance of postOpt inputDerivativesUsed (simulation): time 7.145e-05/0.2813, allocations: 45.52 kB / 374.2 MB, free: 19.12 MB / 302.1 MB Notification: Performance of postOpt calculateStrongComponentJacobians (simulation): time 2.775e-06/0.2813, allocations: 2.672 kB / 374.2 MB, free: 19.12 MB / 302.1 MB Notification: Performance of postOpt calculateStateSetsJacobians (simulation): time 1.343e-06/0.2813, allocations: 1.062 kB / 374.2 MB, free: 19.12 MB / 302.1 MB Notification: Performance of postOpt symbolicJacobian (simulation): time 0.001049/0.2824, allocations: 0.6035 MB / 374.8 MB, free: 18.99 MB / 302.1 MB Notification: Performance of postOpt removeConstants (simulation): time 0.0002123/0.2826, allocations: 195.1 kB / 375 MB, free: 18.89 MB / 302.1 MB Notification: Performance of postOpt simplifyTimeIndepFuncCalls (simulation): time 0.0001008/0.2827, allocations: 15.41 kB / 375 MB, free: 18.89 MB / 302.1 MB Notification: Performance of postOpt simplifyAllExpressions (simulation): time 0.0001462/0.2828, allocations: 21.14 kB / 375 MB, free: 18.89 MB / 302.1 MB Notification: Performance of postOpt findZeroCrossings (simulation): time 0.0002005/0.283, allocations: 88.23 kB / 375.1 MB, free: 18.89 MB / 302.1 MB Notification: Performance of postOpt collapseArrayExpressions (simulation): time 0.0002188/0.2833, allocations: 283.4 kB / 375.4 MB, free: 18.88 MB / 302.1 MB Notification: Performance of sorting global known variables: time 0.000159/0.2834, allocations: 198.9 kB / 375.6 MB, free: 18.8 MB / 302.1 MB Notification: Performance of sort global known variables: time 1.2e-07/0.2834, allocations: 1.094 kB / 375.6 MB, free: 18.8 MB / 302.1 MB Notification: Performance of remove unused functions: time 0.0003981/0.2838, allocations: 107.2 kB / 375.7 MB, free: 18.79 MB / 302.1 MB Notification: Model statistics after passing the back-end for simulation: * Number of independent subsystems: 1 * Number of states: 0 () * Number of discrete variables: 33 ($whenCondition1,FF.RS1.Nor1.auxiliary[2],FF.RS1.Nor1.auxiliary_n,FF.RS1.Nor2.x[1],FF.RS1.Nor2.x[2],FF.RS1.Nor2.auxiliary[2],FF.RS1.Nor2.auxiliary_n,FF.RS1.TD1.x,FF.RS1.TD1.x_delayed,FF.RS2.Nor1.auxiliary[2],FF.RS2.Nor1.auxiliary_n,FF.RS2.Nor2.x[1],FF.RS2.Nor2.x[2],FF.RS2.Nor2.auxiliary[2],FF.RS2.Nor2.auxiliary_n,FF.RS2.TD1.x,FF.RS2.TD1.x_delayed,FF.And1.x[1],FF.And1.y,FF.And1.auxiliary[2],FF.And1.auxiliary_n,FF.And2.x[1],FF.And2.auxiliary[2],FF.And2.auxiliary_n,FF.And3.x[2],FF.And3.y,FF.And3.auxiliary_n,FF.And4.x[1],FF.And4.auxiliary_n,FF.Not1.auxiliary,CLK.t_i,J.y,K.y) * Number of discrete states: 13 (FF.Not1.auxiliary,FF.And4.auxiliary_n,FF.And3.auxiliary_n,FF.And2.auxiliary_n,FF.And1.auxiliary_n,FF.RS2.TD1.x,FF.RS2.Nor2.auxiliary_n,FF.RS2.Nor1.auxiliary_n,FF.RS1.TD1.x,FF.RS1.Nor2.auxiliary_n,FF.RS1.Nor1.auxiliary_n,K.y,J.y) * Number of clocked states: 0 () * Top-level inputs: 0 Notification: Strong component statistics for simulation (35): * Single equations (assignments): 32 * Array equations: 0 * Algorithm blocks: 2 * Record equations: 0 * When equations: 1 * If-equations: 0 * Equation systems (not torn): 0 * Torn equation systems: 0 * Mixed (continuous/discrete) equation systems: 0 Notification: Performance of Backend phase and start with SimCode phase: time 0.0001556/0.284, allocations: 137.8 kB / 375.8 MB, free: 18.71 MB / 302.1 MB Notification: Performance of simCode: created initialization part: time 0.001014/0.285, allocations: 0.5962 MB / 376.4 MB, free: 18.51 MB / 302.1 MB Notification: Performance of simCode: created event and clocks part: time 2.314e-06/0.285, allocations: 0 / 376.4 MB, free: 18.51 MB / 302.1 MB Notification: Performance of simCode: created simulation system equations: time 0.0004486/0.2855, allocations: 360.1 kB / 376.8 MB, free: 18.33 MB / 302.1 MB Notification: Performance of simCode: created of all other equations (e.g. parameter, nominal, assert, etc): time 0.001206/0.2867, allocations: 339.9 kB / 377.1 MB, free: 18.28 MB / 302.1 MB Notification: Performance of simCode: created linear, non-linear and system jacobian parts: time 0.001141/0.2879, allocations: 0.7524 MB / 377.9 MB, free: 17.88 MB / 302.1 MB Notification: Performance of simCode: some other stuff during SimCode phase: time 0.0002483/0.2881, allocations: 0.809 MB / 378.7 MB, free: 17.17 MB / 302.1 MB Notification: Performance of simCode: all other stuff during SimCode phase: time 0.0009355/0.2891, allocations: 366.7 kB / 379 MB, free: 16.95 MB / 302.1 MB Notification: Performance of SimCode: time 4.41e-07/0.2891, allocations: 0 / 379 MB, free: 16.95 MB / 302.1 MB Notification: Performance of Templates: time 0.01148/0.3006, allocations: 8.296 MB / 387.3 MB, free: 14.32 MB / 302.1 MB make -j1 -f Modelica_4.1.0-beta.om_Modelica.Electrical.Digital.Examples.FlipFlop.makefile (rm -f Modelica_4.1.0-beta.om_Modelica.Electrical.Digital.Examples.FlipFlop.pipe ; mkfifo Modelica_4.1.0-beta.om_Modelica.Electrical.Digital.Examples.FlipFlop.pipe ; head -c 1048576 < Modelica_4.1.0-beta.om_Modelica.Electrical.Digital.Examples.FlipFlop.pipe >> ../files/Modelica_4.1.0-beta.om_Modelica.Electrical.Digital.Examples.FlipFlop.sim & ./Modelica_4.1.0-beta.om_Modelica.Electrical.Digital.Examples.FlipFlop -abortSlowSimulation -alarm=480 -emit_protected -lv LOG_STATS > Modelica_4.1.0-beta.om_Modelica.Electrical.Digital.Examples.FlipFlop.pipe 2>&1) diffSimulationResults("Modelica_4.1.0-beta.om_Modelica.Electrical.Digital.Examples.FlipFlop_res.mat","/var/lib/jenkins1/ws/OpenModelicaLibraryTestingWork/Reference-modelica.org/ReferenceResults/MAP-LIB_ReferenceResults/v4.1.0/Modelica/Electrical/Digital/Examples/FlipFlop/FlipFlop.csv","/var/lib/jenkins1/ws/OpenModelicaLibraryTestingWork/OpenModelicaLibraryTesting/files/Modelica_4.1.0-beta.om_Modelica.Electrical.Digital.Examples.FlipFlop.diff",relTol=0.003,relTolDiffMinMax=0.003,rangeDelta=0.001) Reference file matches