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

Subversion Repositories or1k

[/] [or1k/] [tags/] [rel_25/] [or1200/] [rtl/] [verilog/] [or1200_genpc.v] - Diff between revs 589 and 617

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

Rev 589 Rev 617
Line 1... Line 1...
 
 
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
////                                                              ////
////                                                              ////
////  OR1200's generate PC                                        ////
////  OR1200's generate PC                                        ////
////                                                              ////
////                                                              ////
////  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.3  2002/01/18 07:56:00  lampret
 
// No more low/high priority interrupts (PICPR removed). Added tick timer exception. Added exception prefix (SR[EPH]). Fixed single-step bug whenreading NPC.
 
//
// Revision 1.2  2002/01/14 06:18:22  lampret
// Revision 1.2  2002/01/14 06:18:22  lampret
// Fixed mem2reg bug in FAST implementation. Updated debug unit to work with new genpc/if.
// Fixed mem2reg bug in FAST implementation. Updated debug unit to work with new genpc/if.
//
//
// Revision 1.1  2002/01/03 08:16:15  lampret
// Revision 1.1  2002/01/03 08:16:15  lampret
// New prefixes for RTL files, prefixed module names. Updated cache controllers and MMUs.
// New prefixes for RTL files, prefixed module names. Updated cache controllers and MMUs.
Line 89... Line 91...
 
 
        // Internal i/f
        // Internal i/f
        branch_op, except_type, except_prefix,
        branch_op, except_type, except_prefix,
        branch_addrofs, lr_restor, flag, taken, except_start,
        branch_addrofs, lr_restor, flag, taken, except_start,
        binsn_addr, epcr, spr_dat_i, spr_pc_we, genpc_refetch,
        binsn_addr, epcr, spr_dat_i, spr_pc_we, genpc_refetch,
        genpc_freeze, flushpipe
        genpc_freeze, flushpipe, no_more_dslot
);
);
 
 
//
//
// I/O
// I/O
//
//
Line 133... Line 135...
input   [31:0]                   spr_dat_i;
input   [31:0]                   spr_dat_i;
input                           spr_pc_we;
input                           spr_pc_we;
input                           genpc_refetch;
input                           genpc_refetch;
input                           genpc_freeze;
input                           genpc_freeze;
input                           flushpipe;
input                           flushpipe;
 
input                           no_more_dslot;
 
 
//
//
// Internal wires and regs
// Internal wires and regs
//
//
reg     [31:2]                  pcreg;
reg     [31:2]                  pcreg;
Line 146... Line 149...
reg                             btarget; /* set when fetching branch target insns */
reg                             btarget; /* set when fetching branch target insns */
 
 
//
//
// Address of insn to be fecthed
// Address of insn to be fecthed
//
//
assign icpu_adr_o = !except_start & !spr_pc_we & (icpu_rty_i | genpc_refetch) ? icpu_adr_i : pc;
assign icpu_adr_o = !no_more_dslot & !except_start & !spr_pc_we & (icpu_rty_i | genpc_refetch) ? icpu_adr_i : pc;
 
// assign icpu_adr_o = !except_start & !spr_pc_we & (icpu_rty_i | genpc_refetch) ? icpu_adr_i : pc;
 
 
//
//
// Control access to IC subsystem
// Control access to IC subsystem
//
//
 
// assign icpu_cyc_o = !genpc_freeze & !no_more_dslot;
assign icpu_cyc_o = !genpc_freeze;
assign icpu_cyc_o = !genpc_freeze;
assign icpu_stb_o = icpu_cyc_o;
assign icpu_stb_o = icpu_cyc_o;
assign icpu_sel_o = 4'b1111;
assign icpu_sel_o = 4'b1111;
assign icpu_tag_o = `OR1200_ITAG_NI;
assign icpu_tag_o = `OR1200_ITAG_NI;
 
 
Line 269... Line 274...
always @(posedge clk or posedge rst)
always @(posedge clk or posedge rst)
        if (rst)
        if (rst)
                pcreg <= #1 30'd63;
                pcreg <= #1 30'd63;
        else if (spr_pc_we)
        else if (spr_pc_we)
                pcreg <= #1 spr_dat_i[31:2];
                pcreg <= #1 spr_dat_i[31:2];
        else if (except_start | !genpc_freeze & !icpu_rty_i & !genpc_refetch)
        else if (no_more_dslot | except_start | !genpc_freeze & !icpu_rty_i & !genpc_refetch)
 
//      else if (except_start | !genpc_freeze & !icpu_rty_i & !genpc_refetch)
                pcreg <= #1 pc[31:2];
                pcreg <= #1 pc[31:2];
 
 
//
 
// dslot
 
//
 
always @(posedge clk or posedge rst)
 
        if (rst)
 
                dslot <= #1 1'b0;
 
        else if (spr_pc_we)
 
                dslot <= #1 1'b0;
 
        else if (!icpu_rty_i)
 
                dslot <= #1 |branch_op;
 
 
 
//
 
// btarget
 
//
 
always @(posedge clk or posedge rst)
 
        if (rst)
 
                btarget <= #1 1'b0;
 
        else if (spr_pc_we)
 
                btarget <= #1 1'b0;
 
        else if (!icpu_rty_i)
 
                btarget <= #1 dslot;
 
 
 
endmodule
endmodule
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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