Demo entry 6636162

GetOffsetTable

   

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

function OffsetTableType GetOffsetTable();
      OffsetTableType Result;
      for (ushort i = 0; i < 2; i++) begin
         logic Inc;
         Inc = i;
         for (ushort d = 0; d < 2**Queues; d++) begin
            logic [Queues-1:0] Dec;
            OffsetType         Offset;
            Dec    = d;
            Offset = 0;
            if (Inc)
              ++Offset;
            for (ushort q = 0; q < Queues; q++)
              if (Dec[q])
                --Offset;
            Result[i][d] = Offset;
         end
      end
      return Result;
   endfunction

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).