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

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [branches/] [clos_opt/] [common/] [src/] [addr_dec.v] - Blame information for rev 61

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 61 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
 XY address decoder, 1-of-4 code
13
 * Assuming the output will be capture for long time
14
 * The withdrawal of inputs are not guarded
15
 
16
 History:
17
 14/07/2010  Initial version. <wsong83@gmail.com>
18
 
19
*/
20
 
21
module addr_dec(/*AUTOARG*/
22
   // Outputs
23
   dec,
24
   // Inputs
25
   locx, locy, tarx, tary
26
   );
27
   input [7:0] locx, locy;       // the local addresses
28
   input [7:0] tarx, tary;       // the target addresses in the incoming frame
29
   output [4:0] dec;             // the decoded routing request
30
 
31
   wire [3:0][2:0] cmp;           // compare results
32
 
33
   comp4 X0 (.a(tarx[3:0]), .b(locx[3:0]), .q(dec[0]));
34
   comp4 X1 (.a(tarx[7:4]), .b(locx[7:4]), .q(dec[1]));
35
   comp4 Y0 (.a(tary[3:0]), .b(locy[3:0]), .q(dec[2]));
36
   comp4 Y1 (.a(tary[7:4]), .b(locy[7:4]), .q(dec[3]));
37
 
38
   assign dec[0] = dec[1][1] | (dec[1][2]&dec[0][1]); // south, tarx < locx
39
   assign dec[1] = dec[1][2]&dec[0][2]&(dec[3][0]|(dec[3][2]&dec[2][0])); // west, tary > locy
40
   assign dec[2] = dec[1][0] | (dec[1][2]&dec[0][0]); // north, tarx < locx
41
   assign dec[3] = dec[1][2]&dec[0][2]&(dec[3][1]|(dec[3][2]&dec[2][1])); // west, tary < locy
42
   assign dec[4] = dec[3][2]&dec[2][2]&dec[1][2]&dec[0][2];
43
endmodule // addr_dec

powered by: WebSVN 2.1.0

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