Demo entry 6636163

Shift

   

Submitted by anonymous on Aug 23, 2017 at 10:39
Language: verilog. Code size: 553 Bytes.

function void Shift (logic [abits(Depth)-1:0] pos,
                        ushort chan);
      for (ushort c = 0; c < Queues; c++)//Queues=4
        if (c == chan)
          for (ushort i = 0; i < Depth; i++)// Depth=8
            if (i == pos)
              for (ushort j = i; j < $bits(ShiftSlot[c]); j++)//$bits(ShiftSlot[c])=8
                TmpShiftSlot[c][j] = 1;
      TmpWriteSlot[$high(TmpWriteSlot)-1:0]
        = TmpWriteSlot[$high(TmpWriteSlot):1];//右移1个bit位
      TmpWriteSlot[$high(TmpWriteSlot)] = 0;//再把高位bit写0
   endfunction

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).