This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C6678 Queue N Register D



hello:

the guider says:

The Queue N Register D is written to add a packet to the queue and read
to pop a packet off a queue.  

if I want to push a descriptor to a queue, what shoul Ido?

I find the function define:

void push_queue(Uint16 qn, Uint8 mode, Uint32 c_val, Uint32 d_val)
{
#ifdef USE_VBUSM
if (mode == 2)
{
uint64_t *reg;
reg = (uint64_t *)(QM_QMAN_VBUSM_REGION + QM_REG_QUE_REG_C + (qn * 16));
#ifdef _BIG_ENDIAN

*reg = ((uint64_t)c_val << 32) | d_val;
#else
*reg = ((uint64_t)d_val << 32) | c_val;
#endif
}
else
{
Uint32 *reg;
reg = (Uint32 *)(QM_QMAN_VBUSM_REGION + QM_REG_QUE_REG_D + (qn * 16));
*reg = d_val;
}
#else
Uint32 *reg;
if (mode == 2)
{
reg = (Uint32 *)(QM_QMAN_REGION + QM_REG_QUE_REG_C + (qn * 16));
*reg = c_val;
}
reg = (Uint32 *)(QM_QMAN_REGION + QM_REG_QUE_REG_D + (qn * 16));
*reg = d_val;
#endif
}

It means that what I need to do is just give the address of  descriptor to the Queue N Register D, is it right ?

But Queue N Register D bit 0-3 and bit 4-31 represent different meaning,  if I give the address of  descriptor to the Queue N Register D, the value of  this register will be modified, so I am confused by this! Can anyone help me ?

Thanks!

  • si cheng said:

    It means that what I need to do is just give the address of  descriptor to the Queue N Register D, is it right ?

    But Queue N Register D bit 0-3 and bit 4-31 represent different meaning,  if I give the address of  descriptor to the Queue N Register D, the value of  this register will be modified, so I am confused by this! Can anyone help me ?

    Yes, you provide a 16B aligned address when you write Register D (bottom 4bits are assumed 0).  During the same write operation, you also need to specify the descriptor size.  Some descriptors may have protocol specific info for example.  Once you do this the Navigator HW will link the descriptor in the appropriate queue.

    If you haven't done so already, you should look at the MCSDK examples that use Navigator queues, for example...

    pdk_C6678_1_0_0_20\packages\ti\drv\srio\example\SRIOMulticoreLoopback

    Regards,

    Travis