Unverified Commit 49661615 authored by Michael von Wenckstern's avatar Michael von Wenckstern Committed by GitHub
Browse files

Merge pull request #13 from EmbeddedMontiArc/RemoveTagging

fixed FAS model so that it can be loaded by symbol table
parents 62601aae 9d919ce1
......@@ -23,6 +23,7 @@ package de.monticore.lang.embeddedmontiarc;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.*;
import de.monticore.lang.monticar.mcexpressions._ast.ASTExpression;
import de.monticore.symboltable.Scope;
import de.monticore.symboltable.Symbol;
import de.se_rwth.commons.logging.Log;
import org.junit.Ignore;
import org.junit.Test;
......@@ -37,7 +38,16 @@ import static org.junit.Assert.*;
* @author Michael von Wenckstern
*/
public class ExpandedComponentInstanceTest extends AbstractSymtabTest {
//@Ignore
@Test
public void testFAS() throws Exception {
Scope symTab = createSymTab("src/test/resources");
ExpandedComponentInstanceSymbol inst = symTab.<ExpandedComponentInstanceSymbol>resolve(
"fas.demo_fas_Fkt_m.fAS", ExpandedComponentInstanceSymbol.KIND).orElse(null);
assertNotNull(inst);
}
@Test
public void testComponentSub2() throws Exception {
Scope symTab = createSymTab("src/test/resources");
......
......@@ -8,16 +8,16 @@ component CountDown_RE {
in B in_R,
in B in_IV,
out B out_y;
instance Greater<(-oo : oo )> relOp_C, relOp_Y;
instance And logOp_C;
instance PlusMinus<(-oo s:oo s)> sum_C;
instance SwitchM<B> switch_C, switch_R;
instance SwitchM<Boolean> switch_C, switch_R;
instance Constant<(-oo s: oo s)>(0 s) zero_C;
instance Constant<(-oo s: oo s)>(eps*100000) zero_Y;
instance Constant<(1 s: 1 s)>(1) one_C;
instance Memory<B>(false) memory_C;
instance Memory<Boolean>(false) memory_C;
connect in_IV -> switch_R.in1;
connect in_R -> switch_R.cond;
connect in_E -> logOp_C.in1;
......
......@@ -10,9 +10,9 @@ component EdgeFalling {
out B y;
instance And and;
instance Not<B> not;
instance SwitchB<B> switch_R;
instance Memory<B>(false) memory_U;
instance Not<Boolean> not;
instance SwitchB<Boolean> switch_R;
instance Memory<Boolean>(false) memory_U;
connect u -> not.in1;
connect not.out1 -> and.in1;
......
......@@ -10,9 +10,9 @@ component EdgeRising {
out B y;
instance And and;
instance Not<B> not;
instance SwitchB<B> switch_R;
instance Memory<B>(false) memory_U;
instance Not<Boolean> not;
instance SwitchB<Boolean> switch_R;
instance Memory<Boolean>(false) memory_U;
connect u -> and.in1, memory_U.in1;
connect IV -> switch_R.in1;
......
......@@ -9,11 +9,11 @@ component RSFlipFlop {
out B out_Q,
out B Not_Q;
instance Constant<B>(true) oneS;
instance Constant<B>(false) zeroR;
instance SwitchB<B> switch_R, switch_S;
instance Memory<B>(false) memory_Q;
instance Not<B> logOp_N;
instance Constant<Boolean>(true) oneS;
instance Constant<Boolean>(false) zeroR;
instance SwitchB<Boolean> switch_R, switch_S;
instance Memory<Boolean>(false) memory_Q;
instance Not<Boolean> logOp_N;
connect S -> switch_S.cond;
connect R -> switch_R.cond;
......
......@@ -6,8 +6,8 @@ component SysInit {
port
out B y;
instance Constant<B>(false) zero_Init;
instance Memory<B>(true) memory_Init;
instance Constant<Boolean>(false) zero_Init;
instance Memory<Boolean>(true) memory_Init;
connect zero_Init.out1 -> memory_Init.in1;
connect memory_Init.out1 -> y;
......
package fas.basicLibrary;
component And<N1 n=2> {
port
port
in B in1[n],
out B out1;
}
package fas.basicLibrary;
component ConditionB<T>(String condition) {
port
in T in1,
in B in2,
out B out1;
}
package fas.basicLibrary;
component LookUpM<T,X,N1 n> (B values[n]) {
port
in T in1,
out X out1;
}
package fas.basicLibrary;
component Or<N1 n=2> {
port
port
in B in1[n],
out B out1;
}
package fas.basicLibrary;
component Terminator<T> {
ports
in T in1;
}
package fas.basicLibrary;
component UnitDelay<T>(T value){
port
in T in1,
out T out1;
}
......@@ -4,11 +4,11 @@ import fas.demo_fas_Fkt_m.brakeAssistant_m.Brake_Booster;
component BrakeAssistant {
port
in (-oo:d:oo) BrakeForce_pedal_pc,
out (-oo:d:oo) BrakeForceBoosted_pc;
in Z(0:255) BrakeForce_pedal_pc,
out Z(0:255) BrakeForceBoosted_pc;
instance Brake_Booster brake;
connect BrakeForce_pedal_pc -> brake.BrakeForce_pedal_pc;
connect brake.BrakeForceBoosted_pc -> BrakeForceBoosted_pc;
}
......@@ -4,13 +4,13 @@ import fas.demo_fas_Fkt_m.distancewarner_m.Distancewarner_Function;
component Distancewarner {
port
in (-oo:d:oo) V_Vehicle_ms,
in (-oo:d:oo) Distance_Object_m,
in (0m/s:0.28m/s:1820.39m/s) V_Vehicle_ms,
in (0m:1m:200m) Distance_Object_m,
out B Opti_warn_b,
out B Acusti_warn_b;
instance Distancewarner_Function distance;
connect V_Vehicle_ms -> distance.V_Vehicle_ms;
connect Distance_Object_m -> distance.Distance_Object_m;
connect distance.Opti_warn_b -> Opti_warn_b;
......
......@@ -10,23 +10,23 @@ import fas.demo_fas_Fkt_m.distronic_m.Distronic_Deactive;
component Distronic {
port
in B CC_active_b,
in (-oo:d:oo) V_Vehicle_ms,
in (-oo:d:oo) Distance_Object_m,
in (-oo:d:oo) Distance_stat,
in (-oo:d:oo) V_Obj_rel_kmh,
in (0m/s:0.28m/s:1820.39m/s) V_Vehicle_ms,
in (0m:1m:200m) Distance_Object_m,
in Z(0:255) Distance_stat,
in (0m/s:0.28m/s:1820.39m/s) V_Obj_rel_kmh,
in B FTS_active_b,
in (-oo:d:oo) FTS_Abstand_soll_m,
out (-oo:d:oo) BrakeForce_Distronic_pc,
out (-oo:d:oo) Decelerator_pc;
instance SwitchB<(-oo:d:oo)> switch1, switch2, switch3, switch4, switch5, switch6;
in (0m:200m) FTS_Abstand_soll_m,
out Z(0:255) BrakeForce_Distronic_pc,
out Z(0:255) Decelerator_pc;
instance SwitchB<Z(0:255)> switch1, switch2, switch3, switch4, switch5, switch6;
instance And and1, and2, and3, and4, and5;
instance Not<B> not1, not2;
instance Not<Boolean> not1, not2;
instance Distronic_Enabled dist_Enabled;
instance Distronic_FTS_Enabled dist_FTS_Enabled;
instance Distronic_Disabled dist_Disabled;
instance Distronic_Deactive dist_Deactive;
connect V_Vehicle_ms -> dist_Enabled.V_Vehicle_ms;
connect Distance_Object_m -> dist_Enabled.Distance_Object_m, dist_FTS_Enabled.Distance_Object_m;
connect Distance_stat -> dist_Enabled.Distance_stat;
......
......@@ -11,23 +11,23 @@ component Distronic_edited {
port
in B demo_fas_Distronic,
in B CC_active_b,
in (-oo:d:oo) V_Vehicle_ms,
in (-oo:d:oo) Distance_Object_m,
in (-oo:d:oo) Distance_stat,
in (-oo:d:oo) V_Obj_rel_kmh,
in (0m/s:0.28m/s:1820.39m/s) V_Vehicle_ms,
in (0m:1m:200m) Distance_Object_m,
in Z(0:255) Distance_stat,
in (0m/s:0.28m/s:1820.39m/s) V_Obj_rel_kmh,
in B FTS_active_b,
in (-oo:d:oo) FTS_Abstand_soll_m,
out (-oo:d:oo) BrakeForce_Distronic_pc,
out (-oo:d:oo) Decelerator_pc;
instance SwitchB<(-oo:d:oo)> switch1, switch2, switch3, switch4, switch5, switch6;
in (0m:200m) FTS_Abstand_soll_m,
out Z(0:255) BrakeForce_Distronic_pc,
out Z(0:255) Decelerator_pc;
instance SwitchB<Z(0:255)> switch1, switch2, switch3, switch4, switch5, switch6;
instance And and1, and2, and3, and4, and5;
instance Not<B> not1, not2;
instance Not<Boolean> not1, not2;
instance Distronic_Enabled dist_Enabled;
instance Distronic_FTS_Enabled dist_FTS_Enabled;
instance Distronic_Disabled dist_Disabled;
instance Distronic_Deactive dist_Deactive;
connect V_Vehicle_ms -> dist_Enabled.V_Vehicle_ms;
connect Distance_Object_m -> dist_Enabled.Distance_Object_m, dist_FTS_Enabled.Distance_Object_m;
connect Distance_stat -> dist_Enabled.Distance_stat;
......
......@@ -5,19 +5,19 @@ import fas.demo_fas_Fkt_m.emergencyBrake_m.EmergencyBrake_Function;
component EmergencyBrake {
port
in (-oo:d:oo) V_Vehicle_ms,
in (-oo:d:oo) Distance_Object_m,
in (-oo:d:oo) V_Obj_rel_ms,
in (0m/s:0.28m/s:1820.39m/s) V_Vehicle_ms,
in (0m:1m:200m) Distance_Object_m,
in (0m/s:0.28m/s:1820.39m/s) V_Obj_rel_ms,
in B cond,
out (-oo:d:oo) BrakeForce_Emergency_pc,
out Z(0:255) BrakeForce_Emergency_pc,
out B Acusti_warn_b;
instance EmergencyBrake_Function eBrake_Function;
instance SwitchB<(-oo:d:oo)> switch1;
instance SwitchB<B> switch2;
instance Memory<(-oo:d:oo)>(0) mem1;
instance Memory<B>(false) mem2;
instance SwitchB<Z(0:255)> switch1;
instance SwitchB<Boolean> switch2;
instance Memory<Z(0:255)>(0) mem1;
instance Memory<Boolean>(false) mem2;
connect V_Vehicle_ms -> eBrake_Function.V_Vehicle_ms;
connect Distance_Object_m -> eBrake_Function.Distance_Object_m;
connect V_Obj_rel_ms -> eBrake_Function.V_Obj_rel_ms;
......@@ -29,4 +29,3 @@ component EmergencyBrake {
connect switch1.out1 -> BrakeForce_Emergency_pc, mem1.in1;
connect switch2.out1 -> Acusti_warn_b, mem2.in1;
}
......@@ -5,23 +5,26 @@ import fas.basicLibrary.*;
component FAS {
port
in B ParkingBrake_b,
in (-oo:d:oo) BrakeForce_pedal_pc,
in (-oo:d:oo) Accelaration_pedal_pc,
// Winkel BrakeForce_pedal = (0°:0.2°:45°), codiert in 8-bit
in Z(0:255) BrakeForce_pedal_pc, // BRMS_STATUS
// Winkel Accelaration_pedal = (0°:0.2°:45°)
in Z(0:255) Accelaration_pedal_pc, // GAS_STATUS
in B CruiseControl_b,
in B Limiter_b,
in (-oo:d:oo) LeverUp_stat,
in (-oo:d:oo) LeverDown_stat,
in (-oo:d:oo) V_Vehicle_kmh,
in (-oo:d:oo) V_Sign_kmh,
in Z(0:7) LeverUp_stat, // TMP_POS
in Z(0:7) LeverDown_stat, // TMP_POS
// Geschwindigkeit = (0km/h:0.1km/h:6553.4km/h)
in (0m/s:0.28m/s:1820.39m/s) V_Vehicle_kmh, // R_Fahrzeuggeschwindigkeit_kmh
in Z(0:255) V_Sign_kmh, // R_TrafficSign, 8-bit Datenstruktur
in B Sign_b,
in (-oo:d:oo) Distance_stat,
in (-oo:d:oo) V_Obj_rel_kmh,
in (-oo:d:oo) Distance_Object_m,
in Z(0:255) Distance_stat, // RDR_DETECT, 8-bit Datenstruktur
in (0m/s:2.8m/s:1820.39m/s) V_Obj_rel_kmh,
in (0m:1m:200m) Distance_Object_m, // siehe: RDR_DETECT
out B CC_active_b,
out (-oo:d:oo) Accelaration_pc,
out (-oo:d:oo) BrakeForce_pc,
out (-oo:d:oo) CCSetValue_kmh,
out (-oo:d:oo) LimiterSetValue_kmh,
out Z(0:255) Accelaration_pc,
out Z(0:255) BrakeForce_pc,
out (0m/s:2.8m/s:1820.39m/s) CCSetValue_kmh,
out (0m/s:2.8m/s:1820.39m/s) LimiterSetValue_kmh,
out B Limiter_active_b,
out B Opti_warn_b,
out B Acusti_warn_b;
......@@ -34,8 +37,8 @@ component FAS {
//component FollowToStop followToStop;
instance EmergencyBrake emergencyBrake;
instance VelocityControl velocityControl;
instance Or<B> or;
instance MultDiv<(-oo:d:oo)> multDiv1, multDiv2;
instance Or or;
instance MultDiv<(0m/s:0.28m/s:1820.39m/s)> multDiv1, multDiv2;
connect BrakeForce_pedal_pc -> brakeAssistant.BrakeForce_pedal_pc;
......@@ -47,7 +50,7 @@ component FAS {
connect LeverUp_stat -> tempo.LeverUp_stat;
connect LeverDown_stat -> tempo.LeverDown_stat;
//connect followToStop.FTS_active_b -> tempo.FTS_active_b;
connect Limiter_b -> lim.Limiter_b;
connect Accelaration_pedal_pc -> lim.Accelaration_pedal_pc;
connect V_Vehicle_kmh -> lim.V_Vehicle_kmh;
......@@ -58,10 +61,10 @@ component FAS {
connect V_Vehicle_kmh -> multDiv1.in1;
connect 3.6 -> multDiv1.in2;
connect V_Obj_rel_kmh -> multDiv2.in1;
connect 3.6 -> multDiv2.in2;
connect multDiv1.out1 -> distWarner.V_Vehicle_ms;
connect Distance_Object_m -> distWarner.Distance_Object_m;
......@@ -72,7 +75,7 @@ component FAS {
connect V_Obj_rel_kmh -> dist.V_Obj_rel_kmh;
//connect followToStop.FTS_active_b -> dist.FTS_active_b;
//connect followToStop.FTS_Abstand_soll_m -> dist.FTS_Abstand_soll_m;
connect V_Vehicle_kmh -> followToStop.V_Vehicle_kmh;
connect V_Obj_rel_kmh -> followToStop.V_Obj_rel_kmh;
......
......@@ -6,15 +6,15 @@ import fas.demo_fas_Fkt_m.lim_m.Limiter_Function;
component Limiter {
port
in B Limiter_b,
in (-oo:d:oo) Accelaration_pedal_pc,
in (-oo:d:oo) V_Vehicle_kmh,
in (-oo:d:oo) LeverUp_stat,
in (-oo:d:oo) LeverDown_stat,
in (-oo:d:oo) V_Sign_kmh,
in Z(0:255) Accelaration_pedal_pc,
in (0m/s:0.28m/s:1820.39m/s) V_Vehicle_kmh,
in Z(0:7) LeverUp_stat,
in Z(0:7) LeverDown_stat,
in Z(0:255) V_Sign_kmh,
in B Sign_b,
out (-oo:d:oo) VMax_kmh,
out (0m/s:0.28m/s:1820.39m/s) VMax_kmh,
out B Limiter_active_b,
out (-oo:d:oo) DEMO_FAS_V_CCSetValue;
out (0m/s:0.28m/s:1820.39m/s) DEMO_FAS_V_CCSetValue;
instance Limiter_Function l_Function;
......
......@@ -6,16 +6,16 @@ import fas.demo_fas_Fkt_m.lim_m.Limiter_Function_edited;
component Limiter_edited {
port
in B Limiter_b,
in (-oo:d:oo) Accelaration_pedal_pc,
in (-oo:d:oo) V_Vehicle_kmh,
in (-oo:d:oo) LeverUp_stat,
in (-oo:d:oo) LeverDown_stat,
in (-oo:d:oo) V_Sign_kmh,
in Z(0:255) Accelaration_pedal_pc,
in (0m/s:0.28m/s:1820.39m/s) V_Vehicle_kmh,
in Z(0:7) LeverUp_stat,
in Z(0:7) LeverDown_stat,
in Z(0:255) V_Sign_kmh,
in B Sign_b,
in B Enable,
out (-oo:d:oo) VMax_kmh,
out (0m/s:0.28m/s:1820.39m/s) VMax_kmh,
out B Limiter_active_b,
out (-oo:d:oo) DEMO_FAS_V_CCSetValue;
out (0m/s:0.28m/s:1820.39m/s) DEMO_FAS_V_CCSetValue;
instance Limiter_Function_edited l_Function;
......
Supports Markdown
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