OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 226 to Rev 227
    Reverse comparison

Rev 226 → Rev 227

/trunk/or1ksim/testbench/dma.c
1,8 → 1,8
/* DMA test */
 
#include "support.h"
#include "../../peripheral/fields.h"
#include "../../peripheral/dma.h"
#include "../peripheral/fields.h"
#include "../peripheral/dma.h"
 
#define DMA_BASE 0x90000000LU
 
52,7 → 52,7
 
/* Wait till the channel finishes */
while ( TEST_FLAG( *ch0_csr, DMA_CH_CSR, BUSY ) )
;
;
 
/* Dump contents of memory */
ok = (dst[0] == src[0] && dst[1] == src[1]);
77,7 → 77,7
 
/* Fill source */
for ( i = 0; i < 6; ++ i )
src[i] = 0xA63F879CLU + i;
src[i] = 0xA63F879CLU + i;
 
/* Now set channel CSR */
*ch0_csr = FLAG_MASK( DMA_CH_CSR, CH_EN ) | FLAG_MASK( DMA_CH_CSR, INC_SRC ) | FLAG_MASK( DMA_CH_CSR, INC_DST );
84,13 → 84,13
 
/* Wait till the channel finishes */
while ( TEST_FLAG( *ch0_csr, DMA_CH_CSR, BUSY ) )
;
;
 
/* Dump contents of memory */
ok = 1;
for ( i = 0; i < 6 && ok; ++ i )
if ( dst[i] != src[i] )
ok = 0;
if ( dst[i] != src[i] )
ok = 0;
report( i );
 
return ok;
118,7 → 118,7
 
/* Fill source */
for ( i = 0; i < 10; ++ i )
src[i] = 0x110BD540FLU + i;
src[i] = 0x110BD540FLU + i;
 
/* Set descriptor CSR */
desc[0].csr |= FLAG_MASK( DMA_DESC_CSR, INC_SRC ) | FLAG_MASK( DMA_DESC_CSR, INC_DST );
136,14 → 136,14
 
/* Wait till the channel finishes */
while ( TEST_FLAG( *ch0_csr, DMA_CH_CSR, BUSY ) )
;
;
 
ok = TEST_FLAG( *ch0_csr, DMA_CH_CSR, DONE );
/* Dump contents of memory */
for ( i = 0; i < 10 && ok; ++ i )
if ( dst[i] != src[i] )
ok = 0;
if ( dst[i] != src[i] )
ok = 0;
report( i );
 
return ok;
152,16 → 152,18
 
int main()
{
int ok = 1;
ok &= simple();
ok &= chunks();
ok &= list();
printf( "Starting DMA test\n" );
 
if ( ok )
report( 0xdeaddeadLU );
printf( "Simple DMA: " );
printf( simple() ? "Passed" : "Failed" );
printf( "Chunks DMA: " );
printf( chunks() ? "Passed" : "Failed" );
printf( "List DMA: " );
printf( list() ? "Passed" : "Failed" );
 
printf( "Ending DMA test\n" );
return 0;
exit( 0 );
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.