// ========== Copyright Header Begin ==========================================
|
// ========== Copyright Header Begin ==========================================
|
//
|
//
|
// OpenSPARC T1 Processor File: lsu_dcache_lfsr.v
|
// OpenSPARC T1 Processor File: lsu_dcache_lfsr.v
|
// Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
|
// Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
|
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
|
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
|
//
|
//
|
// The above named program is free software; you can redistribute it and/or
|
// The above named program is free software; you can redistribute it and/or
|
// modify it under the terms of the GNU General Public
|
// modify it under the terms of the GNU General Public
|
// License version 2 as published by the Free Software Foundation.
|
// License version 2 as published by the Free Software Foundation.
|
//
|
//
|
// The above named program is distributed in the hope that it will be
|
// The above named program is distributed in the hope that it will be
|
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// General Public License for more details.
|
// General Public License for more details.
|
//
|
//
|
// You should have received a copy of the GNU General Public
|
// You should have received a copy of the GNU General Public
|
// License along with this work; if not, write to the Free Software
|
// License along with this work; if not, write to the Free Software
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
//
|
//
|
// ========== Copyright Header End ============================================
|
// ========== Copyright Header End ============================================
|
|
`ifdef SIMPLY_RISC_TWEAKS
|
|
`define SIMPLY_RISC_SCANIN .si(0)
|
|
`else
|
|
`define SIMPLY_RISC_SCANIN .si()
|
|
`endif
|
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
/*
|
/*
|
// Module Name: lsu_dcache_lfsr
|
// Module Name: lsu_dcache_lfsr
|
*/
|
*/
|
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
|
|
module lsu_dcache_lfsr (/*AUTOARG*/
|
module lsu_dcache_lfsr (/*AUTOARG*/
|
// Outputs
|
// Outputs
|
out,
|
out,
|
// Inputs
|
// Inputs
|
advance, clk, se, si, so, reset
|
advance, clk, se, si, so, reset
|
);
|
);
|
|
|
input advance;
|
input advance;
|
|
|
input clk, se, si, so, reset;
|
input clk, se, si, so, reset;
|
|
|
output [1:0] out;
|
output [1:0] out;
|
|
|
reg [4:0] q_next;
|
reg [4:0] q_next;
|
wire [4:0] q;
|
wire [4:0] q;
|
|
|
|
|
/*
|
/*
|
always @ (posedge clk)
|
always @ (posedge clk)
|
begin
|
begin
|
out = $random;
|
out = $random;
|
end // always @ posedge
|
end // always @ posedge
|
*/
|
*/
|
|
|
// always @ (posedge clk)
|
// always @ (posedge clk)
|
// begin
|
// begin
|
// q[4:0] <= q_next[4:0];
|
// q[4:0] <= q_next[4:0];
|
// end
|
// end
|
|
|
always @ (/*AUTOSENSE*/advance or q or reset)
|
always @ (/*AUTOSENSE*/advance or q or reset)
|
begin
|
begin
|
if (reset)
|
if (reset)
|
q_next = 5'b11111;
|
q_next = 5'b11111;
|
else if (advance)
|
else if (advance)
|
begin
|
begin
|
// lfsr -- stable at 000000, period of 63
|
// lfsr -- stable at 000000, period of 63
|
q_next[1] = q[0];
|
q_next[1] = q[0];
|
q_next[2] = q[1];
|
q_next[2] = q[1];
|
q_next[3] = q[2];
|
q_next[3] = q[2];
|
q_next[4] = q[3];
|
q_next[4] = q[3];
|
q_next[0] = q[1] ^ q[4];
|
q_next[0] = q[1] ^ q[4];
|
end
|
end
|
else
|
else
|
q_next = q;
|
q_next = q;
|
end // always @ (...
|
end // always @ (...
|
|
|
assign out = {q[0], q[2]};
|
assign out = {q[0], q[2]};
|
|
|
dff #(5) lfsr_reg(.din (q_next),
|
dff_s #(5) lfsr_reg(.din (q_next),
|
.q (q),
|
.q (q),
|
.clk (clk), .se(se), .si(), .so());
|
.clk (clk), .se(se), `SIMPLY_RISC_SCANIN, .so());
|
|
|
endmodule // lsu_dcache_lfsr
|
endmodule // lsu_dcache_lfsr
|
|
|
|
|
|
|
|
|
|
|