private void Clocked() { if (Clk.RisingEdge() && EnIn.Cur == '1') { _stg.Next = DIn.Cur; } }
private void UpdateAddr() { if (Clk.RisingEdge()) { _lastAddr.Next = _outAddr.Cur; } }
protected override void Process() { if (Clk.RisingEdge() && EnIn.Cur == '1') { DOut.Next = DIn.Cur[0]; } }
private void DoWireUp() { V.ConnectTo(_flop7.V) .ConnectTo(_flop6.V) .ConnectTo(_flop5.V) .ConnectTo(_flop4.V) .ConnectTo(_flop3.V) .ConnectTo(_flop2.V) .ConnectTo(_flop1.V) .ConnectTo(_flop0.V); Clr.ConnectTo(_flop7.Clr) .ConnectTo(_flop6.Clr) .ConnectTo(_flop5.Clr) .ConnectTo(_flop4.Clr) .ConnectTo(_flop3.Clr) .ConnectTo(_flop2.Clr) .ConnectTo(_flop1.Clr) .ConnectTo(_flop0.Clr); Clk.ConnectTo(_flop7.Clk) .ConnectTo(_flop6.Clk) .ConnectTo(_flop5.Clk) .ConnectTo(_flop4.Clk) .ConnectTo(_flop3.Clk) .ConnectTo(_flop2.Clk) .ConnectTo(_flop1.Clk) .ConnectTo(_flop0.Clk); Pre.ConnectTo(_flop7.Pre) .ConnectTo(_flop6.Pre) .ConnectTo(_flop5.Pre) .ConnectTo(_flop4.Pre) .ConnectTo(_flop3.Pre) .ConnectTo(_flop2.Pre) .ConnectTo(_flop1.Pre) .ConnectTo(_flop0.Pre); }
private void OnClock() { if (Clk.RisingEdge()) { _stages.Next = _stages.Cur[_belowbit, 0].Concat(Din.Cur); } }
private void OnClockWithEn() { if (Clk.RisingEdge() && En.Cur == '1') { _stages.Next = _stages.Cur[_belowbit, 0].Concat(Din.Cur); } }
/// <summary> /// The actual arbitration process. /// </summary> private void Arbitrate() { if (Clk.RisingEdge()) { if (_curGrant.Cur == -1) { for (int i = 0; i < _count; i++) { if (Request[i].Cur == '1') { _curGrant.Next = i; Grant[i].Next = '1'; break; } } } else { if (Request[_curGrant.Cur].Cur == '0') { Grant[_curGrant.Cur].Next = '0'; _curGrant.Next = -1; } } } }
private void ReadProcess() { if (Clk.RisingEdge() && RdEn.Cur == '1') { DataOut.Next = _content[Addr.Cur.UnsignedValue.IntValue]; } }
private void OnClock1() { if (Clk.RisingEdge()) { Dout.Next = Din.Cur; } }
private void OnClock1WithEn() { if (Clk.RisingEdge() && En.Cur == '1') { Dout.Next = Din.Cur; } }
private void DiagMonSFix() { if (Clk.RisingEdge() && EnIn.Cur == '1') { Console.WriteLine("Writing variable " + MappedVariableName + ": " + SFix.FromSigned(DIn.Cur.SignedValue, _fracWidth).DoubleValue); } }
private void DiagMonDouble() { if (Clk.RisingEdge() && EnIn.Cur == '1') { Console.WriteLine("Writing variable " + MappedVariableName + ": " + DIn.Cur.ToDouble()); } }
public void Resume() { if (State == State.Paused) { Clk.Start(); State = State.On; } }
public void Pause() { if (State == State.On) { Clk.Stop(); State = State.Paused; } }
public void PowerOff() { if (State > 0) { Clk.Stop(); State = State.Off; } }
public void PowerOn() { if (State == State.Off) { Clk.Start(); State = State.On; } }
private void LookupProcess() { if (Clk.RisingEdge()) { Addr.Next = X.Cur.GetIntPart().Resize(AddrWidth); _yIn.Next = Data.Cur.SLVValue; } }
private void Compute() { if (Clk.RisingEdge()) { _tmp1.Next = A.Cur * B.Cur; _tmp2.Next = C.Cur * D.Cur; R.Next = _tmp1.Cur + _tmp2.Cur; } }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { var hash = 41; // Suitable nullity checks etc, of course :) if (Op != null) { hash = hash * 59 + Op.GetHashCode(); } if (Id != null) { hash = hash * 59 + Id.GetHashCode(); } if (SegmentationEnabled != null) { hash = hash * 59 + SegmentationEnabled.GetHashCode(); } if (Clk != null) { hash = hash * 59 + Clk.GetHashCode(); } if (HeartbeatMs != null) { hash = hash * 59 + HeartbeatMs.GetHashCode(); } if (InitialClk != null) { hash = hash * 59 + InitialClk.GetHashCode(); } if (MarketFilter != null) { hash = hash * 59 + MarketFilter.GetHashCode(); } if (ConflateMs != null) { hash = hash * 59 + ConflateMs.GetHashCode(); } if (MarketDataFilter != null) { hash = hash * 59 + MarketDataFilter.GetHashCode(); } return(hash); } }
private void Process() { if (Clk.RisingEdge()) { if (WrEn.Cur == '1') { _content[WrAddr.Cur.UnsignedValue.IntValue] = DataIn.Cur; } DataOut.Next = _content[RdAddr.Cur.UnsignedValue.IntValue]; } }
private void TraceMon() { if (Clk.RisingEdge() && EnIn.Cur == '1') { if (_tracePos < _trace.Length) { var value = DIn.Cur; Debug.Assert(value == _trace[_tracePos]); _tracePos++; } } }
private void SyncResetHandling() { if (Clk.RisingEdge()) { if (Rst.Cur == '1') { _rstq.Next = _rstPat; } else { _rstq.Next = StdLogic._0.Concat(_rstq.Cur[Latency - 2, 1]); } } }
private void ComputeAbs1() { if (Clk.RisingEdge()) { if (Operand.Cur[InputWidth - 1] == '1') { Result.Next = (-Operand.Cur.SignedValue).Resize(OutputWidth).SLVValue; } else { Result.Next = (Operand.Cur.SignedValue).Resize(OutputWidth).SLVValue; } } }
private void Processing() { if (Clk.RisingEdge()) { int shift = Shift.Cur.UnsignedValue.IntValue; if (Dir.Cur == "0") // shift left { _y.Next = X.Cur.Concat(_pad)[2 * DataWidth - shift - 1, DataWidth - shift]; } else // shift right { _y.Next = _pad.Concat(X.Cur)[DataWidth + shift - 1, shift]; } } }
/// <summary> /// Returns true if OrderSubscriptionMessage instances are equal /// </summary> /// <param name="other">Instance of OrderSubscriptionMessage to be compared</param> /// <returns>Boolean</returns> public bool Equals(OrderSubscriptionMessage other) { // credit: http://stackoverflow.com/a/10454552/677735 if (other == null) { return(false); } return((Op == other.Op || Op != null && Op.Equals(other.Op)) && (Id == other.Id || Id != null && Id.Equals(other.Id)) && (SegmentationEnabled == other.SegmentationEnabled || SegmentationEnabled != null && SegmentationEnabled.Equals(other.SegmentationEnabled)) && (OrderFilter == other.OrderFilter || OrderFilter != null && OrderFilter.Equals(other.OrderFilter)) && (Clk == other.Clk || Clk != null && Clk.Equals(other.Clk)) && (HeartbeatMs == other.HeartbeatMs || HeartbeatMs != null && HeartbeatMs.Equals(other.HeartbeatMs)) && (InitialClk == other.InitialClk || InitialClk != null && InitialClk.Equals(other.InitialClk)) && (ConflateMs == other.ConflateMs || ConflateMs != null && ConflateMs.Equals(other.ConflateMs))); }
/// <summary> /// Returns true if OrderChangeMessage instances are equal /// </summary> /// <param name="other">Instance of OrderChangeMessage to be compared</param> /// <returns>Boolean</returns> public bool Equals(OrderChangeMessage other) { // credit: http://stackoverflow.com/a/10454552/677735 if (other == null) { return(false); } return((Op == other.Op || Op != null && Op.Equals(other.Op)) && (Id == other.Id || Id != null && Id.Equals(other.Id)) && (Ct == other.Ct || Ct != null && Ct.Equals(other.Ct)) && (Clk == other.Clk || Clk != null && Clk.Equals(other.Clk)) && (HeartbeatMs == other.HeartbeatMs || HeartbeatMs != null && HeartbeatMs.Equals(other.HeartbeatMs)) && (Pt == other.Pt || Pt != null && Pt.Equals(other.Pt)) && (Oc == other.Oc || Oc != null && Oc.SequenceEqual(other.Oc)) && (InitialClk == other.InitialClk || InitialClk != null && InitialClk.Equals(other.InitialClk)) && (ConflateMs == other.ConflateMs || ConflateMs != null && ConflateMs.Equals(other.ConflateMs)) && (SegmentType == other.SegmentType || SegmentType != null && SegmentType.Equals(other.SegmentType))); }
private void Compute() { if (Clk.RisingEdge()) { switch (_state.Cur) { case State.Mul1: _tmp1.Next = A.Cur * B.Cur; _state.Next = State.Mul2; break; case State.Mul2: _tmp2.Next = C.Cur * D.Cur; _state.Next = State.Add; break; case State.Add: R.Next = _tmp1.Cur + _tmp2.Cur; _state.Next = State.Mul1; break; } } }
public override void First() { //Write the first value to get things started Clk.Write(!Clk.Read(), delay); }
public void Next() { Clk.Write(!Clk.Read(), period / 2); }
public void Dispose() => Clk?.Dispose();