Commit 6d95f5aa authored by Nils Kaminski's avatar Nils Kaminski
Browse files

Version update + new test(s)

parent e5906b04
Pipeline #95687 failed with stage
in 8 minutes and 11 seconds
......@@ -8,7 +8,7 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-generator</artifactId>
<version>0.1.3-SNAPSHOT</version>
<version>0.1.4-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
......
......@@ -30,8 +30,8 @@ public class VariablePortValueChecker extends Variable {
@Override
public String getNameTargetLanguageFormat() {
return "__pvc_"+this.idPVC+"_"+GeneralHelperMethods.getTargetLanguageVariableInstanceName(this.getName());
//return name.replaceAll("\\[", "_").replaceAll("\\]", "_");
String s = "__pvc_"+this.idPVC+"_"+this.getName();
return s.replaceAll("\\[", "_").replaceAll("\\]", "_");
}
public String getTypeTargetLanguageFormat(){
......@@ -39,7 +39,7 @@ public class VariablePortValueChecker extends Variable {
}
public void addInitInstructionsToMethod(Method init){
TargetCodeInstruction ti = new TargetCodeInstruction(getNameTargetLanguageFormat()+".setPortReference(&"+this.getName()+");\n" );
TargetCodeInstruction ti = new TargetCodeInstruction(getNameTargetLanguageFormat()+".setPortReference(&"+GeneralHelperMethods.getTargetLanguageVariableInstanceName(this.getName())+");\n" );
init.addInstruction(ti);
int id = 0;
......
......@@ -524,6 +524,14 @@ public class EventDynamicConnectConverter {
}
//TODO: check if names > 0
if(names.size() > 0) {
String c = "";
for(int i = 0; i < free_method_index_counter; ++i){
c += "(_connected_idxs["+i+"] < 0)";
if( i < free_method_index_counter -1){
c += " || ";
}
}
body.addInstruction(new TargetCodeInstruction("if("+c+"){free(_connected_idxs); return;}\n"));
body.addInstruction(new TargetCodeInstruction("if(__parent != NULL){__parent_dynamic(__parent, true, false);}\n"));
free.addInstruction(new TargetCodeInstruction("if(__parent != NULL){__parent_dynamic(__parent, false, true);}\n"));
}
......
......@@ -164,14 +164,18 @@ public:
}
bool check(){
if(N == 0){
return false;
}
if(!isNreached){
return false;
}
if(isChecked){
if(isChecked && (valueHistory[N-1] == *portReference)){
return checkedValue;
}
valueHistory[N-1] = *portReference;
isChecked = true;
for(int i = 0; i < N; ++i){
if(!checkers[i]->check()){
......
package basicLibrary;
component Event1 {
ports
in Q a,
in B useSubComp,
out Q b;
component Sub {
ports
in Q x,
out Q y;
connect x -> y;
}
@ useSubComponent::value( true ){
instance Sub s;
connect a -> s.x;
connect s.y -> b;
}
@ useSubComponent::value( false ){
connect a -> b;
}
}
\ No newline at end of file
package basicLibrary;
componen SchmittTrigger {
ports
in Q sigIn,
out B sigOut;
@ sigIn::value( >= 10 ) && sigOut::value( false ) {
connect true -> sigOut;
}
@ sigIn::value( <= 5 ) && sigOut::value( true ) {
connect true -> sigOut;
}
}
\ No newline at end of file
......@@ -2,21 +2,21 @@ package portRequest;
dynamic component PortRequest1 {
ports
dynamic in B a[2:8],
dynamic out B b[3:8],
dynamic in B a[0:8],
dynamic out B b[0:8];
in Q c,
dynamic out Q d [0:3];
//in Q c,
//dynamic out Q d [0:3];
connect a[1] -> b[1];
connect a[2] -> b[2];
//connect a[1] -> b[1];
//connect a[2] -> b[2];
@ b::connect && a::connect {
connect a[?] -> b[?];
}
/*
@ d::connect {
connect c -> d[?];
}
*/
}
\ No newline at end of file
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