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

Subversion Repositories robust_ahb_matrix

[/] [robust_ahb_matrix/] [trunk/] [src/] [base/] [ahb_matrix_hlast.v] - Blame information for rev 10

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 10 eyalhoc
<##//////////////////////////////////////////////////////////////////
2 2 eyalhoc
////                                                             ////
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 10 eyalhoc
//////////////////////////////////////////////////////////////////##>
29 2 eyalhoc
 
30
OUTFILE PREFIX_hlast.v
31
INCLUDE def_ahb_matrix.txt
32
 
33
ITER MX
34
 
35
module PREFIX_hlast (PORTS);
36
 
37
   input                      clk;
38
   input                      reset;
39
 
40
   input [1:0]                 MMX_HTRANS;
41
   input                      MMX_HREADY;
42
   input [2:0]                 MMX_HBURST;
43
   output                     MMX_HLAST;
44
 
45
 
46
   parameter                  TRANS_IDLE   = 2'b00;
47
   parameter                  TRANS_BUSY   = 2'b01;
48
   parameter                  TRANS_NONSEQ = 2'b10;
49
   parameter                  TRANS_SEQ    = 2'b11;
50
 
51
   parameter                  BURST_SINGLE = 3'b000;
52
   parameter                  BURST_INCR4  = 3'b011;
53
   parameter                  BURST_INCR8  = 3'b101;
54
   parameter                  BURST_INCR16 = 3'b111;
55
 
56
 
57
   reg [3:0]                  MMX_count;
58
 
59
 
60
   assign                     MMX_HLAST = (MMX_count == 'd1) | ((MMX_HTRANS == TRANS_NONSEQ) & MMX_HREADY & (MMX_HBURST == BURST_SINGLE));
61
 
62
LOOP MX
63
   always @(posedge clk or posedge reset)
64
     if (reset)
65
       MMX_count <= #FFD 4'd15;
66
     else if ((MMX_HTRANS == TRANS_NONSEQ) & MMX_HREADY)
67
       MMX_count <= #FFD
68
                          (MMX_HBURST == BURST_INCR4) ? 4'd3 :
69
                          (MMX_HBURST == BURST_INCR8) ? 4'd7 :
70
                          (MMX_HBURST == BURST_INCR16) ? 4'd15 :
71
                          4'd0;
72
     else if ((MMX_HTRANS == TRANS_SEQ) & MMX_HREADY)
73
       MMX_count <= #FFD MMX_count - 1'b1;
74
 
75
ENDLOOP MX
76
 
77
 
78
     endmodule
79
 
80
 
81
 

powered by: WebSVN 2.1.0

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