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

Subversion Repositories s1_core

[/] [s1_core/] [trunk/] [hdl/] [rtl/] [sparc_core/] [sparc_ifu_thrcmpl.v] - Diff between revs 105 and 113

Show entire file | Details | Blame | View Log

Rev 105 Rev 113
Line 16... Line 16...
// 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: sparc_ifu_thrcmpl
//  Module Name: sparc_ifu_thrcmpl
//  Description:
//  Description:
//  The thread completion block processes the completion signals fomr
//  The thread completion block processes the completion signals fomr
Line 33... Line 38...
   // Inputs
   // Inputs
   clk, se, si, reset, fcl_ifq_icmiss_s1, erb_dtu_ifeterr_d1,
   clk, se, si, reset, fcl_ifq_icmiss_s1, erb_dtu_ifeterr_d1,
   sw_cond_s, en_spec_g, atr_s, dtu_fcl_thr_active, ifq_dtu_thrrdy,
   sw_cond_s, en_spec_g, atr_s, dtu_fcl_thr_active, ifq_dtu_thrrdy,
   ifq_dtu_pred_rdy, exu_lop_done, branch_done_d, fixedop_done,
   ifq_dtu_pred_rdy, exu_lop_done, branch_done_d, fixedop_done,
   ldmiss, spec_ld_d, trap, retr_thr_wakeup, flush_wake_w2,
   ldmiss, spec_ld_d, trap, retr_thr_wakeup, flush_wake_w2,
   ldhit_thr, spec_ld_g, clear_wmo_e,wbm_spc_stall,wbm_spc_resume,wait_state, wm_stbwait, stb_retry,
   ldhit_thr, spec_ld_g, clear_wmo_e, wm_stbwait, stb_retry,
   rst_thread, trap_thrrdy, thr_s2, thr_e, thr_s1, fp_thrrdy,
   rst_thread, trap_thrrdy, thr_s2, thr_e, thr_s1, fp_thrrdy,
   lsu_ifu_ldst_cmplt, sta_done_e, killed_inst_done_e
   lsu_ifu_ldst_cmplt, sta_done_e, killed_inst_done_e
   );
   );
 
 
   input     clk, se, si, reset;
   input     clk, se, si, reset;
Line 61... Line 66...
                           retr_thr_wakeup,
                           retr_thr_wakeup,
                           flush_wake_w2,
                           flush_wake_w2,
                           ldhit_thr,
                           ldhit_thr,
                           spec_ld_g;
                           spec_ld_g;
 
 
   input       clear_wmo_e;input wbm_spc_stall;input wbm_spc_resume;output wait_state;wire wait_next;
   input       clear_wmo_e;
   input [3:0] wm_stbwait,
   input [3:0] wm_stbwait,
               stb_retry;
               stb_retry;
 
 
   input [3:0] rst_thread,
   input [3:0] rst_thread,
                           trap_thrrdy;
                           trap_thrrdy;
Line 124... Line 129...
   // -- may not be a valid assumption, since milhits could be faster
   // -- may not be a valid assumption, since milhits could be faster
 
 
//   assign  can_imiss = fcl_ifq_canthr;
//   assign  can_imiss = fcl_ifq_canthr;
                        // & (wm_imiss | ({4{fcl_ifq_icmiss_s1}} & thr_s1));
                        // & (wm_imiss | ({4{fcl_ifq_icmiss_s1}} & thr_s1));
 
 
   dffr #(4) wmi_ff(.din (wmi_nxt),
   dffr_s #(4) wmi_ff(.din (wmi_nxt),
                              .clk (clk),
                              .clk (clk),
                              .q   (wm_imiss),
                              .q   (wm_imiss),
                              .rst (reset),
                              .rst (reset),
                              .se  (se), .si(), .so());
                              .se  (se), `SIMPLY_RISC_SCANIN, .so());
 
 
   dffr #(4) wmo_ff(.din (wmo_nxt),
   dffr_s #(4) wmo_ff(.din (wmo_nxt),
                              .clk (clk),
                              .clk (clk),
                              .q   (wm_other),
                              .q   (wm_other),
                              .rst (reset),
                              .rst (reset),
                              .se  (se), .si(), .so());
                              .se  (se), `SIMPLY_RISC_SCANIN, .so());
 
 
   assign  wmi_nxt = ({4{fcl_ifq_icmiss_s1}} & thr_s1) | // set
   assign  wmi_nxt = ({4{fcl_ifq_icmiss_s1}} & thr_s1) | // set
                                   ({4{erb_dtu_ifeterr_d1}} & thr_e) |
                                   ({4{erb_dtu_ifeterr_d1}} & thr_e) |
                                           (wm_imiss & ~imiss_thrrdy);    // reset
                                           (wm_imiss & ~imiss_thrrdy);    // reset
 
 
