public AbstractValue Evaluate(LessThan expr) { AbstractValue left = Evaluate(expr.Left); AbstractValue right = Evaluate(expr.Right); if ((left != null) && (right != null) && (left is TIME_VALUE) && (right is TIME_VALUE)) { return(TIME_VALUE.LESS_THAN(left as TIME_VALUE, right as TIME_VALUE)); } throw new NotImplementedException(); }
public ModelingSystemCore(VHDL.libraryunit.Architecture architecture, VHDL.LibraryDeclarativeRegion library, VHDL.RootDeclarativeRegion rootDeclarationRegion) { ExpressionEvaluator.DefaultEvaluator = new ExpressionEvaluator(this); this.architecture = architecture; this.library = library; this.rootDeclarationRegion = rootDeclarationRegion; functionAnalyser = new FunctionAnalyser(architecture.Scope); currentScope = new List <IValueProvider>(); signalScope = new List <Signal>(); now = new TIME_VALUE(0); FormDefaultResultScope(); }
public AbstractValue Evaluate(Equals expr) { AbstractValue left = Evaluate(expr.Left); AbstractValue right = Evaluate(expr.Right); if ((left != null) && (right != null) && (left is STD_LOGIC_VALUE) && (right is STD_LOGIC_VALUE)) { return(STD_LOGIC_VALUE.EQUALS(left as STD_LOGIC_VALUE, right as STD_LOGIC_VALUE)); } if ((left != null) && (right != null) && (left is TIME_VALUE) && (right is TIME_VALUE)) { return(TIME_VALUE.EQUALS(left as TIME_VALUE, right as TIME_VALUE)); } if ((left != null) && (right != null) && (left is TIME_VALUE) && (right is PhysicalValue)) { return(TIME_VALUE.EQUALS(left as TIME_VALUE, right as PhysicalValue)); } throw new NotImplementedException(); }
public ModelingSystemCore(VHDL.libraryunit.Architecture architecture, VHDL.LibraryDeclarativeRegion library, VHDL.RootDeclarativeRegion rootDeclarationRegion, SimulationScope scope) { ExpressionEvaluator.DefaultEvaluator = new ExpressionEvaluator(this); this.architecture = architecture; this.library = library; this.rootDeclarationRegion = rootDeclarationRegion; functionAnalyser = new FunctionAnalyser(architecture.Scope); currentScope = new List <IValueProvider>(); signalScope = new List <Signal>(); now = new TIME_VALUE(0); result_scope = scope; foreach (var s in scope.Variables) { if (s is Signal) { signalScope.Add(s as Signal); currentScope.Add(s as Signal); } } }
public override void AddEvent(ulong NOW, ulong after, AbstractValue value, VHDL.DelayMechanism delayMechanism) { AbstractTimeStampInfo <T> newValue = new AbstractTimeStampInfo <T>(valueCovertor.GetValue(value)); if (delayMechanism is VHDL.TRANSPORTDelayMechanism) { dump.AddTransportEvent(NOW + after, newValue); return; } if (delayMechanism.PulseRejectionLimit != null) { TIME_VALUE reject = ExpressionEvaluator.DefaultEvaluator.Evaluate(delayMechanism.PulseRejectionLimit) as TIME_VALUE; dump.AddInertialEvent(NOW, NOW + after, newValue, (UInt64)reject.DoubleValue); return; } if (delayMechanism is VHDL.INERTIALDelayMechanism) { dump.AddInertialEvent(NOW, NOW + after, newValue); return; } }