comparison modules/bluespec/Pygar/core/audioCorePipeline.bsv @ 33:2c8166d205d5 pygar svn.34

[svn r34] uses scratchpad, set up for audio through c
author punk
date Tue, 04 May 2010 10:13:53 -0400
parents 220c14f5963c
children 99519a031813
comparison
equal deleted inserted replaced
32:0c775e733b81 33:2c8166d205d5
33 `include "asim/provides/soft_connections.bsh" 33 `include "asim/provides/soft_connections.bsh"
34 `include "asim/provides/common_services.bsh" 34 `include "asim/provides/common_services.bsh"
35 35
36 //Local includes 36 //Local includes
37 `include "asim/provides/audio_pipe_types.bsh" //provides Audio Pipeline interface 37 `include "asim/provides/audio_pipe_types.bsh" //provides Audio Pipeline interface
38 `include "asim/provides/path_types.bsh"
38 `include "asim/provides/core.bsh" 39 `include "asim/provides/core.bsh"
39 `include "asim/provides/processor_library.bsh" 40 `include "asim/provides/processor_library.bsh"
40 `include "asim/provides/fpga_components.bsh" 41 `include "asim/provides/fpga_components.bsh"
42 `include "asim/provides/scratchpad_memory.bsh"
43 `include "asim/provides/mem_services.bsh"
44 `include "asim/dict/VDEV_SCRATCH.bsh"
45
41 `include "asim/rrr/remote_client_stub_AUDIOCORERRR.bsh" 46 `include "asim/rrr/remote_client_stub_AUDIOCORERRR.bsh"
42 //`include "asim/rrr/remote_server_stub_AUDIOCORERRR.bsh" 47 //`include "asim/rrr/remote_server_stub_AUDIOCORERRR.bsh"
43 48
44 module [CONNECTED_MODULE] mkConnectedApplication (); 49 module [CONNECTED_MODULE] mkConnectedApplication ();
45 Core core <- mkCore; 50 Core core <- mkCore;
46 Reg#(int) cycle <- mkReg(0); 51 Reg#(int) cycle <- mkReg(0);
47 52
48 //External memory 53 //External memory
49 // I'm not comfortable assuming that the memory subsystem is in order 54 // I'm not comfortable assuming that the memory subsystem is in order
50 // So I'll insert a completion buffer here. 55 // So I'll insert a completion buffer here.
56 MEMORY_IFC#(Bit#(18), Bit#(32)) memory <- mkScratchpad(`VDEV_SCRATCH_MEMORY, SCRATCHPAD_CACHED); //Services Memory items
57
58 // Services Samples
51 ClientStub_AUDIOCORERRR client_stub <- mkClientStub_AUDIOCORERRR(); 59 ClientStub_AUDIOCORERRR client_stub <- mkClientStub_AUDIOCORERRR();
52 // Make this big enough so that several outstanding requests may be supported 60 // Make this big enough so that several outstanding requests may be supported
53 FIFO#(Bit#(MainMemTagSz)) tags <- mkSizedFIFO(8); 61 FIFO#(Bit#(MainMemTagSz)) tags <- mkSizedFIFO(8);
54 62
55 // this is for the tracing 63 // this is for the tracing
61 rule sendMemReq; 69 rule sendMemReq;
62 let coreReq <- core.mmem_client.request.get; 70 let coreReq <- core.mmem_client.request.get;
63 case (coreReq) matches 71 case (coreReq) matches
64 tagged LoadReq .load: begin 72 tagged LoadReq .load: begin
65 //Allocate ROB space 73 //Allocate ROB space
66 client_stub.makeRequest_MemoryRequestLoad(load.addr); 74 memory.readReq(truncate(load.addr>>2));
67 tags.enq(load.tag); 75 tags.enq(load.tag);
68 end 76 end
69 tagged StoreReq .store: begin 77 tagged StoreReq .store: begin
70 client_stub.makeRequest_MemoryRequestStore(store.addr,store.data); 78 memory.write(truncate(store.addr>>2),store.data);
71 end 79 end
72 endcase 80 endcase
73 endrule 81 endrule
74 82
75 rule receiveMemResp; 83 rule receiveMemResp;
76 let memResp <- client_stub.getResponse_MemoryRequestLoad(); 84 let memResp <- memory.readRsp();
77 tags.deq; 85 tags.deq;
78 core.mmem_client.response.put(tagged LoadResp {data:memResp, 86 core.mmem_client.response.put(tagged LoadResp {data:memResp,
79 tag: tags.first}); 87 tag: tags.first});
80 endrule 88 endrule
81
82 // this isn't particularly correct as it doesn't actually connect the processor interfaces, but this should allow me to verify the data path before fully blending the two items together.
83 89
84 rule feedOutput; 90 rule feedOutput;
85 let pipelineData <- core.sampleOutput.get(); 91 let pipelineData <- core.sampleOutput.get();
86 AudioProcessorControl endOfFileTag = EndOfFile; 92 AudioProcessorControl endOfFileTag = EndOfFile;
87 AudioProcessorControl sampleTag = Data; 93 AudioProcessorControl sampleTag = Data;