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

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [branches/] [init/] [common/] [src/] [cell_lib.v] - Diff between revs 6 and 8

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 6 Rev 8
Line 1... Line 1...
// A synthesizable cell library for asynchronous logic
/*
// author Wei Song, songw@cs.man.ac.uk
 Asynchronous SDM NoC
// the Advanced Processor Technology Group
 (C)2011 Wei Song
// the School of Computer Science
 Advanced Processor Technologies Group
// the Uniersity of Manchester
 Computer Science, the Univ. of Manchester, UK
// 5th May, 2009
 
// a latch is added, 11/08/2010 songw@cs.man.ac.uk
 
 
 
 
 
module c2 (
 
     a0
 
    ,a1
 
    ,q
 
    );
 
 
 
input a0;
 Authors:
input a1;
 Wei Song     wsong83@gmail.com
output q;
 
 
 
AO222EHD U1 ( .A1(q), .A2(a0), .B1(q), .B2(a1), .C1(a0), .C2(a1), .O(q) );
 
 
 
endmodule
 License: LGPL 3.0 or later
 
 
// the dc2 cell for Faraday 130nm Tech
 A synthesizable cell library for asynchronous circuis.
module dc2 (
 Some cell are directly initialized to one of the Nangate 45nm cell lib.
     d
 
    ,a
 
    ,q
 
    );
 
 
 
input d;
 History:
input a;
 05/05/2009  Initial version. <wsong83@gmail.com>
output q;
 20/05/2011  Change to general verilog description for opensource.
 
             The Nangate cell library is used. <wsong83@gmail.com>
 
 
AO222HHD U1 ( .A1(q), .A2(d), .B1(q), .B2(a), .C1(d), .C2(a), .O(q) );
*/
 
 
endmodule // dc2
// General 2-input C-element
 
module c2 (a0, a1, q);
 
 
module c2n (
   input a0, a1;                // two inputs
     a0
   output q;                    // output
    ,a1
 
    ,q
 
    );
 
 
 
input a0;
   wire [2:0] m;         // internal wires
input a1;
 
output q;
 
 
 
   AO12EHD U1 (.B1(a1), .B2(q), .A1(a0), .O(q));
   nand U1 (m[0], a0, a1);
 
   nand U2 (m[1], a0, q);
 
   nand U3 (m[2], a1, q);
 
   assign q = &m;
 
 
endmodule
endmodule
 
 
 
// the 2-input C-element on data paths, different name for easy synthesis scription
 
module dc2 (d, a, q);
 
 
module c2p (
   input d;                     // data input
     a0
   input a;                     // ack input
    ,a1
   output q;                    // data output
    ,q
 
    );
 
 
 
input a0;
   wire [2:0] m;         // internal wires
input a1;
 
output q;
 
 
 
 
   nand U1 (m[0], a, d);
 
   nand U2 (m[1], d, q);
 
   nand U3 (m[2], a, q);
 
   assign q = &m;
 
 
OA12EHD U1 ( .B1(a1), .B2(q), .A1(a0), .O(q) );
endmodule
 
 
 
// 2-input C-element with a minus input
 
module c2n (a, b, q);
 
 
 
   input a;                     // the normal input
 
   input b;                     // the minus input
 
   output q;                    // output
 
 
 
   wire m;                      // internal wire
 
 
 
   and U1 (m, b, q);
 
   or  U2 (q, m, a);
 
 
endmodule
endmodule
 
 
// for Faraday
// 2-input C-element with a plus input
module mutex ( a, b, qa, qb );
module c2p (a, b, q);
input a, b;
 
output qa, qb;
   input a;                     // the normal input
wire   qan, qbn;
   input b;                     // the plus input
 
   output q;                    // output
 
 
 
   wire m;                      // internal wire
 
 
 
   or  U1 (m, b, q);
 
   and U2 (q, m, a);
 
 
ND2HHD U1 ( .I1(a), .I2(qbn), .O(qan) );
 
NR3HHD U2 ( .I1(qbn), .I2(qbn), .I3(qbn), .O(qb) );
 
NR3HHD U3 ( .I1(qan), .I2(qan), .I3(qan), .O(qa) );
 
ND2KHD U4 ( .I1(b), .I2(qan), .O(qbn) );
 
endmodule
endmodule
 
 
 
// 2-input MUTEX cell, Nangate
 
module mutex ( a, b, qa, qb );  // !!! dont touch !!!
 
 
module c2p1 (
   input a, b;                  // request inputs
             a0,
   output qa, qb;               // grant outputs
             a1,
 
             b,
   wire   qan, qbn;             // internal wires
             q
 
             );
 
   input a0, a1, b;
 
   output q;
 
 
 
  wire   n1;
   NAND2_X2 U1 ( .A1(a), .A2(qbn), .ZN(qan) ); // different driving strength for fast convergence
 
   NOR3_X2  U2 ( .A1(qbn), .A2(qbn), .A3(qbn), .ZN(qb) ); // pulse filter
 
   NOR3_X2  U3 ( .A1(qan), .A2(qan), .A3(qan), .ZN(qa) ); // pulse filter
 
   NAND2_X1 U4 ( .A1(b), .A2(qan), .ZN(qbn) );
 
 
 