Line 177... Line 182...
 
 
   // Imiss predicted ready
   // Imiss predicted ready
   assign pred_ifq_rdy = ifq_dtu_pred_rdy & {4{~atr_s}} & dtu_fcl_thr_active;
   assign pred_ifq_rdy = ifq_dtu_pred_rdy & {4{~atr_s}} & dtu_fcl_thr_active;
   assign imiss_thrrdy = pred_ifq_rdy | ifq_dtu_thrrdy;
   assign imiss_thrrdy = pred_ifq_rdy | ifq_dtu_thrrdy;
 
 
//   assign completion[0] = imiss_thrrdy & (~(wm_other | wm_stbwait) |
//   assign completion = imiss_thrrdy & (~(wm_other | wm_stbwait) |
//                                                                     other_thrrdy) |       //see C1
//                                                                     other_thrrdy) |       //see C1
//                                 other_thrrdy & (~(wm_imiss | wmi_nxt));
//                                 other_thrrdy & (~(wm_imiss | wmi_nxt));
 
 
//   assign completion[0] = (imiss_thrrdy & ~(wm_other | wm_stbwait) |
//   assign completion = (imiss_thrrdy & ~(wm_other | wm_stbwait) |
//                                  other_thrrdy & ~(wm_stbwait | wm_imiss) |
//                                  other_thrrdy & ~(wm_stbwait | wm_imiss) |
//                        stb_retry & ~(wm_other | wm_imiss) |
//                        stb_retry & ~(wm_other | wm_imiss) |
//                        imiss_thrrdy & other_thrrdy & ~wm_stbwait |
//                        imiss_thrrdy & other_thrrdy & ~wm_stbwait |
//                        imiss_thrrdy & stb_retry & ~wm_other |
//                        imiss_thrrdy & stb_retry & ~wm_other |
//                        stb_retry & other_thrrdy & ~wm_imiss);
//                        stb_retry & other_thrrdy & ~wm_imiss);
 
 
   assign completion[0] = ((imiss_thrrdy | ~wm_imiss) &
   assign completion = ((imiss_thrrdy | ~wm_imiss) &
                        (other_thrrdy | ~wm_other) &
                        (other_thrrdy | ~wm_other) &
                        (stb_retry | ~wm_stbwait) &
                        (stb_retry | ~wm_stbwait) &
                        (wm_imiss | wm_other | wm_stbwait|wait_state));
                        (wm_imiss | wm_other | wm_stbwait));
 
 
   // C1: should we do ~(wm_other | wmo_nxt)??
   // C1: should we do ~(wm_other | wmo_nxt)??
   // When an imiss is pending, we cannot be doing another fetch, so I
   // When an imiss is pending, we cannot be doing another fetch, so I
   // don't think so.  It seems nice and symmetric to put it in
   // don't think so.  It seems nice and symmetric to put it in
   // though, unfortunately this results in a timing problem on swc_s 
   // though, unfortunately this results in a timing problem on swc_s 
   // and trap
   // and trap
 
 
assign wait_next=wbm_spc_stall|(wait_state & ~wbm_spc_resume);
 
dffr wait_ff(.din(wait_next),.q(wait_state),.clk(clk),.rst(reset),.se(se),.si(),.so());
 
assign completion[1]=completion[0];
 
assign completion[2]=completion[0];
 
assign completion[3]=completion[0];
 
endmodule // sparc_ifu_thrcmpl
endmodule // sparc_ifu_thrcmpl
 
 
 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.