/// <summary> /// Constructs a SimObject instance for a specific design context. /// </summary> protected DesignObject(DesignContext context) { Contract.Requires <ArgumentNullException>(context != null); Context = context; Init(); }
/// <summary> /// Currently out of order, see remarks. /// </summary> /// <remarks> /// Because of a compiler bug (see http://stackoverflow.com/questions/14198019/await-array-by-implementing-extension-method-for-array) /// await signals[] cannot be compiled. /// </remarks> public static IAwaitable GetAwaiter(this IInPort[] signals) { //because of a compiler bug (see http://stackoverflow.com/questions/14198019/await-array-by-implementing-extension-method-for-array) //await signals[] cannot be compiled, even though this extension method allows it an intellisense says that "(awaitable) IInPort[]" return(new MultiEvent(null, DesignContext.MakeEventList(signals)).GetAwaiter()); }
private Process AddClockedThreadInternal(Action func, Func <bool> predicate, params IInPort[] sensitive) { Process process = new Process( this, Process.EProcessKind.Threaded, func) { Predicate = predicate, Sensitivity = DesignContext.MakeEventList(sensitive) }; process.Schedule(0); return(process); }
/// <summary> /// Changes a process sensitivity list. /// </summary> /// <param name="sensitive">The new sensitivity list</param> protected void NextTrigger(params IInPort[] sensitive) { Process curp = Context.CurrentProcess; curp.Sensitivity = DesignContext.MakeEventList(sensitive); }
/// <summary> /// Registers a triggered process. /// </summary> /// <param name="func">The process body</param> /// <param name="sensitive">The sensitivity list</param> protected void AddProcess(Action func, params IInPort[] sensitive) { AddProcess(func, DesignContext.MakeEventList(sensitive)); }
public static MultiEvent Any(params IInPort[] signals) { return(Any(DesignContext.MakeEventList(signals))); }
public static PredicatedEvent FallingEdge(In <StdLogic> clk) { return(new PredicatedEvent(null, new MultiEvent(null, DesignContext.MakeEventList(clk)), clk.FallingEdge)); }
/// <summary> /// Converts the encoded time to raw ticks with respect to a simulation context. /// </summary> /// <remarks> /// The conversion depends on the time resolution which is specified for the simulation context. /// </remarks> /// <param name="context">The simulation context</param> /// <returns>The time expressed in raw ticks</returns> internal long GetTicks(DesignContext context) { return((long)(ScaleTo(context.Resolution.Unit) / context.Resolution.Value)); }
/// <summary> /// <c>await signals</c> pauses until one of the specified signals changes its values. /// </summary> public static IAwaitable GetAwaiter(this IEnumerable <IInPort> signals) { return(new MultiEvent(null, DesignContext.MakeEventList(signals)).GetAwaiter()); }