csfiforptr.v
2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/**************************************************************************
* *
* Copyright (C) 1994, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
*************************************************************************/
// $Id: csfiforptr.v,v 1.3 2002/11/22 00:34:20 rws Exp $
/////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module: csfiforptr
// description: contails logic clocked by gclk. Rams are not included
//
//
// designer: Mike M. Cai 8/11/94
//
/////////////////////////////////////////////////////////////////////////
module csfiforptr( // outputs
read_adrs,
base_adrs,
// inputs
update_rptr,
one_word_cmd,
cmd_size,
reset_l, clk, start_gclk
);
output [5:0] read_adrs;
output [4:0] base_adrs;
input update_rptr, one_word_cmd;
input [4:0] cmd_size;
input reset_l, clk, start_gclk;
reg [5:0] read_adrs_reg;
wire [4:0] base_adrs;
wire [5:0] read_adrs;
reg [5:0] r_addr_inc;
always @(posedge clk)
if (reset_l == 0)
read_adrs_reg <= 6'h0;
else if (start_gclk)
begin
// read pointer
r_addr_inc = one_word_cmd ? (read_adrs_reg + 6'h1) :
(read_adrs_reg + {1'h0,cmd_size});
read_adrs_reg <= update_rptr ? r_addr_inc : read_adrs_reg;
/* if (update_rptr)
r_addr_inc = one_word_cmd ? 5'h1 : cmd_size;
else
r_addr_inc = 5'h0;
read_adrs <= read_adrs + {1'h0, r_addr_inc};
*/
end
assign base_adrs = read_adrs_reg[4:0];
assign read_adrs = read_adrs_reg[5:0];
endmodule // csfiforptr