Commit fc390db8 authored by Maxime Perrotin's avatar Maxime Perrotin

Generate VHDL code skeletons

parent 8d679aa1
......@@ -310,6 +310,7 @@ private
pragma Linker_Options ("system_config.o");
pragma Linker_Options ("build_scade_skeletons.o");
pragma Linker_Options ("build_vdm_skeletons.o");
pragma Linker_Options ("build_vhdl_skeletons.o");
pragma Linker_Options ("build_rtds_skeletons.o");
pragma Linker_Options ("build_driver_skeletons.o");
pragma Linker_Options ("asn2datamodel.o");
......
/* Buildsupport is (c) 2008-2016 European Space Agency
* contact: maxime.perrotin@esa.int
* License is LGPL, check LICENSE file */
/* build_vhdl_skeletons.c
*
* VHDL Code skeletons - generate mini-cv.addl and call aadl2glueC
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <stdbool.h>
#include <assert.h>
#include "my_types.h"
#include "practical_functions.h"
#include "backends.h"
void vhdl_skeletons(FV *fv)
{
char *cmd = NULL;
cmd = make_string("cp %s/dataview-uniq.asn %s/dataview-uniq-v1.aadl %s/%s",
OUTPUT_PATH,
OUTPUT_PATH,
OUTPUT_PATH,
fv->name);
if (system(cmd)) {
ERROR ("[ERROR] Missing dataview-uniq.asn or dataview-uniq-v1.aadl\n");
exit(-1);
}
free(cmd);
printf("[INFO] Generating VHDL skeleton code for function %s\n", fv->name);
cmd = make_string("cd %s/%s && aadl2glueC dataview-uniq-v1.aadl mini_cv.aadl",
OUTPUT_PATH,
fv->name);
if (system(cmd)) {
ERROR ("[ERROR] Failed generating VHDL code!\n");
free(cmd);
}
else {
free(cmd);
cmd = make_string("cd %s/%s && rm -f mini_cv.aadl dataview-uniq.asn "
"dataview-uniq-v1.aadl C_ASN1_Types.? ESA_FPGA.h "
"*_VHDL.VHDL.[ch] *_vhdl.ad?",
OUTPUT_PATH,
fv->name,
fv->name,
fv->name);
system(cmd);
free(cmd);
}
}
/* External interface (the one and unique) */
void GW_VHDL_Backend(FV * fv)
{
if (get_context()->onlycv)
return;
if (vhdl == fv->language) {
GLUE_MiniCV_Backend(fv);
if (!get_context()->glue) {
vhdl_skeletons(fv);
}
}
}
......@@ -37,7 +37,7 @@ void add_error()
error_count++;
}
/*
/*:
* Main function called after the Ada AADL parser has completed.
*/
void C_End()
......@@ -127,6 +127,7 @@ void C_End()
GW_Simulink_Backend(fv);
GW_C_Backend(fv);
GW_VDM_Backend(fv);
GW_VHDL_Backend(fv);
GW_Ada_Backend(fv);
GW_SCADE_Backend(fv);
GW_RTDS_Backend(fv);
......
......@@ -15,6 +15,7 @@ extern void GW_SDL_Backend(FV *);
extern void GW_Simulink_Backend(FV *);
extern void GW_C_Backend(FV *);
extern void GW_VDM_Backend(FV *);
extern void GW_VHDL_Backend(FV *);
extern void GW_Ada_Backend(FV *);
extern void GW_SCADE_Backend(FV *);
extern void GW_RTDS_Backend(FV *);
......
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