[6] | 1 | // ========== Copyright Header Begin ========================================== |
---|
| 2 | // |
---|
| 3 | // OpenSPARC T1 Processor File: sparc_ifu_lfsr5.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 | //////////////////////////////////////////////////////////////////////// |
---|
| 22 | /* |
---|
| 23 | // Module Name: sparc_ifu_lfsr5 |
---|
| 24 | // Description: |
---|
| 25 | // The IFQ is the icache input queue. This communicates between the |
---|
| 26 | // IFU and the outside world. It handles icache misses and |
---|
| 27 | // invalidate requests from the crossbar. |
---|
| 28 | */ |
---|
| 29 | //////////////////////////////////////////////////////////////////////// |
---|
| 30 | |
---|
| 31 | module sparc_ifu_lfsr5 (/*AUTOARG*/ |
---|
| 32 | // Outputs |
---|
| 33 | out, |
---|
| 34 | // Inputs |
---|
| 35 | advance, clk, se, si, so, reset |
---|
| 36 | ); |
---|
| 37 | |
---|
| 38 | input advance; |
---|
| 39 | |
---|
| 40 | input clk, se, si, so, reset; |
---|
| 41 | |
---|
| 42 | output [1:0] out; |
---|
| 43 | |
---|
| 44 | reg [4:0] q_next; |
---|
| 45 | wire [4:0] q; |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | /* |
---|
| 49 | always @ (posedge clk) |
---|
| 50 | begin |
---|
| 51 | out = $random; |
---|
| 52 | end // always @ posedge |
---|
| 53 | */ |
---|
| 54 | |
---|
| 55 | // always @ (posedge clk) |
---|
| 56 | // begin |
---|
| 57 | // q[4:0] <= q_next[4:0]; |
---|
| 58 | // end |
---|
| 59 | |
---|
| 60 | always @ (/*AUTOSENSE*/advance or q or reset) |
---|
| 61 | begin |
---|
| 62 | if (reset) |
---|
| 63 | q_next = 5'b11111; |
---|
| 64 | else if (advance) |
---|
| 65 | begin |
---|
| 66 | // lfsr -- stable at 000000, period of 63 |
---|
| 67 | q_next[1] = q[0]; |
---|
| 68 | q_next[2] = q[1]; |
---|
| 69 | q_next[3] = q[2]; |
---|
| 70 | q_next[4] = q[3]; |
---|
| 71 | q_next[0] = q[1] ^ q[4]; |
---|
| 72 | end |
---|
| 73 | else |
---|
| 74 | q_next = q; |
---|
| 75 | end // always @ (... |
---|
| 76 | |
---|
| 77 | assign out = {q[0], q[2]}; |
---|
| 78 | |
---|
| 79 | dff_s #(5) lfsr_reg(.din (q_next), |
---|
| 80 | .q (q), |
---|
| 81 | .clk (clk), .se(se), .si(), .so()); |
---|
| 82 | |
---|
| 83 | endmodule // sparc_ifu_lfsr5 |
---|
| 84 | |
---|
| 85 | |
---|
| 86 | |
---|
| 87 | |
---|