changeset 11:50af57801d6e pygar svn.12

[svn r12] working on getting audio pipe processor working
author punk
date Sun, 25 Apr 2010 08:31:47 -0400
parents 295314b16220
children 394aa40fd812
files modules/bluespec/Pygar/core/Processor.bsv modules/bluespec/Pygar/core/audio_core.awb modules/bluespec/Pygar/core/core.awb modules/bluespec/Pygar/core/processor.awb modules/bluespec/Pygar/core/processor_library.awb modules/bluespec/Pygar/lab4/core.awb modules/bluespec/Pygar/lab4/data_cache.awb modules/bluespec/Pygar/lab4/instruction_cache.awb modules/bluespec/Pygar/lab4/mem_arb.awb modules/bluespec/Pygar/lab4/processor.awb modules/bluespec/Pygar/lab4/processor_library.awb modules/bluespec/Pygar/lab4/processor_system.awb
diffstat 12 files changed, 75 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/modules/bluespec/Pygar/core/Processor.bsv	Fri Apr 23 09:35:02 2010 -0400
     1.2 +++ b/modules/bluespec/Pygar/core/Processor.bsv	Sun Apr 25 08:31:47 2010 -0400
     1.3 @@ -30,6 +30,7 @@
     1.4  import SFIFO::*;
     1.5  import RWire::*;
     1.6  
     1.7 +import Trace::*;
     1.8  import BFIFO::*;
     1.9  import MemTypes::*;
    1.10  import ProcTypes::*;
    1.11 @@ -37,23 +38,24 @@
    1.12  import BranchPred::*;
    1.13  //import PathTypes::*;  This is only there to force the debugging
    1.14  
    1.15 -import Trace::*;
    1.16 -
    1.17  //AWB includes
    1.18  `include "asim/provides/low_level_platform_interface.bsh"
    1.19  `include "asim/provides/soft_connections.bsh"
    1.20  `include "asim/provides/common_services.bsh"
    1.21  
    1.22  // Local includes
    1.23 -`include "asim/provides/processor_library.bsh"
    1.24 +//`include "asim/provides/processor_library.bsh" (included above directly)
    1.25  `include "asim/rrr/remote_server_stub_PROCESSORSYSTEMRRR.bsh"
    1.26  `include "asim/provides/common_services.bsh"
    1.27  `include "asim/dict/STATS_PROCESSOR.bsh"
    1.28  
    1.29 -interface ProcStats;
    1.30 -  interface Get#(Stat) num_cycles;
    1.31 -  interface Get#(Stat) num_inst;
    1.32 -endinterface
    1.33 +// Local includes. Look for the correspondingly named .awb files
    1.34 +// workspace/labs/src/mit-6.375/modules/bluespec/mit-6.375/common/
    1.35 +// to find the actual Bluespec files which are used to generate
    1.36 +// these includes.  These files are specific to this audio processing
    1.37 +// pipeline
    1.38 +
    1.39 +`include "asim/provides/audio_processor_types.bsh"
    1.40  
    1.41  interface CPUToHost;
    1.42    method Bit#(32) cpuToHost(int req);
    1.43 @@ -68,14 +70,19 @@
    1.44    // Interface for enabling/disabling statistics on the rest of the core
    1.45    interface Get#(Bool) statsEn_get;
    1.46  
    1.47 -  // Interface for collecting statistics.
    1.48 -  interface ProcStats stats;
    1.49 -
    1.50    // Interface to host
    1.51    interface CPUToHost tohost;
    1.52  
    1.53 +  // Interface to Audio Pipeline
    1.54 +  interface Audio audio;
    1.55 +	
    1.56  endinterface
    1.57  
    1.58 +//The full interface for this is as below in the common file for audioProcessorTypes.bsv
    1.59 +interface Audio;
    1.60 +  interface Put#(AudioProcessorUnit) audioSampleInput;
    1.61 +  interface Get#(AudioProcessorUnit) audioSampleOutput;
    1.62 +endinterface
    1.63  
    1.64  typedef enum { PCgen, Exec, Writeback } Stage deriving(Eq,Bits);
    1.65  
    1.66 @@ -250,14 +257,19 @@
    1.67     FIFO#(DataReq)  dataReqQ    <- mkBFIFO1();
    1.68     FIFO#(DataResp) dataRespQ   <- mkFIFO();
    1.69  
    1.70 -   // Statistics state
    1.71 -   Reg#(Stat) num_cycles <- mkReg(0);
    1.72 -   Reg#(Stat) num_inst <- mkReg(0);
    1.73 +   // Audio I/O
    1.74 +   FIFO#(AudioProcessorUnit) inAudioFifo <- mkFIFO;
    1.75 +   FIFO#(AudioProcessorUnit) outAudioFifo <- mkFIFO;
    1.76 +
    1.77 +
    1.78 +   // Statistics state (2010)
    1.79 +//   Reg#(Stat) num_cycles <- mkReg(0);
    1.80 +//   Reg#(Stat) num_inst <- mkReg(0);
    1.81  
    1.82     //Or:
    1.83 -      // Statistics state
    1.84 -   //STAT num_cycles <- mkStatCounter(`STATS_PROCESSOR_CYCLE_COUNT);
    1.85 -   //STAT num_inst <- mkStatCounter(`STATS_PROCESSOR_INST_COUNT);
    1.86 +   // Statistics state
    1.87 +   STAT num_cycles <- mkStatCounter(`STATS_PROCESSOR_CYCLE_COUNT);
    1.88 +   STAT num_inst <- mkStatCounter(`STATS_PROCESSOR_INST_COUNT);
    1.89  
    1.90     //-----------------------------------------------------------
    1.91     // Rules
    1.92 @@ -515,7 +527,7 @@
    1.93  	pcQ.deq();
    1.94  
    1.95      if ( cp0_statsEn )
    1.96 -      num_inst <= num_inst+1;
    1.97 +      num_inst.incr();
    1.98  
    1.99    endrule
   1.100  
   1.101 @@ -541,20 +553,25 @@
   1.102  
   1.103    rule inc_num_cycles;
   1.104      if ( cp0_statsEn )
   1.105 -      num_cycles <= num_cycles+1;
   1.106 +      num_cycles.incr();
   1.107    endrule
   1.108 -// THis rule breaks things
   1.109 -//  rule handleCPUToHost;
   1.110 -//   let req <- server_stub.acceptRequest_ReadCPUToHost();
   1.111 -//    case (req)
   1.112 -//    0: server_stub.sendResponse_ReadCPUToHost(cp0_tohost);
   1.113 -//     1: server_stub.sendResponse_ReadCPUToHost(pc);
   1.114 -//     2: server_stub.sendResponse_ReadCPUToHost(zeroExtend(pack(stage)));
   1.115 -//    endcase
   1.116 -//  endrule
   1.117 -//-----------------------------------------------------------
   1.118 -// My Adds
   1.119 -//-----------------------------------------------------------
   1.120 +
   1.121 +(* conservative_implicit_conditions *)
   1.122 +  rule handleCPUToHost;
   1.123 +   let req <- server_stub.acceptRequest_ReadCPUToHost();
   1.124 +    case (req)
   1.125 +    0: server_stub.sendResponse_ReadCPUToHost(cp0_tohost);
   1.126 +     1: server_stub.sendResponse_ReadCPUToHost(pc);
   1.127 +     2: server_stub.sendResponse_ReadCPUToHost(zeroExtend(pack(stage)));
   1.128 +    endcase
   1.129 +  endrule
   1.130 +
   1.131 + // for now, we don't do anything.
   1.132 +  rule connectAudioReqResp;
   1.133 +    $display("FIR copies a data");
   1.134 +    outAudioFifo.enq(inAudioFifo.first);
   1.135 +    outAudioFifo.deq;
   1.136 +  endrule
   1.137  
   1.138    //-----------------------------------------------------------
   1.139    // Methods
   1.140 @@ -571,11 +588,6 @@
   1.141  
   1.142    interface Get statsEn_get = toGet(asReg(cp0_statsEn));
   1.143  
   1.144 -  interface ProcStats stats;
   1.145 -    interface Get num_cycles = toGet(asReg(num_cycles));
   1.146 -    interface Get num_inst = toGet(asReg(num_inst));
   1.147 -  endinterface
   1.148 -
   1.149    interface CPUToHost tohost;
   1.150      method Bit#(32) cpuToHost(int req);
   1.151        return (case (req)
   1.152 @@ -586,5 +598,11 @@
   1.153      endmethod
   1.154    endinterface
   1.155  
   1.156 +  interface Audio audio;
   1.157 +     interface audioSampleInput = fifoToPut(inAudioFifo);
   1.158 +     interface audioSampleOutput = fifoToGet(outAudioFifo);
   1.159 +  endinterface
   1.160 +
   1.161 +
   1.162  endmodule
   1.163  
     2.1 --- a/modules/bluespec/Pygar/core/audio_core.awb	Fri Apr 23 09:35:02 2010 -0400
     2.2 +++ b/modules/bluespec/Pygar/core/audio_core.awb	Sun Apr 25 08:31:47 2010 -0400
     2.3 @@ -1,16 +1,16 @@
     2.4 -%name audio core
     2.5 -%desc Instantiates a soft core used for audio, wrapped in the audio pipeline interface
     2.6 +i%name Simple Audio Processor Core 
     2.7 +%desc Instantiates a processor, some caches, and a memory arbiter
     2.8  
     2.9 -%provides audio_pipeline
    2.10 +%provides core
    2.11  
    2.12 -%requires audio_pipeline_types
    2.13 -%requires core
    2.14 -%requires funcp_simulated_memory
    2.15 -%requires funcp_base_types
    2.16 -%requires hasim_common
    2.17 -
    2.18 +%requires mem_arb
    2.19 +%requires instruction_cache
    2.20 +%requires data_cache
    2.21 +%requires processor
    2.22 +%requires processor_library
    2.23  
    2.24  %attributes 6_375
    2.25  
    2.26 -%public FIRFilterPipeline.bsv
    2.27 +%public audioCore.bsv
    2.28  
    2.29 +
     3.1 --- a/modules/bluespec/Pygar/core/core.awb	Fri Apr 23 09:35:02 2010 -0400
     3.2 +++ b/modules/bluespec/Pygar/core/core.awb	Sun Apr 25 08:31:47 2010 -0400
     3.3 @@ -9,7 +9,7 @@
     3.4  %requires processor
     3.5  %requires processor_library
     3.6  
     3.7 -%attributes 6_375
     3.8 +%attributes PYGAR
     3.9  
    3.10  %public Core.bsv
    3.11  
     4.1 --- a/modules/bluespec/Pygar/core/processor.awb	Fri Apr 23 09:35:02 2010 -0400
     4.2 +++ b/modules/bluespec/Pygar/core/processor.awb	Sun Apr 25 08:31:47 2010 -0400
     4.3 @@ -1,5 +1,5 @@
     4.4 -%name 3-Stage Audio Processor 
     4.5 -%desc 3-Stage Processor, one stage per cycle.
     4.6 +%name 3-Stage Audio Processor  
     4.7 +%desc 3-Stage Processor, with audio in one stage per cycle.
     4.8  
     4.9  %provides processor
    4.10  
     5.1 --- a/modules/bluespec/Pygar/core/processor_library.awb	Fri Apr 23 09:35:02 2010 -0400
     5.2 +++ b/modules/bluespec/Pygar/core/processor_library.awb	Sun Apr 25 08:31:47 2010 -0400
     5.3 @@ -3,7 +3,7 @@
     5.4  
     5.5  %provides processor_library
     5.6  
     5.7 -%attributes 6_375
     5.8 +%attributes PYGAR
     5.9  
    5.10  %public Trace.bsv BFIFO.bsv MemTypes.bsv BRegFile.bsv BranchPred.bsv
    5.11  
     6.1 --- a/modules/bluespec/Pygar/lab4/core.awb	Fri Apr 23 09:35:02 2010 -0400
     6.2 +++ b/modules/bluespec/Pygar/lab4/core.awb	Sun Apr 25 08:31:47 2010 -0400
     6.3 @@ -9,7 +9,7 @@
     6.4  %requires processor
     6.5  %requires processor_library
     6.6  
     6.7 -%attributes 6_375
     6.8 +%attributes PYGAR
     6.9  
    6.10  %public Core.bsv
    6.11  
     7.1 --- a/modules/bluespec/Pygar/lab4/data_cache.awb	Fri Apr 23 09:35:02 2010 -0400
     7.2 +++ b/modules/bluespec/Pygar/lab4/data_cache.awb	Sun Apr 25 08:31:47 2010 -0400
     7.3 @@ -3,7 +3,7 @@
     7.4  
     7.5  %provides data_cache
     7.6  
     7.7 -%attributes 6_375
     7.8 +%attributes PYGAR
     7.9  
    7.10  %public DataCacheBlocking.bsv
    7.11  %public DataCache.dic
     8.1 --- a/modules/bluespec/Pygar/lab4/instruction_cache.awb	Fri Apr 23 09:35:02 2010 -0400
     8.2 +++ b/modules/bluespec/Pygar/lab4/instruction_cache.awb	Sun Apr 25 08:31:47 2010 -0400
     8.3 @@ -3,7 +3,7 @@
     8.4  
     8.5  %provides instruction_cache
     8.6  
     8.7 -%attributes 6_375
     8.8 +%attributes PYGAR
     8.9  
    8.10  %public InstCacheBlocking.bsv
    8.11  %public InstCache.dic
     9.1 --- a/modules/bluespec/Pygar/lab4/mem_arb.awb	Fri Apr 23 09:35:02 2010 -0400
     9.2 +++ b/modules/bluespec/Pygar/lab4/mem_arb.awb	Sun Apr 25 08:31:47 2010 -0400
     9.3 @@ -3,7 +3,7 @@
     9.4  
     9.5  %provides mem_arb
     9.6  
     9.7 -%attributes 6_375
     9.8 +%attributes PYGAR
     9.9  
    9.10  %public MemArb.bsv
    9.11  
    10.1 --- a/modules/bluespec/Pygar/lab4/processor.awb	Fri Apr 23 09:35:02 2010 -0400
    10.2 +++ b/modules/bluespec/Pygar/lab4/processor.awb	Sun Apr 25 08:31:47 2010 -0400
    10.3 @@ -3,7 +3,7 @@
    10.4  
    10.5  %provides processor
    10.6  
    10.7 -%attributes 6_375
    10.8 +%attributes PYGAR
    10.9  
   10.10  %public Processor.bsv ProcTypes.bsv
   10.11  %public Processor.dic
    11.1 --- a/modules/bluespec/Pygar/lab4/processor_library.awb	Fri Apr 23 09:35:02 2010 -0400
    11.2 +++ b/modules/bluespec/Pygar/lab4/processor_library.awb	Sun Apr 25 08:31:47 2010 -0400
    11.3 @@ -3,6 +3,6 @@
    11.4  
    11.5  %provides processor_library
    11.6  
    11.7 -%attributes 6_375
    11.8 +%attributes PYGAR
    11.9  
   11.10 -%public Trace.bsv BFIFO.bsv MemTypes.bsv FIFOUtility.bsv GetPutExt.bsv SFIFO.bsv CBUFF.bsv BRegFile.bsv BranchPred.bsv
   11.11 \ No newline at end of file
   11.12 +%public Trace.bsv BFIFO.bsv MemTypes.bsv FIFOUtility.bsv GetPutExt.bsv SFIFO.bsv CBUFF.bsv BRegFile.bsv BranchPred.bsv
    12.1 --- a/modules/bluespec/Pygar/lab4/processor_system.awb	Fri Apr 23 09:35:02 2010 -0400
    12.2 +++ b/modules/bluespec/Pygar/lab4/processor_system.awb	Sun Apr 25 08:31:47 2010 -0400
    12.3 @@ -8,7 +8,7 @@
    12.4  %requires funcp_base_types
    12.5  %requires hasim_common
    12.6  
    12.7 -%attributes 6_375
    12.8 +%attributes PYGAR
    12.9  
   12.10  %sources -t BSV  -v PUBLIC ProcessorSystem.bsv
   12.11  %sources -t CPP  -v PUBLIC ProcessorSystem.cpp