﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5490	Make the NF the default choice for code generation with automatic fallback to OF	Francesco Casella	Adeel Asghar	"During the Board meeting of 17-05-2019 it was decided to make the new frontend the default option for code generation in 1.14.0, so that people start using it and either get the benefit of improved performance and coverage, or help finding remaining bugs. On the other hand, we need to make sure we don't have users complaining that models that used to work in 1.13.2 now fail with 1.14.0, so it was also decided to have some kind of automatic OF-fallback option.

Analysis of the results of the testsuite using the OF and NF as of today reveals that:
- the NF coverage of the MSL 3.2.3 is 100%, and the remaining issues with models that fail to simulate or prod uce wrong results against the references are due to backend/runtime issues, see #5288
- the overall simulation coverage with the NF is only slightly lower than the one with the NF (7375/8939 vs.7658/8939), mostly because of #5204 - as soon as #5204 is fixed, the NF coverage is very likely going to take over
- after the bugfixes in the last few months, there are no known cases whereby the NF successfully leads to simulation with wrong results, while the OF leads to simulation with correct results, while there are known cases of the contrary occurrence, e.g. #2858.

Given these facts, I would suggest to implement the Board Decision in OMEdit in the following way:
- We change the text of the option ""Enable experimental new instantiation phase"" to ""Enable new frontend for code generation"", which reflects more accurately what happens, and refers to ""new frontend"", which is the buzzword we've used consistently in the last three years
- We make that true by default
- If the code generation fails during frontend, backend, C code generation, and C code compilation, a warning is issued like ""Code generation using the new(old) frontend fails. Retrying with the old(new) one. You may change the preferred frontend option in Tools | Options | Simulation | Enable new frontend for code generation"". Then, the code generation is attempted using the other option

As I see it, this set-up should improves the user experience in terms of increased compilation speed and reduced number of failures, while avoiding cases in which models that were previously simulating correctly in 1.13.2 will cease to do so in 1.14.0.

Regarding the scripting environment, I would instead keep it like it is, only make -d=newInst the default and explain in the release notes that in case this generate trouble, you can set the compiler option -d=nonewInst and use the old one. People using scripting have a deeper technical understanding, so this should be ok. I would avoid the automatic retry option, because this could cause weird behaviour in complex script-based applications."	enhancement	closed	blocker	1.14.0	OMEdit		fixed		Per Östlund Adrian Pop massimo ceraolo Andrea Bartolini Rüdiger Franke
