Commit 2babea3a authored by Maxime Perrotin's avatar Maxime Perrotin

Add vhdl brave language

parent 70c8b054
......@@ -34,9 +34,12 @@ void Call_asn2dataModel(FV * fv)
int ret = 0;
/* There is no A mapper for VHDL/SystemC/GUI */
if (vhdl == fv->language || system_c == fv->language
|| gui == fv->language)
if (vhdl == fv->language
|| vhdl_brave == fv->language
|| system_c == fv->language
|| gui == fv->language) {
return;
}
/* check if there is at least one parameter in one interface */
// Removed - generate data types in any case so that user code
......
......@@ -187,10 +187,11 @@ void Create_script()
/* Remove old zip files and create fresh new ones from user code */
FOREACH (fv, FV, get_system_ast()->functions, {
//if (sdl != fv->language PUT BACK WHEN OPENGEODE FULLY SUPPORTED
if (vhdl != fv->language
&& gui != fv->language
&& rtds != fv->language
&& NULL == fv->zipfile) {
if (vhdl != fv->language
&& vhdl_brave != fv->language
&& gui != fv->language
&& rtds != fv->language
&& NULL == fv->zipfile) {
fprintf (script,
"cd \"$SKELS\" && rm -f %s.zip && "
"zip %s %s/* && cd $OLDPWD\n\n",
......@@ -271,7 +272,8 @@ void Create_script()
case ada: if (fv->is_component_type == true) fprintf (script, "--with-extra-Ada-code ");
else fprintf (script, "--subAda ");
break;
case vhdl: fprintf (script, "--subVHDL ");
case vhdl:
case vhdl_brave: fprintf (script, "--subVHDL ");
break;
case qgenada: fprintf (script, "--subQGenAda ");
break;
......
......@@ -58,7 +58,7 @@ void GW_VHDL_Backend(FV * fv)
{
if (get_context()->onlycv)
return;
if (vhdl == fv->language) {
if (vhdl == fv->language || vhdl_brave == fv->language) {
GLUE_MiniCV_Backend(fv);
if (!get_context()->glue) {
vhdl_skeletons(fv);
......
......@@ -245,6 +245,12 @@ void Set_Language_To_VHDL()
fv->language = vhdl;
}
void Set_Language_To_VHDL_Brave()
{
if (NULL != fv)
fv->language = vhdl_brave;
}
void Set_Language_To_System_C()
{
if (NULL != fv)
......
......@@ -140,15 +140,17 @@ void c_wrappers_preamble(FV * fv)
/* Include the header files to get the function prototypes */
if (!fv->artificial) {
if (blackbox_device != fv->language
&& simulink != fv->language
&& qgenc != fv->language
&& vhdl != fv->language) {
if (blackbox_device != fv->language
&& simulink != fv->language
&& qgenc != fv->language
&& vhdl_brave != fv->language
&& vhdl != fv->language) {
fprintf (cfile, "#include \"%s_vm_if.h\"\n\n", fv->name);
}
else if(simulink != fv->language
&& qgenc != fv->language
&& vhdl != fv->language) {
else if(simulink != fv->language
&& qgenc != fv->language
&& vhdl != fv->language
&& vhdl_brave != fv->language) {
fprintf (cfile, "#include \"%s.h\"\n\n", fv->name);
}
else if (simulink == fv->language && NULL != fv->interfaces) {
......
......@@ -35,6 +35,7 @@ Copyright 2014-2015 IB Krates <info@krates.ee>
(rtds==i->parent_fv->language)?"RTDS":\
(scade==i->parent_fv->language)?"SCADE6":\
(vhdl==i->parent_fv->language)?"VHDL":\
(vhdl_brave==i->parent_fv->language)?"VHDL_BRAVE":\
(system_c==i->parent_fv->language)?"SYSTEM_C":\
(gui==i->parent_fv->language && PI==i->direction)?"GUI_PI":\
(gui==i->parent_fv->language && RI==i->direction)?"GUI_RI":\
......
......@@ -396,12 +396,17 @@ void Semantic_Checks()
FOREACH(process, Process, get_system_ast()->processes, {
int count = 0;
FOREACH(binding, Aplc_binding, process->bindings, {
if (vhdl == binding->fv->language) count++;}
); if (count > 1) {
ERROR
("[ERROR] in a distributed system, a partition can contain only ONE\n");
ERROR(" VHDL component. Partition \"%s\" has %d.\n",
process->name, count); add_error();}
if (vhdl_brave == binding->fv->language
|| vhdl == binding->fv->language) {
count++;
}
});
if (count > 1) {
ERROR
("[ERROR] in a distributed system, a partition can contain only ONE\n");
ERROR(" VHDL component. Partition \"%s\" has %d.\n",
process->name, count); add_error();
}
});
}
......@@ -70,6 +70,7 @@ typedef enum {
scade,
rtds,
vhdl,
vhdl_brave,
system_c,
blackbox_device,
vdm,
......
......@@ -21,7 +21,7 @@
/* Return a string representing the selected encoding rules for a Parameter */
#define BINARY_ENCODING(p) (native==p->encoding)?"NATIVE":(uper==p->encoding)?"UPER":(acn==p->encoding)?"ACN":"#ERROR#"
#define LANGUAGE(fv) ada==fv->language?"Ada": c==fv->language?"C": sdl==fv->language?"OG": rtds==fv->language?"RTDS": scade==fv->language?"SCADE6":simulink==fv->language?"SIMULINK": blackbox_device==fv->language? "C": rhapsody==fv->language? "C": vhdl==fv->language?"VHDL": system_c==fv->language?"SYSTEM_C":gui==fv->language?"GUI": qgenc==fv->language?"QGenC": qgenada==fv->language?"QGenAda": cpp==fv->language?"CPP": vdm==fv->language?"Vdm": micropython==fv->language?"C": "UNSUPPORTED_LANGUAGE!"
#define LANGUAGE(fv) ada==fv->language?"Ada": c==fv->language?"C": sdl==fv->language?"OG": rtds==fv->language?"RTDS": scade==fv->language?"SCADE6":simulink==fv->language?"SIMULINK": blackbox_device==fv->language? "C": rhapsody==fv->language? "C": vhdl==fv->language?"VHDL": vhdl_brave==fv->language?"VHDL_BRAVE": system_c==fv->language?"SYSTEM_C":gui==fv->language?"GUI": qgenc==fv->language?"QGenC": qgenada==fv->language?"QGenAda": cpp==fv->language?"CPP": vdm==fv->language?"Vdm": micropython==fv->language?"C": "UNSUPPORTED_LANGUAGE!"
#define RCM_KIND(IF) (protected==IF->rcm?"protected":unprotected==IF->rcm?"unprotected":sporadic==IF->rcm?"sporadic":cyclic==IF->rcm?"cyclic":variator==IF->rcm?"variator":"unknown")
......
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