SPRUGR9H November 2010 – April 2015 66AK2E05 , 66AK2H06 , 66AK2H12 , 66AK2H14 , 66AK2L06 , AM5K2E02 , AM5K2E04 , SM320C6678-HIREL , TMS320C6652 , TMS320C6654 , TMS320C6655 , TMS320C6657 , TMS320C6670 , TMS320C6671 , TMS320C6672 , TMS320C6674 , TMS320C6678
At this point, everything has been initialized for the example test case. All that remains to be done is:
The following code will push 8 descriptors into the TX queues then wait for the results:
for (idx = 0; idx < 8; idx ++)
{
Uint32 tmp = pop_queue(5000);
host_pkt = (MNAV_HostPacketDescriptor *)(tmp);
host_pkt->type_id = MNAV_DESC_ID_HOST;
host_pkt->ps_reg_loc = 0;
host_pkt->packet_length = 64;
host_pkt->psv_word_count = 0;
host_pkt->pkt_return_qnum = 0x1000;
host_pkt->buffer_len = 64;
host_pkt->next_desc_ptr = NULL;
host_pkt->src_tag_lo = 0; //copied to .flo_idx of streaming i/f
/* Add code here to fill the descriptor's buffer */
push_queue(800, 1, 0, tmp);
tmp = pop_queue(5001);
mono_pkt = (MNAV_MonolithicPacketDescriptor *)(tmp);
mono_pkt->type_id = MNAV_DESC_ID_MONO;
mono_pkt->data_offset = 12;
mono_pkt->packet_length = 16;
mono_pkt->epib = 0;
mono_pkt->pkt_return_qnum = 0x1001;
mono_pkt->src_tag_lo = 1; //copied to .flo_idx of streaming i/f
/* Add code here to fill the descriptor's buffer */
push_queue(801, 1, 0, tmp);
}
/* Burn some time for the accumulators to run. */
testpass = 0;
for (idx = 0; idx < 20000; idx ++)
{
testpass = idx;
}
Because no data was loaded into buffers, there is no need to check for that here. But, check to see that the correct descriptors arrived in the resulting host descriptor and monolithic descriptor lists. Note that the descriptors in these lists no longer belong to any queue. It is the host’s responsibility to requeue them.
testpass = 1;
/* Check the Host Packet accumulator list. */
for (idx = 0; idx < 8; idx ++)
{
addr = (Uint32)(host_region + ((idx + 16) * 64));
if (hostList[idx+1] != addr)
testpass = 0;
}
if (hostList[0] != 8) //check the list count in element 0
testpass = 0;
if (testpass == 1)
printf("Host Descriptor Test: PASS\n");
else
printf("Host Descriptor Test: FAIL\n");
testpass = 1;
/* Check the Monolithic Packet accumulator list. */
for (idx = 0; idx < 8; idx ++)
{
addr = (Uint32)(mono_region + ((idx + 16) * 160));
if (monoList[idx] != addr)
testpass = 0;
}
if (monoList[8] != 0) //check for the NULL terminator in this list
testpass = 0;
if (testpass == 1)
printf("Monolithic Descriptor Test: PASS\n");
else
printf("Monolithic Descriptor Test: FAIL\n");