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

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [trunk/] [sdm/] [src/] [im_alloc.v] - Diff between revs 22 and 28

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 22 Rev 28
/*
/*
 Asynchronous SDM NoC
 Asynchronous SDM NoC
 (C)2011 Wei Song
 (C)2011 Wei Song
 Advanced Processor Technologies Group
 Advanced Processor Technologies Group
 Computer Science, the Univ. of Manchester, UK
 Computer Science, the Univ. of Manchester, UK
 
 
 Authors:
 Authors:
 Wei Song     wsong83@gmail.com
 Wei Song     wsong83@gmail.com
 
 
 License: LGPL 3.0 or later
 License: LGPL 3.0 or later
 
 
 IM allocator (the IM dispatcher in the thesis)
 IM allocator (the IM dispatcher in the thesis)
 *** SystemVerilog is used ***
 *** SystemVerilog is used ***
 
 
 References
 References
 For the detail structure, please refer to Section 6.3.1 of the thesis:
 For the detail structure, please refer to Section 6.3.1 of the thesis:
   Wei Song, Spatial parallelism in the routers of asynchronous on-chip networks, PhD thesis, the University of Manchester, 2011.
   Wei Song, Spatial parallelism in the routers of asynchronous on-chip networks, PhD thesis, the University of Manchester, 2011.
 
 
 History:
 History:
 05/09/2009  Initial version. <wsong83@gmail.com>
 05/09/2009  Initial version. <wsong83@gmail.com>
 10/10/2009  Add the reset port. <wsong83@gmail.com>
 10/10/2009  Add the reset port. <wsong83@gmail.com>
 05/11/2009  Speed up the arbiter. <wsong83@gmail.com>
 05/11/2009  Speed up the arbiter. <wsong83@gmail.com>
 10/06/2010  [Major] change to use PIM structure. <wsong83@gmail.com>
 10/06/2010  [Major] change to use PIM structure. <wsong83@gmail.com>
 23/08/2010  Fix the non-QDI request withdraw process. <wsong83@gmail.com>
 23/08/2010  Fix the non-QDI request withdraw process. <wsong83@gmail.com>
 25/05/2011  Clean up for opensource. <wsong83@gmail.com>
 27/05/2011  Clean up for opensource. <wsong83@gmail.com>
 
 
*/
*/
 
 
// the router structure definitions
// the router structure definitions
`include "define.v"
`include "define.v"
 
 
module im_alloc (/*AUTOARG*/
module im_alloc (/*AUTOARG*/
`ifndef ENABLE_CRRD
`ifndef ENABLE_CRRD
   CMs,
   CMs,
`endif
`endif
   // Outputs
   // Outputs
   IMa, cfg,
   IMa, cfg,
   // Inputs
   // Inputs
   IMr, rst_n
   IMr, rst_n
   ) ;
   ) ;
   // parameters
   // parameters
   parameter VCN = 2;    // the number of virtual circuits on one port
   parameter VCN = 2;    // the number of virtual circuits on one port
   parameter CMN = 2;    // the number of central modules
   parameter CMN = 2;    // the number of central modules
   parameter SN = 2;     // the possible output port choice of a port
   parameter SN = 2;     // the possible output port choice of a port
 
 
   input  [VCN-1:0][SN-1:0]     IMr; // the requests from virtual circuits
   input  [VCN-1:0][SN-1:0]     IMr; // the requests from virtual circuits
   output [VCN-1:0]              IMa; // switch ready, ack for the request
   output [VCN-1:0]              IMa; // switch ready, ack for the request
 
 
`ifndef ENABLE_CRRD
`ifndef ENABLE_CRRD
   input [CMN-1:0][SN-1:0]        CMs; // the states from CMs
   input [CMN-1:0][SN-1:0]        CMs; // the states from CMs
`endif
`endif
 
 
   input                        rst_n; // the negtive active reset
   input                        rst_n; // the negtive active reset
 
 
   output [CMN-1:0][VCN-1:0]      cfg; // the matrix configuration signals
   output [CMN-1:0][VCN-1:0]      cfg; // the matrix configuration signals
 
 
   // internal wires
   // internal wires
