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

Subversion Repositories s1_core

[/] [s1_core/] [trunk/] [hdl/] [rtl/] [sparc_core/] [sparc_exu_ecc.v] - Blame information for rev 113

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 95 fafa1971
// ========== Copyright Header Begin ==========================================
2
// 
3
// OpenSPARC T1 Processor File: sparc_exu_ecc.v
4
// Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
5
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
6
// 
7
// The above named program is free software; you can redistribute it and/or
8
// modify it under the terms of the GNU General Public
9
// License version 2 as published by the Free Software Foundation.
10
// 
11
// The above named program is distributed in the hope that it will be 
12
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
// General Public License for more details.
15
// 
16
// You should have received a copy of the GNU General Public
17
// License along with this work; if not, write to the Free Software
18
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19
// 
20
// ========== Copyright Header End ============================================
21 113 albert.wat
`ifdef SIMPLY_RISC_TWEAKS
22
`define SIMPLY_RISC_SCANIN .si(0)
23
`else
24
`define SIMPLY_RISC_SCANIN .si()
25
`endif
26 95 fafa1971
////////////////////////////////////////////////////////////////////////
27
/*
28
//  Module Name: sparc_exu_ecc
29
//      Description: This block performs the ecc check and correction as well as
30
//                      doing the w2 write port arbitration and the w2 ecc generation.
31
*/
32
module sparc_exu_ecc (/*AUTOARG*/
33
   // Outputs
34
   so, ecc_ecl_rs1_ce, ecc_ecl_rs1_ue, ecc_ecl_rs2_ce,
35
   ecc_ecl_rs2_ue, ecc_ecl_rs3_ce, ecc_ecl_rs3_ue,
36
   ecc_byp_ecc_result_m, exu_ifu_err_synd_m,
37
   // Inputs
38
   rclk, se, si, byp_ecc_rcc_data_e, ecl_ecc_rs1_use_rf_e,
39
   byp_ecc_rs1_synd_d, byp_alu_rs2_data_e, ecl_ecc_rs2_use_rf_e,
40
   byp_ecc_rs2_synd_d, byp_ecc_rs3_data_e, ecl_ecc_rs3_use_rf_e,
41
   byp_ecc_rs3_synd_d, ecl_ecc_sel_rs1_m_l, ecl_ecc_sel_rs2_m_l,
42
   ecl_ecc_sel_rs3_m_l, ecl_ecc_log_rs1_m, ecl_ecc_log_rs2_m,
43
   ecl_ecc_log_rs3_m
44
   ) ;
45
   input rclk;
46
   input se;
47
   input si;
48
   input [63:0] byp_ecc_rcc_data_e;
49
   input        ecl_ecc_rs1_use_rf_e;
50
   input [7:0]  byp_ecc_rs1_synd_d;
51
   input [63:0] byp_alu_rs2_data_e;
52
   input        ecl_ecc_rs2_use_rf_e;
53
   input [7:0]  byp_ecc_rs2_synd_d;
54
   input [63:0] byp_ecc_rs3_data_e;
55
   input        ecl_ecc_rs3_use_rf_e;
56
   input [7:0]  byp_ecc_rs3_synd_d;
57
   input        ecl_ecc_sel_rs1_m_l;
58
   input        ecl_ecc_sel_rs2_m_l;
59
   input        ecl_ecc_sel_rs3_m_l;
60
   input        ecl_ecc_log_rs1_m;
61
   input        ecl_ecc_log_rs2_m;
62
   input        ecl_ecc_log_rs3_m;
63
 
64
   output       so;
65
   output       ecc_ecl_rs1_ce;
66
   output       ecc_ecl_rs1_ue;
67
   output       ecc_ecl_rs2_ce;
68
   output       ecc_ecl_rs2_ue;
69
   output       ecc_ecl_rs3_ce;
70
   output       ecc_ecl_rs3_ue;
71
 
72
   output [63:0] ecc_byp_ecc_result_m;
73
   output [6:0]  exu_ifu_err_synd_m;
74
 
75
   wire          clk;
76
   wire         sel_rs1_m;
77
   wire         sel_rs2_m;
78
   wire         sel_rs3_m;
79
   wire [7:0]   rs1_ecc_e;
80
   wire [6:0]   rs1_err_e;      // syndrome generated by checker
81
   wire [6:0]   rs1_err_m;      // syndrome generated by checker
82
   wire [7:0]   rs2_ecc_e;
83
   wire [6:0]   rs2_err_e;      // syndrome generated by checker
84
   wire [6:0]   rs2_err_m;      // syndrome generated by checker
85
   wire [7:0]   rs3_ecc_e;
86
   wire [6:0]   rs3_err_e;      // syndrome generated by checker
87
   wire [6:0]   rs3_err_m;      // syndrome generated by checker
88
   wire [6:0]   err_m;
89
   wire [63:0]  ecc_datain_m;
90
   wire [63:0]  byp_ecc_rcc_data_m;
91
   wire [63:0]  byp_alu_rs2_data_m;
92
   wire [63:0]  exu_lsu_rs3_data_m;
93
   wire [63:0]  error_data_m;
94
 
95
   assign       clk = rclk;
96
   // Pass along ecc parity bits from RF
97 113 albert.wat
   dff_s #(8) rs1_ecc_d2e(.din(byp_ecc_rs1_synd_d[7:0]), .clk(clk), .q(rs1_ecc_e[7:0]),
98
                      .se(se), `SIMPLY_RISC_SCANIN, .so());
