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

Subversion Repositories raptor64

[/] [raptor64/] [trunk/] [rtl/] [verilog/] [Raptor64_regfile.v] - Blame information for rev 41

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

Line No. Rev Author Line
1 30 robfinch
`timescale 1ns / 1ps
2
//=============================================================================
3
//        __
4
//   \\__/ o\    (C) 2011,2012  Robert Finch
5
//    \  __ /    All rights reserved.
6
//     \/_//     robfinch<remove>@opencores.org
7
//       ||
8
//  
9
//      Raptor64_regfile.v
10
//  - register file and bypass muxes
11
//  
12
// This source file is free software: you can redistribute it and/or modify 
13
// it under the terms of the GNU Lesser General Public License as published 
14
// by the Free Software Foundation, either version 3 of the License, or     
15
// (at your option) any later version.                                      
16
//                                                                          
17
// This source file is distributed in the hope that it will be useful,      
18
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
19
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
20
// GNU General Public License for more details.                             
21
//                                                                          
22
// You should have received a copy of the GNU General Public License        
23
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
24
//                                                                          
25
//
26
//=============================================================================
27
 
28
module Raptor64_regfile(clk, advanceR, advanceW, dRa, dRb, dRc, dpc,
29
        xRt, m1Rt, m2Rt, wRt, tRt, xData, m1Data, m2Data, wData, tData, nxt_a, nxt_b, nxt_c);
30
input clk;
31
input advanceR;
32
input advanceW;
33
input [8:0] dRa;
34
input [8:0] dRb;
35
input [8:0] dRc;
36
input [63:0] dpc;
37
input [8:0] xRt;
38
input [8:0] m1Rt;
39
input [8:0] m2Rt;
40
input [8:0] wRt;
41
input [8:0] tRt;
42
input [63:0] xData;
43
input [63:0] m1Data;
44
input [63:0] m2Data;
45
input [63:0] wData;
46
input [63:0] tData;
47
output [63:0] nxt_a;
48
output [63:0] nxt_b;
49
output [63:0] nxt_c;
50
 
51
wire [63:0] rfoa, rfob, rfoc;
52
 
53
syncRam512x64_1rw3r u1
54
(
55
        .wrst(1'b0),
56
        .wclk(clk),
57
        .wce(advanceW),
58
        .we(1'b1),
59
        .wadr(wRt),
60
        .i(wData),
61
        .wo(),
62
 
63
        .rrsta(1'b0),
64
        .rclka(~clk),
65
        .rcea(advanceR),
66
        .radra(dRa),
67
        .roa(rfoa),
68
 
69
        .rrstb(1'b0),
70
        .rclkb(~clk),
71
        .rceb(advanceR),
72
        .radrb(dRb),
73
        .rob(rfob),
74
 
75
        .rrstc(1'b0),
76
        .rclkc(~clk),
77
        .rcec(advanceR),
78
        .radrc(dRc),
79
        .roc(rfoc)
80
);
81
 
82
 
83
reg [63:0] nxt_a;
84
always @(dRa or xData or m1Data or m2Data or wData or tData or rfoa or dpc or xRt or m1Rt or m2Rt or wRt or tRt)
85
        casex(dRa)
86
        9'bxxxx00000:   nxt_a <= 64'd0;
87
        9'bxxxx11101:   nxt_a <= dpc;
88
        xRt:    nxt_a <= xData;
89
        m1Rt:   nxt_a <= m1Data;
90
        m2Rt:   nxt_a <= m2Data;
91
        wRt:    nxt_a <= wData;
92
        tRt:    nxt_a <= tData;
93
        default:        nxt_a <= rfoa;
94
        endcase
95
 
96
reg [63:0] nxt_b;
97
always @(dRb or xData or m1Data or m2Data or wData or tData or rfob or dpc or xRt or m1Rt or m2Rt or wRt or tRt)
98
        casex(dRb)
99
        9'bxxxx00000:   nxt_b <= 64'd0;
100
        9'bxxxx11101:   nxt_b <= dpc;
101
        xRt:    nxt_b <= xData;
102
        m1Rt:   nxt_b <= m1Data;
103
        m2Rt:   nxt_b <= m2Data;
104
        wRt:    nxt_b <= wData;
105
        tRt:    nxt_b <= tData;
106
        default:        nxt_b <= rfob;
107
        endcase
108
 
109
reg [63:0] nxt_c;
110
always @(dRc or xData or m1Data or m2Data or wData or tData or rfoc or dpc or xRt or m1Rt or m2Rt or wRt or tRt)
111
        casex(dRc)
112
        9'bxxxx00000:   nxt_c <= 64'd0;
113
        9'bxxxx11101:   nxt_c <= dpc;
114
        xRt:    nxt_c <= xData;
115
        m1Rt:   nxt_c <= m1Data;
116
        m2Rt:   nxt_c <= m2Data;
117
        wRt:    nxt_c <= wData;
118
        tRt:    nxt_c <= tData;
119
        default:        nxt_c <= rfoc;
120
        endcase
121
 
122
 
123
endmodule

powered by: WebSVN 2.1.0

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