changeset 37:0475235d1513 pygar svn.38

[svn r38] fixed audiocorepipe
author punk
date Tue, 04 May 2010 19:25:30 -0400
parents 99519a031813
children 05598d745f99
files modules/bluespec/Pygar/core/AudioCoreSystem.cpp modules/bluespec/Pygar/core/Processor.bsv modules/bluespec/Pygar/core/audioCorePipeline.bsv
diffstat 3 files changed, 41 insertions(+), 38 deletions(-) [+]
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  
     2.1 --- a/modules/bluespec/Pygar/core/Processor.bsv	Tue May 04 18:54:54 2010 -0400
     2.2 +++ b/modules/bluespec/Pygar/core/Processor.bsv	Tue May 04 19:25:30 2010 -0400
     2.3 @@ -81,15 +81,6 @@
     2.4  	
     2.5  endinterface
     2.6  
     2.7 -//The full interface for this is as below in the common file for audioProcessorTypes.bsv
     2.8 -//interface AudioOut;
     2.9 -//  interface Get#(AudioProcessorUnit) audioSampleOutput;
    2.10 -//endinterface
    2.11 -
    2.12 -//interface AudioIn;
    2.13 -//  interface Put#(AudioProcessorUnit) audioSampleInput;
    2.14 -//endinterface	
    2.15 -
    2.16  typedef enum { PCgen, Exec, Writeback } Stage deriving(Eq,Bits);
    2.17  
    2.18  //-----------------------------------------------------------
    2.19 @@ -585,7 +576,7 @@
    2.20  //  endrule
    2.21  
    2.22    rule flagAudioEnd (inAudioFifo.first() matches tagged EndOfFile);
    2.23 -     $display (" Proc Says End Audio Flag Set ");
    2.24 +     $display (" PROCESSOR End Audio Flag Set ");
    2.25       cp0_audioEOF <= True;
    2.26       inAudioFifo.deq;
    2.27    endrule
     3.1 --- a/modules/bluespec/Pygar/core/audioCorePipeline.bsv	Tue May 04 18:54:54 2010 -0400
     3.2 +++ b/modules/bluespec/Pygar/core/audioCorePipeline.bsv	Tue May 04 19:25:30 2010 -0400
     3.3 @@ -107,6 +107,16 @@
     3.4  
     3.5     //*****  SERVER Side  *****
     3.6  
     3.7 +   (* conservative_implicit_conditions *)
     3.8 +  rule handleCPUToHost;
     3.9 +   let req <- server_stub.acceptRequest_ReadCPUToHost();
    3.10 +    case (req)
    3.11 +     0: server_stub.sendResponse_ReadCPUToHost(cp0_tohost);
    3.12 +     1: server_stub.sendResponse_ReadCPUToHost(pc);
    3.13 +     2: server_stub.sendResponse_ReadCPUToHost(zeroExtend(pack(stage)));
    3.14 +    endcase
    3.15 +  endrule
    3.16 +   
    3.17     rule feedInput;
    3.18       let command <- server_stub.acceptRequest_SendUnprocessedStream();
    3.19       AudioProcessorControl ctrl = unpack(truncate(command.ctrl));