Commit 9193650f authored by Maxime Perrotin's avatar Maxime Perrotin

Dump postprocessed model with -test

parent 06165c09
......@@ -141,7 +141,7 @@ void C_End()
GLUE_RTDS_Backend(fv);
GLUE_MiniCV_Backend(fv);
GLUE_C_Backend(fv);
Generate_Python_AST(get_system_ast(), NULL);
Generate_Python_AST(get_system_ast(), NULL, "iv.py");
}
})
......@@ -164,10 +164,10 @@ void C_End()
/*
* Debug mode (userflag -test) : dump the result of the transformation
* TODO: generate an AADL model (equivalent to the Concurrency View)
*/
if (get_system_ast()->context->test) {
Dump_model(get_system_ast());
Generate_Python_AST(get_system_ast(), NULL, "iv2.py");
}
/*
......
......@@ -10,14 +10,14 @@
#include "my_types.h"
#include "practical_functions.h"
void Generate_Python_AST(System *s, char *dest_directory)
void Generate_Python_AST(System *s, char *dest_directory, char *output_name)
{
FILE *py = NULL;
if (NULL == dest_directory) {
dest_directory = s->context->output;
}
create_file (dest_directory, "iv.py", &py);
create_file (dest_directory, output_name, &py);
assert (NULL != py);
fprintf (py,
......
......@@ -30,21 +30,21 @@ void Create_New_SDL_Structure(FV * fv)
build_string(&path, fv->name, strlen(fv->name));
/* OpenGEODE Skeletons require iv.py and DataView.py to be present in the working directory */
Generate_Python_AST(get_system_ast(), path);
char *dataview_uniq = getASN1DataView();
char *dataview_path = getDataViewPath();
// Generate_Python_AST(get_system_ast(), path, "iv.py");
char *dataview_uniq = getASN1DataView();
char *dataview_path = getDataViewPath();
if (!file_exists (dataview_path, dataview_uniq)) {
ERROR ("[INFO] %s/%s not found. Checking for dataview-uniq.asn\n", dataview_path, dataview_uniq);
free (dataview_uniq);
dataview_uniq = make_string ("dataview-uniq.asn");
}
char *command = make_string("mono $(which asn1.exe) -customStg $(taste-config --prefix)/share/asn1scc/python.stg:%s/DataView.py -customStgAstVersion 4 %s/%s", path, dataview_path, dataview_uniq);
if (system(command)) {
ERROR ("[ERROR] Command \"%s\" failed in generation of SDL skeleton\n", command);
}
free(command);
command = make_string("cp \"%s/%s\" %s/", dataview_path, dataview_uniq, path);
//
// char *command = make_string("mono $(which asn1.exe) -customStg $(taste-config --prefix)/share/asn1scc/python.stg:%s/DataView.py -customStgAstVersion 4 %s/%s", path, dataview_path, dataview_uniq);
// if (system(command)) {
// ERROR ("[ERROR] Command \"%s\" failed in generation of SDL skeleton\n", command);
// }
// free(command);
char *command = make_string("cp \"%s/%s\" %s/", dataview_path, dataview_uniq, path);
if (system(command)) {
ERROR ("[ERROR] Command \"%s\" failed in generation of SDL skeleton\n", command);
}
......
......@@ -45,5 +45,5 @@ extern void Backdoor_backend(System *);
extern void Generate_Build_Script();
extern void Generate_Full_ConcurrencyView(Process_list *, char *);
extern void Process_Driver_Configuration(Process *);
extern void Generate_Python_AST(System *, char *);
extern void Generate_Python_AST(System *, char *, char *);
extern void System_Config(System *);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment