# HG changeset patch
# User punk
# Date 1272373343 14400
# Node ID 394aa40fd8123659e7deecb581bb3484a40a6c78
# Parent  50af57801d6e696e93157f3891a95b7e95fb7f7e
[svn r13] more stuff

diff -r 50af57801d6e -r 394aa40fd812 modules/bluespec/Pygar/core/Processor.bsv
--- a/modules/bluespec/Pygar/core/Processor.bsv	Sun Apr 25 08:31:47 2010 -0400
+++ b/modules/bluespec/Pygar/core/Processor.bsv	Tue Apr 27 09:02:23 2010 -0400
@@ -45,9 +45,10 @@
 
 // Local includes
 //`include "asim/provides/processor_library.bsh" (included above directly)
-`include "asim/rrr/remote_server_stub_PROCESSORSYSTEMRRR.bsh"
+`include "asim/rrr/remote_server_stub_AUDIOCORERRR.bsh"
 `include "asim/provides/common_services.bsh"
 `include "asim/dict/STATS_PROCESSOR.bsh"
+`include "asim/provides/audio_pipe_types.bsh"
 
 // Local includes. Look for the correspondingly named .awb files
 // workspace/labs/src/mit-6.375/modules/bluespec/mit-6.375/common/
@@ -55,11 +56,11 @@
 // these includes.  These files are specific to this audio processing
 // pipeline
 
-`include "asim/provides/audio_processor_types.bsh"
+`include "asim/provides/audio_pipe_types.bsh"
 
-interface CPUToHost;
-  method Bit#(32) cpuToHost(int req);
-endinterface
+//interface CPUToHost;
+//  method Bit#(32) cpuToHost(int req);
+//endinterface
 
 interface Proc;
 
@@ -70,20 +71,23 @@
   // Interface for enabling/disabling statistics on the rest of the core
   interface Get#(Bool) statsEn_get;
 
-  // Interface to host
-  interface CPUToHost tohost;
+//  // Interface to host
+//  interface CPUToHost tohost;
 
   // Interface to Audio Pipeline
-  interface Audio audio;
+  interface AudioOut audioOut;
 	
 endinterface
 
 //The full interface for this is as below in the common file for audioProcessorTypes.bsv
-interface Audio;
-  interface Put#(AudioProcessorUnit) audioSampleInput;
+interface AudioOut;
   interface Get#(AudioProcessorUnit) audioSampleOutput;
 endinterface
 
+//interface AudioIn;
+//  interface Put#(AudioProcessorUnit) audioSampleInput;
+//endinterface	
+
 typedef enum { PCgen, Exec, Writeback } Stage deriving(Eq,Bits);
 
 //-----------------------------------------------------------
@@ -224,7 +228,7 @@
    //-----------------------------------------------------------
    // Debug port
    
-   ServerStub_PROCESSORSYSTEMRRR server_stub <- mkServerStub_PROCESSORSYSTEMRRR();   
+   ServerStub_AUDIOCORERRR server_stub <- mkServerStub_AUDIOCORERRR();   
 
    
    //-----------------------------------------------------------
@@ -573,6 +577,23 @@
     outAudioFifo.deq;
   endrule
 
+  // Server items & rules:
+   
+   rule feedInput;
+     let command <- server_stub.acceptRequest_SendUnprocessedStream();
+     AudioProcessorControl ctrl = unpack(truncate(command.ctrl));
+
+     if(ctrl == EndOfFile)
+	begin  
+          inAudioFifo.enq(tagged EndOfFile);
+       end
+     else 
+       begin
+          inAudioFifo.enq(tagged Sample unpack(truncate(command.sample)));
+       end
+   endrule     
+  
+ 
   //-----------------------------------------------------------
   // Methods
 
@@ -588,18 +609,17 @@
 
   interface Get statsEn_get = toGet(asReg(cp0_statsEn));
 
-  interface CPUToHost tohost;
-    method Bit#(32) cpuToHost(int req);
-      return (case (req)
-       0: cp0_tohost;
-       1: pc;
-       2: zeroExtend(pack(stage));
-      endcase);
-    endmethod
-  endinterface
-
-  interface Audio audio;
-     interface audioSampleInput = fifoToPut(inAudioFifo);
+//  interface CPUToHost tohost;
+//    method Bit#(32) cpuToHost(int req);
+//      return (case (req)
+//       0: cp0_tohost;
+//       1: pc;
+//       2: zeroExtend(pack(stage));
+//      endcase);
+//    endmethod
+//  endinterface
+     
+  interface AudioOut audio;
      interface audioSampleOutput = fifoToGet(outAudioFifo);
   endinterface
 
diff -r 50af57801d6e -r 394aa40fd812 modules/bluespec/Pygar/core/audio_core.awb
--- a/modules/bluespec/Pygar/core/audio_core.awb	Sun Apr 25 08:31:47 2010 -0400
+++ b/modules/bluespec/Pygar/core/audio_core.awb	Tue Apr 27 09:02:23 2010 -0400
@@ -1,4 +1,4 @@
-i%name Simple Audio Processor Core 
+%name Audio Processor Core 
 %desc Instantiates a processor, some caches, and a memory arbiter
 
 %provides core