예제 #1
0
 private void Clocked()
 {
     if (Clk.RisingEdge() && EnIn.Cur == '1')
     {
         _stg.Next = DIn.Cur;
     }
 }
예제 #2
0
 private void UpdateAddr()
 {
     if (Clk.RisingEdge())
     {
         _lastAddr.Next = _outAddr.Cur;
     }
 }
예제 #3
0
 protected override void Process()
 {
     if (Clk.RisingEdge() && EnIn.Cur == '1')
     {
         DOut.Next = DIn.Cur[0];
     }
 }
예제 #4
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);
 }
예제 #5
0
 private void OnClock()
 {
     if (Clk.RisingEdge())
     {
         _stages.Next = _stages.Cur[_belowbit, 0].Concat(Din.Cur);
     }
 }
예제 #6
0
 private void OnClockWithEn()
 {
     if (Clk.RisingEdge() && En.Cur == '1')
     {
         _stages.Next = _stages.Cur[_belowbit, 0].Concat(Din.Cur);
     }
 }
예제 #7
0
 /// <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;
             }
         }
     }
 }
예제 #8
0
 private void ReadProcess()
 {
     if (Clk.RisingEdge() && RdEn.Cur == '1')
     {
         DataOut.Next = _content[Addr.Cur.UnsignedValue.IntValue];
     }
 }
예제 #9
0
 private void OnClock1()
 {
     if (Clk.RisingEdge())
     {
         Dout.Next = Din.Cur;
     }
 }
예제 #10
0
 private void OnClock1WithEn()
 {
     if (Clk.RisingEdge() && En.Cur == '1')
     {
         Dout.Next = Din.Cur;
     }
 }
예제 #11
0
 private void DiagMonSFix()
 {
     if (Clk.RisingEdge() && EnIn.Cur == '1')
     {
         Console.WriteLine("Writing variable " + MappedVariableName + ": " + SFix.FromSigned(DIn.Cur.SignedValue, _fracWidth).DoubleValue);
     }
 }
예제 #12
0
 private void DiagMonDouble()
 {
     if (Clk.RisingEdge() && EnIn.Cur == '1')
     {
         Console.WriteLine("Writing variable " + MappedVariableName + ": " + DIn.Cur.ToDouble());
     }
 }
예제 #13
0
 public void Resume()
 {
     if (State == State.Paused)
     {
         Clk.Start();
         State = State.On;
     }
 }
예제 #14
0
 public void Pause()
 {
     if (State == State.On)
     {
         Clk.Stop();
         State = State.Paused;
     }
 }
예제 #15
0
 public void PowerOff()
 {
     if (State > 0)
     {
         Clk.Stop();
         State = State.Off;
     }
 }
예제 #16
0
 public void PowerOn()
 {
     if (State == State.Off)
     {
         Clk.Start();
         State = State.On;
     }
 }
예제 #17
0
파일: LERP.cs 프로젝트: cephdon/systemsharp
 private void LookupProcess()
 {
     if (Clk.RisingEdge())
     {
         Addr.Next = X.Cur.GetIntPart().Resize(AddrWidth);
         _yIn.Next = Data.Cur.SLVValue;
     }
 }
예제 #18
0
 private void Compute()
 {
     if (Clk.RisingEdge())
     {
         _tmp1.Next = A.Cur * B.Cur;
         _tmp2.Next = C.Cur * D.Cur;
         R.Next     = _tmp1.Cur + _tmp2.Cur;
     }
 }
예제 #19
0
        /// <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);
            }
        }
예제 #20
0
 private void Process()
 {
     if (Clk.RisingEdge())
     {
         if (WrEn.Cur == '1')
         {
             _content[WrAddr.Cur.UnsignedValue.IntValue] = DataIn.Cur;
         }
         DataOut.Next = _content[RdAddr.Cur.UnsignedValue.IntValue];
     }
 }
예제 #21
0
 private void TraceMon()
 {
     if (Clk.RisingEdge() && EnIn.Cur == '1')
     {
         if (_tracePos < _trace.Length)
         {
             var value = DIn.Cur;
             Debug.Assert(value == _trace[_tracePos]);
             _tracePos++;
         }
     }
 }
예제 #22
0
 private void SyncResetHandling()
 {
     if (Clk.RisingEdge())
     {
         if (Rst.Cur == '1')
         {
             _rstq.Next = _rstPat;
         }
         else
         {
             _rstq.Next = StdLogic._0.Concat(_rstq.Cur[Latency - 2, 1]);
         }
     }
 }
예제 #23
0
 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;
         }
     }
 }
예제 #24
0
 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];
         }
     }
 }
예제 #25
0
        /// <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)));
        }
예제 #27
0
        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;
                }
            }
        }
예제 #28
0
 public override void First()
 {
     //Write the first value to get things started
     Clk.Write(!Clk.Read(), delay);
 }
예제 #29
0
 public void Next()
 {
     Clk.Write(!Clk.Read(), period / 2);
 }
예제 #30
0
 public void Dispose() => Clk?.Dispose();