csshuffle.v
2.68 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
65
66
67
68
69
70
71
72
73
74
75
/**************************************************************************
* *
* 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: csshuffle.v,v 1.1.1.1 2002/05/17 06:07:45 blythe Exp $
/////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module: csshuffle
// description: Converts data from RSP format to RDP format
//
//
// designer: Mike M. Cai 7/11/94
//
/////////////////////////////////////////////////////////////////////////
module csshuffle( // outputs
rm_addr, rl_addr, shf_state, update_shf,
// inputs
cmd, base_adrs, inc_shf_state,
reset_l, gclk);
output [4:0] rm_addr, rl_addr;
output update_shf;
output [4:0] shf_state;
input [5:0] cmd;
input [4:0] base_adrs;
input inc_shf_state, reset_l, gclk;
reg [4:0] shf_state, inc, noinc;
wire update_shf;
wire [4:0] off_addr;
wire [4:0] off_addr_inv;
wire sel_inv;
wire [4:0] rm_addr, rl_addr;
`include "rdpcmd.vh"
assign update_shf = shf_state == 5'h15;
always @(posedge gclk or negedge reset_l)
if (reset_l == 1'h0)
shf_state <= 5'h0;
else begin
// update_shf = shf_state == 5'h15;
// rst = reset_l | update_shf;
// inc = shf_state + inc_shf_state;
// inc = shf_state + 1;
// inc1 = inc_shf_state ? inc : shf_state;
// shf_state <= update_shf ? 5'h0 : inc1;
inc = update_shf ? 5'h0 : shf_state + 1;
noinc = update_shf ? 5'h0 : shf_state;
shf_state <= inc_shf_state ? inc : noinc;
end
csshuftbl tbl( .off_addr(off_addr), .sel_inv(sel_inv),
.shf_state(shf_state), .cmd(cmd));
assign
off_addr_inv = {off_addr[4:1], off_addr[0] ^ sel_inv};
csadder5b addmsboff(.sum(rm_addr), .a(off_addr), .base_adrs(base_adrs),
.shf_state(shf_state));
csadder5b addlsboff(.sum(rl_addr), .a(off_addr_inv), .base_adrs(base_adrs),
.shf_state(shf_state));
endmodule // csshuffle