comparison modules/bluespec/Pygar/core/Processor.bsv @ 36:99519a031813 pygar svn.37

[svn r37] moved the server into audioCorePipeline
author punk
date Tue, 04 May 2010 18:54:54 -0400
parents 14f7a7ace3f5
children 0475235d1513
comparison
equal deleted inserted replaced
35:14f7a7ace3f5 36:99519a031813
44 `include "asim/provides/soft_connections.bsh" 44 `include "asim/provides/soft_connections.bsh"
45 `include "asim/provides/common_services.bsh" 45 `include "asim/provides/common_services.bsh"
46 46
47 // Local includes 47 // Local includes
48 //`include "asim/provides/processor_library.bsh" (included above directly) 48 //`include "asim/provides/processor_library.bsh" (included above directly)
49 `include "asim/rrr/remote_server_stub_AUDIOCORERRR.bsh" 49
50 `include "asim/provides/common_services.bsh" 50 `include "asim/provides/common_services.bsh"
51 `include "asim/dict/STATS_PROCESSOR.bsh" 51 `include "asim/dict/STATS_PROCESSOR.bsh"
52 `include "asim/provides/processor_library.bsh" 52 `include "asim/provides/processor_library.bsh"
53 53
54 // Local includes. Look for the correspondingly named .awb files 54 // Local includes. Look for the correspondingly named .awb files
75 // // Interface to host 75 // // Interface to host
76 // interface CPUToHost tohost; 76 // interface CPUToHost tohost;
77 77
78 // Interface to Audio Pipeline 78 // Interface to Audio Pipeline
79 interface Get#(AudioProcessorUnit) sampleOutput; 79 interface Get#(AudioProcessorUnit) sampleOutput;
80 interface Put#(AudioProcessorUnit) sampleInput;
80 81
81 endinterface 82 endinterface
82 83
83 //The full interface for this is as below in the common file for audioProcessorTypes.bsv 84 //The full interface for this is as below in the common file for audioProcessorTypes.bsv
84 //interface AudioOut; 85 //interface AudioOut;
224 //(* doc = "synthesis attribute ram_style mkProc distributed;" *) 225 //(* doc = "synthesis attribute ram_style mkProc distributed;" *)
225 //(* synthesize *) 226 //(* synthesize *)
226 227
227 module [CONNECTED_MODULE] mkProc( Proc ); 228 module [CONNECTED_MODULE] mkProc( Proc );
228 229
229 //-----------------------------------------------------------
230 // Debug port
231
232 ServerStub_AUDIOCORERRR server_stub <- mkServerStub_AUDIOCORERRR();
233
234
235 //----------------------------------------------------------- 230 //-----------------------------------------------------------
236 // State 231 // State
237 232
238 // Standard processor state 233 // Standard processor state
239 234
579 rule inc_num_cycles; 574 rule inc_num_cycles;
580 if ( cp0_statsEn ) 575 if ( cp0_statsEn )
581 num_cycles.incr(); 576 num_cycles.incr();
582 endrule 577 endrule
583 578
584 (* conservative_implicit_conditions *)
585 rule handleCPUToHost;
586 let req <- server_stub.acceptRequest_ReadCPUToHost();
587 case (req)
588 0: server_stub.sendResponse_ReadCPUToHost(cp0_tohost);
589 1: server_stub.sendResponse_ReadCPUToHost(pc);
590 2: server_stub.sendResponse_ReadCPUToHost(zeroExtend(pack(stage)));
591 endcase
592 endrule
593 579
594 // for now, we don't do anything. 580 // for now, we don't do anything.
595 // rule connectAudioReqResp; 581 // rule connectAudioReqResp;
596 // $display("rlm: PROCESSOR copies a datum\n"); 582 // $display("rlm: PROCESSOR copies a datum\n");
597 // outAudioFifo.enq(inAudioFifo.first()); 583 // outAudioFifo.enq(inAudioFifo.first());
608 $display (" PROCESSOR Says Program Complete "); 594 $display (" PROCESSOR Says Program Complete ");
609 outAudioFifo.enq(tagged EndOfFile); 595 outAudioFifo.enq(tagged EndOfFile);
610 cp0_progComp <= False; //only send one. And functions to reset 596 cp0_progComp <= False; //only send one. And functions to reset
611 endrule 597 endrule
612 598
613 // Server items & rules: 599
614
615 rule feedInput;
616 let command <- server_stub.acceptRequest_SendUnprocessedStream();
617 AudioProcessorControl ctrl = unpack(truncate(command.ctrl));
618 if(ctrl == EndOfFile)
619 begin
620 $display("lsp: PROCESSOR received EOF ");
621 inAudioFifo.enq(tagged EndOfFile);
622 end
623 else
624 begin
625 $display("lsp: PROCESSOR received Data ");
626 inAudioFifo.enq(tagged Sample unpack(truncate(command.sample)));
627 end
628 endrule
629
630
631 //----------------------------------------------------------- 600 //-----------------------------------------------------------
632 // Methods 601 // Methods
633 602
634 interface Client imem_client; 603 interface Client imem_client;
635 interface Get request = fifoToGet(instReqQ); 604 interface Get request = fifoToGet(instReqQ);
641 interface Put response = fifoToPut(dataRespQ); 610 interface Put response = fifoToPut(dataRespQ);
642 endinterface 611 endinterface
643 612
644 interface Get statsEn_get = toGet(asReg(cp0_statsEn)); 613 interface Get statsEn_get = toGet(asReg(cp0_statsEn));
645 614
646 // interface CPUToHost tohost; 615 /*
647 // method Bit#(32) cpuToHost(int req); 616 interface CPUToHost tohost;
648 // return (case (req) 617 method Bit#(32) cpuToHost(int req);
649 // 0: cp0_tohost; 618 return (case (req)
650 // 1: pc; 619 0: cp0_tohost;
651 // 2: zeroExtend(pack(stage)); 620 1: pc;
652 // endcase); 621 2: zeroExtend(pack(stage));
653 // endmethod 622 endcase);
654 // endinterface 623 endmethod
655 624 endinterface
625 */
626
656 interface Get sampleOutput = fifoToGet(outAudioFifo); 627 interface Get sampleOutput = fifoToGet(outAudioFifo);
628 interface Put sampleInput = fifoToPut(inAudioFifo);
657 629
658 endmodule 630 endmodule
659 631