changeset 12:394aa40fd812 pygar svn.13

[svn r13] more stuff
author punk
date Tue, 27 Apr 2010 09:02:23 -0400
parents 50af57801d6e
children 6d461680c6d9
files modules/bluespec/Pygar/core/Processor.bsv modules/bluespec/Pygar/core/audio_core.awb
diffstat 2 files changed, 44 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/modules/bluespec/Pygar/core/Processor.bsv	Sun Apr 25 08:31:47 2010 -0400
     1.2 +++ b/modules/bluespec/Pygar/core/Processor.bsv	Tue Apr 27 09:02:23 2010 -0400
     1.3 @@ -45,9 +45,10 @@
     1.4  
     1.5  // Local includes
     1.6  //`include "asim/provides/processor_library.bsh" (included above directly)
     1.7 -`include "asim/rrr/remote_server_stub_PROCESSORSYSTEMRRR.bsh"
     1.8 +`include "asim/rrr/remote_server_stub_AUDIOCORERRR.bsh"
     1.9  `include "asim/provides/common_services.bsh"
    1.10  `include "asim/dict/STATS_PROCESSOR.bsh"
    1.11 +`include "asim/provides/audio_pipe_types.bsh"
    1.12  
    1.13  // Local includes. Look for the correspondingly named .awb files
    1.14  // workspace/labs/src/mit-6.375/modules/bluespec/mit-6.375/common/
    1.15 @@ -55,11 +56,11 @@
    1.16  // these includes.  These files are specific to this audio processing
    1.17  // pipeline
    1.18  
    1.19 -`include "asim/provides/audio_processor_types.bsh"
    1.20 +`include "asim/provides/audio_pipe_types.bsh"
    1.21  
    1.22 -interface CPUToHost;
    1.23 -  method Bit#(32) cpuToHost(int req);
    1.24 -endinterface
    1.25 +//interface CPUToHost;
    1.26 +//  method Bit#(32) cpuToHost(int req);
    1.27 +//endinterface
    1.28  
    1.29  interface Proc;
    1.30  
    1.31 @@ -70,20 +71,23 @@
    1.32    // Interface for enabling/disabling statistics on the rest of the core
    1.33    interface Get#(Bool) statsEn_get;
    1.34  
    1.35 -  // Interface to host
    1.36 -  interface CPUToHost tohost;
    1.37 +//  // Interface to host
    1.38 +//  interface CPUToHost tohost;
    1.39  
    1.40    // Interface to Audio Pipeline
    1.41 -  interface Audio audio;
    1.42 +  interface AudioOut audioOut;
    1.43  	
    1.44  endinterface
    1.45  
    1.46  //The full interface for this is as below in the common file for audioProcessorTypes.bsv
    1.47 -interface Audio;
    1.48 -  interface Put#(AudioProcessorUnit) audioSampleInput;
    1.49 +interface AudioOut;
    1.50    interface Get#(AudioProcessorUnit) audioSampleOutput;
    1.51  endinterface
    1.52  
    1.53 +//interface AudioIn;
    1.54 +//  interface Put#(AudioProcessorUnit) audioSampleInput;
    1.55 +//endinterface	
    1.56 +
    1.57  typedef enum { PCgen, Exec, Writeback } Stage deriving(Eq,Bits);
    1.58  
    1.59  //-----------------------------------------------------------
    1.60 @@ -224,7 +228,7 @@
    1.61     //-----------------------------------------------------------
    1.62     // Debug port
    1.63     
    1.64 -   ServerStub_PROCESSORSYSTEMRRR server_stub <- mkServerStub_PROCESSORSYSTEMRRR();   
    1.65 +   ServerStub_AUDIOCORERRR server_stub <- mkServerStub_AUDIOCORERRR();   
    1.66  
    1.67     
    1.68     //-----------------------------------------------------------
    1.69 @@ -573,6 +577,23 @@
    1.70      outAudioFifo.deq;
    1.71    endrule
    1.72  
    1.73 +  // Server items & rules:
    1.74 +   
    1.75 +   rule feedInput;
    1.76 +     let command <- server_stub.acceptRequest_SendUnprocessedStream();
    1.77 +     AudioProcessorControl ctrl = unpack(truncate(command.ctrl));
    1.78 +
    1.79 +     if(ctrl == EndOfFile)
    1.80 +	begin  
    1.81 +          inAudioFifo.enq(tagged EndOfFile);
    1.82 +       end
    1.83 +     else 
    1.84 +       begin
    1.85 +          inAudioFifo.enq(tagged Sample unpack(truncate(command.sample)));
    1.86 +       end
    1.87 +   endrule     
    1.88 +  
    1.89 + 
    1.90    //-----------------------------------------------------------
    1.91    // Methods
    1.92  
    1.93 @@ -588,18 +609,17 @@
    1.94  
    1.95    interface Get statsEn_get = toGet(asReg(cp0_statsEn));
    1.96  
    1.97 -  interface CPUToHost tohost;
    1.98 -    method Bit#(32) cpuToHost(int req);
    1.99 -      return (case (req)
   1.100 -       0: cp0_tohost;
   1.101 -       1: pc;
   1.102 -       2: zeroExtend(pack(stage));
   1.103 -      endcase);
   1.104 -    endmethod
   1.105 -  endinterface
   1.106 -
   1.107 -  interface Audio audio;
   1.108 -     interface audioSampleInput = fifoToPut(inAudioFifo);
   1.109 +//  interface CPUToHost tohost;
   1.110 +//    method Bit#(32) cpuToHost(int req);
   1.111 +//      return (case (req)
   1.112 +//       0: cp0_tohost;
   1.113 +//       1: pc;
   1.114 +//       2: zeroExtend(pack(stage));
   1.115 +//      endcase);
   1.116 +//    endmethod
   1.117 +//  endinterface
   1.118 +     
   1.119 +  interface AudioOut audio;
   1.120       interface audioSampleOutput = fifoToGet(outAudioFifo);
   1.121    endinterface
   1.122  
     2.1 --- a/modules/bluespec/Pygar/core/audio_core.awb	Sun Apr 25 08:31:47 2010 -0400
     2.2 +++ b/modules/bluespec/Pygar/core/audio_core.awb	Tue Apr 27 09:02:23 2010 -0400
     2.3 @@ -1,4 +1,4 @@
     2.4 -i%name Simple Audio Processor Core 
     2.5 +%name Audio Processor Core 
     2.6  %desc Instantiates a processor, some caches, and a memory arbiter
     2.7  
     2.8  %provides core