Mercurial > pygar
comparison modules/bluespec/Pygar/core/audioCorePipeline.bsv @ 48:a139cc07b773 pygar svn.49
[svn r49] moved memory into core
author | punk |
---|---|
date | Wed, 05 May 2010 13:42:07 -0400 |
parents | 97d1959f7c5c |
children | 9fe5ed4af92d |
comparison
equal
deleted
inserted
replaced
47:97d1959f7c5c | 48:a139cc07b773 |
---|---|
38 `include "asim/provides/path_types.bsh" | 38 `include "asim/provides/path_types.bsh" |
39 `include "asim/provides/core.bsh" | 39 `include "asim/provides/core.bsh" |
40 `include "asim/provides/mixer.bsh" | 40 `include "asim/provides/mixer.bsh" |
41 `include "asim/provides/processor_library.bsh" | 41 `include "asim/provides/processor_library.bsh" |
42 `include "asim/provides/fpga_components.bsh" | 42 `include "asim/provides/fpga_components.bsh" |
43 `include "asim/provides/scratchpad_memory.bsh" | |
44 `include "asim/provides/mem_services.bsh" | |
45 `include "asim/dict/VDEV_SCRATCH.bsh" | |
46 | 43 |
47 `include "asim/rrr/remote_client_stub_AUDIOCORERRR.bsh" | 44 `include "asim/rrr/remote_client_stub_AUDIOCORERRR.bsh" |
48 `include "asim/rrr/remote_server_stub_AUDIOCORERRR.bsh" | 45 `include "asim/rrr/remote_server_stub_AUDIOCORERRR.bsh" |
49 | 46 |
50 module [CONNECTED_MODULE] mkConnectedApplication (); | 47 module [CONNECTED_MODULE] mkConnectedApplication (); |
59 // Reg#(Bit#(32)) ac_fini <- mkReg(0); | 56 // Reg#(Bit#(32)) ac_fini <- mkReg(0); |
60 | 57 |
61 //External memory | 58 //External memory |
62 // I'm not comfortable assuming that the memory subsystem is in order | 59 // I'm not comfortable assuming that the memory subsystem is in order |
63 // So I'll insert a completion buffer here. | 60 // So I'll insert a completion buffer here. |
64 MEMORY_IFC#(Bit#(18), Bit#(32)) memory <- mkScratchpad(`VDEV_SCRATCH_MEMORY, SCRATCHPAD_CACHED); //Services Memory items | |
65 | 61 |
66 // Services Samples | 62 // Services Samples |
67 ClientStub_AUDIOCORERRR client_stub <- mkClientStub_AUDIOCORERRR(); | 63 ClientStub_AUDIOCORERRR client_stub <- mkClientStub_AUDIOCORERRR(); |
68 // Make this big enough so that several outstanding requests may be supported | 64 |
69 FIFO#(Bit#(MainMemTagSz)) tags <- mkSizedFIFO(8); | |
70 | 65 |
71 //----------------------------------------------------------- | 66 //----------------------------------------------------------- |
72 // Debug port | 67 // Debug port |
73 | 68 |
74 ServerStub_AUDIOCORERRR server_stub <- mkServerStub_AUDIOCORERRR(); | 69 ServerStub_AUDIOCORERRR server_stub <- mkServerStub_AUDIOCORERRR(); |
78 rule printCycles; | 73 rule printCycles; |
79 cycle <= cycle+1; | 74 cycle <= cycle+1; |
80 $fdisplay(stderr, " => Cycle = %d", cycle); | 75 $fdisplay(stderr, " => Cycle = %d", cycle); |
81 endrule | 76 endrule |
82 | 77 |
83 rule sendMemReq; | 78 rule feedOutput; |
84 let coreReq <- core.mmem_client.request.get; | |
85 case (coreReq) matches | |
86 tagged LoadReq .load: begin | |
87 // $display("PIPE Load Addr Req %h", load.addr); | |
88 //Allocate ROB space | |
89 memory.readReq(truncate(load.addr>>2)); | |
90 tags.enq(load.tag); | |
91 end | |
92 tagged StoreReq .store: begin | |
93 // $display("PIPE Write Addr Req %h", store.addr); | |
94 memory.write(truncate(store.addr>>2),store.data); | |
95 end | |
96 endcase | |
97 endrule | |
98 | |
99 rule receiveMemResp; | |
100 let memResp <- memory.readRsp(); | |
101 tags.deq; | |
102 core.mmem_client.response.put(tagged LoadResp {data:memResp, | |
103 tag: tags.first}); | |
104 // $display("PIPE Receive MemReq %x", memResp); | |
105 endrule | |
106 | |
107 rule feedOutput; | |
108 let pipelineData <- core.sampleOutput.get(); | 79 let pipelineData <- core.sampleOutput.get(); |
109 AudioProcessorControl endOfFileTag = EndOfFile; | 80 AudioProcessorControl endOfFileTag = EndOfFile; |
110 AudioProcessorControl sampleTag = Data; | 81 AudioProcessorControl sampleTag = Data; |
111 | 82 |
112 case (pipelineData) matches | 83 case (pipelineData) matches |
129 rule feedInput; | 100 rule feedInput; |
130 let command <- server_stub.acceptRequest_SendUnprocessedStream(); | 101 let command <- server_stub.acceptRequest_SendUnprocessedStream(); |
131 AudioProcessorControl ctrl = unpack(truncate(command.ctrl)); | 102 AudioProcessorControl ctrl = unpack(truncate(command.ctrl)); |
132 | 103 |
133 Bit#(32) test = unpack(truncate(command.channel)); | 104 Bit#(32) test = unpack(truncate(command.channel)); |
134 $display("rlm: %x", test); | 105 // $display("rlm: %x", test); |
135 | 106 |
136 | 107 |
137 if(ctrl == EndOfFile) | 108 if(ctrl == EndOfFile) |
138 begin | 109 begin |
139 $display("lsp: PIPE received EOF "); | 110 $display("lsp: PIPE received EOF "); |