From 8d69922698ca3ef853e3ec1cc828edf4c861729e Mon Sep 17 00:00:00 2001 From: Levon Saldamli Date: Wed, 17 Dec 2003 14:02:34 +0000 Subject: [PATCH] Debug traces git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@1058 f25d12d1-65f4-0310-ae8a-bbce733d8d8e --- modeq/inst.rml | 14 ++++++++++++-- modeq/staticexp.rml | 34 ++++++++++++++++++++++++++++++---- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/modeq/inst.rml b/modeq/inst.rml index 2136596915b..a5f1b33044b 100644 --- a/modeq/inst.rml +++ b/modeq/inst.rml @@ -1129,6 +1129,12 @@ relation add_components_to_env2 : (Env, Mod, Prefix, Connect.Sets, ClassInf.Stat attr as SCode.ATTR(ad,flow,acc,param,dir), t,m),cmod))::xs,inst_dims,impl) => env'' +(* rule add_components_to_env2(env,mods,pre,csets,ci_state, + xs,inst_dims,impl) => env' + ----------------- + add_components_to_env2(env,mods,pre,csets,ci_state, + nocomp::xs,inst_dims,impl) => env' *) + axiom add_components_to_env2(env,_,_,_,_,[],_,_) => env @@ -2624,7 +2630,11 @@ rule (*Prefix.prefix_add(n,[],pre) => pre' &*) parts as SCode.PARTS(els,_,_,_,_,_)), inst_dims, false) => (env', [DAE.EXTFUNCTION(fpath,DAE.DAE(dae), ty, extdecl)]) - + + rule Debug.fprint("failtrace", "#-- implicit_function_instantiation failed\n") + ------------------------------------------------------------------------ + implicit_function_instantiation(_,_,_,_,_,_,_) => fail + end (** relation: inst_overloaded_functions @@ -4788,4 +4798,4 @@ relation print_compmods:((SCode.Element * Types.Mod) list) => () = print_compmods(xs) ------------------ print_compmods((el,mod)::xs) => () -end \ No newline at end of file +end diff --git a/modeq/staticexp.rml b/modeq/staticexp.rml index bb566834c76..53b3d0a5fb4 100644 --- a/modeq/staticexp.rml +++ b/modeq/staticexp.rml @@ -1805,24 +1805,30 @@ end relation generate_compiled_function: (Env.Env, Absyn.ComponentRef, Exp.Exp, Types.Properties, Interactive.InteractiveSymbolTable option) => (Interactive.InteractiveSymbolTable option) = - axiom generate_compiled_function(_,_,_,_,NONE) => NONE +(* axiom generate_compiled_function(_,_,_,_,NONE) => NONE *) - rule Absyn.cref_to_path(fn) => pfn & + rule Debug.fprintln("sei", "generate_compiled_function: start1") & + Absyn.cref_to_path(fn) => pfn & is_function_in_cflist (cflist,pfn) => true ----------------------------------------------- generate_compiled_function(env,fn,e,Types.PROP(t,_),SOME(st as Interactive.SYMBOLTABLE(p,_,_,_,cflist))) => SOME(st) - rule Absyn.cref_to_path(fn) => path & + rule Debug.fprintln("sei", "generate_compiled_function: start2") & + Absyn.cref_to_path(fn) => path & is_function_in_cflist (cflist, path) => false & SCode.elaborate(p) => p' & + Debug.fprintln("sei", "generate_compiled_function: elaborated") & (* Inst.instantiate_implicit(p') => d & *) Lookup.lookup_class(env, path, false) => (cls, env') & + Debug.fprintln("sei", "generate_compiled_function: class looked up") & Inst.implicit_function_instantiation(env', Types.NOMOD, Prefix.NOPRE, [], cls, [], false) => (env'',d) & + Debug.fprintln("sei", "generate_compiled_function: function instantiated") & Print.clear_buf() & ModUtil.string_prefix_params DAE.DAE(d) => d' & Codegen.generate_functions(d') & + Debug.fprintln("sei", "generate_compiled_function: function generated") & ModUtil.path_string2 (path,"_") => pathstr & string_append(pathstr,".c") => filename & Print.print_buf "#include \"modelica.h\"\n#include \n#include \n#include \n" & @@ -1830,10 +1836,30 @@ relation generate_compiled_function: (Env.Env, Absyn.ComponentRef, Exp.Exp, Type Print.print_buf pathstr & Print.print_buf "_read_call_write(argv[1],argv[2]);\n return 0;\n}\n" & Print.write_buf(filename)& Print.clear_buf() & - System.compile_c_file(filename) + System.compile_c_file(filename) & + Debug.fprintln("sei", "generate_compiled_function: compiled") ----------------------------------------------- generate_compiled_function(env,fn,e,Types.PROP(t,_),SOME(st as Interactive.SYMBOLTABLE(p,a,b,c,cflist))) => SOME(Interactive.SYMBOLTABLE(p,a,b,c,(path,t)::cflist)) + + + rule Debug.fprintln("sei", "generate_compiled_function: start3") + ----------------------------------------------- + generate_compiled_function(env,fn,e,Types.PROP(t,_),NONE) => NONE + + + + + rule Debug.fprint("failtrace", "- generate_compiled_function failed4\n") & + Dump.print_component_ref_str cr => str1 & + Exp.print_exp_str exp => str2 & + Print.print_buf str1 & + Print.print_buf " -- " & + Print.print_buf str2 & + Print.print_buf "\n" + ------------------------------------------------------------------ + generate_compiled_function(env,cr,exp,_,_) => fail + end