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

Subversion Repositories or1k

[/] [or1k/] [branches/] [branch_qmem/] [or1200/] [rtl/] [verilog/] [or1200_genpc.v] - Diff between revs 1171 and 1206

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

Rev 1171 Rev 1206
Line 42... Line 42...
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
// CVS Revision History
// CVS Revision History
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.7.4.1  2003/07/08 15:36:37  lampret
 
// Added embedded memory QMEM.
 
//
// Revision 1.7  2003/04/20 22:23:57  lampret
// Revision 1.7  2003/04/20 22:23:57  lampret
// No functional change. Only added customization for exception vectors.
// No functional change. Only added customization for exception vectors.
//
//
// Revision 1.6  2002/03/29 15:16:55  lampret
// Revision 1.6  2002/03/29 15:16:55  lampret
// Some of the warnings fixed.
// Some of the warnings fixed.
Line 103... Line 106...
 
 
        // 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, no_more_dslot
        genpc_freeze, genpc_stop_prefetch, no_more_dslot
);
);
 
 
//
//
// I/O
// I/O
//
//
Line 142... Line 145...
input   [31:2]                  binsn_addr;
input   [31:2]                  binsn_addr;
input   [31:0]                   epcr;
input   [31:0]                   epcr;
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_stop_prefetch;
input                           genpc_freeze;
input                           genpc_freeze;
input                           no_more_dslot;
input                           no_more_dslot;
 
 
//
//
// Internal wires and regs
// Internal wires and regs
//
//
reg     [31:2]                  pcreg;
reg     [31:2]                  pcreg;
reg     [31:0]                   pc;
reg     [31:0]                   pc;
reg                             taken;  /* Set to in case of jump or taken branch */
reg                             taken;  /* Set to in case of jump or taken branch */
 
reg                             genpc_refetch_r;
 
 
//
//
// Address of insn to be fecthed
// Address of insn to be fecthed
//
//
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 = !no_more_dslot & !except_start & !spr_pc_we & (icpu_rty_i | genpc_refetch) ? icpu_adr_i : pc;
Line 162... Line 167...
 
 
//
//
// Control access to IC subsystem
// Control access to IC subsystem
//
//
// assign icpu_cycstb_o = !genpc_freeze & !no_more_dslot;
// assign icpu_cycstb_o = !genpc_freeze & !no_more_dslot;
assign icpu_cycstb_o = !genpc_freeze;
assign icpu_cycstb_o = !genpc_freeze; // works, except remaining raised cycstb during long load/store
 
//assign icpu_cycstb_o = !(genpc_freeze | genpc_refetch & genpc_refetch_r);
 
//assign icpu_cycstb_o = !(genpc_freeze | genpc_stop_prefetch);
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;
 
 
//
//
 
// genpc_freeze_r
 
//
 
always @(posedge clk or posedge rst)
 
        if (rst)
 
                genpc_refetch_r <= #1 1'b0;
 
        else if (genpc_refetch)
 
                genpc_refetch_r <= #1 1'b1;
 
        else
 
                genpc_refetch_r <= #1 1'b0;
 
 
 
//
// Async calculation of new PC value. This value is used for addressing the IC.
// Async calculation of new PC value. This value is used for addressing the IC.
//
//
always @(pcreg or branch_addrofs or binsn_addr or flag or branch_op or except_type
always @(pcreg or branch_addrofs or binsn_addr or flag or branch_op or except_type
        or except_start or lr_restor or epcr or spr_pc_we or spr_dat_i or except_prefix) begin
        or except_start or lr_restor or epcr or spr_pc_we or spr_dat_i or except_prefix) begin
        casex ({spr_pc_we, except_start, branch_op})    // synopsys parallel_case
        casex ({spr_pc_we, except_start, branch_op})    // synopsys parallel_case
Line 277... Line 295...
// PC register
// PC register
//
//
always @(posedge clk or posedge rst)
always @(posedge clk or posedge rst)
        if (rst)
        if (rst)
//              pcreg <= #1 30'd63;
//              pcreg <= #1 30'd63;
                pcreg <= #1 ({`OR1200_EXCEPT_RESET, `OR1200_EXCEPT_VV} - 1) >> 2;
                pcreg <= #1 ({{4{except_prefix}}, `OR1200_EXCEPT_MMMM, `OR1200_EXCEPT_RESET, `OR1200_EXCEPT_VV} - 1) >> 2;
        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 (no_more_dslot | 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)
//      else if (except_start | !genpc_freeze & !icpu_rty_i & !genpc_refetch)
                pcreg <= #1 pc[31:2];
                pcreg <= #1 pc[31:2];

powered by: WebSVN 2.1.0

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