endmodule
 
 
  OA12EHD U2 ( .B1(a1), .B2(a0), .A1(q), .O(n1) );
// 3-input C-element with a plus input
  AO13EHD U1 ( .B1(a1), .B2(a0), .B3(b), .A1(n1), .O(q) );
module c2p1 (a0, a1, b, q);
 
 
//assign q = (a0&a1&b)|(a0&q)|(b0&q);
   input a0, a1;                // normal inputs
endmodule // c2p1                    
   input b;                     // plus input
 
   output q;                    // output
 
 
 
   wire [2:0] m;         // internal wires
 
 
 
   nand U1 (m[0], a0, a1, b);
 
   nand U2 (m[1], a0, q);
 
   nand U3 (m[2], a1, q);
 
   assign q = &m;
 
 
 
endmodule
 
 
 
// the basic element of a tree arbiter
module tarb ( ngnt, ntgnt, req, treq );
module tarb ( ngnt, ntgnt, req, treq );
  output [1:0] ngnt;
 
  input [1:0] req;
   input [1:0] req;              // request input
  input ntgnt;
   output [1:0] ngnt;            // the negative grant output
  output treq;
   output treq;                 // combined request output
  wire   n1, n2;
   input ntgnt;                 // the negative combined grant input
  wire   [1:0] mgnt;
 
 
   wire  n1, n2;                // internal wires
 
   wire [1:0] mgnt;              // outputs of the MUTEX
 
 
  mutex ME ( .a(req[0]), .b(req[1]), .qa(mgnt[0]), .qb(mgnt[1]) );
  mutex ME ( .a(req[0]), .b(req[1]), .qa(mgnt[0]), .qb(mgnt[1]) );
  c2n C0 ( .a0(ntgnt), .a1(n2), .q(ngnt[0]) );
   c2n C0 ( .a(ntgnt), .b(n2), .q(ngnt[0]) );
  c2n C1 ( .a0(ntgnt), .a1(n1), .q(ngnt[1]) );
   c2n C1 ( .a(ntgnt), .b(n1), .q(ngnt[1]) );
  ND2HHD U1 ( .I1(n1), .I2(n2), .O(treq) );
   nand U1 (treq, n1, n2);
  ND2DHD U2 ( .I1(ngnt[0]), .I2(mgnt[1]), .O(n1) );
   nand U2 (n1, ngnt[0], mgnt[1]);
  ND2DHD U3 ( .I1(ngnt[1]), .I2(mgnt[0]), .O(n2) );
   nand U3 (n2, ngnt[1], mgnt[0]);
endmodule
endmodule
 
 
 
// the tile in a multi-resource arbiter
module cr_blk ( bo, hs, cbi, rbi, rg, cg );
module cr_blk ( bo, hs, cbi, rbi, rg, cg );
  input cbi, rbi, rg, cg;
 
  output bo, hs;
   input rg, cg;                // input requests
  wire   blk;
   input cbi, rbi;              // input blockage
 
   output bo;                   // output blockage
 
   output hs;                   // match result
 
 
 
   wire   blk;                  // internal wire
 
 
  c2p1 XG ( .a0(rg), .a1(cg), .b(blk), .q(bo) );
  c2p1 XG ( .a0(rg), .a1(cg), .b(blk), .q(bo) );
  c2p1 HG ( .a0(cbi), .a1(rbi), .b(bo), .q(hs) );
  c2p1 HG ( .a0(cbi), .a1(rbi), .b(bo), .q(hs) );
  NR2EHD U1 ( .I1(rbi), .I2(cbi), .O(blk) );
   nor U1 (blk, rbi, cbi);
 
 
endmodule
endmodule
 
 
 
// a data latch template, Nangate
module dlatch ( q, qb, d, g);
module dlatch ( q, qb, d, g);
   output q, qb;
   output q, qb;
   input  d, g;
   input  d, g;
 
 
   DLAHEHD U1 (.Q(q), .QB(qb), .D(d), .G(g));
   DLH_X1 U1 (.Q(q), .D(d), .G(g));
endmodule // dlatch
endmodule
 
 
 
// a delay line, Nangate
module delay (q, a);
module delay (q, a);
   input a;
   input a;
   output q;
   output q;
   BUFKHD U (.O(q), .I(a));
 
endmodule // delay
   BUF_X2 U (.Z(q), .A(a));
 
endmodule
 
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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