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

Subversion Repositories robust_axi_fabric

[/] [robust_axi_fabric/] [trunk/] [src/] [base/] [ic_dec.v] - Blame information for rev 22

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

Line No. Rev Author Line
1 7 eyalhoc
<##//////////////////////////////////////////////////////////////////
2
////                                                             ////
3
////  Author: Eyal Hochberg                                      ////
4
////          eyal@provartec.com                                 ////
5
////                                                             ////
6
////  Downloaded from: http://www.opencores.org                  ////
7
/////////////////////////////////////////////////////////////////////
8
////                                                             ////
9
//// Copyright (C) 2010 Provartec LTD                            ////
10
//// www.provartec.com                                           ////
11
//// info@provartec.com                                          ////
12
////                                                             ////
13
//// This source file may be used and distributed without        ////
14
//// restriction provided that this copyright statement is not   ////
15
//// removed from the file and that any derivative work contains ////
16
//// the original copyright notice and the associated disclaimer.////
17
////                                                             ////
18
//// This source file is free software; you can redistribute it  ////
19
//// and/or modify it under the terms of the GNU Lesser General  ////
20
//// Public License as published by the Free Software Foundation.////
21
////                                                             ////
22
//// This source is distributed in the hope that it will be      ////
23
//// useful, but WITHOUT ANY WARRANTY; without even the implied  ////
24
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR     ////
25
//// PURPOSE.  See the GNU Lesser General Public License for more////
26
//// details. http://www.gnu.org/licenses/lgpl.html              ////
27
////                                                             ////
28
//////////////////////////////////////////////////////////////////##>
29
 
30 2 eyalhoc
OUTFILE PREFIX_ic_dec.v
31
 
32
ITER MX
33
ITER SX
34
 
35
module PREFIX_ic_dec (PORTS);
36
 
37
   input [ADDR_BITS-1:0]                       MMX_AADDR;
38
   input [ID_BITS-1:0]                         MMX_AID;
39
   output [SLV_BITS-1:0]                       MMX_ASLV;
40
   output                                     MMX_AIDOK;
41
 
42
   parameter                                  DEC_MSB =  ADDR_BITS - 1;
43 9 eyalhoc
   parameter                                  DEC_LSB =  ADDR_BITS - SLV_BITS;
44 2 eyalhoc
 
45
   reg [SLV_BITS-1:0]                          MMX_ASLV;
46
   reg                                        MMX_AIDOK;
47
 
48 20 eyalhoc
   wire [DEC_MSB:DEC_LSB]                     MMX_AADDR_DEC;
49
 
50
 
51
   assign                                     MMX_AADDR_DEC = MMX_AADDR[DEC_MSB:DEC_LSB];
52
 
53 16 eyalhoc
LOOP MX
54 2 eyalhoc
     always @(MMX_AADDR or MMX_AIDOK)
55 13 eyalhoc
       begin
56
IFDEF TRUE(SLAVE_NUM==1)
57
          case (MMX_AIDOK)
58 16 eyalhoc
            1'b1 : MMX_ASLV = SLV_BITS'd0;
59 13 eyalhoc
ELSE TRUE(SLAVE_NUM==1)
60 20 eyalhoc
          case ({MMX_AIDOK, MMX_AADDR_DEC})
61 16 eyalhoc
            {1'b1, BIN(SX SLV_BITS)} : MMX_ASLV = SLV_BITS'dSX;
62 13 eyalhoc
ENDIF TRUE(SLAVE_NUM==1)
63 16 eyalhoc
            default : MMX_ASLV = SLV_BITS'dSERR;
64 2 eyalhoc
          endcase
65
       end
66
 
67
   always @(MMX_AID)
68
     begin
69 19 eyalhoc
        case (MMX_AID[MSTR_ID_BITS-1:0])
70
          MSTR_ID_BITS'bGROUP_MMX_ID : MMX_AIDOK = 1'b1;
71 2 eyalhoc
          default : MMX_AIDOK = 1'b0;
72
        endcase
73
     end
74
 
75 16 eyalhoc
ENDLOOP MX
76 2 eyalhoc
 
77 16 eyalhoc
endmodule
78 2 eyalhoc
 
79
 
80
 

powered by: WebSVN 2.1.0

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