Like Open Modelica? https://openmodelica.org/

Hm, maybe. I don’t think it has a code generator though.