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

Subversion Repositories or1k

[/] [or1k/] [tags/] [rel_13/] [or1200/] [rtl/] [verilog/] [or1200_if.v] - Diff between revs 504 and 617

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 504 Rev 617
Line 1... Line 1...
 
 
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
////                                                              ////
////                                                              ////
////  OR1200's instruction fetch                                  ////
////  OR1200's instruction fetch                                  ////
////                                                              ////
////                                                              ////
////  This file is part of the OpenRISC 1200 project              ////
////  This file is part of the OpenRISC 1200 project              ////
Line 43... Line 42...
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
// CVS Revision History
// CVS Revision History
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.1  2002/01/03 08:16:15  lampret
 
// New prefixes for RTL files, prefixed module names. Updated cache controllers and MMUs.
 
//
// Revision 1.10  2001/11/20 18:46:15  simons
// Revision 1.10  2001/11/20 18:46:15  simons
// Break point bug fixed
// Break point bug fixed
//
//
// Revision 1.9  2001/11/18 09:58:28  lampret
// Revision 1.9  2001/11/18 09:58:28  lampret
// Fixed some l.trap typos.
// Fixed some l.trap typos.
Line 80... Line 82...
        // External i/f to IC
        // External i/f to IC
        icpu_dat_i, icpu_ack_i, icpu_rty_i, icpu_err_i, icpu_adr_i, icpu_tag_i,
        icpu_dat_i, icpu_ack_i, icpu_rty_i, icpu_err_i, icpu_adr_i, icpu_tag_i,
 
 
        // Internal i/f
        // Internal i/f
        if_freeze, if_insn, if_pc, flushpipe,
        if_freeze, if_insn, if_pc, flushpipe,
        if_stall, has_dslot, taken, genpc_refetch, rfe,
        if_stall, no_more_dslot, taken, genpc_refetch, rfe,
        except_itlbmiss, except_immufault, except_ibuserr
        except_itlbmiss, except_immufault, except_ibuserr
);
);
 
 
//
//
// I/O
// I/O
Line 112... Line 114...
input                           if_freeze;
input                           if_freeze;
output  [31:0]                   if_insn;
output  [31:0]                   if_insn;
output  [31:0]                   if_pc;
output  [31:0]                   if_pc;
input                           flushpipe;
input                           flushpipe;
output                          if_stall;
output                          if_stall;
input                           has_dslot;
input                           no_more_dslot;
input                           taken;
input                           taken;
output                          genpc_refetch;
output                          genpc_refetch;
input                           rfe;
input                           rfe;
output                          except_itlbmiss;
output                          except_itlbmiss;
output                          except_immufault;
output                          except_immufault;
Line 130... Line 132...
reg                             saved;
reg                             saved;
 
 
//
//
// IF stage insn
// IF stage insn
//
//
assign if_insn = icpu_err_i | has_dslot & taken | rfe ? {`OR1200_OR32_NOP, 26'h000_444F} : saved ? insn_saved : icpu_ack_i ? icpu_dat_i : {`OR1200_OR32_NOP, 26'h000_666F};
assign if_insn = icpu_err_i | no_more_dslot | rfe ? {`OR1200_OR32_NOP, 26'h041_0000} : saved ? insn_saved : icpu_ack_i ? icpu_dat_i : {`OR1200_OR32_NOP, 26'h061_0000};
assign if_pc = saved ? addr_saved : icpu_adr_i;
assign if_pc = saved ? addr_saved : icpu_adr_i;
 
// assign if_stall = !icpu_err_i & !icpu_ack_i & !saved & !no_more_dslot;
assign if_stall = !icpu_err_i & !icpu_ack_i & !saved;
assign if_stall = !icpu_err_i & !icpu_ack_i & !saved;
assign genpc_refetch = saved & icpu_ack_i;
assign genpc_refetch = saved & icpu_ack_i;
assign except_itlbmiss = icpu_err_i & (icpu_tag_i == `OR1200_ITAG_TE);
assign except_itlbmiss = icpu_err_i & (icpu_tag_i == `OR1200_ITAG_TE) & !no_more_dslot;
assign except_immufault = icpu_err_i & (icpu_tag_i == `OR1200_ITAG_PE);
assign except_immufault = icpu_err_i & (icpu_tag_i == `OR1200_ITAG_PE) & !no_more_dslot;
assign except_ibuserr = icpu_err_i & (icpu_tag_i == `OR1200_ITAG_BE);
assign except_ibuserr = icpu_err_i & (icpu_tag_i == `OR1200_ITAG_BE) & !no_more_dslot;
 
 
//
//
// Flag for saved insn/address
// Flag for saved insn/address
//
//
always @(posedge clk or posedge rst)
always @(posedge clk or posedge rst)
Line 156... Line 159...
//
//
// Store fetched instruction
// Store fetched instruction
//
//
always @(posedge clk or posedge rst)
always @(posedge clk or posedge rst)
        if (rst)
        if (rst)
                insn_saved <= #1 {`OR1200_OR32_NOP, 26'h000_444F};
                insn_saved <= #1 {`OR1200_OR32_NOP, 26'h041_0000};
        else if (flushpipe)
        else if (flushpipe)
                insn_saved <= #1 {`OR1200_OR32_NOP, 26'h000_444F};
                insn_saved <= #1 {`OR1200_OR32_NOP, 26'h041_0000};
        else if (icpu_ack_i & if_freeze & !saved)
        else if (icpu_ack_i & if_freeze & !saved)
                insn_saved <= #1 icpu_dat_i;
                insn_saved <= #1 icpu_dat_i;
        else if (!if_freeze)
        else if (!if_freeze)
                insn_saved <= #1 {`OR1200_OR32_NOP, 26'h000_444F};
                insn_saved <= #1 {`OR1200_OR32_NOP, 26'h041_0000};
 
 
//
//
// Store fetched instruction's address
// Store fetched instruction's address
//
//
always @(posedge clk or posedge rst)
always @(posedge clk or posedge rst)

powered by: WebSVN 2.1.0

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