99
   dff_s #(8) rs2_ecc_d2e(.din(byp_ecc_rs2_synd_d[7:0]), .clk(clk), .q(rs2_ecc_e[7:0]),
100
                      .se(se), `SIMPLY_RISC_SCANIN, .so());
101
   dff_s #(8) rs3_ecc_d2e(.din(byp_ecc_rs3_synd_d[7:0]), .clk(clk), .q(rs3_ecc_e[7:0]),
102
                      .se(se), `SIMPLY_RISC_SCANIN, .so());
103 95 fafa1971
 
104
   // Check the ecc for all 4 outputs from RF
105
   zzecc_exu_chkecc2 chk_rs1(.d(byp_ecc_rcc_data_e[63:0]),
106
                            .vld(ecl_ecc_rs1_use_rf_e),
107
                            .p(rs1_ecc_e[7:0]),
108
                            .q(rs1_err_e[6:0]),
109
                            .ce(ecc_ecl_rs1_ce), .ue(ecc_ecl_rs1_ue), .ne());
110
   zzecc_exu_chkecc2 chk_rs2(.d(byp_alu_rs2_data_e[63:0]),
111
                            .vld(ecl_ecc_rs2_use_rf_e),
112
                            .p(rs2_ecc_e[7:0]),
113
                            .q(rs2_err_e[6:0]),
114
                            .ce(ecc_ecl_rs2_ce), .ue(ecc_ecl_rs2_ue), .ne());
115
   zzecc_exu_chkecc2 chk_rs3(.d(byp_ecc_rs3_data_e[63:0]),
116
                                .vld(ecl_ecc_rs3_use_rf_e),
117
                                .p(rs3_ecc_e[7:0]),
118
                                .q(rs3_err_e[6:0]),
119
                                .ce(ecc_ecl_rs3_ce), .ue(ecc_ecl_rs3_ue), .ne());
120
 
121
   // Put results from checkers into flops
122 113 albert.wat
   dff_s #(7) rs1_err_e2m(.din(rs1_err_e[6:0]), .clk(clk), .q(rs1_err_m[6:0]),
123
                      .se(se), `SIMPLY_RISC_SCANIN, .so());
124
   dff_s #(7) rs2_err_e2m(.din(rs2_err_e[6:0]), .clk(clk), .q(rs2_err_m[6:0]),
125
                      .se(se), `SIMPLY_RISC_SCANIN, .so());
126
   dff_s #(7) rs3o_err_e2m(.din(rs3_err_e[6:0]), .clk(clk), .q(rs3_err_m[6:0]),
127
                      .se(se), `SIMPLY_RISC_SCANIN, .so());
128 95 fafa1971
 
129
   // Pass along RF data to M stage
130 113 albert.wat
   dff_s #(64) rs1_data_e2m(.din(byp_ecc_rcc_data_e[63:0]), .clk(clk), .q(byp_ecc_rcc_data_m[63:0]),
131
                        .se(se), `SIMPLY_RISC_SCANIN, .so());
132
   dff_s #(64) rs2_data_e2m(.din(byp_alu_rs2_data_e[63:0]), .clk(clk), .q(byp_alu_rs2_data_m[63:0]),
133
                        .se(se), `SIMPLY_RISC_SCANIN, .so());
134
   dff_s #(64) rs3_data_e2m(.din(byp_ecc_rs3_data_e[63:0]), .clk(clk),
135 95 fafa1971
                         .q(exu_lsu_rs3_data_m[63:0]),
136 113 albert.wat
                         .se(se), `SIMPLY_RISC_SCANIN, .so());
137 95 fafa1971
 
138
   // Mux between 3 different ports for syndrome and data
139
   assign       sel_rs1_m = ~ecl_ecc_sel_rs1_m_l;
140
   assign       sel_rs2_m = ~ecl_ecc_sel_rs2_m_l;
141
   assign       sel_rs3_m = ~ecl_ecc_sel_rs3_m_l;
142
   mux3ds #(7) syn_mux(.dout(err_m[6:0]),
143
                     .in0(rs1_err_m[6:0]),
144
                     .in1(rs2_err_m[6:0]),
145
                     .in2(rs3_err_m[6:0]),
146
                     .sel0(sel_rs1_m),
147
                     .sel1(sel_rs2_m),
148
                     .sel2(sel_rs3_m));
149
   mux3ds #(64) data_m_mux(.dout(ecc_datain_m[63:0]),
150
                     .in0(byp_ecc_rcc_data_m[63:0]),
151
                     .in1(byp_alu_rs2_data_m[63:0]),
152
                     .in2(exu_lsu_rs3_data_m[63:0]),
153
                     .sel0(sel_rs1_m),
154
                     .sel1(sel_rs2_m),
155
                     .sel2(sel_rs3_m));
156
 
157
   mux3ds #(7) syn_log_mux(.dout(exu_ifu_err_synd_m[6:0]),
158
                           .in0(rs1_err_m[6:0]),
159
                           .in1(rs2_err_m[6:0]),
160
                           .in2(rs3_err_m[6:0]),
161
                           .sel0(ecl_ecc_log_rs1_m),
162
                           .sel1(ecl_ecc_log_rs2_m),
163
                           .sel2(ecl_ecc_log_rs3_m));
164
   // Decode syndrome from checker
165
   sparc_exu_ecc_dec decode(.e          (error_data_m[63:0]),
166
                            .q          (err_m[6:0]));
167
   assign       ecc_byp_ecc_result_m[63:0] = ecc_datain_m[63:0] ^ error_data_m[63:0];
168
 
169
 
170
endmodule // sparc_exu_ecc

powered by: WebSVN 2.1.0

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