`ifdef ENABLE_CRRD
`ifdef ENABLE_CRRD
 `ifdef ENABLE_MRMA
 `ifdef ENABLE_MRMA
   wire [VCN-1:0]                IPr; // request to the MRMA
   wire [VCN-1:0]                IPr; // request to the MRMA
   wire [CMN-1:0]               OPrdy, OPblk; // OP ready and blocked status
   wire [CMN-1:0]               OPrdy, OPblk; // OP ready and blocked status
   wire [CMN:0]          OPrst_n; // the buffered resets to avoid metastability
   wire [CMN:0]          OPrst_n; // the buffered resets to avoid metastability
 `else
 `else
   wire [VCN-1:0][CMN-1:0]        IPr; // request to the MNMA
   wire [VCN-1:0][CMN-1:0]        IPr; // request to the MNMA
 `endif
 `endif
`else
`else
   // using the feedback from CMs
   // using the feedback from CMs
   wire [VCN-1:0][CMN-1:0][SN-1:0] IPrm; // to generate the practical IPr
   wire [VCN-1:0][CMN-1:0][SN-1:0] IPrm; // to generate the practical IPr
   wire [VCN-1:0][CMN-1:0]           IPr;
   wire [VCN-1:0][CMN-1:0]           IPr;
`endif
`endif
 
 
   // generate variables
   // generate variables
   genvar                  i, j, k;
   genvar                  i, j, k;
 
 
   //----------------------------------------
   //----------------------------------------
   // the PIM crossbar allocator
   // the PIM crossbar allocator
`ifndef ENABLE_MRMA
`ifndef ENABLE_MRMA
   mnma #(.N(VCN), .M(CMN))
   mnma #(.N(VCN), .M(CMN))
   PIMA (
   PIMA (
         .cfg ( cfg   ),
         .cfg ( cfg   ),
         .r   ( IPr   ),
         .r   ( IPr   ),
         .ra  ( IMa   )
         .ra  ( IMa   )
         );
         );
 
 
   generate
   generate
      for(i=0; i<VCN; i++) begin: IPC
      for(i=0; i<VCN; i++) begin: IPC
         for(j=0; j<CMN; j++) begin: OPC
         for(j=0; j<CMN; j++) begin: OPC
 `ifdef ENABLE_CRRD
 `ifdef ENABLE_CRRD
            IPr[i][j] = |IMr[i];
            assign IPr[i][j] = |IMr[i];
 `else
 `else
            IPr[i][j] = |IPrm[i][j];
            assign IPr[i][j] = |IPrm[i][j];
            for(k=0; k<SN; k++) begin: DIRC
            for(k=0; k<SN; k++) begin: DIRC
               c2p IPRen (.q(IPrm[i][j][k]), .a0(IMr[i][k]), .a1(~CMs[j][k]));
               c2p IPRen (.q(IPrm[i][j][k]), .a0(IMr[i][k]), .a1(~CMs[j][k]));
            end
            end
 `endif
 `endif
         end
         end
      end // block: IPC
      end // block: IPC
   endgenerate
   endgenerate
 
 
`else
`else
   mrma #(.N(VCN), .M(CMN))
   mrma #(.N(VCN), .M(CMN))
   PIMA (
   PIMA (
         .ca    ( IMa   ),
         .ca    ( IMa   ),
         .ra    ( OPblk ),
         .ra    ( OPblk ),
         .cfg   ( cfg   ),
         .cfg   ( cfg   ),
         .c     ( IPr   ),
         .c     ( IPr   ),
         .r     ( OPrdy ),
         .r     ( OPrdy ),
         .rst_n ( rst_n )
         .rst_n ( rst_n )
         );
         );
 
 
   generate
   generate
      for(i=0; i<CMN; i++) begin: OPC
      for(i=0; i<CMN; i++) begin: OPC
         delay DLY ( .q(OPrst_n[i+1]), .a(OPrst_n[i])); // dont touch
         delay DLY ( .q(OPrst_n[i+1]), .a(OPrst_n[i])); // dont touch
         assign OPrdy[i] = (~OPblk[i])&OPrst_n[i+1];
         assign OPrdy[i] = (~OPblk[i])&OPrst_n[i+1];
      end
      end
 
 
      for(i=0; i<VCN; i++) begin: IPC
      for(i=0; i<VCN; i++) begin: IPC
         assign IPr[i] = |IMr[i];
         assign IPr[i] = |IMr[i];
      end
      end
   endgenerate
   endgenerate
 
 
 
   assign OPrst_n[0] = rst_n;
 
 
`endif // !`ifndef ENABLE_MRMA
`endif // !`ifndef ENABLE_MRMA
 
 
endmodule // im_alloc
endmodule // im_alloc
 
 

powered by: WebSVN 2.1.0

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