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

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [trunk/] [common/] [src/] [mrma.v] - Blame information for rev 56

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 17 wsong0210
/*
2
 Asynchronous SDM NoC
3
 (C)2011 Wei Song
4
 Advanced Processor Technologies Group
5
 Computer Science, the Univ. of Manchester, UK
6
 
7
 Authors:
8
 Wei Song     wsong83@gmail.com
9
 
10
 License: LGPL 3.0 or later
11
 
12
 Multi-resource match arbiter
13
 *** SystemVerilog is used ***
14
 
15
 References
16
   Stanislavs Golubcovs, Delong Shang, Fei Xia, Andrey Mokhov and Alex Yakovlev, Multi-resource arbiter decomposition, Tech report NCL-EECE-MSD-TR-2009-143, Microelectronic System Design Group, School of EECE, Newcastle University, 2009.
17
   Stanislavs Golubcovs, Delong Shang, Fei Xia, Andrey Mokhov and Alex Yakovlev, Modular approach to multi-resource arbiter design, IEEE Symposium on Asynchronous Circuits and Systems, 2009.
18
 
19
 History:
20
 05/09/2009  Initial version. <wsong83@gmail.com>
21
 05/11/2009  Speed up the arbiter. <wsong83@gmail.com>
22 28 wsong0210
 27/05/2011  Clean up for opensource. <wsong83@gmail.com>
23 17 wsong0210
 
24
*/
25
 
26
module mrma (/*AUTOARG*/
27
   // Outputs
28 18 wsong0210
   ca, ra, cfg,
29 17 wsong0210
   // Inputs
30 18 wsong0210
   c, r, rst_n
31 17 wsong0210
   );
32
 
33
   // parameters
34
   parameter N = 2;      // the number of requests/clients
35
   parameter M = 2;      // the number of resources
36
 
37
   input [N-1:0]   c;            // requests/clients
38
   output [N-1:0]  ca;           // requests ack
39
 
40
   input [M-1:0]   r;            // resources
41
   output [M-1:0]  ra;           // resource ack
42
 
43
   output [M-1:0][N-1:0] cfg;     // the generated configuration
44
   wire [N-1:0][M-1:0]     scfg;
45
 
46
   wire [M-1:0][N-1:0]     hs;    // match results
47
   wire [M-1:0][N-1:0]   blk;     // blockage
48 28 wsong0210
   wire [N-1:0][M-1:0]   sblk;    // shuffled blockage
49
   wire [M-1:0]   rbi;   // resource blockage
50
   wire [N-1:0]   cbi;   // client blockage
51 17 wsong0210
   wire [N-1:0]   cg, cm; // client requests
52
   wire [M-1:0]   rg, rm; // resource requests
53
 
54
   input                 rst_n; // active low reset
55
 
56
   // generate variables
57
   genvar                  i, j;
58
 
59
 
60
   // input arbiters
61
   tree_arb #(N) CIArb (
62
                          .req    ( cm  ),
63
                          .gnt    ( cg  )
64
                          );
65
 
66
   tree_arb #(M) RIArb (
67
                          .req    ( rm ),
68
                          .gnt    ( rg )
69
                          );
70
 
71
   generate
72
      // tile matrix
73
      for (i=0; i<M; i++) begin: Row
74
         for(j=0; j<N; j++) begin: Clm
75
            cr_blk E (
76
                      .bo   ( blk[i][j]   ),
77
                      .hs   ( hs[i][j]    ),
78
                      .cbi  ( cbi[j]      ),
79
                      .rbi  ( rbi[i]      ),
80
                      .rg   ( rg[i]       ),
81
                      .cg   ( cg[j]       )
82
                      );
83
 
84
            // shuffle the blockage
85 28 wsong0210
            assign sblk[j][i] = blk[i][j];
86 17 wsong0210
 
87
            // shuffle the configuration
88
            assign scfg[j][i] = cfg[i][j];
89
 
90
            // store the match results
91 28 wsong0210
            c2p  C (.q(cfg[i][j]), .a(c[j]), .b(hs[i][j]));
92 17 wsong0210
 
93
         end // block: Clm
94
      end // block: Row
95
 
96
      // combine the row blockage and generate input requests
97
      for(i=0; i<M; i++) begin: RB
98
         assign rbi[i] = (|blk[i]) & rst_n;
99
         and AND_RG (rm[i], r[i], ~ra[i], rst_n);
100 28 wsong0210
         assign ra[i] = |cfg[i];
101 17 wsong0210
      end
102
 
103
      // combine the column blockage and generate input requests
104
      for(j=0; j<N; j++) begin: CB
105 28 wsong0210
         assign cbi[j] = (|sblk[j]) & rst_n;
106 17 wsong0210
         and AND_CG (cm[j], c[j], ~ca[j], rst_n);
107
         assign ca[j] = |scfg[j];
108
      end
109
   endgenerate
110
 
111 28 wsong0210
endmodule // mrma
112
 

powered by: WebSVN 2.1.0

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