diff modules/bluespec/Pygar/core/AudioCoreSystem.cpp @ 37:0475235d1513 pygar svn.38

[svn r38] fixed audiocorepipe
author punk
date Tue, 04 May 2010 19:25:30 -0400
parents 99519a031813
children 5a30f173bbac
line wrap: on
line diff
     1.1 --- a/modules/bluespec/Pygar/core/AudioCoreSystem.cpp	Tue May 04 18:54:54 2010 -0400
     1.2 +++ b/modules/bluespec/Pygar/core/AudioCoreSystem.cpp	Tue May 04 19:25:30 2010 -0400
     1.3 @@ -64,9 +64,9 @@
     1.4  {
     1.5    //rlm: two files
     1.6    FILE *inputFile;
     1.7 -  //  FILE *inputFile1;
     1.8 +//  FILE *inputFile1;
     1.9    UINT16 sample;
    1.10 -  //UINT16 sample1;
    1.11 +//UINT16 sample1;
    1.12  
    1.13    //rlm: not sure if normal ints are ok here; using UINT16 because I know it works
    1.14    UINT16 channel0 = 0;
    1.15 @@ -103,35 +103,37 @@
    1.16  
    1.17    //rlm: here we read both files. later refactor into a function.
    1.18    // also, this will terminate when the FIRST file reaches its end.
    1.19 -  while( (fread(&sample, 2, 1, inputFile)) )//&& (fread(&sample1, 2 , 1, inputFile1))) 
    1.20 -    {
    1.21 -    if (!coreFin && (result = clientStub->ReadCPUToHost(0)) != 1) 
    1.22 -    {
    1.23 -      sleepCount++;
    1.24 -      if(sleepCount == 200) {
    1.25 -	printf("Failed to get response from hardware, bailing\n\n");
    1.26 -	printf("This means that either your hardware is hanging\n");
    1.27 -	printf("or that the software hasn't given it enough time\n");
    1.28 -	printf("to complete.  If you think it needs more time, then\n");
    1.29 -	printf("edit CONNECTED_APPLICATION_CLASS::Main() in ProcessorSystem.cpp\n");
    1.30 -        printf("(connected_application)\n");
    1.31 +  while( fread(&sample, 2, 1, inputFile)) //&& (fread(&sample1, 2 , 1, inputFile1))) 
    1.32 +  {
    1.33 +    printf("hi\n");
    1.34 +     if (!coreFin && (result = clientStub->ReadCPUToHost(0)) != 1) 
    1.35 +     {
    1.36 +       sleepCount++;
    1.37 +       if(sleepCount == 200) {
    1.38 +	 printf("Failed to get response from hardware, bailing\n\n");
    1.39 +	 printf("This means that either your hardware is hanging\n");
    1.40 +	 printf("or that the software hasn't given it enough time\n");
    1.41 +	 printf("to complete.  If you think it needs more time, then\n");
    1.42 +	 printf("edit CONNECTED_APPLICATION_CLASS::Main() in ProcessorSystem.cpp\n");
    1.43 +	 printf("(connected_application)\n");
    1.44        }
    1.45 -    }
    1.46 -    else if (!coreFin && result == 1) 
    1.47 -      {
    1.48 -	printf("\n***SOFT_CORE PASSED***\n");
    1.49 -	coreFin = true;
    1.50 -      }
    1.51 +     }
    1.52 +     else if (!coreFin && result == 1) 
    1.53 +       {
    1.54 +	 printf("\n***SOFT_CORE PASSED***\n");
    1.55 +	 coreFin = true;
    1.56 +       }
    1.57  
    1.58 -    if(count%1000 == 0)
    1.59 -      printf("main: %d\n", count);
    1.60 -    count++;
    1.61 -    sem_wait(&throttle);
    1.62 -
    1.63 +     if(count%1000 == 0)
    1.64 +     printf("main: %d\n", count);
    1.65 +     count++;
    1.66 +     sem_wait(&throttle);
    1.67 +    
    1.68 +     printf("sending file\n");
    1.69      //rlm: two files.
    1.70 -    clientStub->SendUnprocessedStream( Data,(UINT32)sample);
    1.71 -    //clientStub->SendUnprocessedStream(channel0 , Data,(UINT32)sample);
    1.72 -    //clientStub->SendUnprocessedStream(channel1 , Data,(UINT32)sample1);
    1.73 +     clientStub->SendUnprocessedStream( Data,(UINT32)sample);
    1.74 +     //clientStub->SendUnprocessedStream(channel0 , Data,(UINT32)sample);
    1.75 +     //clientStub->SendUnprocessedStream(channel1 , Data,(UINT32)sample1);
    1.76  
    1.77    } 
    1.78