OpenCores
URL https://opencores.org/ocsvn/cryptosorter/cryptosorter/trunk

Subversion Repositories cryptosorter

[/] [cryptosorter/] [trunk/] [memocodeDesignContest2008/] [sort/] [VLevelFIFO.bsv] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 kfleming
//----------------------------------------------------------------------//
2
// The MIT License
3
//
4
// Copyright (c) 2008 Alfred Man Cheuk Ng, mcn02@mit.edu
5
//
6
// Permission is hereby granted, free of charge, to any person
7
// obtaining a copy of this software and associated documentation
8
// files (the "Software"), to deal in the Software without
9
// restriction, including without limitation the rights to use,
10
// copy, modify, merge, publish, distribute, sublicense, and/or sell
11
// copies of the Software, and to permit persons to whom the
12
// Software is furnished to do so, subject to the following conditions:
13
//
14
// The above copyright notice and this permission notice shall be
15
// included in all copies or substantial portions of the Software.
16
//
17
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
// OTHER DEALINGS IN THE SOFTWARE.
25
//----------------------------------------------------------------------//
26
 
27
// import standard library
28
import DReg::*;
29
import FIFO::*;
30
import Vector::*;
31
 
32
// interface definition of a vector of logical fifos indexed by fifo_idx_t
33
// with data type data_t. Each fifos gives a usage report too
34
interface VLevelFIFO#(numeric type no_fifo,
35
                      numeric type fifo_sz,
36
                      type data_t);
37
 
38
   // enq fifo idx
39
   method Action enq(Bit#(TLog#(no_fifo)) idx, data_t data);
40
 
41
   // deq fifo idx
42
   method Action deq(Bit#(TLog#(no_fifo)) idx);
43
 
44
   // read_req for first of fifo idx
45
   method Action firstReq(Bit#(TLog#(no_fifo)) idx);
46
 
47
   // first_resp
48
   method data_t firstResp();
49
 
50
   // clear all fifos
51
   method Action clear();
52
 
53
   // return no. elements in each fifo at the beginning of cycle
54
   method Vector#(no_fifo,Bit#(TLog#(TAdd#(fifo_sz,1)))) used();
55
 
56
   // return no. elements in each fifo at the end of cycle
57
//   method Vector#(no_fifo,Bit#(TLog#(TAdd#(fifo_sz,1)))) used2();
58
 
59
   // return no. enq credit tokens in each fifo
60
   method Vector#(no_fifo,Bit#(TLog#(TAdd#(fifo_sz,1)))) free();
61
 
62
   // decrement amnt of "enq credit tokens" of fifo idx
63
   method Action decrFree(Bit#(TLog#(no_fifo)) idx, Bit#(TLog#(TAdd#(fifo_sz,1))) amnt);
64
 
65
endinterface

powered by: WebSVN 2.1.0

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