Beispiel #1
0
 private void OnClockWithEn()
 {
     if (Clk.RisingEdge() && En.Cur == '1')
     {
         _stages.Next = _stages.Cur[_belowbit, 0].Concat(Din.Cur);
     }
 }
Beispiel #2
0
 private void OnClock()
 {
     if (Clk.RisingEdge())
     {
         _stages.Next = _stages.Cur[_belowbit, 0].Concat(Din.Cur);
     }
 }
Beispiel #3
0
 private void DiagMonSFix()
 {
     if (Clk.RisingEdge() && EnIn.Cur == '1')
     {
         Console.WriteLine("Writing variable " + MappedVariableName + ": " + SFix.FromSigned(DIn.Cur.SignedValue, _fracWidth).DoubleValue);
     }
 }
Beispiel #4
0
 private void OnClock1()
 {
     if (Clk.RisingEdge())
     {
         Dout.Next = Din.Cur;
     }
 }
Beispiel #5
0
 protected override void Process()
 {
     if (Clk.RisingEdge() && EnIn.Cur == '1')
     {
         DOut.Next = DIn.Cur[0];
     }
 }
Beispiel #6
0
 private void DiagMonDouble()
 {
     if (Clk.RisingEdge() && EnIn.Cur == '1')
     {
         Console.WriteLine("Writing variable " + MappedVariableName + ": " + DIn.Cur.ToDouble());
     }
 }
Beispiel #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;
             }
         }
     }
 }
Beispiel #8
0
 private void OnClock1WithEn()
 {
     if (Clk.RisingEdge() && En.Cur == '1')
     {
         Dout.Next = Din.Cur;
     }
 }
Beispiel #9
0
 private void ReadProcess()
 {
     if (Clk.RisingEdge() && RdEn.Cur == '1')
     {
         DataOut.Next = _content[Addr.Cur.UnsignedValue.IntValue];
     }
 }
Beispiel #10
0
 private void UpdateAddr()
 {
     if (Clk.RisingEdge())
     {
         _lastAddr.Next = _outAddr.Cur;
     }
 }
Beispiel #11
0
 private void Clocked()
 {
     if (Clk.RisingEdge() && EnIn.Cur == '1')
     {
         _stg.Next = DIn.Cur;
     }
 }
Beispiel #12
0
 private void LookupProcess()
 {
     if (Clk.RisingEdge())
     {
         Addr.Next = X.Cur.GetIntPart().Resize(AddrWidth);
         _yIn.Next = Data.Cur.SLVValue;
     }
 }
Beispiel #13
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;
     }
 }
Beispiel #14
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];
     }
 }
Beispiel #15
0
 private void TraceMon()
 {
     if (Clk.RisingEdge() && EnIn.Cur == '1')
     {
         if (_tracePos < _trace.Length)
         {
             var value = DIn.Cur;
             Debug.Assert(value == _trace[_tracePos]);
             _tracePos++;
         }
     }
 }
Beispiel #16
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]);
         }
     }
 }
Beispiel #17
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;
         }
     }
 }
Beispiel #18
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];
         }
     }
 }
Beispiel #19
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;
                }
            }
        }