Line 22... |
Line 22... |
// Creator: Dan Gisselquist, Ph.D.
|
// Creator: Dan Gisselquist, Ph.D.
|
// Gisselquist Technology, LLC
|
// Gisselquist Technology, LLC
|
//
|
//
|
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
//
|
//
|
// Copyright (C) 2015, Gisselquist Technology, LLC
|
// Copyright (C) 2015,2017, Gisselquist Technology, LLC
|
//
|
//
|
// This program is free software (firmware): you can redistribute it and/or
|
// This program is free software (firmware): you can redistribute it and/or
|
// modify it under the terms of the GNU General Public License as published
|
// modify it under the terms of the GNU General Public License as published
|
// by the Free Software Foundation, either version 3 of the License, or (at
|
// by the Free Software Foundation, either version 3 of the License, or (at
|
// your option) any later version.
|
// your option) any later version.
|
Line 34... |
Line 34... |
// This program is distributed in the hope that it will be useful, but WITHOUT
|
// This program is distributed in the hope that it will be useful, but WITHOUT
|
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
// for more details.
|
// for more details.
|
//
|
//
|
|
// You should have received a copy of the GNU General Public License along
|
|
// with this program. (It's in the $(ROOT)/doc directory. Run make with no
|
|
// target there if the PDF file isn't present.) If not, see
|
|
// <http://www.gnu.org/licenses/> for a copy.
|
|
//
|
// License: GPL, v3, as defined and found on www.gnu.org,
|
// License: GPL, v3, as defined and found on www.gnu.org,
|
// http://www.gnu.org/licenses/gpl.html
|
// http://www.gnu.org/licenses/gpl.html
|
//
|
//
|
//
|
//
|
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
//
|
//
|
|
//
|
// Flash requires a minimum of 4 clocks per byte to read, so that would be
|
// Flash requires a minimum of 4 clocks per byte to read, so that would be
|
// 4*(4bytes/32bit word) = 16 clocks per word read---and that's in pipeline
|
// 4*(4bytes/32bit word) = 16 clocks per word read---and that's in pipeline
|
// mode which this prefetch does not support. In non--pipelined mode, the
|
// mode which this prefetch does not support. In non--pipelined mode, the
|
// flash will require (16+6+6)*2 = 56 clocks plus 16 clocks per word read,
|
// flash will require (16+6+6)*2 = 56 clocks plus 16 clocks per word read,
|
// or 72 clocks to fetch one instruction.
|
// or 72 clocks to fetch one instruction.
|
Line 112... |
Line 118... |
initial o_illegal = 1'b0;
|
initial o_illegal = 1'b0;
|
always @(posedge i_clk)
|
always @(posedge i_clk)
|
if ((o_wb_cyc)&&(i_wb_ack))
|
if ((o_wb_cyc)&&(i_wb_ack))
|
begin
|
begin
|
o_valid <= (i_pc == o_wb_addr)&&(~i_wb_err);
|
o_valid <= (i_pc == o_wb_addr)&&(~i_wb_err);
|
o_illegal <= i_wb_err;
|
o_illegal <= (i_wb_err)&&(i_pc == o_wb_addr);
|
end else if (i_stalled_n)
|
end else if (i_stalled_n)
|
begin
|
begin
|
o_valid <= 1'b0;
|
o_valid <= 1'b0;
|
o_illegal <= 1'b0;
|
o_illegal <= 1'b0;
|
end
|
end
|