OpenCores
URL https://opencores.org/ocsvn/bluespec-h264/bluespec-h264/trunk

Subversion Repositories bluespec-h264

[/] [bluespec-h264/] [trunk/] [src/] [mkMemEDDecoupled.bsv] - Blame information for rev 100

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 83 jamey.hick
 
2
// The MIT License
3
 
4
// Copyright (c) 2006-2007 Massachusetts Institute of Technology
5
 
6
// Permission is hereby granted, free of charge, to any person obtaining a copy
7
// of this software and associated documentation files (the "Software"), to deal
8
// in the Software without restriction, including without limitation the rights
9
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
// copies of the Software, and to permit persons to whom the Software is
11
// furnished to do so, subject to the following conditions:
12
 
13
// The above copyright notice and this permission notice shall be included in
14
// all copies or substantial portions of the Software.
15
 
16
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
// THE SOFTWARE.
23
 
24 66 jamey.hick
//**********************************************************************
25
// Memory for Entropy Decoder
26
//----------------------------------------------------------------------
27
//
28
//
29
//
30
 
31
import H264Types::*;
32
import IMemEDDecoupled::*;
33
import RegFile::*;
34
import GetPut::*;
35
import ClientServer::*;
36
import FIFO::*;
37
 
38
 
39
//----------------------------------------------------------------------
40
// Main module
41
//----------------------------------------------------------------------
42
 
43
module mkMemEDDecoupled(IMemEDDecoupled#(index_size,data_size))
44
   provisos (Bits#(MemReq#(index_size,data_size),mReqLen),
45
             Bits#(MemResp#(data_size),mRespLen));
46
 
47
  //-----------------------------------------------------------
48
  // State
49
 
50
   RegFile#(Bit#(index_size),Bit#(data_size)) rfile <- mkRegFileWCF(0,fromInteger(valueof(TSub#(TExp#(index_size),1))));
51
 
52
   FIFO#(MemReq#(index_size,data_size)) reqQStore  <- mkFIFO();
53
   FIFO#(MemReq#(index_size,data_size)) reqQLoad   <- mkFIFO();
54
   FIFO#(MemResp#(data_size))  respQ <- mkFIFO();
55
 
56
   rule storing ( reqQStore.first() matches tagged StoreReq { addr:.addrt,data:.datat} );
57
      rfile.upd(addrt,datat);
58
      reqQStore.deq();
59
   endrule
60
 
61
   rule reading ( reqQLoad.first() matches tagged LoadReq .addrt );
62
      respQ.enq( tagged LoadResp (rfile.sub(addrt)) );
63
      reqQLoad.deq();
64
   endrule
65
 
66
 
67
   interface Put request_store  = fifoToPut(reqQStore);
68
   interface Put request_load  = fifoToPut(reqQLoad);
69
   interface Get response = fifoToGet(respQ);
70
 
71
endmodule
72
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.