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

Subversion Repositories s1_core

[/] [s1_core/] [trunk/] [hdl/] [rtl/] [sparc_core/] [lsu_dctl.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)
 
`define SIMPLY_RISC_SCANOUT .so(0)
 
`else
 
`define SIMPLY_RISC_SCANIN .si()
 
`define SIMPLY_RISC_SCANOUT .so()
 
`endif
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
/*
/*
//  Description:  LSU Data Cache Control and Minor Datapath
//  Description:  LSU Data Cache Control and Minor Datapath
//      - Tag Comparison - hit/miss.
//      - Tag Comparison - hit/miss.
*/
*/
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// Global header file includes
// Global header file includes
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// system level definition file which contains the /*
`include  "sys.h" // system level definition file which contains the 
/* ========== Copyright Header Begin ==========================================
 
*
 
* OpenSPARC T1 Processor File: sys.h
 
* Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
 
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
 
*
 
* The above named program is free software; you can redistribute it and/or
 
* modify it under the terms of the GNU General Public
 
* License version 2 as published by the Free Software Foundation.
 
*
 
* The above named program is distributed in the hope that it will be
 
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
 
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
* General Public License for more details.
 
*
 
* You should have received a copy of the GNU General Public
 
* License along with this work; if not, write to the Free Software
 
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
*
 
* ========== Copyright Header End ============================================
 
*/
 
// -*- verilog -*-
 
////////////////////////////////////////////////////////////////////////
 
/*
 
//
 
// Description:         Global header file that contain definitions that
 
//                      are common/shared at the systme level
 
*/
 
////////////////////////////////////////////////////////////////////////
 
//
 
// Setting the time scale
 
// If the timescale changes, JP_TIMESCALE may also have to change.
 
`timescale      1ps/1ps
 
 
 
//
 
// JBUS clock
 
// =========
 
//
 
 
 
 
 
 
 
// Afara Link Defines
 
// ==================
 
 
 
// Reliable Link
 
 
 
 
 
 
 
 
 
// Afara Link Objects
 
 
 
 
 
// Afara Link Object Format - Reliable Link
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
// Afara Link Object Format - Congestion
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
// Afara Link Object Format - Acknowledge
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
// Afara Link Object Format - Request
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
// Afara Link Object Format - Message
 
 
 
 
 
 
 
// Acknowledge Types
 
 
 
 
 
 
 
 
 
// Request Types
 
 
 
 
 
 
 
 
 
 
 
// Afara Link Frame
 
 
 
 
 
 
 
//
 
// UCB Packet Type
 
// ===============
 
//
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
//
 
// UCB Data Packet Format
 
// ======================
 
//
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
// Size encoding for the UCB_SIZE_HI/LO field
 
// 000 - byte
 
// 001 - half-word
 
// 010 - word
 
// 011 - double-word
 
// 111 - quad-word
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
//
 
// UCB Interrupt Packet Format
 
// ===========================
 
//
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
//`define UCB_THR_HI             9      // (6) cpu/thread ID shared with
 
//`define UCB_THR_LO             4             data packet format
 
//`define UCB_PKT_HI             3      // (4) packet type shared with
 
//`define UCB_PKT_LO             0      //     data packet format
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
//
 
// FCRAM Bus Widths
 
// ================
 
//
 
 
 
 
 
 
 
 
 
 
 
 
 
//
 
// ENET clock periods
 
// ==================
 
//
 
 
 
 
 
 
 
 
 
//
 
// JBus Bridge defines
 
// =================
 
//
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
//
 
// PCI Device Address Configuration
 
// ================================
 
//
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
          // time scale definition
          // time scale definition
 
 
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// Local header file includes / local defines
// Local header file includes / local defines
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/*
`include  "lsu.h"
/* ========== Copyright Header Begin ==========================================
 
*
 
* OpenSPARC T1 Processor File: lsu.h
 
* Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
 
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
 
*
 
* The above named program is free software; you can redistribute it and/or
 
* modify it under the terms of the GNU General Public
 
* License version 2 as published by the Free Software Foundation.
 
*
 
* The above named program is distributed in the hope that it will be
 
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
 
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
* General Public License for more details.
 
*
 
* You should have received a copy of the GNU General Public
 
* License along with this work; if not, write to the Free Software
 
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
*
 
* ========== Copyright Header End ============================================
 
*/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
//`define STB_PCX_WY_HI   107
 
//`define STB_PCX_WY_LO   106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
// TLB Tag and Data Format
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
// I-TLB version - lsu_tlb only.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
// Invalidate Format
 
//addr<5:4>=00
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
//addr<5:4>=01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
//addr<5:4>=10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
//addr<5:4>=11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
// cpuid - 4b
 
 
 
 
 
 
 
// CPUany, addr<5:4>=00,10
 
 
 
 
 
 
 
 
 
 
 
// CPUany, addr<5:4>=01,11
 
 
 
 
 
 
 
 
 
// CPUany, addr<5:4>=01,11
 
 
 
 
 
 
 
 
 
// DTAG parity error Invalidate
 
 
 
 
 
 
 
 
 
// CPX BINIT STORE
 
 
 
 
 
module lsu_dctl ( /*AUTOARG*/
module lsu_dctl ( /*AUTOARG*/
   // Outputs
   // Outputs
   lsu_tlu_nucleus_ctxt_m, lsu_quad_word_access_g, so, dctl_rst_l,
   lsu_tlu_nucleus_ctxt_m, lsu_quad_word_access_g, so, dctl_rst_l,
   lsu_tlu_wsr_inst_e, lsu_l2fill_fpld_e, dva_vld_m_bf,
   lsu_tlu_wsr_inst_e, lsu_l2fill_fpld_e, dva_vld_m_bf,
Line 1000... Line 429...
output      lsu_ld_miss_wb ;  // load misses in d$.
output      lsu_ld_miss_wb ;  // load misses in d$.
//output      lsu_ld_hit_wb ;   // load hits in d$.
//output      lsu_ld_hit_wb ;   // load hits in d$.
 
 
output      lsu_dtlb_bypass_e ; // dtlb is bypassed
output      lsu_dtlb_bypass_e ; // dtlb is bypassed
 
 
output [65-1:40] ld_pcx_pkt_g ;    // ld miss pkt for thread.
output [`LMQ_WIDTH-1:40] ld_pcx_pkt_g ;    // ld miss pkt for thread.
output      tlb_ldst_cam_vld ;
output      tlb_ldst_cam_vld ;
 
 
 
 
//output      stxa_internal ;   // internal stxa, stg g 
//output      stxa_internal ;   // internal stxa, stg g 
output      ldxa_internal ;   // internal ldxa, stg g
output      ldxa_internal ;   // internal ldxa, stg g
Line 1805... Line 1234...
wire  [3:0]  pend_atm_ld_ue ;
wire  [3:0]  pend_atm_ld_ue ;
 
 
wire [2:0]   lsu_byp_misc_addr_m ;   // lower 3bits of addr for ldxa/raw etc
wire [2:0]   lsu_byp_misc_addr_m ;   // lower 3bits of addr for ldxa/raw etc
wire [1:0]   lsu_byp_misc_sz_m ;     // size for ldxa/raw etc
wire [1:0]   lsu_byp_misc_sz_m ;     // size for ldxa/raw etc
 
 
 
`ifdef SIMPLY_RISC_TWEAKS
 
wire pref_inst_m;
 
wire pref_inst_g;
 
wire ldstub_m;
 
wire swap_m;
 
wire ldstub_g;
 
wire swap_g;
 
`endif
 
 
//==========================================================
//==========================================================
//RESET, CLK
//RESET, CLK
//==========================================================     
//==========================================================     
   wire       reset;
   wire       reset;
 
 
Line 1816... Line 1254...
   wire       dbb_reset_l;
   wire       dbb_reset_l;
   wire       clk;
   wire       clk;
 
 
    dffrl_async rstff(.din (grst_l),
    dffrl_async rstff(.din (grst_l),
                        .q   (dbb_reset_l),
                        .q   (dbb_reset_l),
                        .clk (clk), .se(se), .si(), .so(),
                        .clk (clk), .se(se), `SIMPLY_RISC_SCANIN, .so(),
                        .rst_l (arst_l));
                        .rst_l (arst_l));
 
 
   assign  reset  =  ~dbb_reset_l;
   assign  reset  =  ~dbb_reset_l;
   assign dctl_rst_l = dbb_reset_l;
   assign dctl_rst_l = dbb_reset_l;
   assign clk = rclk;
   assign clk = rclk;
 
 
wire      lsu_bist_wvld_e ;           // bist writes to cache
wire      lsu_bist_wvld_e ;           // bist writes to cache
wire            lsu_bist_rvld_e ;                 // bist reads dcache
wire            lsu_bist_rvld_e ;                 // bist reads dcache
 
 
dff #(2) mbist_stge (
dff_s #(2) mbist_stge (
   .din ({mbist_dcache_write, mbist_dcache_read}),
   .din ({mbist_dcache_write, mbist_dcache_read}),
   .q   ({lsu_bist_wvld_e,    lsu_bist_rvld_e  }),
   .q   ({lsu_bist_wvld_e,    lsu_bist_rvld_e  }),
   .clk (clk),
   .clk (clk),
   .se  (se),       .si (),          .so ()
   .se  (se),       `SIMPLY_RISC_SCANIN,          .so ()
);
);
 
 
//===========================================================
//===========================================================
//from lsu_excpctl
//from lsu_excpctl
//wire          lsu_flush_pipe_w ;      // flush - local to lsu
//wire          lsu_flush_pipe_w ;      // flush - local to lsu
Line 1847... Line 1285...
 
 
//wire    lsu_l2fill_bendian_g;
//wire    lsu_l2fill_bendian_g;
 
 
wire memref_e;
wire memref_e;
 
 
dff #(1) stge_ad_e (
dff_s #(1) stge_ad_e (
  .din (ifu_lsu_memref_d),
  .din (ifu_lsu_memref_d),
  .q   (memref_e),
  .q   (memref_e),
  .clk (clk),
  .clk (clk),
  .se     (se),       .si (),          .so ()
  .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
);
);
 
 
//=================================================================================================
//=================================================================================================
// SHADOW SCAN
// SHADOW SCAN
//=================================================================================================
//=================================================================================================
Line 1875... Line 1313...
                ctu_sscan_tid[1] & (tlb_ld_inst1 | tlb_st_inst1) |
                ctu_sscan_tid[1] & (tlb_ld_inst1 | tlb_st_inst1) |
                        ctu_sscan_tid[2] & (tlb_ld_inst2 | tlb_st_inst2) |
                        ctu_sscan_tid[2] & (tlb_ld_inst2 | tlb_st_inst2) |
                ctu_sscan_tid[3] & (tlb_ld_inst3 | tlb_st_inst3) ;
                ctu_sscan_tid[3] & (tlb_ld_inst3 | tlb_st_inst3) ;
 
 
 
 
dff #(2) stg_d1 (
dff_s #(2) stg_d1 (
  .din ({sscan_data_14,sscan_data_13}),
  .din ({sscan_data_14,sscan_data_13}),
  .q   (lsu_sscan_data[14:13]),
  .q   (lsu_sscan_data[14:13]),
  .clk (clk),
  .clk (clk),
  .se     (se),       .si (),          .so ()
  .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
);
);
 
 
//=========================================================================================
//=========================================================================================
//  INST_VLD_W GENERATION
//  INST_VLD_W GENERATION
//=========================================================================================
//=========================================================================================
Line 1892... Line 1330...
wire    lsu_inst_vld_w ;
wire    lsu_inst_vld_w ;
assign  flush_w_inst_vld_m =
assign  flush_w_inst_vld_m =
        ifu_tlu_inst_vld_m &
        ifu_tlu_inst_vld_m &
        ~(dctl_flush_pipe_w & (thrid_m[1:0] == thrid_g[1:0])) ; // really lsu_flush_pipe_w
        ~(dctl_flush_pipe_w & (thrid_m[1:0] == thrid_g[1:0])) ; // really lsu_flush_pipe_w
 
 
dff  stgw_ivld (
dff_s  stgw_ivld (
        .din    (flush_w_inst_vld_m),
        .din    (flush_w_inst_vld_m),
        .q      (lsu_inst_vld_w),
        .q      (lsu_inst_vld_w),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
// Specifically for qctl2. Does not include flush-pipe, but does include ifu's flush.
// Specifically for qctl2. Does not include flush-pipe, but does include ifu's flush.
wire    ld_vld ;
wire    ld_vld ;
 
 
   wire ifu_lsu_flush_w;
   wire ifu_lsu_flush_w;
 
 
   wire ifu_tlu_flush_fd_w_q, ifu_tlu_flush_fd2_w_q, ifu_tlu_flush_fd3_w_q;
   wire ifu_tlu_flush_fd_w_q, ifu_tlu_flush_fd2_w_q, ifu_tlu_flush_fd3_w_q;
 
 
dff #(4) ifu_tlu_flush_stgw (
dff_s #(4) ifu_tlu_flush_stgw (
        .din    ({ifu_tlu_flush_m,ifu_tlu_flush_m,     ifu_tlu_flush_m,      ifu_tlu_flush_m}     ),
        .din    ({ifu_tlu_flush_m,ifu_tlu_flush_m,     ifu_tlu_flush_m,      ifu_tlu_flush_m}     ),
        .q      ({ifu_lsu_flush_w,ifu_tlu_flush_fd_w_q,ifu_tlu_flush_fd2_w_q,ifu_tlu_flush_fd3_w_q}),
        .q      ({ifu_lsu_flush_w,ifu_tlu_flush_fd_w_q,ifu_tlu_flush_fd2_w_q,ifu_tlu_flush_fd3_w_q}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
bw_u1_buf_30x UZfix_ifu_tlu_flush_fd_w  ( .a(ifu_tlu_flush_fd_w_q),  .z(ifu_tlu_flush_fd_w)  );
bw_u1_buf_30x UZfix_ifu_tlu_flush_fd_w  ( .a(ifu_tlu_flush_fd_w_q),  .z(ifu_tlu_flush_fd_w)  );
bw_u1_buf_30x UZfix_ifu_tlu_flush_fd2_w ( .a(ifu_tlu_flush_fd2_w_q), .z(ifu_tlu_flush_fd2_w) );
bw_u1_buf_30x UZfix_ifu_tlu_flush_fd2_w ( .a(ifu_tlu_flush_fd2_w_q), .z(ifu_tlu_flush_fd2_w) );
bw_u1_buf_30x UZfix_ifu_tlu_flush_fd3_w ( .a(ifu_tlu_flush_fd3_w_q), .z(ifu_tlu_flush_fd3_w) );
bw_u1_buf_30x UZfix_ifu_tlu_flush_fd3_w ( .a(ifu_tlu_flush_fd3_w_q), .z(ifu_tlu_flush_fd3_w) );
Line 1931... Line 1369...
//=========================================================================================
//=========================================================================================
//  TLB Control 
//  TLB Control 
//=========================================================================================
//=========================================================================================
 
 
wire    alt_space_e ;
wire    alt_space_e ;
dff #(1) aspace_e (
dff_s #(1) aspace_e (
        .din    (ifu_lsu_alt_space_d),
        .din    (ifu_lsu_alt_space_d),
        .q      (alt_space_e),
        .q      (alt_space_e),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//Atomics require translation.
//Atomics require translation.
assign tlb_ldst_cam_vld =
assign tlb_ldst_cam_vld =
  memref_e &
  memref_e &
Line 1979... Line 1417...
      //(thread3_e & memref_e) ;
      //(thread3_e & memref_e) ;
 
 
assign  altspace_ldst_e   = memref_e &  alt_space_e ;
assign  altspace_ldst_e   = memref_e &  alt_space_e ;
assign  non_altspace_ldst_e = memref_e & ~alt_space_e ;
assign  non_altspace_ldst_e = memref_e & ~alt_space_e ;
 
 
dff #(2) aspace_stgm (
dff_s #(2) aspace_stgm (
        .din    ({altspace_ldst_e,non_altspace_ldst_e}),
        .din    ({altspace_ldst_e,non_altspace_ldst_e}),
        .q      ({altspace_ldst_m,non_altspace_ldst_m}),
        .q      ({altspace_ldst_m,non_altspace_ldst_m}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(2) aspace_stgg (
dff_s #(2) aspace_stgg (
        .din    ({altspace_ldst_m,non_altspace_ldst_m}),
        .din    ({altspace_ldst_m,non_altspace_ldst_m}),
        .q      ({altspace_ldst_g,non_altspace_ldst_g}),
        .q      ({altspace_ldst_g,non_altspace_ldst_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    [3:0]    tl_zero_d1 ;
wire    [3:0]    tl_zero_d1 ;
dff #(4) tlz_stgd1 (
dff_s #(4) tlz_stgd1 (
        .din    (tlu_lsu_tl_zero[3:0]),
        .din    (tlu_lsu_tl_zero[3:0]),
        .q      (tl_zero_d1[3:0]),
        .q      (tl_zero_d1[3:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
mux4ds  #(1) trap_level_zero_mux (
mux4ds  #(1) trap_level_zero_mux (
        .in0    (tl_zero_d1[0]),
        .in0    (tl_zero_d1[0]),
        .in1    (tl_zero_d1[1]),
        .in1    (tl_zero_d1[1]),
Line 2014... Line 1452...
        .sel3   (thread3_e),
        .sel3   (thread3_e),
        .dout   (thread_tl_zero)
        .dout   (thread_tl_zero)
);
);
 
 
wire    thread_tl_zero_m ;
wire    thread_tl_zero_m ;
dff #(1) ttlz_stgm (
dff_s #(1) ttlz_stgm (
        .din    (thread_tl_zero),
        .din    (thread_tl_zero),
        .q      (thread_tl_zero_m),
        .q      (thread_tl_zero_m),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
assign  lsu_nonalt_nucl_access_m = non_altspace_ldst_m & ~thread_tl_zero_m ;
assign  lsu_nonalt_nucl_access_m = non_altspace_ldst_m & ~thread_tl_zero_m ;
 
 
Line 2043... Line 1481...
//tmp
//tmp
   wire thread_default;
   wire thread_default;
   assign thread_default = ~(thread_pctxt | thread_sctxt | thread_actxt);
   assign thread_default = ~(thread_pctxt | thread_sctxt | thread_actxt);
 
 
wire    [3:0]    pstate_am ;
wire    [3:0]    pstate_am ;
dff #(4) psam_stgd1 (
dff_s #(4) psam_stgd1 (
        .din    (tlu_lsu_pstate_am[3:0]),
        .din    (tlu_lsu_pstate_am[3:0]),
        .q      (pstate_am[3:0]),
        .q      (pstate_am[3:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//assign  lsu_dtlb_addr_mask_l_e = 
//assign  lsu_dtlb_addr_mask_l_e = 
//  thread0_e ? ~pstate_am[0] :
//  thread0_e ? ~pstate_am[0] :
//    thread1_e ? ~pstate_am[1] :
//    thread1_e ? ~pstate_am[1] :
Line 2084... Line 1522...
assign  admp_write = lsu_dtlb_dmp_vld_e & tlb_demap_actxt ;
assign  admp_write = lsu_dtlb_dmp_vld_e & tlb_demap_actxt ;
wire admp_rst ;
wire admp_rst ;
assign  admp_rst = reset | lsu_dtlb_wr_vld_e ;
assign  admp_rst = reset | lsu_dtlb_wr_vld_e ;
 
 
wire    local_dtlb_wr_vld_g ;
wire    local_dtlb_wr_vld_g ;
dffre #(1) twr_stgd1 (
dffre_s #(1) twr_stgd1 (
        .din    (admp_write),
        .din    (admp_write),
        .q      (local_dtlb_wr_vld_g),
        .q      (local_dtlb_wr_vld_g),
        .clk    (clk),
        .clk    (clk),
        .en     (admp_write),   .rst    (admp_rst),
        .en     (admp_write),   .rst    (admp_rst),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
wire    dtlb_wr_init_d1,dtlb_wr_init_d2,dtlb_wr_init_d3 ;
wire    dtlb_wr_init_d1,dtlb_wr_init_d2,dtlb_wr_init_d3 ;
// Handshake between tlu and lsu needs to be fine-tuned !!!
// Handshake between tlu and lsu needs to be fine-tuned !!!
Line 2115... Line 1553...
 
 
assign  tlb_demap_vld = lsu_dtlb_dmp_vld_e ;
assign  tlb_demap_vld = lsu_dtlb_dmp_vld_e ;
 
 
// Switchout for threads. Force threads to swo if tlb operation does not occur for over 5 cycles.
// Switchout for threads. Force threads to swo if tlb operation does not occur for over 5 cycles.
 
 
dff #(5) tlbop_stgd1 (
dff_s #(5) tlbop_stgd1 (
        //.din    ({tlu_dtlb_wr_vld_g,tlu_dtlb_tag_rd_g,tlu_dtlb_data_rd_g,tlu_dtlb_dmp_vld_g,
        //.din    ({tlu_dtlb_wr_vld_g,tlu_dtlb_tag_rd_g,tlu_dtlb_data_rd_g,tlu_dtlb_dmp_vld_g,
        .din    ({local_dtlb_wr_vld_g,tlu_dtlb_tag_rd_g,tlu_dtlb_data_rd_g,tlu_dtlb_dmp_vld_g,
        .din    ({local_dtlb_wr_vld_g,tlu_dtlb_tag_rd_g,tlu_dtlb_data_rd_g,tlu_dtlb_dmp_vld_g,
    tlu_dtlb_invalidate_all_g}),
    tlu_dtlb_invalidate_all_g}),
        .q      ({dtlb_wr_vld_d1,dtlb_tag_rd_d1,dtlb_data_rd_d1,dtlb_dmp_vld_d1,
        .q      ({dtlb_wr_vld_d1,dtlb_tag_rd_d1,dtlb_data_rd_d1,dtlb_dmp_vld_d1,
    dtlb_inv_all_d1}),
    dtlb_inv_all_d1}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// Detect event.
// Detect event.
//bug6193 / ECO bug6511   
//bug6193 / ECO bug6511   
assign  ldst_in_pipe = memref_e ;
assign  ldst_in_pipe = memref_e ;
Line 2135... Line 1573...
  (~dtlb_tag_rd_d1  & tlu_dtlb_tag_rd_g)   |
  (~dtlb_tag_rd_d1  & tlu_dtlb_tag_rd_g)   |
  (~dtlb_data_rd_d1 & tlu_dtlb_data_rd_g) |
  (~dtlb_data_rd_d1 & tlu_dtlb_data_rd_g) |
  (~dtlb_inv_all_d1 & tlu_dtlb_invalidate_all_g) |
  (~dtlb_inv_all_d1 & tlu_dtlb_invalidate_all_g) |
  (~dtlb_dmp_vld_d1 & tlu_dtlb_dmp_vld_g)) & ldst_in_pipe ;
  (~dtlb_dmp_vld_d1 & tlu_dtlb_dmp_vld_g)) & ldst_in_pipe ;
 
 
dff #(1) tlbinit_stgd1 ( .din    (tlbop_init), .q      (tlbop_init_d1),
dff_s #(1) tlbinit_stgd1 ( .din    (tlbop_init), .q      (tlbop_init_d1),
        .clk    (clk), .se     (se),       .si (),          .so ());
        .clk    (clk), .se     (se),       `SIMPLY_RISC_SCANIN,          .so ());
dff #(1) tlbinit_stgd2 ( .din    (tlbop_init_d1 &  ldst_in_pipe), .q      (tlbop_init_d2),
dff_s #(1) tlbinit_stgd2 ( .din    (tlbop_init_d1 &  ldst_in_pipe), .q      (tlbop_init_d2),
        .clk    (clk), .se     (se),       .si (),          .so ());
        .clk    (clk), .se     (se),       `SIMPLY_RISC_SCANIN,          .so ());
dff #(1) tlbinit_stgd3 ( .din    (tlbop_init_d2 &  ldst_in_pipe), .q      (tlbop_init_d3),
dff_s #(1) tlbinit_stgd3 ( .din    (tlbop_init_d2 &  ldst_in_pipe), .q      (tlbop_init_d3),
        .clk    (clk), .se     (se),       .si (),          .so ());
        .clk    (clk), .se     (se),       `SIMPLY_RISC_SCANIN,          .so ());
dff #(1) tlbinit_stgd4 ( .din    (tlbop_init_d3 &  ldst_in_pipe), .q      (tlbop_init_d4),
dff_s #(1) tlbinit_stgd4 ( .din    (tlbop_init_d3 &  ldst_in_pipe), .q      (tlbop_init_d4),
        .clk    (clk), .se     (se),       .si (),          .so ());
        .clk    (clk), .se     (se),       `SIMPLY_RISC_SCANIN,          .so ());
dff #(1) tlbinit_stgd5 ( .din    (tlbop_init_d4 &  ldst_in_pipe), .q      (tlbop_init_d5),
dff_s #(1) tlbinit_stgd5 ( .din    (tlbop_init_d4 &  ldst_in_pipe), .q      (tlbop_init_d5),
        .clk    (clk), .se     (se),       .si (),          .so ());
        .clk    (clk), .se     (se),       `SIMPLY_RISC_SCANIN,          .so ());
 
 
 
 
assign  lsu_tlbop_force_swo = tlbop_init_d5 & ldst_in_pipe ;
assign  lsu_tlbop_force_swo = tlbop_init_d5 & ldst_in_pipe ;
 
 
//assign  dtlb_done =   lsu_dtlb_wr_vld_e  | lsu_dtlb_tag_rd_e | 
//assign  dtlb_done =   lsu_dtlb_wr_vld_e  | lsu_dtlb_tag_rd_e | 
assign  dtlb_done =     lsu_dtlb_tag_rd_e | lsu_dtlb_data_rd_e |
assign  dtlb_done =     lsu_dtlb_tag_rd_e | lsu_dtlb_data_rd_e |
                        lsu_dtlb_dmp_vld_e | dtlb_inv_all_e ;
                        lsu_dtlb_dmp_vld_e | dtlb_inv_all_e ;
 
 
assign  dtlb_inv_all_e = tlu_dtlb_invalidate_all_g & ~(memref_e | dtlb_done_d1 | dtlb_done_d2) ;
assign  dtlb_inv_all_e = tlu_dtlb_invalidate_all_g & ~(memref_e | dtlb_done_d1 | dtlb_done_d2) ;
 
 
dff #(3) dn_stgd1 (
dff_s #(3) dn_stgd1 (
        .din    ({dtlb_done,lsu_dtlb_tag_rd_e,lsu_dtlb_data_rd_e}),
        .din    ({dtlb_done,lsu_dtlb_tag_rd_e,lsu_dtlb_data_rd_e}),
        .q      ({dtlb_done_d1,tag_rd_vld_m,data_rd_vld_m}),
        .q      ({dtlb_done_d1,tag_rd_vld_m,data_rd_vld_m}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    dtlb_inv_all_din ;
wire    dtlb_inv_all_din ;
assign  dtlb_inv_all_din = sehold ? dtlb_inv_all_m : dtlb_inv_all_e ;
assign  dtlb_inv_all_din = sehold ? dtlb_inv_all_m : dtlb_inv_all_e ;
 
 
dff #(1) dinv_stgd1 (
dff_s #(1) dinv_stgd1 (
        .din    (dtlb_inv_all_din),
        .din    (dtlb_inv_all_din),
        .q      (dtlb_inv_all_m),
        .q      (dtlb_inv_all_m),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  lsu_dtlb_invalid_all_m = dtlb_inv_all_m ;
assign  lsu_dtlb_invalid_all_m = dtlb_inv_all_m ;
// added by sureshT
// added by sureshT
assign  lsu_dtlb_invalid_all_l_m = ~lsu_dtlb_invalid_all_m;
assign  lsu_dtlb_invalid_all_l_m = ~lsu_dtlb_invalid_all_m;
 
 
dff #(3) dn_stgd2 (
dff_s #(3) dn_stgd2 (
        .din    ({dtlb_done_d1,tag_rd_vld_m,data_rd_vld_m}),
        .din    ({dtlb_done_d1,tag_rd_vld_m,data_rd_vld_m}),
        .q      ({dtlb_done_d2,tag_rd_vld_g,data_rd_vld_g}),
        .q      ({dtlb_done_d2,tag_rd_vld_g,data_rd_vld_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  lsu_tlb_data_rd_vld_g = data_rd_vld_g ;
assign  lsu_tlb_data_rd_vld_g = data_rd_vld_g ;
assign  lsu_tlb_tag_rd_vld_g  = tag_rd_vld_g ;
assign  lsu_tlb_tag_rd_vld_g  = tag_rd_vld_g ;
//assign  lsu_tlb_st_vld_g = ~lsu_tlb_tag_rd_vld_g & ~lsu_tlb_data_rd_vld_g ;
//assign  lsu_tlb_st_vld_g = ~lsu_tlb_tag_rd_vld_g & ~lsu_tlb_data_rd_vld_g ;
Line 2200... Line 1638...
 
 
//=========================================================================================
//=========================================================================================
//  State/ASI Registers.
//  State/ASI Registers.
//=========================================================================================
//=========================================================================================
 
 
dff #(8) stctl_stg_e (
dff_s #(8) stctl_stg_e (
        .din    ({ifu_tlu_sraddr_d[6:0],ifu_tlu_wsr_inst_d}),
        .din    ({ifu_tlu_sraddr_d[6:0],ifu_tlu_wsr_inst_d}),
        .q      ({lsu_sraddr_e[6:0],    lsu_wsr_inst_e}),
        .q      ({lsu_sraddr_e[6:0],    lsu_wsr_inst_e}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign lsu_tlu_wsr_inst_e = lsu_wsr_inst_e;
assign lsu_tlu_wsr_inst_e = lsu_wsr_inst_e;
 
 
   wire asi_state_wr_en_e, asi_state_wr_en_m;
   wire asi_state_wr_en_e, asi_state_wr_en_m;
Line 2219... Line 1657...
        ~lsu_sraddr_e[4] & ~lsu_sraddr_e[3] &
        ~lsu_sraddr_e[4] & ~lsu_sraddr_e[3] &
        ~lsu_sraddr_e[2] &  lsu_sraddr_e[1] &
        ~lsu_sraddr_e[2] &  lsu_sraddr_e[1] &
         lsu_sraddr_e[0] &
         lsu_sraddr_e[0] &
         lsu_wsr_inst_e ; // write
         lsu_wsr_inst_e ; // write
 
 
dff #(2) stctl_stg_m (
dff_s #(2) stctl_stg_m (
        .din    ({asi_state_wr_en_e, alt_space_e}),
        .din    ({asi_state_wr_en_e, alt_space_e}),
        .q      ({asi_state_wr_en_m, lsu_alt_space_m}),
        .q      ({asi_state_wr_en_m, lsu_alt_space_m}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(2) stctl_stg_w (
dff_s #(2) stctl_stg_w (
        .din    ({asi_state_wr_en_m, lsu_alt_space_m}),
        .din    ({asi_state_wr_en_m, lsu_alt_space_m}),
        .q      ({asi_state_wr_en,   lsu_alt_space_g}),
        .q      ({asi_state_wr_en,   lsu_alt_space_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//assign  asi_state_wr_en =   
//assign  asi_state_wr_en =   
//      ~lsu_sraddr_w[6] &  // 1=hypervisor
//      ~lsu_sraddr_w[6] &  // 1=hypervisor
//      ~lsu_sraddr_w[5] &  // =0 for state reg. 
//      ~lsu_sraddr_w[5] &  // =0 for state reg. 
Line 2242... Line 1680...
//        ~lsu_sraddr_w[2] &  lsu_sraddr_w[1] & 
//        ~lsu_sraddr_w[2] &  lsu_sraddr_w[1] & 
//         lsu_sraddr_w[0] &  
//         lsu_sraddr_w[0] &  
//         lsu_wsr_inst_w ; // write
//         lsu_wsr_inst_w ; // write
 
 
 
 
dff #(3) asi_stgw (
dff_s #(3) asi_stgw (
        .din    ({tlu_lsu_asi_update_m,tlu_lsu_tid_m[1:0]}),
        .din    ({tlu_lsu_asi_update_m,tlu_lsu_tid_m[1:0]}),
        .q      ({tlu_lsu_asi_update_g,tlu_lsu_tid_g[1:0]}),
        .q      ({tlu_lsu_asi_update_g,tlu_lsu_tid_g[1:0]}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
assign  tsa_update_asi0 =  ~tlu_lsu_tid_g[1] & ~tlu_lsu_tid_g[0] & tlu_lsu_asi_update_g ;
assign  tsa_update_asi0 =  ~tlu_lsu_tid_g[1] & ~tlu_lsu_tid_g[0] & tlu_lsu_asi_update_g ;
assign  tsa_update_asi1 =  ~tlu_lsu_tid_g[1] &  tlu_lsu_tid_g[0] & tlu_lsu_asi_update_g ;
assign  tsa_update_asi1 =  ~tlu_lsu_tid_g[1] &  tlu_lsu_tid_g[0] & tlu_lsu_asi_update_g ;
Line 2279... Line 1717...
// qualification must be removed.
// qualification must be removed.
assign  lsu_ifu_ldsta_internal_e = asi_internal_e ;
assign  lsu_ifu_ldsta_internal_e = asi_internal_e ;
//assign  lsu_ifu_ldsta_internal_e = asi_internal_e & ~ld_inst_vld_e  ;
//assign  lsu_ifu_ldsta_internal_e = asi_internal_e & ~ld_inst_vld_e  ;
 
 
 
 
dff #(2)  stai_stgm (
dff_s #(2)  stai_stgm (
        .din    ({sta_internal_e,lda_internal_e}),
        .din    ({sta_internal_e,lda_internal_e}),
        .q      ({sta_internal_m,lda_internal_m}),
        .q      ({sta_internal_m,lda_internal_m}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
   wire stxa_internal_m;
   wire stxa_internal_m;
   assign stxa_internal_m = sta_internal_m & ~(dtagv_diagnstc_asi_m | dc_diagnstc_asi_m);
   assign stxa_internal_m = sta_internal_m & ~(dtagv_diagnstc_asi_m | dc_diagnstc_asi_m);
 
 
dff #(2)  stai_stgg (
dff_s #(2)  stai_stgg (
        .din    ({stxa_internal_m, lda_internal_m}),
        .din    ({stxa_internal_m, lda_internal_m}),
        .q      ({stxa_internal,   ldxa_internal}),
        .q      ({stxa_internal,   ldxa_internal}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
   wire [7:0] ldst_va_g;
   wire [7:0] ldst_va_g;
 
 
   assign ldst_va_g[7:0] = lsu_ldst_va_g[7:0];
   assign ldst_va_g[7:0] = lsu_ldst_va_g[7:0];
 
 
   wire [7:0]    lsu_asi_state ;
   wire [7:0]    lsu_asi_state ;
dff #(8)  asistate_stgg (
dff_s #(8)  asistate_stgg (
        .din    (lsu_dctl_asi_state_m[7:0]),
        .din    (lsu_dctl_asi_state_m[7:0]),
        .q      (lsu_asi_state[7:0]),
        .q      (lsu_asi_state[7:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  pctxt_va_vld = (ldst_va_g[7:0] == 8'h08) ;
assign  pctxt_va_vld = (ldst_va_g[7:0] == 8'h08) ;
assign  pctxt_state_en =  (lsu_asi_state[7:0] == 8'h21) & pctxt_va_vld &
assign  pctxt_state_en =  (lsu_asi_state[7:0] == 8'h21) & pctxt_va_vld &
        lsu_alt_space_g & lsu_inst_vld_w ;
        lsu_alt_space_g & lsu_inst_vld_w ;
Line 2382... Line 1820...
wire    [3:0]    redmode_rst ;
wire    [3:0]    redmode_rst ;
//dff #(4) rdmode_stgd1 (
//dff #(4) rdmode_stgd1 (
//        .din    ({tlu_lsu_redmode_rst[3:0]}),
//        .din    ({tlu_lsu_redmode_rst[3:0]}),
//        .q      ({redmode_rst[3:0]}),
//        .q      ({redmode_rst[3:0]}),
//        .clk    (clk),
//        .clk    (clk),
//        .se     (se),       .si (),          .so ()
//        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//        );  
//        );  
 
 
   assign   redmode_rst[3:0] =  tlu_lsu_redmode_rst_d1[3:0];
   assign   redmode_rst[3:0] =  tlu_lsu_redmode_rst_d1[3:0];
 
 
assign  lctl_rst[0] = redmode_rst[0] | reset ;
assign  lctl_rst[0] = redmode_rst[0] | reset ;
Line 2426... Line 1864...
    ((hpv_priv_e & hpstate_en_e) & ~(alt_space_e & (as_if_user_asi_e | tlb_byp_asi_e)));
    ((hpv_priv_e & hpstate_en_e) & ~(alt_space_e & (as_if_user_asi_e | tlb_byp_asi_e)));
        // hpv enabled VA->PA 
        // hpv enabled VA->PA 
 
 
assign  lsu_dtlb_bypass_e = dtlb_bypass_e ;
assign  lsu_dtlb_bypass_e = dtlb_bypass_e ;
wire  dcache_enable_m,dcache_enable_g ;
wire  dcache_enable_m,dcache_enable_g ;
dff #(2) dbyp_stgm (
dff_s #(2) dbyp_stgm (
        .din    ({dtlb_bypass_e,lsu_dcache_enable}),
        .din    ({dtlb_bypass_e,lsu_dcache_enable}),
        .q      ({dtlb_bypass_m,dcache_enable_m}),
        .q      ({dtlb_bypass_m,dcache_enable_m}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(2) dbyp_stgg (
dff_s #(2) dbyp_stgg (
        .din    ({dtlb_bypass_m,dcache_enable_m}),
        .din    ({dtlb_bypass_m,dcache_enable_m}),
        .q      ({lsu_dtlb_bypass_g,dcache_enable_g}),
        .q      ({lsu_dtlb_bypass_g,dcache_enable_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
   wire lsu_ctl_reg0_bf_b0, lsu_ctl_reg1_bf_b0, lsu_ctl_reg2_bf_b0, lsu_ctl_reg3_bf_b0;
   wire lsu_ctl_reg0_bf_b0, lsu_ctl_reg1_bf_b0, lsu_ctl_reg2_bf_b0, lsu_ctl_reg3_bf_b0;
   wire lsu_ctl_reg0_bf_b2, lsu_ctl_reg1_bf_b2, lsu_ctl_reg2_bf_b2, lsu_ctl_reg3_bf_b2;
   wire lsu_ctl_reg0_bf_b2, lsu_ctl_reg1_bf_b2, lsu_ctl_reg2_bf_b2, lsu_ctl_reg3_bf_b2;
 
 
Line 2462... Line 1900...
//=========================================================================================
//=========================================================================================
//  DCACHE Access thru IOBrdge
//  DCACHE Access thru IOBrdge
//=========================================================================================
//=========================================================================================
 
 
wire    iob_fwdpkt_vld ;
wire    iob_fwdpkt_vld ;
dff  iobvld_stg (
dff_s  iobvld_stg (
        .din    (lsu_iobrdge_fwd_pkt_vld),
        .din    (lsu_iobrdge_fwd_pkt_vld),
        .q      (iob_fwdpkt_vld),
        .q      (iob_fwdpkt_vld),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    dcache_iob_wr_e, dcache_iob_rd_e ;
wire    dcache_iob_wr_e, dcache_iob_rd_e ;
wire    dcache_iob_wr, dcache_iob_rd ;
wire    dcache_iob_wr, dcache_iob_rd ;
assign dcache_iob_wr =
assign dcache_iob_wr =
~lsu_iobrdge_tap_rq_type_b8[8] & lsu_iobrdge_tap_rq_type_b6_b3[6] & lsu_iobrdge_fwd_pkt_vld ;
~lsu_iobrdge_tap_rq_type_b8[8] & lsu_iobrdge_tap_rq_type_b6_b3[6] & lsu_iobrdge_fwd_pkt_vld ;
assign dcache_iob_rd =
assign dcache_iob_rd =
 lsu_iobrdge_tap_rq_type_b8[8] & lsu_iobrdge_tap_rq_type_b6_b3[6] & lsu_iobrdge_fwd_pkt_vld ;
 lsu_iobrdge_tap_rq_type_b8[8] & lsu_iobrdge_tap_rq_type_b6_b3[6] & lsu_iobrdge_fwd_pkt_vld ;
 
 
dff #(2) dcrw_stge (
dff_s #(2) dcrw_stge (
        .din    ({dcache_iob_wr,dcache_iob_rd}),
        .din    ({dcache_iob_wr,dcache_iob_rd}),
        .q      ({dcache_iob_wr_e,dcache_iob_rd_e}),
        .q      ({dcache_iob_wr_e,dcache_iob_rd_e}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  lsu_dc_iob_access_e = dcache_iob_wr_e | dcache_iob_rd_e ;
assign  lsu_dc_iob_access_e = dcache_iob_wr_e | dcache_iob_rd_e ;
 
 
//=========================================================================================
//=========================================================================================
Line 2506... Line 1944...
 lsu_iobrdge_tap_rq_type_b8[8] & lsu_iobrdge_tap_rq_type_b6_b3[5] & iob_fwdpkt_vld ;
 lsu_iobrdge_tap_rq_type_b8[8] & lsu_iobrdge_tap_rq_type_b6_b3[5] & iob_fwdpkt_vld ;
assign  bist_tap_wr =
assign  bist_tap_wr =
~lsu_iobrdge_tap_rq_type_b8[8] & lsu_iobrdge_tap_rq_type_b6_b3[5] & iob_fwdpkt_vld ;
~lsu_iobrdge_tap_rq_type_b8[8] & lsu_iobrdge_tap_rq_type_b6_b3[5] & iob_fwdpkt_vld ;
 
 
/*
/*
dff #(2) bstrw_stge (
dff_s #(2) bstrw_stge (
        .din    ({bist_tap_rd,bist_tap_wr}),
        .din    ({bist_tap_rd,bist_tap_wr}),
        .q      ({bist_tap_rd_en,bist_tap_wr_en}),
        .q      ({bist_tap_rd_en,bist_tap_wr_en}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
*/
*/
dff #(1) bstrw_stge (
dff_s #(1) bstrw_stge (
        .din    ({bist_tap_wr}),
        .din    ({bist_tap_wr}),
        .q      ({bist_tap_wr_en}),
        .q      ({bist_tap_wr_en}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire mrgn_tap_rd,mrgn_tap_wr ;
wire mrgn_tap_rd,mrgn_tap_wr ;
assign  mrgn_tap_rd =
assign  mrgn_tap_rd =
lsu_iobrdge_tap_rq_type_b8[8] & lsu_iobrdge_tap_rq_type_b6_b3[4] & iob_fwdpkt_vld ;
lsu_iobrdge_tap_rq_type_b8[8] & lsu_iobrdge_tap_rq_type_b6_b3[4] & iob_fwdpkt_vld ;
assign  mrgn_tap_wr =
assign  mrgn_tap_wr =
~lsu_iobrdge_tap_rq_type_b8[8] & lsu_iobrdge_tap_rq_type_b6_b3[4] & iob_fwdpkt_vld ;
~lsu_iobrdge_tap_rq_type_b8[8] & lsu_iobrdge_tap_rq_type_b6_b3[4] & iob_fwdpkt_vld ;
/*
/*
dff #(2) mrgnrw_stge (
dff_s #(2) mrgnrw_stge (
        .din    ({mrgn_tap_rd,mrgn_tap_wr}),
        .din    ({mrgn_tap_rd,mrgn_tap_wr}),
        .q      ({mrgn_tap_rd_en,mrgn_tap_wr_en}),
        .q      ({mrgn_tap_rd_en,mrgn_tap_wr_en}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
*/
*/
dff #(1) mrgnrw_stge (
dff_s #(1) mrgnrw_stge (
        .din    ({mrgn_tap_wr}),
        .din    ({mrgn_tap_wr}),
        .q      ({mrgn_tap_wr_en}),
        .q      ({mrgn_tap_wr_en}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire  dfture_access_vld ;
wire  dfture_access_vld ;
wire    [3:0]    dfture_tap_rd,dfture_tap_wr ;
wire    [3:0]    dfture_tap_rd,dfture_tap_wr ;
assign  dfture_access_vld = lsu_iobrdge_tap_rq_type_b6_b3[3] & iob_fwdpkt_vld ;
assign  dfture_access_vld = lsu_iobrdge_tap_rq_type_b6_b3[3] & iob_fwdpkt_vld ;
Line 2565... Line 2003...
assign  dfture_tap_wr[2] =
assign  dfture_tap_wr[2] =
  ~lsu_iobrdge_tap_rq_type_b8[8] & dfture_access_vld & tap_thread[2] ;
  ~lsu_iobrdge_tap_rq_type_b8[8] & dfture_access_vld & tap_thread[2] ;
assign  dfture_tap_wr[3] =
assign  dfture_tap_wr[3] =
  ~lsu_iobrdge_tap_rq_type_b8[8] & dfture_access_vld & tap_thread[3] ;
  ~lsu_iobrdge_tap_rq_type_b8[8] & dfture_access_vld & tap_thread[3] ;
 
 
dff #(8) dftrw_stge (
dff_s #(8) dftrw_stge (
        .din    ({dfture_tap_rd_default, dfture_tap_rd[2:0],dfture_tap_wr[3:0]}),
        .din    ({dfture_tap_rd_default, dfture_tap_rd[2:0],dfture_tap_wr[3:0]}),
        .q      ({dfture_tap_rd_d1[3:0],                    dfture_tap_wr_en[3:0]}),
        .q      ({dfture_tap_rd_d1[3:0],                    dfture_tap_wr_en[3:0]}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
   assign dfture_tap_rd_en [0] = dfture_tap_rd_d1[0] & ~rst_tri_en;
   assign dfture_tap_rd_en [0] = dfture_tap_rd_d1[0] & ~rst_tri_en;
   assign dfture_tap_rd_en [1] = dfture_tap_rd_d1[1] & ~rst_tri_en;
   assign dfture_tap_rd_en [1] = dfture_tap_rd_d1[1] & ~rst_tri_en;
Line 2585... Line 2023...
 
 
wire    bistctl_va_vld_m,bistctl_state_en_m;
wire    bistctl_va_vld_m,bistctl_state_en_m;
assign  bistctl_va_vld_m = (lsu_ldst_va_b7_b0_m[7:0] == 8'h00);
assign  bistctl_va_vld_m = (lsu_ldst_va_b7_b0_m[7:0] == 8'h00);
assign  bistctl_state_en_m = (lsu_dctl_asi_state_m[7:0] == 8'h42) & bistctl_va_vld_m &
assign  bistctl_state_en_m = (lsu_dctl_asi_state_m[7:0] == 8'h42) & bistctl_va_vld_m &
        lsu_alt_space_m ;
        lsu_alt_space_m ;
dff  #(2) bistdcd_stw (
dff_s  #(2) bistdcd_stw (
        .din    ({bistctl_va_vld_m,bistctl_state_en_m}),
        .din    ({bistctl_va_vld_m,bistctl_state_en_m}),
        .q      ({bistctl_va_vld,bistctl_state_en}),
        .q      ({bistctl_va_vld,bistctl_state_en}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
// asi42 dealt with as a whole.
// asi42 dealt with as a whole.
/*assign  bistctl_illgl_va = (lsu_asi_state[7:0] == 8'h42) & ~bistctl_va_vld &
/*assign  bistctl_illgl_va = (lsu_asi_state[7:0] == 8'h42) & ~bistctl_va_vld &
        lsu_alt_space_g ;*/
        lsu_alt_space_g ;*/
//assign  bistctl_rd_en = bistctl_state_en & asi_ld_vld_g ;
//assign  bistctl_rd_en = bistctl_state_en & asi_ld_vld_g ;
Line 2609... Line 2047...
 
 
wire    mrgnctl_va_vld_m,mrgnctl_state_en_m;
wire    mrgnctl_va_vld_m,mrgnctl_state_en_m;
assign  mrgnctl_va_vld_m = (lsu_ldst_va_b7_b0_m[7:0] == 8'h00);
assign  mrgnctl_va_vld_m = (lsu_ldst_va_b7_b0_m[7:0] == 8'h00);
assign  mrgnctl_state_en_m = (lsu_dctl_asi_state_m[7:0] == 8'h44) & mrgnctl_va_vld_m &
assign  mrgnctl_state_en_m = (lsu_dctl_asi_state_m[7:0] == 8'h44) & mrgnctl_va_vld_m &
        lsu_alt_space_m ;
        lsu_alt_space_m ;
dff  #(2) mrgndcd_stw (
dff_s  #(2) mrgndcd_stw (
        .din    ({mrgnctl_va_vld_m,mrgnctl_state_en_m}),
        .din    ({mrgnctl_va_vld_m,mrgnctl_state_en_m}),
        .q      ({mrgnctl_va_vld,mrgnctl_state_en}),
        .q      ({mrgnctl_va_vld,mrgnctl_state_en}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  mrgnctl_illgl_va = (lsu_asi_state[7:0] == 8'h44) & ~mrgnctl_va_vld &
assign  mrgnctl_illgl_va = (lsu_asi_state[7:0] == 8'h44) & ~mrgnctl_va_vld &
        lsu_alt_space_g ;
        lsu_alt_space_g ;
 
 
Line 2627... Line 2065...
// No access from tap.
// No access from tap.
wire    ldiagctl_va_vld_m,ldiagctl_state_en_m;
wire    ldiagctl_va_vld_m,ldiagctl_state_en_m;
assign  ldiagctl_va_vld_m = (lsu_ldst_va_b7_b0_m[7:0] == 8'h10);
assign  ldiagctl_va_vld_m = (lsu_ldst_va_b7_b0_m[7:0] == 8'h10);
assign  ldiagctl_state_en_m = (lsu_dctl_asi_state_m[7:0] == 8'h42) & ldiagctl_va_vld_m &
assign  ldiagctl_state_en_m = (lsu_dctl_asi_state_m[7:0] == 8'h42) & ldiagctl_va_vld_m &
        lsu_alt_space_m ;
        lsu_alt_space_m ;
dff  #(2) ldiagdcd_stw (
dff_s  #(2) ldiagdcd_stw (
        .din    ({ldiagctl_va_vld_m,ldiagctl_state_en_m}),
        .din    ({ldiagctl_va_vld_m,ldiagctl_state_en_m}),
        .q      ({ldiagctl_va_vld,ldiagctl_state_en}),
        .q      ({ldiagctl_va_vld,ldiagctl_state_en}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
// asi42 dealt with as a whole.
// asi42 dealt with as a whole.
/*assign  ldiagctl_illgl_va = (lsu_asi_state[7:0] == 8'h42) & ~ldiagctl_va_vld &
/*assign  ldiagctl_illgl_va = (lsu_asi_state[7:0] == 8'h42) & ~ldiagctl_va_vld &
        lsu_alt_space_g ;*/
        lsu_alt_space_g ;*/
 
 
Line 2768... Line 2206...
// or diagnostic read w/ asi read enable
// or diagnostic read w/ asi read enable
assign  lsu_diagnstc_asi_rd_en  =  lsu_asi_rd_en | dtagv_diagnstc_rd_g  ; //Bug 3959
assign  lsu_diagnstc_asi_rd_en  =  lsu_asi_rd_en | dtagv_diagnstc_rd_g  ; //Bug 3959
//assign  lsu_diagnstc_asi_rd_en  =  lsu_asi_rd_en | dtagv_diagnstc_rd_g  | lsu_local_ldxa_tlbrd_sel_g;
//assign  lsu_diagnstc_asi_rd_en  =  lsu_asi_rd_en | dtagv_diagnstc_rd_g  | lsu_local_ldxa_tlbrd_sel_g;
 
 
 
 
dff  #(1) lldxa_stw2 (
dff_s  #(1) lldxa_stw2 (
        .din    (lsu_diagnstc_asi_rd_en),
        .din    (lsu_diagnstc_asi_rd_en),
        .q      (lsu_asi_rd_en_w2),
        .q      (lsu_asi_rd_en_w2),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    ldxa_tlbrd0_w2,ldxa_tlbrd1_w2,ldxa_tlbrd2_w2,ldxa_tlbrd3_w2;
wire    ldxa_tlbrd0_w2,ldxa_tlbrd1_w2,ldxa_tlbrd2_w2,ldxa_tlbrd3_w2;
wire    ldxa_tlbrd0_w3,ldxa_tlbrd1_w3,ldxa_tlbrd2_w3,ldxa_tlbrd3_w3;
wire    ldxa_tlbrd0_w3,ldxa_tlbrd1_w3,ldxa_tlbrd2_w3,ldxa_tlbrd3_w3;
 
 
Line 2785... Line 2223...
assign  ldxa_tlbrd2_w2 = tlu_stxa_thread2_w2 & lsu_local_ldxa_tlbrd_sel_g ;
assign  ldxa_tlbrd2_w2 = tlu_stxa_thread2_w2 & lsu_local_ldxa_tlbrd_sel_g ;
assign  ldxa_tlbrd1_w2 = tlu_stxa_thread1_w2 & lsu_local_ldxa_tlbrd_sel_g ;
assign  ldxa_tlbrd1_w2 = tlu_stxa_thread1_w2 & lsu_local_ldxa_tlbrd_sel_g ;
assign  ldxa_tlbrd0_w2 = tlu_stxa_thread0_w2 & lsu_local_ldxa_tlbrd_sel_g ;
assign  ldxa_tlbrd0_w2 = tlu_stxa_thread0_w2 & lsu_local_ldxa_tlbrd_sel_g ;
 
 
// Bug 3959
// Bug 3959
dff  #(4) tlbrd_stw3 (
dff_s  #(4) tlbrd_stw3 (
        .din    ({ldxa_tlbrd3_w2,ldxa_tlbrd2_w2,
        .din    ({ldxa_tlbrd3_w2,ldxa_tlbrd2_w2,
                ldxa_tlbrd1_w2,ldxa_tlbrd0_w2}),
                ldxa_tlbrd1_w2,ldxa_tlbrd0_w2}),
        .q      ({ldxa_tlbrd3_w3,ldxa_tlbrd2_w3,
        .q      ({ldxa_tlbrd3_w3,ldxa_tlbrd2_w3,
                ldxa_tlbrd1_w3,ldxa_tlbrd0_w3}),
                ldxa_tlbrd1_w3,ldxa_tlbrd0_w3}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// pid and va-wtchpt va removed.
// pid and va-wtchpt va removed.
assign  lsu_asi_illgl_va =
assign  lsu_asi_illgl_va =
  lsuctl_illgl_va | pscxt_ldxa_illgl_va | mrgnctl_illgl_va | asi42_illgl_va ;
  lsuctl_illgl_va | pscxt_ldxa_illgl_va | mrgnctl_illgl_va | asi42_illgl_va ;
assign  lsu_asi_illgl_va_cmplt[0] = lsu_asi_illgl_va & ld_inst_vld_g & thread0_g ;
assign  lsu_asi_illgl_va_cmplt[0] = lsu_asi_illgl_va & ld_inst_vld_g & thread0_g ;
assign  lsu_asi_illgl_va_cmplt[1] = lsu_asi_illgl_va & ld_inst_vld_g & thread1_g ;
assign  lsu_asi_illgl_va_cmplt[1] = lsu_asi_illgl_va & ld_inst_vld_g & thread1_g ;
assign  lsu_asi_illgl_va_cmplt[2] = lsu_asi_illgl_va & ld_inst_vld_g & thread2_g ;
assign  lsu_asi_illgl_va_cmplt[2] = lsu_asi_illgl_va & ld_inst_vld_g & thread2_g ;
assign  lsu_asi_illgl_va_cmplt[3] = lsu_asi_illgl_va & ld_inst_vld_g & thread3_g ;
assign  lsu_asi_illgl_va_cmplt[3] = lsu_asi_illgl_va & ld_inst_vld_g & thread3_g ;
 
 
dff  #(4) lsuillgl_stgw2(
dff_s  #(4) lsuillgl_stgw2(
        .din    (lsu_asi_illgl_va_cmplt[3:0]),
        .din    (lsu_asi_illgl_va_cmplt[3:0]),
        .q      (lsu_asi_illgl_va_cmplt_w2[3:0]),
        .q      (lsu_asi_illgl_va_cmplt_w2[3:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//=========================================================================================
//=========================================================================================
//  ASI_DCACHE_TAG way decode
//  ASI_DCACHE_TAG way decode
//=========================================================================================
//=========================================================================================
Line 2822... Line 2260...
assign  dtag_rsel_dcd[3:0]  =    {(lsu_ldst_va_b12_b11_m[12:11] == 2'b11),
assign  dtag_rsel_dcd[3:0]  =    {(lsu_ldst_va_b12_b11_m[12:11] == 2'b11),
                                (lsu_ldst_va_b12_b11_m[12:11] == 2'b10),
                                (lsu_ldst_va_b12_b11_m[12:11] == 2'b10),
                                (lsu_ldst_va_b12_b11_m[12:11] == 2'b01),
                                (lsu_ldst_va_b12_b11_m[12:11] == 2'b01),
                                (lsu_ldst_va_b12_b11_m[12:11] == 2'b00)};
                                (lsu_ldst_va_b12_b11_m[12:11] == 2'b00)};
//bug5994
//bug5994
dffe #(4) dtag_hold (
dffe_s #(4) dtag_hold (
        .din    (dtag_rsel_dcd[3:0]),
        .din    (dtag_rsel_dcd[3:0]),
        .q      (dtag_rsel_hold[3:0]),
        .q      (dtag_rsel_hold[3:0]),
        .en     (sehold),
        .en     (sehold),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  lsu_dtag_rsel_m[3:0] = sehold ? dtag_rsel_hold[3:0] : dtag_rsel_dcd[3:0] ;
assign  lsu_dtag_rsel_m[3:0] = sehold ? dtag_rsel_hold[3:0] : dtag_rsel_dcd[3:0] ;
 
 
 
 
Line 2883... Line 2321...
(vr_wtchpt_cmp_en_m & ld_inst_vld_m) ;
(vr_wtchpt_cmp_en_m & ld_inst_vld_m) ;
 
 
//=========================================================================================
//=========================================================================================
//  Hit/Miss/Fill Control
//  Hit/Miss/Fill Control
//=========================================================================================
//=========================================================================================
dff  #(10) stg_m (
dff_s  #(10) stg_m (
        .din    ({ld_inst_vld_e, st_inst_vld_e,ldst_sz_e[1:0],
        .din    ({ld_inst_vld_e, st_inst_vld_e,ldst_sz_e[1:0],
    ifu_lsu_rd_e[4:0],ifu_lsu_ldst_fp_e}),
    ifu_lsu_rd_e[4:0],ifu_lsu_ldst_fp_e}),
        .q      ({ld_inst_vld_m, st_inst_vld_m,ldst_sz_m[1:0],
        .q      ({ld_inst_vld_m, st_inst_vld_m,ldst_sz_m[1:0],
    ld_rd_m[4:0],fp_ldst_m}),
    ld_rd_m[4:0],fp_ldst_m}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    dcache_arry_data_sel_e;
wire    dcache_arry_data_sel_e;
 
 
assign   dcache_arry_data_sel_e = lsu_bist_rvld_e | ld_inst_vld_e | dcache_iob_rd_e ;
assign   dcache_arry_data_sel_e = lsu_bist_rvld_e | ld_inst_vld_e | dcache_iob_rd_e ;
dff #(1) dcache_arry_data_sel_stgm (
dff_s #(1) dcache_arry_data_sel_stgm (
  .din (dcache_arry_data_sel_e),
  .din (dcache_arry_data_sel_e),
  .q   (dcache_arry_data_sel_m),
  .q   (dcache_arry_data_sel_m),
  .clk    (clk),
  .clk    (clk),
  .se     (se),       .si (),          .so ()
  .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
);
);
 
 
 
 
dff  #(10) stg_g (
dff_s  #(10) stg_g (
        .din    ({ld_inst_vld_m, st_inst_vld_m,ldst_sz_m[1:0],
        .din    ({ld_inst_vld_m, st_inst_vld_m,ldst_sz_m[1:0],
    ld_rd_m[4:0],fp_ldst_m}),
    ld_rd_m[4:0],fp_ldst_m}),
        .q      ({ld_inst_vld_unflushed, st_inst_vld_unflushed,ldst_sz_g[1:0],
        .q      ({ld_inst_vld_unflushed, st_inst_vld_unflushed,ldst_sz_g[1:0],
    ld_rd_g[4:0],fp_ldst_g}),
    ld_rd_g[4:0],fp_ldst_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
//assign  asi_ld_vld_g = ld_inst_vld_unflushed & lsu_inst_vld_w & ~dctl_early_flush_w ;
//assign  asi_ld_vld_g = ld_inst_vld_unflushed & lsu_inst_vld_w & ~dctl_early_flush_w ;
assign  asi_st_vld_g = st_inst_vld_unflushed & lsu_inst_vld_w & ~dctl_early_flush_w ;
assign  asi_st_vld_g = st_inst_vld_unflushed & lsu_inst_vld_w & ~dctl_early_flush_w ;
Line 2931... Line 2369...
// This should contain ld miss, MMU miss, exception. 
// This should contain ld miss, MMU miss, exception. 
// should tlb_cam_miss be factored in or can miss/hit be solely
// should tlb_cam_miss be factored in or can miss/hit be solely
// based on way_hit.
// based on way_hit.
 
 
wire  tlb_cam_hit_mod ;
wire  tlb_cam_hit_mod ;
dff  stgcmiss_g (
dff_s  stgcmiss_g (
        .din    (tlb_cam_hit),
        .din    (tlb_cam_hit),
        .q      (tlb_cam_hit_mod),
        .q      (tlb_cam_hit_mod),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// NOTE !! qualification with tte_data_parity_error removed for timing.
// NOTE !! qualification with tte_data_parity_error removed for timing.
assign tlb_cam_hit_g = tlb_cam_hit_mod ;
assign tlb_cam_hit_g = tlb_cam_hit_mod ;
//assign tlb_cam_hit_g = tlb_cam_hit_mod & ~tte_data_parity_error ;
//assign tlb_cam_hit_g = tlb_cam_hit_mod & ~tte_data_parity_error ;
Line 2952... Line 2390...
 
 
wire nceen_pipe_m, nceen_pipe_g ;
wire nceen_pipe_m, nceen_pipe_g ;
 
 
   wire [3:0] lsu_nceen_d1;
   wire [3:0] lsu_nceen_d1;
 
 
dff #(4) nceen_stg (
dff_s #(4) nceen_stg (
   .din (ifu_lsu_nceen[3:0]),
   .din (ifu_lsu_nceen[3:0]),
   .q   (lsu_nceen_d1[3:0]),
   .q   (lsu_nceen_d1[3:0]),
   .clk (clk),
   .clk (clk),
   .se  (se),       .si (),          .so ()
   .se  (se),       `SIMPLY_RISC_SCANIN,          .so ()
);
);
 
 
 
 
assign  nceen_pipe_m =
assign  nceen_pipe_m =
(thread0_m & lsu_nceen_d1[0]) | (thread1_m & lsu_nceen_d1[1]) |
(thread0_m & lsu_nceen_d1[0]) | (thread1_m & lsu_nceen_d1[1]) |
(thread2_m & lsu_nceen_d1[2]) | (thread3_m & lsu_nceen_d1[3]) ;
(thread2_m & lsu_nceen_d1[2]) | (thread3_m & lsu_nceen_d1[3]) ;
 
 
dff #(1)  stgg_een (
dff_s #(1)  stgg_een (
        .din    (nceen_pipe_m),
        .din    (nceen_pipe_m),
        .q      (nceen_pipe_g),
        .q      (nceen_pipe_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//wire  tte_data_perror_corr_en ;
//wire  tte_data_perror_corr_en ;
wire    tte_data_perror_unc_en ;
wire    tte_data_perror_unc_en ;
// separate ld from st for error reporting.
// separate ld from st for error reporting.
Line 2983... Line 2421...
 
 
wire    dtlb_perror_en_w,dtlb_perror_en_w2,dtlb_perror_en_w3 ;
wire    dtlb_perror_en_w,dtlb_perror_en_w2,dtlb_perror_en_w3 ;
assign  dtlb_perror_en_w = tte_data_perror_unc_en ;
assign  dtlb_perror_en_w = tte_data_perror_unc_en ;
//assign        dtlb_perror_en_w = tte_data_perror_unc_en | tte_data_perror_corr_en ;
//assign        dtlb_perror_en_w = tte_data_perror_unc_en | tte_data_perror_corr_en ;
 
 
dff #(1)  stgw2_perr (
dff_s #(1)  stgw2_perr (
        .din    (dtlb_perror_en_w),
        .din    (dtlb_perror_en_w),
        .q      (dtlb_perror_en_w2),
        .q      (dtlb_perror_en_w2),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(1)  stgw3_perr (
dff_s #(1)  stgw3_perr (
        .din    (dtlb_perror_en_w2),
        .din    (dtlb_perror_en_w2),
        .q      (dtlb_perror_en_w3),
        .q      (dtlb_perror_en_w3),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// For now, "or" ld_inst_vld_g and ldst_dbl. Ultimately, it ldst_dbl
// For now, "or" ld_inst_vld_g and ldst_dbl. Ultimately, it ldst_dbl
// needs to cause ld_inst_vld_g to be asserted.
// needs to cause ld_inst_vld_g to be asserted.
// st and ld ldst_dbl terms are redundant.
// st and ld ldst_dbl terms are redundant.
Line 3078... Line 2516...
 
 
//dff #(4)  stgw2_dcdiag (
//dff #(4)  stgw2_dcdiag (
//        .din  ({dc3_diagnstc_rd_g,dc2_diagnstc_rd_g,dc1_diagnstc_rd_g,dc0_diagnstc_rd_g}),
//        .din  ({dc3_diagnstc_rd_g,dc2_diagnstc_rd_g,dc1_diagnstc_rd_g,dc0_diagnstc_rd_g}),
//        .q    ({dc3_diagnstc_rd_w2,dc2_diagnstc_rd_w2,dc1_diagnstc_rd_w2,dc0_diagnstc_rd_w2}),
//        .q    ({dc3_diagnstc_rd_w2,dc2_diagnstc_rd_w2,dc1_diagnstc_rd_w2,dc0_diagnstc_rd_w2}),
//        .clk  (clk),
//        .clk  (clk),
//        .se     (se),       .si (),          .so ()
//        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//        );
//        );
 
 
assign  dtagv_diagnstc_rd_g = dtagv_diagnstc_asi_g & ld_inst_vld_g & lsu_alt_space_g ;
assign  dtagv_diagnstc_rd_g = dtagv_diagnstc_asi_g & ld_inst_vld_g & lsu_alt_space_g ;
 
 
// Prefetch will swo thread if it does not miss in tlb.
// Prefetch will swo thread if it does not miss in tlb.
dff  stgm_prf (
dff_s  stgm_prf (
        .din    (ifu_lsu_pref_inst_e),
        .din    (ifu_lsu_pref_inst_e),
        .q      (pref_inst_m),
        .q      (pref_inst_m),
        .clk  (clk),
        .clk  (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff  stgg_prf (
dff_s  stgg_prf (
        .din    (pref_inst_m),
        .din    (pref_inst_m),
        .q      (pref_inst_g),
        .q      (pref_inst_g),
        .clk  (clk),
        .clk  (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
 
 
//assign        lsu_ifu_data_error_w = 1'b0 ;
//assign        lsu_ifu_data_error_w = 1'b0 ;
Line 3127... Line 2565...
  (l2fill_vld_m & ~(unc_err_trap_m | l2fill_fpld_m))          | // fill
  (l2fill_vld_m & ~(unc_err_trap_m | l2fill_fpld_m))          | // fill
  (~fp_ldst_m & ld_inst_vld_m &
  (~fp_ldst_m & ld_inst_vld_m &
        ~(ldxa_swo_annul & lsu_alt_space_m) & flush_w_inst_vld_m) | // in pipe
        ~(ldxa_swo_annul & lsu_alt_space_m) & flush_w_inst_vld_m) | // in pipe
  intld_byp_data_vld_m ;                                              // bypass
  intld_byp_data_vld_m ;                                              // bypass
 
 
dff #(1) dfill_vld_stgg (
dff_s #(1) dfill_vld_stgg (
   .din (lsu_exu_dfill_vld_m),
   .din (lsu_exu_dfill_vld_m),
   .q   (lsu_exu_dfill_vld_w2),
   .q   (lsu_exu_dfill_vld_w2),
   .clk    (clk),
   .clk    (clk),
   .se     (se),       .si (),          .so ()
   .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
);
);
 
 
//------              
//------              
// Bld errors : Bug 4315
// Bld errors : Bug 4315
// Errors need to be accummulated across helpers. Once unc error detected 
// Errors need to be accummulated across helpers. Once unc error detected 
Line 3144... Line 2582...
 
 
wire    bld_cnt_max_m,bld_cnt_max_g ;
wire    bld_cnt_max_m,bld_cnt_max_g ;
assign  bld_cnt_max_m = lsu_bld_cnt_m[2] & lsu_bld_cnt_m[1] & lsu_bld_cnt_m[0] ;
assign  bld_cnt_max_m = lsu_bld_cnt_m[2] & lsu_bld_cnt_m[1] & lsu_bld_cnt_m[0] ;
 
 
wire    [1:0]    cpx_ld_err_m ;
wire    [1:0]    cpx_ld_err_m ;
dff #(3) lderr_stgm (
dff_s #(3) lderr_stgm (
   .din ({lsu_cpx_pkt_ld_err[1:0],bld_cnt_max_m}),
   .din ({lsu_cpx_pkt_ld_err[1:0],bld_cnt_max_m}),
   .q   ({cpx_ld_err_m[1:0],bld_cnt_max_g}),
   .q   ({cpx_ld_err_m[1:0],bld_cnt_max_g}),
   .clk    (clk),
   .clk    (clk),
   .se     (se),       .si (),          .so ()
   .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
);
);
 
 
wire [1:0] bld_err ;
wire [1:0] bld_err ;
wire [1:0] bld_err_din ;
wire [1:0] bld_err_din ;
wire       bld_rst ;
wire       bld_rst ;
// Accummulate errors.
// Accummulate errors.
assign  bld_err_din[1:0] = cpx_ld_err_m[1:0] | bld_err[1:0] ;
assign  bld_err_din[1:0] = cpx_ld_err_m[1:0] | bld_err[1:0] ;
assign  bld_rst = reset | lsu_bld_reset ;
assign  bld_rst = reset | lsu_bld_reset ;
 
 
dffre #(2) blderr_ff (
dffre_s #(2) blderr_ff (
        .din    (bld_err_din[1:0]),
        .din    (bld_err_din[1:0]),
        .q      (bld_err[1:0]),
        .q      (bld_err[1:0]),
        .clk    (clk),
        .clk    (clk),
        .en     (lsu_bld_helper_cmplt_m), .rst (bld_rst),
        .en     (lsu_bld_helper_cmplt_m), .rst (bld_rst),
        .se     (se),   .si (), .so ()
        .se     (se),   `SIMPLY_RISC_SCANIN,    .so ()
        );
        );
 
 
wire    bld_helper_cmplt_g ;
wire    bld_helper_cmplt_g ;
dff  bldh_stgg (
dff_s  bldh_stgg (
   .din (lsu_bld_helper_cmplt_m),
   .din (lsu_bld_helper_cmplt_m),
   .q   (bld_helper_cmplt_g),
   .q   (bld_helper_cmplt_g),
   .clk    (clk),
   .clk    (clk),
   .se     (se),       .si (),          .so ()
   .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
);
);
 
 
wire    bld_unc_err_pend_g, bld_unc_err_pend_w2 ;
wire    bld_unc_err_pend_g, bld_unc_err_pend_w2 ;
assign  bld_unc_err_pend_g = bld_err[1] & bld_helper_cmplt_g ;
assign  bld_unc_err_pend_g = bld_err[1] & bld_helper_cmplt_g ;
wire    bld_corr_err_pend_g, bld_corr_err_pend_w2 ;
wire    bld_corr_err_pend_g, bld_corr_err_pend_w2 ;
Line 3184... Line 2622...
 
 
wire    bld_squash_err_g,bld_squash_err_w2 ;
wire    bld_squash_err_g,bld_squash_err_w2 ;
// bld cnt should be vld till g
// bld cnt should be vld till g
assign  bld_squash_err_g = bld_helper_cmplt_g & ~bld_cnt_max_g ;
assign  bld_squash_err_g = bld_helper_cmplt_g & ~bld_cnt_max_g ;
 
 
dff #(3)  bldsq_stgw2 (
dff_s #(3)  bldsq_stgw2 (
   .din ({bld_squash_err_g,bld_unc_err_pend_g,bld_corr_err_pend_g}),
   .din ({bld_squash_err_g,bld_unc_err_pend_g,bld_corr_err_pend_g}),
   .q   ({bld_squash_err_w2,bld_unc_err_pend_w2,bld_corr_err_pend_w2}),
   .q   ({bld_squash_err_w2,bld_unc_err_pend_w2,bld_corr_err_pend_w2}),
   .clk    (clk),
   .clk    (clk),
   .se     (se),       .si (),          .so ()
   .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
);
);
 
 
//------              
//------              
 
 
wire    stb_cam_hit_w2 ;
wire    stb_cam_hit_w2 ;
wire    fld_vld_sync_no_camhit,fld_vld_sync_no_camhit_w2 ;
wire    fld_vld_sync_no_camhit,fld_vld_sync_no_camhit_w2 ;
wire    fld_vld_async,fld_vld_async_w2 ;
wire    fld_vld_async,fld_vld_async_w2 ;
dff  #(3) stbchit_stg (
dff_s  #(3) stbchit_stg (
        .din    ({stb_cam_hit,fld_vld_sync_no_camhit,fld_vld_async}),
        .din    ({stb_cam_hit,fld_vld_sync_no_camhit,fld_vld_async}),
        .q      ({stb_cam_hit_w2,fld_vld_sync_no_camhit_w2,fld_vld_async_w2}),
        .q      ({stb_cam_hit_w2,fld_vld_sync_no_camhit_w2,fld_vld_async_w2}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  fld_vld_sync_no_camhit =
assign  fld_vld_sync_no_camhit =
        (lsu_ld_hit_wb & ~tte_data_perror_unc_en & fp_ldst_g &
        (lsu_ld_hit_wb & ~tte_data_perror_unc_en & fp_ldst_g &
        ~dctl_flush_pipe_w) ; // l1hit 
        ~dctl_flush_pipe_w) ; // l1hit 
Line 3221... Line 2659...
 
 
/*dff  #(1) fldvld_stgw2 (
/*dff  #(1) fldvld_stgw2 (
        .din    (ffu_ld_vld),
        .din    (ffu_ld_vld),
        .q      (lsu_ffu_ld_vld),
        .q      (lsu_ffu_ld_vld),
        .clk    (clk),
        .clk    (clk),
        .se     (1'b0),       .si (),          .so ()
        .se     (1'b0),       `SIMPLY_RISC_SCANIN,          .so ()
        ); */
        ); */
 
 
dff  #(2) dtid_stgm (
dff_s  #(2) dtid_stgm (
        .din    (lsu_dfill_tid_e[1:0]),
        .din    (lsu_dfill_tid_e[1:0]),
        .q      (dfq_tid_m[1:0]),
        .q      (dfq_tid_m[1:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff  #(2) dtid_stgg (
dff_s  #(2) dtid_stgg (
        .din    (dfq_tid_m[1:0]),
        .din    (dfq_tid_m[1:0]),
        .q      (dfq_tid_g[1:0]),
        .q      (dfq_tid_g[1:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// Timing Change -  shifting dfill-data sel gen. to m-stage
// Timing Change -  shifting dfill-data sel gen. to m-stage
//assign  ldbyp_tid[0] = ld_thrd_byp_sel_g[1] | ld_thrd_byp_sel_g[3] ;
//assign  ldbyp_tid[0] = ld_thrd_byp_sel_g[1] | ld_thrd_byp_sel_g[3] ;
//assign  ldbyp_tid[1] = ld_thrd_byp_sel_g[2] | ld_thrd_byp_sel_g[3] ;
//assign  ldbyp_tid[1] = ld_thrd_byp_sel_g[2] | ld_thrd_byp_sel_g[3] ;
Line 3381... Line 2819...
assign  pref_tlbmiss_cmplt[0] = pref_tlbmiss_g & thread0_g ;
assign  pref_tlbmiss_cmplt[0] = pref_tlbmiss_g & thread0_g ;
assign  pref_tlbmiss_cmplt[1] = pref_tlbmiss_g & thread1_g ;
assign  pref_tlbmiss_cmplt[1] = pref_tlbmiss_g & thread1_g ;
assign  pref_tlbmiss_cmplt[2] = pref_tlbmiss_g & thread2_g ;
assign  pref_tlbmiss_cmplt[2] = pref_tlbmiss_g & thread2_g ;
assign  pref_tlbmiss_cmplt[3] = pref_tlbmiss_g & thread3_g ;
assign  pref_tlbmiss_cmplt[3] = pref_tlbmiss_g & thread3_g ;
 
 
dff  #(4) pfcmpl_stgd1 (
dff_s  #(4) pfcmpl_stgd1 (
        .din    (pref_tlbmiss_cmplt[3:0]),
        .din    (pref_tlbmiss_cmplt[3:0]),
        .q      (pref_tlbmiss_cmplt_d1[3:0]),
        .q      (pref_tlbmiss_cmplt_d1[3:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff  #(4) pfcmpl_stgd2 (
dff_s  #(4) pfcmpl_stgd2 (
        .din    (pref_tlbmiss_cmplt_d1[3:0]),
        .din    (pref_tlbmiss_cmplt_d1[3:0]),
        .q      (pref_tlbmiss_cmplt_d2[3:0]),
        .q      (pref_tlbmiss_cmplt_d2[3:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// *** add diagnstc rd and prefetch(tlb-miss) signals. ***
// *** add diagnstc rd and prefetch(tlb-miss) signals. ***
// *** add ifu asi ack.
// *** add ifu asi ack.
 
 
Line 3495... Line 2933...
//    dc3_diagnstc_rd_w2 |
//    dc3_diagnstc_rd_w2 |
    ldxa_illgl_va_cmplt_d1[3] |
    ldxa_illgl_va_cmplt_d1[3] |
    pref_tlbmiss_cmplt_d2[3] |
    pref_tlbmiss_cmplt_d2[3] |
    lsu_pcx_pref_issue[3];
    lsu_pcx_pref_issue[3];
 
 
dff #(4) ldstcmplt_d1 (
dff_s #(4) ldstcmplt_d1 (
        .din    ({ldst_cmplt_late_3,ldst_cmplt_late_2,ldst_cmplt_late_1,ldst_cmplt_late_0}),
        .din    ({ldst_cmplt_late_3,ldst_cmplt_late_2,ldst_cmplt_late_1,ldst_cmplt_late_0}),
        .q      ({ldst_cmplt_late_3_d1,ldst_cmplt_late_2_d1,
        .q      ({ldst_cmplt_late_3_d1,ldst_cmplt_late_2_d1,
                ldst_cmplt_late_1_d1,ldst_cmplt_late_0_d1}),
                ldst_cmplt_late_1_d1,ldst_cmplt_late_0_d1}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//=========================================================================================
//=========================================================================================
//  LD/ST MISS SIGNAL - IFU
//  LD/ST MISS SIGNAL - IFU
//=========================================================================================
//=========================================================================================
Line 3524... Line 2962...
// This represents *all* ld asi.
// This represents *all* ld asi.
wire    asi_internal_ld_m,asi_internal_ld_g ;
wire    asi_internal_ld_m,asi_internal_ld_g ;
assign  asi_internal_ld_m =
assign  asi_internal_ld_m =
        asi_internal_m & ld_inst_vld_m & lsu_alt_space_m ;
        asi_internal_m & ld_inst_vld_m & lsu_alt_space_m ;
 
 
dff #(2) ldaswo_stgg (
dff_s #(2) ldaswo_stgg (
        .din    ({ldxa_internal_swo_m,asi_internal_ld_m}),
        .din    ({ldxa_internal_swo_m,asi_internal_ld_m}),
        .q      ({ldxa_internal_swo_g,asi_internal_ld_g}),
        .q      ({ldxa_internal_swo_g,asi_internal_ld_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    common_ldst_miss_w ;
wire    common_ldst_miss_w ;
assign  common_ldst_miss_w =
assign  common_ldst_miss_w =
(~(cache_hit & (tlb_cam_hit_g | lsu_dtlb_bypass_g)) |   // include miss in tlb;bypass
(~(cache_hit & (tlb_cam_hit_g | lsu_dtlb_bypass_g)) |   // include miss in tlb;bypass
Line 3571... Line 3009...
/*
/*
   wire   lsu_ld_inst_vld_flush_w, lsu_ld_inst_vld_flush_w2;
   wire   lsu_ld_inst_vld_flush_w, lsu_ld_inst_vld_flush_w2;
   assign lsu_ld_inst_vld_flush_w = lsu_inst_vld_w & ld_inst_vld_unflushed & ~dctl_flush_pipe_w ;
   assign lsu_ld_inst_vld_flush_w = lsu_inst_vld_w & ld_inst_vld_unflushed & ~dctl_flush_pipe_w ;
 
 
 
 
dff #(1) lsu_ld_inst_vld_flush_stgw2 (
dff_s #(1) lsu_ld_inst_vld_flush_stgw2 (
        .din    (lsu_ld_inst_vld_flush_w),
        .din    (lsu_ld_inst_vld_flush_w),
        .q      (lsu_ld_inst_vld_flush_w2),
        .q      (lsu_ld_inst_vld_flush_w2),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
*/
*/
 
 
   wire   lsu_ifu_dc_parity_error_w2_q;
   wire   lsu_ifu_dc_parity_error_w2_q;
 
 
dff #(1) lsu_ifu_dc_parity_error_stgw2 (
dff_s #(1) lsu_ifu_dc_parity_error_stgw2 (
        .din    (lsu_ifu_dc_parity_error_w),
        .din    (lsu_ifu_dc_parity_error_w),
        .q      (lsu_ifu_dc_parity_error_w2_q),
        .q      (lsu_ifu_dc_parity_error_w2_q),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
   assign lsu_ifu_dc_parity_error_w2 = (lsu_ifu_dc_parity_error_w2_q | stb_cam_hit_w2) & ld_inst_vld_w2;
   assign lsu_ifu_dc_parity_error_w2 = (lsu_ifu_dc_parity_error_w2_q | stb_cam_hit_w2) & ld_inst_vld_w2;
 
 
//=========================================================================================
//=========================================================================================
Line 3612... Line 3050...
 
 
 
 
   wire ld_inst_vld_no_flush_w, ld_inst_vld_no_flush_w2;
   wire ld_inst_vld_no_flush_w, ld_inst_vld_no_flush_w2;
   assign ld_inst_vld_no_flush_w = ld_inst_vld_unflushed & lsu_inst_vld_w;
   assign ld_inst_vld_no_flush_w = ld_inst_vld_unflushed & lsu_inst_vld_w;
 
 
dff #(1) ld_inst_vld_no_flush_stgw2 (
dff_s #(1) ld_inst_vld_no_flush_stgw2 (
        .din    (ld_inst_vld_no_flush_w),
        .din    (ld_inst_vld_no_flush_w),
        .q      (ld_inst_vld_no_flush_w2),
        .q      (ld_inst_vld_no_flush_w2),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
   wire lsu_exu_ldst_miss_w2_tmp;
   wire lsu_exu_ldst_miss_w2_tmp;
 
 
dff #(1) exuldstmiss_stgw2 (
dff_s #(1) exuldstmiss_stgw2 (
        .din    (exu_ldst_miss_g_no_stb_cam_hit),
        .din    (exu_ldst_miss_g_no_stb_cam_hit),
        .q      (lsu_exu_ldst_miss_w2_tmp),
        .q      (lsu_exu_ldst_miss_w2_tmp),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
   assign lsu_exu_ldst_miss_w2 =  (lsu_exu_ldst_miss_w2_tmp | stb_cam_hit_w2) & ld_inst_vld_no_flush_w2;
   assign lsu_exu_ldst_miss_w2 =  (lsu_exu_ldst_miss_w2_tmp | stb_cam_hit_w2) & ld_inst_vld_no_flush_w2;
 
 
 
 
Line 3651... Line 3089...
 
 
// Start with SDATA Reg for Streaming
// Start with SDATA Reg for Streaming
wire    strm_asi, strm_asi_m ;
wire    strm_asi, strm_asi_m ;
assign  strm_asi_m = (lsu_dctl_asi_state_m[7:0]==8'h40) ;
assign  strm_asi_m = (lsu_dctl_asi_state_m[7:0]==8'h40) ;
 
 
dff  strm_stgg (
dff_s  strm_stgg (
        .din    (strm_asi_m),
        .din    (strm_asi_m),
        .q      (strm_asi),
        .q      (strm_asi),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  stxa_stall_asi_g =
assign  stxa_stall_asi_g =
  strm_asi & ((ldst_va_g[7:0] == 8'h80)) ;       // ma ctl
  strm_asi & ((ldst_va_g[7:0] == 8'h80)) ;       // ma ctl
  /*strm_asi & (        (ldst_va_g[7:0] == 8'h18) |     // streaming stxa to sdata
  /*strm_asi & (        (ldst_va_g[7:0] == 8'h18) |     // streaming stxa to sdata
Line 3671... Line 3109...
assign  dtlb_wr_cmplt0 = demap_thread0 & lsu_dtlb_wr_vld_e ;
assign  dtlb_wr_cmplt0 = demap_thread0 & lsu_dtlb_wr_vld_e ;
assign  dtlb_wr_cmplt1 = demap_thread1 & lsu_dtlb_wr_vld_e ;
assign  dtlb_wr_cmplt1 = demap_thread1 & lsu_dtlb_wr_vld_e ;
assign  dtlb_wr_cmplt2 = demap_thread2 & lsu_dtlb_wr_vld_e ;
assign  dtlb_wr_cmplt2 = demap_thread2 & lsu_dtlb_wr_vld_e ;
assign  dtlb_wr_cmplt3 = demap_thread3 & lsu_dtlb_wr_vld_e ;
assign  dtlb_wr_cmplt3 = demap_thread3 & lsu_dtlb_wr_vld_e ;
 
 
dff  dtlbw_stgd1 (
dff_s  dtlbw_stgd1 (
        .din    (lsu_dtlb_wr_vld_e),
        .din    (lsu_dtlb_wr_vld_e),
        .q      (dtlb_wr_init_d1),
        .q      (dtlb_wr_init_d1),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff  dtlbw_stgd2 (
dff_s  dtlbw_stgd2 (
        .din    (dtlb_wr_init_d1),
        .din    (dtlb_wr_init_d1),
        .q      (dtlb_wr_init_d2),
        .q      (dtlb_wr_init_d2),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff  dtlbw_stgd3 (
dff_s  dtlbw_stgd3 (
        .din    (dtlb_wr_init_d2),
        .din    (dtlb_wr_init_d2),
        .q      (dtlb_wr_init_d3),
        .q      (dtlb_wr_init_d3),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    dtlb_wr_init_d4 ;
wire    dtlb_wr_init_d4 ;
dff  dtlbw_stgd4 (
dff_s  dtlbw_stgd4 (
        .din    (dtlb_wr_init_d3),
        .din    (dtlb_wr_init_d3),
        .q      (dtlb_wr_init_d4),
        .q      (dtlb_wr_init_d4),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
 
 
wire    tlb_access_sel_thrd3_d1,tlb_access_sel_thrd2_d1;
wire    tlb_access_sel_thrd3_d1,tlb_access_sel_thrd2_d1;
Line 3722... Line 3160...
assign  stxa_stall_wr_cmplt3 =  (spu_lsu_stxa_ack & spu_stxa_thread3) |
assign  stxa_stall_wr_cmplt3 =  (spu_lsu_stxa_ack & spu_stxa_thread3) |
        (tlu_stxa_thread3_w2 & tlu_lsu_stxa_ack & ~dtlb_wr_init_d4) |
        (tlu_stxa_thread3_w2 & tlu_lsu_stxa_ack & ~dtlb_wr_init_d4) |
        (ifu_asi_store_cmplt_en_d1 & tlb_access_sel_thrd3_d1) |
        (ifu_asi_store_cmplt_en_d1 & tlb_access_sel_thrd3_d1) |
        dtlb_wr_cmplt3 ;
        dtlb_wr_cmplt3 ;
 
 
dff  #(4) stxastall_stgd1 (
dff_s  #(4) stxastall_stgd1 (
        .din    ({stxa_stall_wr_cmplt3,stxa_stall_wr_cmplt2,
        .din    ({stxa_stall_wr_cmplt3,stxa_stall_wr_cmplt2,
                stxa_stall_wr_cmplt1,stxa_stall_wr_cmplt0}),
                stxa_stall_wr_cmplt1,stxa_stall_wr_cmplt0}),
        .q      ({stxa_stall_wr_cmplt3_d1,stxa_stall_wr_cmplt2_d1,
        .q      ({stxa_stall_wr_cmplt3_d1,stxa_stall_wr_cmplt2_d1,
                stxa_stall_wr_cmplt1_d1,stxa_stall_wr_cmplt0_d1}),
                stxa_stall_wr_cmplt1_d1,stxa_stall_wr_cmplt0_d1}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
// enable speculates on inst not being flushed
// enable speculates on inst not being flushed
// Only dside diagnostic writes will be logged for long-latency action. dside diagnostic
// Only dside diagnostic writes will be logged for long-latency action. dside diagnostic
Line 3753... Line 3191...
    & thread2_e & alt_space_e ;
    & thread2_e & alt_space_e ;
assign  tlb_access_en3_e =
assign  tlb_access_en3_e =
  (tlb_lng_ltncy_asi_e | wr_dc_diag_asi_e | wr_dtagv_diag_asi_e | ifu_nontlb_asi_e)
  (tlb_lng_ltncy_asi_e | wr_dc_diag_asi_e | wr_dtagv_diag_asi_e | ifu_nontlb_asi_e)
    & thread3_e & alt_space_e ;
    & thread3_e & alt_space_e ;
 
 
dff  #(4) tlbac_stgm (
dff_s  #(4) tlbac_stgm (
        .din    ({tlb_access_en0_e,tlb_access_en1_e,tlb_access_en2_e,tlb_access_en3_e}),
        .din    ({tlb_access_en0_e,tlb_access_en1_e,tlb_access_en2_e,tlb_access_en3_e}),
        .q      ({tlb_access_en0_tmp,tlb_access_en1_tmp,tlb_access_en2_tmp,tlb_access_en3_tmp}),
        .q      ({tlb_access_en0_tmp,tlb_access_en1_tmp,tlb_access_en2_tmp,tlb_access_en3_tmp}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    ldst_vld_m = ld_inst_vld_m | st_inst_vld_m ;
wire    ldst_vld_m = ld_inst_vld_m | st_inst_vld_m ;
assign  tlb_access_en0_m = tlb_access_en0_tmp & ldst_vld_m ;
assign  tlb_access_en0_m = tlb_access_en0_tmp & ldst_vld_m ;
assign  tlb_access_en1_m = tlb_access_en1_tmp & ldst_vld_m ;
assign  tlb_access_en1_m = tlb_access_en1_tmp & ldst_vld_m ;
assign  tlb_access_en2_m = tlb_access_en2_tmp & ldst_vld_m ;
assign  tlb_access_en2_m = tlb_access_en2_tmp & ldst_vld_m ;
assign  tlb_access_en3_m = tlb_access_en3_tmp & ldst_vld_m ;
assign  tlb_access_en3_m = tlb_access_en3_tmp & ldst_vld_m ;
 
 
dff  #(4) tlbac_stgw (
dff_s  #(4) tlbac_stgw (
        .din    ({tlb_access_en0_m,tlb_access_en1_m,tlb_access_en2_m,tlb_access_en3_m}),
        .din    ({tlb_access_en0_m,tlb_access_en1_m,tlb_access_en2_m,tlb_access_en3_m}),
        .q      ({tlb_access_en0_unflushed,tlb_access_en1_unflushed,tlb_access_en2_unflushed,tlb_access_en3_unflushed}),
        .q      ({tlb_access_en0_unflushed,tlb_access_en1_unflushed,tlb_access_en2_unflushed,tlb_access_en3_unflushed}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// Flush ld/st with as=42 belonging to lsu. bistctl and ldiag
// Flush ld/st with as=42 belonging to lsu. bistctl and ldiag
 
 
assign  tlb_access_en0_g = tlb_access_en0_unflushed & lsu_inst_vld_w & ~(dctl_early_flush_w | ifu_asi42_flush_g) ;
assign  tlb_access_en0_g = tlb_access_en0_unflushed & lsu_inst_vld_w & ~(dctl_early_flush_w | ifu_asi42_flush_g) ;
Line 3825... Line 3263...
 
 
 
 
// tlb_ld_inst* and tlb_st_inst* are generically used to indicate a read or write. 
// tlb_ld_inst* and tlb_st_inst* are generically used to indicate a read or write. 
// Thread 0
// Thread 0
 
 
dffre #(2)  asiv_thrd0 (
dffre_s #(2)  asiv_thrd0 (
        .din    ({ld_inst_vld_g,st_inst_vld_g}),
        .din    ({ld_inst_vld_g,st_inst_vld_g}),
        .q      ({tlb_ld_inst0,tlb_st_inst0}),
        .q      ({tlb_ld_inst0,tlb_st_inst0}),
        .rst    (tlb_access_rst0),        .en     (tlb_access_en0_g),
        .rst    (tlb_access_rst0),        .en     (tlb_access_en0_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dffe #(3)  asiv_thrd0_sec (
dffe_s #(3)  asiv_thrd0_sec (
        .din    ({dc_diagnstc_asi_g,dtagv_diagnstc_asi_g,ifu_nontlb_asi_g}),
        .din    ({dc_diagnstc_asi_g,dtagv_diagnstc_asi_g,ifu_nontlb_asi_g}),
        .q      ({dc0_diagnstc_asi,dtagv0_diagnstc_asi,ifu_nontlb0_asi}),
        .q      ({dc0_diagnstc_asi,dtagv0_diagnstc_asi,ifu_nontlb0_asi}),
        .en     (tlb_access_en0_g),
        .en     (tlb_access_en0_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  nontlb_asi0 = dc0_diagnstc_asi | dtagv0_diagnstc_asi | ifu_nontlb0_asi ;
assign  nontlb_asi0 = dc0_diagnstc_asi | dtagv0_diagnstc_asi | ifu_nontlb0_asi ;
 
 
// Thread 1
// Thread 1
 
 
dffre #(2)  asiv_thrd1 (
dffre_s #(2)  asiv_thrd1 (
        .din    ({ld_inst_vld_g,st_inst_vld_g}),
        .din    ({ld_inst_vld_g,st_inst_vld_g}),
        .q      ({tlb_ld_inst1,tlb_st_inst1}),
        .q      ({tlb_ld_inst1,tlb_st_inst1}),
        .rst    (tlb_access_rst1),        .en     (tlb_access_en1_g),
        .rst    (tlb_access_rst1),        .en     (tlb_access_en1_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dffe #(3)  asiv_thrd1_sec (
dffe_s #(3)  asiv_thrd1_sec (
        .din    ({dc_diagnstc_asi_g,dtagv_diagnstc_asi_g,ifu_nontlb_asi_g}),
        .din    ({dc_diagnstc_asi_g,dtagv_diagnstc_asi_g,ifu_nontlb_asi_g}),
        .q      ({dc1_diagnstc_asi,dtagv1_diagnstc_asi,ifu_nontlb1_asi}),
        .q      ({dc1_diagnstc_asi,dtagv1_diagnstc_asi,ifu_nontlb1_asi}),
        .en     (tlb_access_en1_g),
        .en     (tlb_access_en1_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  nontlb_asi1 = dc1_diagnstc_asi | dtagv1_diagnstc_asi | ifu_nontlb1_asi ;
assign  nontlb_asi1 = dc1_diagnstc_asi | dtagv1_diagnstc_asi | ifu_nontlb1_asi ;
 
 
// Thread 2
// Thread 2
 
 
dffre #(2)  asiv_thrd2 (
dffre_s #(2)  asiv_thrd2 (
        .din    ({ld_inst_vld_g,st_inst_vld_g}),
        .din    ({ld_inst_vld_g,st_inst_vld_g}),
        .q      ({tlb_ld_inst2,tlb_st_inst2}),
        .q      ({tlb_ld_inst2,tlb_st_inst2}),
        .rst    (tlb_access_rst2),        .en     (tlb_access_en2_g),
        .rst    (tlb_access_rst2),        .en     (tlb_access_en2_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dffe #(3)  asiv_thrd2_sec (
dffe_s #(3)  asiv_thrd2_sec (
        .din    ({dc_diagnstc_asi_g,dtagv_diagnstc_asi_g,ifu_nontlb_asi_g}),
        .din    ({dc_diagnstc_asi_g,dtagv_diagnstc_asi_g,ifu_nontlb_asi_g}),
        .q      ({dc2_diagnstc_asi,dtagv2_diagnstc_asi,ifu_nontlb2_asi}),
        .q      ({dc2_diagnstc_asi,dtagv2_diagnstc_asi,ifu_nontlb2_asi}),
        .en     (tlb_access_en2_g),
        .en     (tlb_access_en2_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  nontlb_asi2 = dc2_diagnstc_asi | dtagv2_diagnstc_asi | ifu_nontlb2_asi ;
assign  nontlb_asi2 = dc2_diagnstc_asi | dtagv2_diagnstc_asi | ifu_nontlb2_asi ;
 
 
// Thread 3
// Thread 3
 
 
dffre #(2)  asiv_thrd3 (
dffre_s #(2)  asiv_thrd3 (
        .din    ({ld_inst_vld_g,st_inst_vld_g}),
        .din    ({ld_inst_vld_g,st_inst_vld_g}),
        .q      ({tlb_ld_inst3,tlb_st_inst3}),
        .q      ({tlb_ld_inst3,tlb_st_inst3}),
        .rst    (tlb_access_rst3),        .en     (tlb_access_en3_g),
        .rst    (tlb_access_rst3),        .en     (tlb_access_en3_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dffe #(3)  asiv_thrd3_sec (
dffe_s #(3)  asiv_thrd3_sec (
        .din    ({dc_diagnstc_asi_g,dtagv_diagnstc_asi_g,ifu_nontlb_asi_g}),
        .din    ({dc_diagnstc_asi_g,dtagv_diagnstc_asi_g,ifu_nontlb_asi_g}),
        .q      ({dc3_diagnstc_asi,dtagv3_diagnstc_asi,ifu_nontlb3_asi}),
        .q      ({dc3_diagnstc_asi,dtagv3_diagnstc_asi,ifu_nontlb3_asi}),
        .en     (tlb_access_en3_g),
        .en     (tlb_access_en3_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  nontlb_asi3 = dc3_diagnstc_asi | dtagv3_diagnstc_asi | ifu_nontlb3_asi ;
assign  nontlb_asi3 = dc3_diagnstc_asi | dtagv3_diagnstc_asi | ifu_nontlb3_asi ;
 
 
//---
//---
Line 3999... Line 3437...
assign  asi_fifo2_rst = reset ;
assign  asi_fifo2_rst = reset ;
assign  asi_fifo3_rst = reset ;
assign  asi_fifo3_rst = reset ;
 
 
// Datapath :
// Datapath :
// fifo entry 0 is earliest. fifo entry 3 is latest.
// fifo entry 0 is earliest. fifo entry 3 is latest.
dffe #(2)  asiq_fifo_0 (
dffe_s #(2)  asiq_fifo_0 (
        .din    (asi_fifo0_din[1:0]),
        .din    (asi_fifo0_din[1:0]),
        .q      (asi_fifo0_q[1:0]),
        .q      (asi_fifo0_q[1:0]),
        .en     (asi_fifo0_en),
        .en     (asi_fifo0_en),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dffre   asiqv_fifo_0 (
dffre_s   asiqv_fifo_0 (
        .din    (asi_fifo0_vin),
        .din    (asi_fifo0_vin),
        .q      (asi_fifo0_vld),
        .q      (asi_fifo0_vld),
        .en     (asi_fifo0_en), .rst (asi_fifo0_rst),
        .en     (asi_fifo0_en), .rst (asi_fifo0_rst),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    asi_sel_thrd3,asi_sel_thrd2,asi_sel_thrd1,asi_sel_thrd0;
wire    asi_sel_thrd3,asi_sel_thrd2,asi_sel_thrd1,asi_sel_thrd0;
assign  asi_sel_thrd0 = ~asi_fifo0_q[1] & ~asi_fifo0_q[0] & (tlb_ld_inst0 | tlb_st_inst0) ;
assign  asi_sel_thrd0 = ~asi_fifo0_q[1] & ~asi_fifo0_q[0] & (tlb_ld_inst0 | tlb_st_inst0) ;
assign  asi_sel_thrd1 = ~asi_fifo0_q[1] &  asi_fifo0_q[0] & (tlb_ld_inst1 | tlb_st_inst1) ;
assign  asi_sel_thrd1 = ~asi_fifo0_q[1] &  asi_fifo0_q[0] & (tlb_ld_inst1 | tlb_st_inst1) ;
assign  asi_sel_thrd2 =  asi_fifo0_q[1] & ~asi_fifo0_q[0] & (tlb_ld_inst2 | tlb_st_inst2) ;
assign  asi_sel_thrd2 =  asi_fifo0_q[1] & ~asi_fifo0_q[0] & (tlb_ld_inst2 | tlb_st_inst2) ;
assign  asi_sel_thrd3 =  asi_fifo0_q[1] &  asi_fifo0_q[0] & (tlb_ld_inst3 | tlb_st_inst3) ;
assign  asi_sel_thrd3 =  asi_fifo0_q[1] &  asi_fifo0_q[0] & (tlb_ld_inst3 | tlb_st_inst3) ;
 
 
dffe #(2)  asiq_fifo_1 (
dffe_s #(2)  asiq_fifo_1 (
        .din    (asi_fifo1_din[1:0]),
        .din    (asi_fifo1_din[1:0]),
        .q      (asi_fifo1_q[1:0]),
        .q      (asi_fifo1_q[1:0]),
        .en     (asi_fifo1_en),
        .en     (asi_fifo1_en),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dffre  asiqv_fifo_1 (
dffre_s  asiqv_fifo_1 (
        .din    (asi_fifo1_vin),
        .din    (asi_fifo1_vin),
        .q      (asi_fifo1_vld),
        .q      (asi_fifo1_vld),
        .en     (asi_fifo1_en), .rst    (asi_fifo1_rst),
        .en     (asi_fifo1_en), .rst    (asi_fifo1_rst),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dffe #(2)  asiq_fifo_2 (
dffe_s #(2)  asiq_fifo_2 (
        .din    (asi_fifo2_din[1:0]),
        .din    (asi_fifo2_din[1:0]),
        .q      (asi_fifo2_q[1:0]),
        .q      (asi_fifo2_q[1:0]),
        .en     (asi_fifo2_en),
        .en     (asi_fifo2_en),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dffre   asiqv_fifo_2 (
dffre_s   asiqv_fifo_2 (
        .din    (asi_fifo2_vin),
        .din    (asi_fifo2_vin),
        .q      (asi_fifo2_vld),
        .q      (asi_fifo2_vld),
        .en     (asi_fifo2_en), .rst    (asi_fifo2_rst),
        .en     (asi_fifo2_en), .rst    (asi_fifo2_rst),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dffe #(2)  asiq_fifo_3 (
dffe_s #(2)  asiq_fifo_3 (
        .din    (asi_fifo3_din[1:0]),
        .din    (asi_fifo3_din[1:0]),
        .q      (asi_fifo3_q[1:0]),
        .q      (asi_fifo3_q[1:0]),
        .en     (asi_fifo3_en),
        .en     (asi_fifo3_en),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dffre  asiqv_fifo_3 (
dffre_s  asiqv_fifo_3 (
        .din    (asi_fifo3_vin),
        .din    (asi_fifo3_vin),
        .q      (asi_fifo3_vld),
        .q      (asi_fifo3_vld),
        .en     (asi_fifo3_en), .rst    (asi_fifo3_rst),
        .en     (asi_fifo3_en), .rst    (asi_fifo3_rst),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//---
//---
 
 
assign  tlb_access_initiated =
assign  tlb_access_initiated =
Line 4088... Line 3526...
  ifu_lsu_asi_ack |
  ifu_lsu_asi_ack |
  lsu_diagnstc_wr_src_sel_e;
  lsu_diagnstc_wr_src_sel_e;
 
 
 
 
// MMU/IFU/DIAG Action is pending
// MMU/IFU/DIAG Action is pending
dffre #(1)  tlbpnd (
dffre_s #(1)  tlbpnd (
        .din    (tlb_access_initiated),
        .din    (tlb_access_initiated),
        .q      (tlb_access_pending),
        .q      (tlb_access_pending),
        .rst    (tlb_blocking_rst),        .en     (tlb_access_initiated),
        .rst    (tlb_blocking_rst),        .en     (tlb_access_initiated),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
/*wire  asi_pend0,asi_pend1,asi_pend2,asi_pend3 ;
/*wire  asi_pend0,asi_pend1,asi_pend2,asi_pend3 ;
dffre #(4)  asithrdpnd (
dffre_s #(4)  asithrdpnd (
        .din    ({tlb_access_sel_thrd3,tlb_access_sel_thrd2,
        .din    ({tlb_access_sel_thrd3,tlb_access_sel_thrd2,
                            tlb_access_sel_thrd1,tlb_access_sel_thrd0}),
                            tlb_access_sel_thrd1,tlb_access_sel_thrd0}),
        .q    ({asi_pend3,asi_pend2,asi_pend1,asi_pend0}),
        .q    ({asi_pend3,asi_pend2,asi_pend1,asi_pend0}),
        .rst    (tlb_blocking_rst),     .en     (tlb_access_initiated),
        .rst    (tlb_blocking_rst),     .en     (tlb_access_initiated),
        .clk  (clk),
        .clk  (clk),
        .se   (se),       .si (),          .so ()
        .se   (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    asi_pend_non_thrd0 ;
wire    asi_pend_non_thrd0 ;
assign  asi_pend_non_thrd0 = asi_pend1 | asi_pend2 | asi_pend3 ;
assign  asi_pend_non_thrd0 = asi_pend1 | asi_pend2 | asi_pend3 ;
wire    asi_pend_non_thrd1 ;
wire    asi_pend_non_thrd1 ;
Line 4173... Line 3611...
//  (tlb_ld_inst3 | tlb_st_inst3) & 
//  (tlb_ld_inst3 | tlb_st_inst3) & 
//  ~(((tlb_ld_inst0 | tlb_st_inst0 | tlb_ld_inst1 | tlb_st_inst1 | 
//  ~(((tlb_ld_inst0 | tlb_st_inst0 | tlb_ld_inst1 | tlb_st_inst1 | 
//    tlb_ld_inst2 | tlb_st_inst2) & ~tlb_access_pending) | tlb_access_blocked) &
//    tlb_ld_inst2 | tlb_st_inst2) & ~tlb_access_pending) | tlb_access_blocked) &
//  ~asi_pend_non_thrd3 );
//  ~asi_pend_non_thrd3 );
 
 
dff  #(4) selt_stgd1 (
dff_s  #(4) selt_stgd1 (
        .din    ({tlb_access_sel_thrd3,tlb_access_sel_thrd2,
        .din    ({tlb_access_sel_thrd3,tlb_access_sel_thrd2,
                tlb_access_sel_thrd1,tlb_access_sel_thrd0}),
                tlb_access_sel_thrd1,tlb_access_sel_thrd0}),
        .q     ({tlb_access_sel_thrd3_d1,tlb_access_sel_thrd2_d1,
        .q     ({tlb_access_sel_thrd3_d1,tlb_access_sel_thrd2_d1,
                tlb_access_sel_thrd1_d1,tlb_access_sel_thrd0_d1}),
                tlb_access_sel_thrd1_d1,tlb_access_sel_thrd0_d1}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
   wire tlb_access_sel_default;
   wire tlb_access_sel_default;
assign  tlb_access_sel_default = rst_tri_en | (
assign  tlb_access_sel_default = rst_tri_en | (
        ~(tlb_access_sel_thrd2 | tlb_access_sel_thrd1 | tlb_access_sel_thrd0));
        ~(tlb_access_sel_thrd2 | tlb_access_sel_thrd1 | tlb_access_sel_thrd0));
 
 
dff  #(4) lsu_diagnstc_data_sel_ff (
dff_s  #(4) lsu_diagnstc_data_sel_ff (
        .din    ({tlb_access_sel_default,tlb_access_sel_thrd2,
        .din    ({tlb_access_sel_default,tlb_access_sel_thrd2,
                tlb_access_sel_thrd1,tlb_access_sel_thrd0}),
                tlb_access_sel_thrd1,tlb_access_sel_thrd0}),
        .q     ({lsu_diagnstc_data_sel[3:0]}),
        .q     ({lsu_diagnstc_data_sel[3:0]}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff  #(4) lsu_diagnstc_va_sel_ff (
dff_s  #(4) lsu_diagnstc_va_sel_ff (
        .din    ({tlb_access_sel_default,tlb_access_sel_thrd2,
        .din    ({tlb_access_sel_default,tlb_access_sel_thrd2,
                tlb_access_sel_thrd1,tlb_access_sel_thrd0}),
                tlb_access_sel_thrd1,tlb_access_sel_thrd0}),
        .q     ({lsu_diagnstc_va_sel[3:0]}),
        .q     ({lsu_diagnstc_va_sel[3:0]}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
// Begin - Bug 3487
// Begin - Bug 3487
assign  st_sqsh_m =
assign  st_sqsh_m =
Line 4266... Line 3704...
assign  diag_wr_src = dtagv_diagnstc_wr_en | dc_diagnstc_wr_en ;
assign  diag_wr_src = dtagv_diagnstc_wr_en | dc_diagnstc_wr_en ;
 
 
   wire diag_wr_src_with_rst;
   wire diag_wr_src_with_rst;
   assign diag_wr_src_with_rst = diag_wr_src & ~lsu_diagnstc_wr_src_sel_e;
   assign diag_wr_src_with_rst = diag_wr_src & ~lsu_diagnstc_wr_src_sel_e;
 
 
dff  #(1) diagwr_d1 (
dff_s  #(1) diagwr_d1 (
        .din    (diag_wr_src_with_rst),
        .din    (diag_wr_src_with_rst),
        .q      (diag_wr_src_d1),
        .q      (diag_wr_src_d1),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
   wire diag_wr_src_d1_with_rst;
   wire diag_wr_src_d1_with_rst;
   assign diag_wr_src_d1_with_rst = diag_wr_src_d1 & ~lsu_diagnstc_wr_src_sel_e;
   assign diag_wr_src_d1_with_rst = diag_wr_src_d1 & ~lsu_diagnstc_wr_src_sel_e;
 
 
dff  #(1) diagwr_d2 (
dff_s  #(1) diagwr_d2 (
        .din    (diag_wr_src_d1_with_rst),
        .din    (diag_wr_src_d1_with_rst),
        .q      (diag_wr_src_d2),
        .q      (diag_wr_src_d2),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// If there is no memory reference, then the diag access is free to go.
// If there is no memory reference, then the diag access is free to go.
// tlb_access_blocked must be set appr. 
// tlb_access_blocked must be set appr. 
wire diag_wr_src_sel_d1, diag_wr_src_sel_din;
wire diag_wr_src_sel_d1, diag_wr_src_sel_din;
Line 4293... Line 3731...
//assign diag_wr_src_sel_din = diag_wr_src_d2 & ~memref_e;
//assign diag_wr_src_sel_din = diag_wr_src_d2 & ~memref_e;
assign diag_wr_src_sel_din = diag_wr_src_d2 & ~(memref_e | lsu_dfq_vld);
assign diag_wr_src_sel_din = diag_wr_src_d2 & ~(memref_e | lsu_dfq_vld);
 
 
assign  lsu_diagnstc_wr_src_sel_e =  ~diag_wr_src_sel_d1 & diag_wr_src_sel_din ;
assign  lsu_diagnstc_wr_src_sel_e =  ~diag_wr_src_sel_d1 & diag_wr_src_sel_din ;
 
 
dff  #(1) diagwrsel_d1 (
dff_s  #(1) diagwrsel_d1 (
        .din    (diag_wr_src_sel_din),
        .din    (diag_wr_src_sel_din),
        .q      (diag_wr_src_sel_d1),
        .q      (diag_wr_src_sel_d1),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// Decode for diagnostic cache/dtag/vld write 
// Decode for diagnostic cache/dtag/vld write 
   //wire [13:11] lngltncy_ldst_va;
   //wire [13:11] lngltncy_ldst_va;
 
 
Line 4329... Line 3767...
  (tlb_access_sel_thrd2 & tlb_st_inst2 & ifu_nontlb2_asi) |
  (tlb_access_sel_thrd2 & tlb_st_inst2 & ifu_nontlb2_asi) |
  (tlb_access_sel_thrd3 & tlb_st_inst3 & ifu_nontlb3_asi) ;
  (tlb_access_sel_thrd3 & tlb_st_inst3 & ifu_nontlb3_asi) ;
 
 
assign  ifu_asi_vld = lsu_ifu_asi_load | ifu_asi_store ;
assign  ifu_asi_vld = lsu_ifu_asi_load | ifu_asi_store ;
 
 
dff  #(2) iasiv_d1 (
dff_s  #(2) iasiv_d1 (
        .din    ({ifu_asi_vld,ifu_lsu_asi_ack}),
        .din    ({ifu_asi_vld,ifu_lsu_asi_ack}),
        .q      ({ifu_asi_vld_d1,ifu_asi_ack_d1}),
        .q      ({ifu_asi_vld_d1,ifu_asi_ack_d1}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// Bug 3932 - delay asi_vld for ifu.
// Bug 3932 - delay asi_vld for ifu.
assign  lsu_ifu_asi_vld = ifu_asi_vld_d1 & ~ifu_asi_ack_d1 ;
assign  lsu_ifu_asi_vld = ifu_asi_vld_d1 & ~ifu_asi_ack_d1 ;
 
 
assign  ifu_asi_store_cmplt_en = ifu_asi_store & ifu_lsu_asi_ack ;
assign  ifu_asi_store_cmplt_en = ifu_asi_store & ifu_lsu_asi_ack ;
dff  #(1) iasist_d1 (
dff_s  #(1) iasist_d1 (
        .din    (ifu_asi_store_cmplt_en),
        .din    (ifu_asi_store_cmplt_en),
        .q      (ifu_asi_store_cmplt_en_d1),
        .q      (ifu_asi_store_cmplt_en_d1),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  lsu_ifu_asi_thrid[1:0] = lsu_tlu_tlb_access_tid_m[1:0] ;
assign  lsu_ifu_asi_thrid[1:0] = lsu_tlu_tlb_access_tid_m[1:0] ;
 
 
 
 
Line 4366... Line 3804...
// membar will signal completion once stb for thread empty
// membar will signal completion once stb for thread empty
// flush  will signal completion once flush pkt is visible at head of cfq and
// flush  will signal completion once flush pkt is visible at head of cfq and
// i-side invalidates are complete
// i-side invalidates are complete
// ** flush bit needs to be added to dfq **
// ** flush bit needs to be added to dfq **
 
 
dff  #(2) bsync_stgm (
dff_s  #(2) bsync_stgm (
        .din    ({ifu_tlu_mb_inst_e,ifu_tlu_flsh_inst_e}),
        .din    ({ifu_tlu_mb_inst_e,ifu_tlu_flsh_inst_e}),
        .q      ({mbar_inst_m,flsh_inst_m}),
        .q      ({mbar_inst_m,flsh_inst_m}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  lsu_flsh_inst_m = flsh_inst_m ;
assign  lsu_flsh_inst_m = flsh_inst_m ;
 
 
wire  mbar_inst_unflushed,flsh_inst_unflushed ;
wire  mbar_inst_unflushed,flsh_inst_unflushed ;
 
 
dff  #(2) bsync_stgg (
dff_s  #(2) bsync_stgg (
        .din    ({mbar_inst_m,flsh_inst_m}),
        .din    ({mbar_inst_m,flsh_inst_m}),
        .q      ({mbar_inst_unflushed,flsh_inst_unflushed}),
        .q      ({mbar_inst_unflushed,flsh_inst_unflushed}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    [3:0]    flsh_cmplt_d1 ;
wire    [3:0]    flsh_cmplt_d1 ;
/*dff  #(4) flshcmplt (
/*dff  #(4) flshcmplt (
        .din    (lsu_dfq_flsh_cmplt[3:0]),
        .din    (lsu_dfq_flsh_cmplt[3:0]),
        .q      (flsh_cmplt_d1[3:0]),
        .q      (flsh_cmplt_d1[3:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );*/
        );*/
 
 
// now flopped in dctl
// now flopped in dctl
assign  flsh_cmplt_d1[3:0] = lsu_dfq_flsh_cmplt[3:0] ;
assign  flsh_cmplt_d1[3:0] = lsu_dfq_flsh_cmplt[3:0] ;
 
 
Line 4412... Line 3850...
assign  flush_inst0_g = flsh_inst_g & thread0_g ;
assign  flush_inst0_g = flsh_inst_g & thread0_g ;
assign  mbar_inst0_g  = mbar_inst_g & thread0_g ;
assign  mbar_inst0_g  = mbar_inst_g & thread0_g ;
 
 
// bsyncs are set in g-stage to allow earlier stores in pipe to drain to 
// bsyncs are set in g-stage to allow earlier stores in pipe to drain to 
// thread's stb
// thread's stb
dffre #(2)  bsync_vld0 (
dffre_s #(2)  bsync_vld0 (
        .din    ({mbar_inst0_g,flush_inst0_g}),
        .din    ({mbar_inst0_g,flush_inst0_g}),
        .q      ({mbar_vld0,flsh_vld0}),
        .q      ({mbar_vld0,flsh_vld0}),
        .rst    (bsync0_reset),        .en     (bsync0_en),
        .rst    (bsync0_reset),        .en     (bsync0_en),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// THREAD1 MEMBAR/FLUSH
// THREAD1 MEMBAR/FLUSH
 
 
// barrier sync
// barrier sync
Line 4434... Line 3872...
assign  flush_inst1_g = flsh_inst_g & thread1_g ;
assign  flush_inst1_g = flsh_inst_g & thread1_g ;
assign  mbar_inst1_g  = mbar_inst_g & thread1_g ;
assign  mbar_inst1_g  = mbar_inst_g & thread1_g ;
 
 
// bsyncs are set in g-stage to allow earlier stores in pipe to drain to 
// bsyncs are set in g-stage to allow earlier stores in pipe to drain to 
// thread's stb
// thread's stb
dffre #(2)  bsync_vld1 (
dffre_s #(2)  bsync_vld1 (
        .din    ({mbar_inst1_g,flush_inst1_g}),
        .din    ({mbar_inst1_g,flush_inst1_g}),
        .q      ({mbar_vld1,flsh_vld1}),
        .q      ({mbar_vld1,flsh_vld1}),
        .rst    (bsync1_reset),        .en     (bsync1_en),
        .rst    (bsync1_reset),        .en     (bsync1_en),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// THREAD2 MEMBAR/FLUSH
// THREAD2 MEMBAR/FLUSH
 
 
// barrier sync
// barrier sync
Line 4456... Line 3894...
assign  flush_inst2_g = flsh_inst_g & thread2_g ;
assign  flush_inst2_g = flsh_inst_g & thread2_g ;
assign  mbar_inst2_g  = mbar_inst_g & thread2_g ;
assign  mbar_inst2_g  = mbar_inst_g & thread2_g ;
 
 
// bsyncs are set in g-stage to allow earlier stores in pipe to drain to 
// bsyncs are set in g-stage to allow earlier stores in pipe to drain to 
// thread's stb
// thread's stb
dffre #(2)  bsync_vld2 (
dffre_s #(2)  bsync_vld2 (
        .din    ({mbar_inst2_g,flush_inst2_g}),
        .din    ({mbar_inst2_g,flush_inst2_g}),
        .q      ({mbar_vld2,flsh_vld2}),
        .q      ({mbar_vld2,flsh_vld2}),
        .rst    (bsync2_reset),        .en     (bsync2_en),
        .rst    (bsync2_reset),        .en     (bsync2_en),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// THREAD3 MEMBAR/FLUSH
// THREAD3 MEMBAR/FLUSH
 
 
// barrier sync
// barrier sync
Line 4478... Line 3916...
assign  flush_inst3_g = flsh_inst_g & thread3_g ;
assign  flush_inst3_g = flsh_inst_g & thread3_g ;
assign  mbar_inst3_g  = mbar_inst_g & thread3_g ;
assign  mbar_inst3_g  = mbar_inst_g & thread3_g ;
 
 
// bsyncs are set in g-stage to allow earlier stores in pipe to drain to 
// bsyncs are set in g-stage to allow earlier stores in pipe to drain to 
// thread's stb
// thread's stb
dffre #(2)  bsync_vld3 (
dffre_s #(2)  bsync_vld3 (
        .din    ({mbar_inst3_g,flush_inst3_g}),
        .din    ({mbar_inst3_g,flush_inst3_g}),
        .q      ({mbar_vld3,flsh_vld3}),
        .q      ({mbar_vld3,flsh_vld3}),
        .rst    (bsync3_reset),        .en     (bsync3_en),
        .rst    (bsync3_reset),        .en     (bsync3_en),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//=========================================================================================
//=========================================================================================
//  RMO Store Ack Count
//  RMO Store Ack Count
//=========================================================================================
//=========================================================================================
Line 4540... Line 3978...
assign  ackcnt_en[1] = lsu_stb_rmo_st_issue[1] ^ lsu_cpx_rmo_st_ack[1] ;
assign  ackcnt_en[1] = lsu_stb_rmo_st_issue[1] ^ lsu_cpx_rmo_st_ack[1] ;
assign  ackcnt_en[2] = lsu_stb_rmo_st_issue[2] ^ lsu_cpx_rmo_st_ack[2] ;
assign  ackcnt_en[2] = lsu_stb_rmo_st_issue[2] ^ lsu_cpx_rmo_st_ack[2] ;
assign  ackcnt_en[3] = lsu_stb_rmo_st_issue[3] ^ lsu_cpx_rmo_st_ack[3] ;
assign  ackcnt_en[3] = lsu_stb_rmo_st_issue[3] ^ lsu_cpx_rmo_st_ack[3] ;
 
 
// Thread0
// Thread0
dffre #(4)  ackcnt0_ff (
dffre_s #(4)  ackcnt0_ff (
        .din    (ackcnt0_din[3:0]),
        .din    (ackcnt0_din[3:0]),
        .q      (ackcnt0[3:0]),
        .q      (ackcnt0[3:0]),
        .rst    (reset),        .en     (ackcnt_en[0]),
        .rst    (reset),        .en     (ackcnt_en[0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// Thread1
// Thread1
dffre #(4)  ackcnt1_ff (
dffre_s #(4)  ackcnt1_ff (
        .din    (ackcnt1_din[3:0]),
        .din    (ackcnt1_din[3:0]),
        .q      (ackcnt1[3:0]),
        .q      (ackcnt1[3:0]),
        .rst    (reset),        .en     (ackcnt_en[1]),
        .rst    (reset),        .en     (ackcnt_en[1]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// Thread2
// Thread2
dffre #(4)  ackcnt2_ff (
dffre_s #(4)  ackcnt2_ff (
        .din    (ackcnt2_din[3:0]),
        .din    (ackcnt2_din[3:0]),
        .q      (ackcnt2[3:0]),
        .q      (ackcnt2[3:0]),
        .rst    (reset),        .en     (ackcnt_en[2]),
        .rst    (reset),        .en     (ackcnt_en[2]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// Thread3
// Thread3
dffre #(4)  ackcnt3_ff (
dffre_s #(4)  ackcnt3_ff (
        .din    (ackcnt3_din[3:0]),
        .din    (ackcnt3_din[3:0]),
        .q      (ackcnt3[3:0]),
        .q      (ackcnt3[3:0]),
        .rst    (reset),        .en     (ackcnt_en[3]),
        .rst    (reset),        .en     (ackcnt_en[3]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  no_spc_rmo_st[0] = ~(|ackcnt0[3:0]) ;
assign  no_spc_rmo_st[0] = ~(|ackcnt0[3:0]) ;
assign  no_spc_rmo_st[1] = ~(|ackcnt1[3:0]) ;
assign  no_spc_rmo_st[1] = ~(|ackcnt1[3:0]) ;
assign  no_spc_rmo_st[2] = ~(|ackcnt2[3:0]) ;
assign  no_spc_rmo_st[2] = ~(|ackcnt2[3:0]) ;
Line 4593... Line 4031...
 
 
/*dff #(4)  spustb_d1 ( // moved to stb_rwctl
/*dff #(4)  spustb_d1 ( // moved to stb_rwctl
        .din    (lsu_stb_empty[3:0]),
        .din    (lsu_stb_empty[3:0]),
        .q      (lsu_spu_stb_empty[3:0]),
        .q      (lsu_spu_stb_empty[3:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        ); */
        ); */
 
 
//assign                lsu_spu_stb_empty[3:0] = lsu_stb_empty[3:0] ;
//assign                lsu_spu_stb_empty[3:0] = lsu_stb_empty[3:0] ;
 
 
//=========================================================================================
//=========================================================================================
//  Thread Staging
//  Thread Staging
//=========================================================================================
//=========================================================================================
 
 
// Thread staging can be optimized. 
// Thread staging can be optimized. 
 
 
dff  #(2) thrid_stgd (
dff_s  #(2) thrid_stgd (
        .din    (ifu_lsu_thrid_s[1:0]),
        .din    (ifu_lsu_thrid_s[1:0]),
        .q      (thrid_d[1:0]),
        .q      (thrid_d[1:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff  #(2) lsu_tlu_thrid_stgd (
dff_s  #(2) lsu_tlu_thrid_stgd (
        .din    (ifu_lsu_thrid_s[1:0]),
        .din    (ifu_lsu_thrid_s[1:0]),
        .q      (lsu_tlu_thrid_d[1:0]),
        .q      (lsu_tlu_thrid_d[1:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//assign        lsu_tlu_thrid_d[1:0] = thrid_d[1:0] ;
//assign        lsu_tlu_thrid_d[1:0] = thrid_d[1:0] ;
 
 
assign  thread0_d = ~thrid_d[1] & ~thrid_d[0] ;
assign  thread0_d = ~thrid_d[1] & ~thrid_d[0] ;
assign  thread1_d = ~thrid_d[1] &  thrid_d[0] ;
assign  thread1_d = ~thrid_d[1] &  thrid_d[0] ;
assign  thread2_d =  thrid_d[1] & ~thrid_d[0] ;
assign  thread2_d =  thrid_d[1] & ~thrid_d[0] ;
assign  thread3_d =  thrid_d[1] &  thrid_d[0] ;
assign  thread3_d =  thrid_d[1] &  thrid_d[0] ;
 
 
dff  #(2) thrid_stge (
dff_s  #(2) thrid_stge (
        .din    (thrid_d[1:0]),
        .din    (thrid_d[1:0]),
        .q      (thrid_e[1:0]),
        .q      (thrid_e[1:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  thread0_e = ~thrid_e[1] & ~thrid_e[0] ;
assign  thread0_e = ~thrid_e[1] & ~thrid_e[0] ;
assign  thread1_e = ~thrid_e[1] &  thrid_e[0] ;
assign  thread1_e = ~thrid_e[1] &  thrid_e[0] ;
assign  thread2_e =  thrid_e[1] & ~thrid_e[0] ;
assign  thread2_e =  thrid_e[1] & ~thrid_e[0] ;
assign  thread3_e =  thrid_e[1] &  thrid_e[0] ;
assign  thread3_e =  thrid_e[1] &  thrid_e[0] ;
 
 
dff  #(2) thrid_stgm (
dff_s  #(2) thrid_stgm (
        .din    (thrid_e[1:0]),
        .din    (thrid_e[1:0]),
        .q      (thrid_m[1:0]),
        .q      (thrid_m[1:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  thread0_m = ~thrid_m[1] & ~thrid_m[0] ;
assign  thread0_m = ~thrid_m[1] & ~thrid_m[0] ;
assign  thread1_m = ~thrid_m[1] &  thrid_m[0] ;
assign  thread1_m = ~thrid_m[1] &  thrid_m[0] ;
assign  thread2_m =  thrid_m[1] & ~thrid_m[0] ;
assign  thread2_m =  thrid_m[1] & ~thrid_m[0] ;
Line 4654... Line 4092...
bw_u1_buf_30x UZfix_thread0_m  ( .a(thread0_m),  .z(lsu_dctldp_thread0_m)  );
bw_u1_buf_30x UZfix_thread0_m  ( .a(thread0_m),  .z(lsu_dctldp_thread0_m)  );
bw_u1_buf_30x UZfix_thread1_m  ( .a(thread1_m),  .z(lsu_dctldp_thread1_m)  );
bw_u1_buf_30x UZfix_thread1_m  ( .a(thread1_m),  .z(lsu_dctldp_thread1_m)  );
bw_u1_buf_30x UZfix_thread2_m  ( .a(thread2_m),  .z(lsu_dctldp_thread2_m)  );
bw_u1_buf_30x UZfix_thread2_m  ( .a(thread2_m),  .z(lsu_dctldp_thread2_m)  );
bw_u1_buf_30x UZfix_thread3_m  ( .a(thread3_m),  .z(lsu_dctldp_thread3_m)  );
bw_u1_buf_30x UZfix_thread3_m  ( .a(thread3_m),  .z(lsu_dctldp_thread3_m)  );
 
 
dff  #(2) thrid_stgg (
dff_s  #(2) thrid_stgg (
        .din    (thrid_m[1:0]),
        .din    (thrid_m[1:0]),
        .q      (thrid_g[1:0]),
        .q      (thrid_g[1:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  thread0_g = ~thrid_g[1] & ~thrid_g[0] ;
assign  thread0_g = ~thrid_g[1] & ~thrid_g[0] ;
assign  thread1_g = ~thrid_g[1] &  thrid_g[0] ;
assign  thread1_g = ~thrid_g[1] &  thrid_g[0] ;
assign  thread2_g =  thrid_g[1] & ~thrid_g[0] ;
assign  thread2_g =  thrid_g[1] & ~thrid_g[0] ;
assign  thread3_g =  thrid_g[1] &  thrid_g[0] ;
assign  thread3_g =  thrid_g[1] &  thrid_g[0] ;
 
 
dff  #(2) thrid_stgw2 (
dff_s  #(2) thrid_stgw2 (
        .din    (thrid_g[1:0]),
        .din    (thrid_g[1:0]),
        .q      (thrid_w2[1:0]),
        .q      (thrid_w2[1:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  thread0_w2 = ~thrid_w2[1] & ~thrid_w2[0] ;
assign  thread0_w2 = ~thrid_w2[1] & ~thrid_w2[0] ;
assign  thread1_w2 = ~thrid_w2[1] &  thrid_w2[0] ;
assign  thread1_w2 = ~thrid_w2[1] &  thrid_w2[0] ;
assign  thread2_w2 =  thrid_w2[1] & ~thrid_w2[0] ;
assign  thread2_w2 =  thrid_w2[1] & ~thrid_w2[0] ;
assign  thread3_w2 =  thrid_w2[1] &  thrid_w2[0] ;
assign  thread3_w2 =  thrid_w2[1] &  thrid_w2[0] ;
 
 
dff  #(2) thrid_stgw3 (
dff_s  #(2) thrid_stgw3 (
        .din    (thrid_w2[1:0]),
        .din    (thrid_w2[1:0]),
        .q      (thrid_w3[1:0]),
        .q      (thrid_w3[1:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  thread0_w3 = ~thrid_w3[1] & ~thrid_w3[0] ;
assign  thread0_w3 = ~thrid_w3[1] & ~thrid_w3[0] ;
assign  thread1_w3 = ~thrid_w3[1] &  thrid_w3[0] ;
assign  thread1_w3 = ~thrid_w3[1] &  thrid_w3[0] ;
assign  thread2_w3 =  thrid_w3[1] & ~thrid_w3[0] ;
assign  thread2_w3 =  thrid_w3[1] & ~thrid_w3[0] ;
Line 4694... Line 4132...
 
 
//dff  #(4) thrid_stgw3 (
//dff  #(4) thrid_stgw3 (
//        .din    ({thread0_w2,thread1_w2,thread2_w2,thread3_w2}),
//        .din    ({thread0_w2,thread1_w2,thread2_w2,thread3_w2}),
//        .q      ({thread0_w3,thread1_w3,thread2_w3,thread3_w3}),
//        .q      ({thread0_w3,thread1_w3,thread2_w3,thread3_w3}),
//        .clk    (clk),
//        .clk    (clk),
//        .se     (se),       .si (),          .so ()
//        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//        );
//        );
 
 
// ldxa thread id
// ldxa thread id
 
 
assign  ldxa_thrid_w2[1:0] = tlu_lsu_ldxa_tid_w2[1:0] ;
assign  ldxa_thrid_w2[1:0] = tlu_lsu_ldxa_tid_w2[1:0] ;
Line 4722... Line 4160...
assign  ifu_ldxa_thread1_w2 = ~ifu_lsu_ldxa_tid_w2[1] &  ifu_lsu_ldxa_tid_w2[0] ;
assign  ifu_ldxa_thread1_w2 = ~ifu_lsu_ldxa_tid_w2[1] &  ifu_lsu_ldxa_tid_w2[0] ;
assign  ifu_ldxa_thread2_w2 =  ifu_lsu_ldxa_tid_w2[1] & ~ifu_lsu_ldxa_tid_w2[0] ;
assign  ifu_ldxa_thread2_w2 =  ifu_lsu_ldxa_tid_w2[1] & ~ifu_lsu_ldxa_tid_w2[0] ;
assign  ifu_ldxa_thread3_w2 =  ifu_lsu_ldxa_tid_w2[1] &  ifu_lsu_ldxa_tid_w2[0] ;
assign  ifu_ldxa_thread3_w2 =  ifu_lsu_ldxa_tid_w2[1] &  ifu_lsu_ldxa_tid_w2[0] ;
 
 
wire    [1:0]    ifu_nontlb_asi_tid ;
wire    [1:0]    ifu_nontlb_asi_tid ;
dff  #(2) iasi_tid (
dff_s  #(2) iasi_tid (
        .din    (lsu_ifu_asi_thrid[1:0]),
        .din    (lsu_ifu_asi_thrid[1:0]),
        .q      (ifu_nontlb_asi_tid[1:0]),
        .q      (ifu_nontlb_asi_tid[1:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  ifu_stxa_thread0_w2 = ~ifu_nontlb_asi_tid[1] & ~ifu_nontlb_asi_tid[0] ;
assign  ifu_stxa_thread0_w2 = ~ifu_nontlb_asi_tid[1] & ~ifu_nontlb_asi_tid[0] ;
assign  ifu_stxa_thread1_w2 = ~ifu_nontlb_asi_tid[1] &  ifu_nontlb_asi_tid[0] ;
assign  ifu_stxa_thread1_w2 = ~ifu_nontlb_asi_tid[1] &  ifu_nontlb_asi_tid[0] ;
assign  ifu_stxa_thread2_w2 =  ifu_nontlb_asi_tid[1] & ~ifu_nontlb_asi_tid[0] ;
assign  ifu_stxa_thread2_w2 =  ifu_nontlb_asi_tid[1] & ~ifu_nontlb_asi_tid[0] ;
Line 4757... Line 4195...
 
 
//SC dff  #(2) tlbex_stgm (
//SC dff  #(2) tlbex_stgm (
//SC         .din    ({tlb_daccess_excptn_e,tlb_daccess_error_e}),
//SC         .din    ({tlb_daccess_excptn_e,tlb_daccess_error_e}),
//SC         .q      ({tlb_daccess_excptn_m,tlb_daccess_error_m}),
//SC         .q      ({tlb_daccess_excptn_m,tlb_daccess_error_m}),
//SC         .clk    (clk),
//SC         .clk    (clk),
//SC         .se     (se),       .si (),          .so ()
//SC         .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//SC         );
//SC         );
 
 
//SC dff  #(2) tlbex_stgg (
//SC dff  #(2) tlbex_stgg (
//SC         .din    ({tlb_daccess_excptn_m,tlb_daccess_error_m}),
//SC         .din    ({tlb_daccess_excptn_m,tlb_daccess_error_m}),
//SC         .q      ({tlb_daccess_excptn_g,tlb_daccess_error_g}),
//SC         .q      ({tlb_daccess_excptn_g,tlb_daccess_error_g}),
//SC         .clk    (clk),
//SC         .clk    (clk),
//SC         .se     (se),       .si (),          .so ()
//SC         .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//SC         );
//SC         );
 
 
//assign  pstate_priv_m = 
//assign  pstate_priv_m = 
//  thread0_m ? tlu_lsu_pstate_priv[0] :
//  thread0_m ? tlu_lsu_pstate_priv[0] :
//    thread1_m ? tlu_lsu_pstate_priv[1] :
//    thread1_m ? tlu_lsu_pstate_priv[1] :
Line 4789... Line 4227...
 
 
//SC dff  priv_stgg (
//SC dff  priv_stgg (
//SC         .din    (pstate_priv_m),
//SC         .din    (pstate_priv_m),
//SC         .q      (pstate_priv),
//SC         .q      (pstate_priv),
//SC         .clk    (clk),
//SC         .clk    (clk),
//SC         .se     (se),       .si (),          .so ()
//SC         .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//SC         );
//SC         );
 
 
// privilege violation - priv page accessed in user mode
// privilege violation - priv page accessed in user mode
//SC assign  priv_pg_usr_mode =  // data access exception; TT=h30
//SC assign  priv_pg_usr_mode =  // data access exception; TT=h30
//SC   (ld_inst_vld_unflushed | st_inst_vld_unflushed) & ~(pstate_priv | hpv_priv) & tlb_rd_tte_data[`STLB_DATA_P] ;
//SC   (ld_inst_vld_unflushed | st_inst_vld_unflushed) & ~(pstate_priv | hpv_priv) & tlb_rd_tte_data[`STLB_DATA_P] ;
Line 4893... Line 4331...
// Timing change :
// Timing change :
 
 
wire [3:0] hpv_priv_d1 ;
wire [3:0] hpv_priv_d1 ;
wire [3:0] hpstate_en_d1 ;
wire [3:0] hpstate_en_d1 ;
 
 
dff #(8) hpv_stgd1 (
dff_s #(8) hpv_stgd1 (
        .din    ({tlu_lsu_hpv_priv[3:0],tlu_lsu_hpstate_en[3:0]}),
        .din    ({tlu_lsu_hpv_priv[3:0],tlu_lsu_hpstate_en[3:0]}),
        .q      ({hpv_priv_d1[3:0],hpstate_en_d1[3:0]}),
        .q      ({hpv_priv_d1[3:0],hpstate_en_d1[3:0]}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
mux4ds  #(1) hpv_priv_e_mux (
mux4ds  #(1) hpv_priv_e_mux (
        .in0    (hpv_priv_d1[0]),
        .in0    (hpv_priv_d1[0]),
        .in1    (hpv_priv_d1[1]),
        .in1    (hpv_priv_d1[1]),
Line 4930... Line 4368...
        .sel2   (thread2_e),
        .sel2   (thread2_e),
        .sel3   (thread3_e),
        .sel3   (thread3_e),
        .dout   (hpstate_en_e)
        .dout   (hpstate_en_e)
);
);
 
 
dff #(2) hpv_stgm (
dff_s #(2) hpv_stgm (
        .din    ({hpv_priv_e, hpstate_en_e}),
        .din    ({hpv_priv_e, hpstate_en_e}),
        .q      ({hpv_priv_m, hpstate_en_m}),
        .q      ({hpv_priv_m, hpstate_en_m}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//dff #(2) hpv_stgg (
//dff #(2) hpv_stgg (
//        .din    ({hpv_priv_m, hpstate_en_m}),
//        .din    ({hpv_priv_m, hpstate_en_m}),
//        .q            ({hpv_priv,   hpstate_en}),
//        .q            ({hpv_priv,   hpstate_en}),
//        .clk    (clk),
//        .clk    (clk),
//        .se     (se),       .si (),          .so ()
//        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//        );
//        );
 
 
/*assign  priv_action = (ld_inst_vld_unflushed | st_inst_vld_unflushed) & ~lsu_asi_state[7] &
/*assign  priv_action = (ld_inst_vld_unflushed | st_inst_vld_unflushed) & ~lsu_asi_state[7] &
      ~pstate_priv & ~(hpv_priv & hpstate_en) & lsu_alt_space_g ;*/
      ~pstate_priv & ~(hpv_priv & hpstate_en) & lsu_alt_space_g ;*/
// Generate a stage earlier
// Generate a stage earlier
Line 4954... Line 4392...
 
 
//SC dff  pact_stgg (
//SC dff  pact_stgg (
//SC         .din    (priv_action_m),
//SC         .din    (priv_action_m),
//SC         .q         (priv_action),
//SC         .q         (priv_action),
//SC         .clk    (clk),
//SC         .clk    (clk),
//SC         .se     (se),       .si (),          .so ()
//SC         .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//SC         );
//SC         );
 
 
// Take data_access exception if supervisor uses hypervisor asi
// Take data_access exception if supervisor uses hypervisor asi
//SC wire    hpv_asi_range ;
//SC wire    hpv_asi_range ;
//SC assign  hpv_asi_range =
//SC assign  hpv_asi_range =
Line 5052... Line 4490...
 
 
//SC dff #(11)   etrp_stgg (
//SC dff #(11)   etrp_stgg (
//SC         .din    ({early_ttype_m[8:0],early_trap_vld_m,asi_related_trap_m}),
//SC         .din    ({early_ttype_m[8:0],early_trap_vld_m,asi_related_trap_m}),
//SC         .q      ({early_ttype_g[8:0],early_trap_vld_g,asi_related_trap_g}),
//SC         .q      ({early_ttype_g[8:0],early_trap_vld_g,asi_related_trap_g}),
//SC         .clk    (clk),
//SC         .clk    (clk),
//SC         .se     (se),       .si (),          .so ()
//SC         .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//SC         );
//SC         );
 
 
//SC wire nceen_pipe_g ;
//SC wire nceen_pipe_g ;
//SC assign  nceen_pipe_g = 
//SC assign  nceen_pipe_g = 
//SC   (thread0_g & ifu_lsu_nceen[0]) | (thread1_g & ifu_lsu_nceen[1]) |
//SC   (thread0_g & ifu_lsu_nceen[0]) | (thread1_g & ifu_lsu_nceen[1]) |
Line 5068... Line 4506...
 
 
//SC dff  #(1) nce_stgm (
//SC dff  #(1) nce_stgm (
//SC         .din    (nceen_fill_e),
//SC         .din    (nceen_fill_e),
//SC         .q      (nceen_fill_m),
//SC         .q      (nceen_fill_m),
//SC         .clk    (clk),
//SC         .clk    (clk),
//SC         .se     (se),       .si (),          .so ()
//SC         .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//SC         );
//SC         );
 
 
//SC dff  #(1) nce_stgg (
//SC dff  #(1) nce_stgg (
//SC         .din    (nceen_fill_m),
//SC         .din    (nceen_fill_m),
//SC         .q      (nceen_fill_g),
//SC         .q      (nceen_fill_g),
//SC         .clk    (clk),
//SC         .clk    (clk),
//SC         .se     (se),       .si (),          .so ()
//SC         .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//SC         );
//SC         );
 
 
//SC assign  daccess_error = 1'b0 ;
//SC assign  daccess_error = 1'b0 ;
  // Commented out currently for timing reasons. This needs to be
  // Commented out currently for timing reasons. This needs to be
  // rolled into the ttype_vld sent to the tlu, but can be left out
  // rolled into the ttype_vld sent to the tlu, but can be left out
Line 5093... Line 4531...
//SC assign  lsu_tlu_async_dacc_err_g = unc_err_trap_g | tlb_asi_unc_err_g ;
//SC assign  lsu_tlu_async_dacc_err_g = unc_err_trap_g | tlb_asi_unc_err_g ;
 
 
//SC assign  lsu_tlu_dmmu_miss_g = dmmu_miss_g ;
//SC assign  lsu_tlu_dmmu_miss_g = dmmu_miss_g ;
 
 
 wire  cam_real_m ;
 wire  cam_real_m ;
 dff   real_stgm (
 dff_s   real_stgm (
         .din    (lsu_dtlb_cam_real_e),
         .din    (lsu_dtlb_cam_real_e),
         .q      (cam_real_m),
         .q      (cam_real_m),
         .clk    (clk),
         .clk    (clk),
         .se     (se),       .si (),          .so ()
         .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
         );
         );
 
 
// dff   real_stgg (
// dff   real_stgg (
//         .din    (cam_real_m),
//         .din    (cam_real_m),
//         .q      (cam_real_g),
//         .q      (cam_real_g),
//         .clk    (clk),
//         .clk    (clk),
//         .se     (se),       .si (),          .so ()
//         .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//         );
//         );
 
 
assign  lsu_tlu_nonalt_ldst_m =  (st_inst_vld_m | ld_inst_vld_m) & ~lsu_alt_space_m  ;
assign  lsu_tlu_nonalt_ldst_m =  (st_inst_vld_m | ld_inst_vld_m) & ~lsu_alt_space_m  ;
assign  lsu_tlu_xslating_ldst_m = (st_inst_vld_m | ld_inst_vld_m) &
assign  lsu_tlu_xslating_ldst_m = (st_inst_vld_m | ld_inst_vld_m) &
        (((~asi_internal_m  & recognized_asi_m) & lsu_alt_space_m)  | // Bug 4327
        (((~asi_internal_m  & recognized_asi_m) & lsu_alt_space_m)  | // Bug 4327
Line 5121... Line 4559...
        (~(thread_pctxt | thread_sctxt) &  // default to nucleus - translating asi
        (~(thread_pctxt | thread_sctxt) &  // default to nucleus - translating asi
        ~(alt_space_e & (asi_internal_e | ~recognized_asi_e ))) ; //bug3660
        ~(alt_space_e & (asi_internal_e | ~recognized_asi_e ))) ; //bug3660
                                           // nontranslating asi to select 11 in CT
                                           // nontranslating asi to select 11 in CT
                                           // field of dsfsr.
                                           // field of dsfsr.
 
 
dff  #(3) ctxsel (
dff_s  #(3) ctxsel (
        .din    (ctxt_sel_e[2:0]),
        .din    (ctxt_sel_e[2:0]),
        .q      (lsu_tlu_ctxt_sel_m[2:0]),
        .q      (lsu_tlu_ctxt_sel_m[2:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  lsu_tlu_nucleus_ctxt_m = lsu_tlu_ctxt_sel_m[2] ;
assign  lsu_tlu_nucleus_ctxt_m = lsu_tlu_ctxt_sel_m[2] ;
 
 
assign  lsu_tlu_write_op_m = st_inst_vld_m | atomic_m ;
assign  lsu_tlu_write_op_m = st_inst_vld_m | atomic_m ;
Line 5177... Line 4615...
 
 
//SC dff  eflushspu_g (
//SC dff  eflushspu_g (
//SC         .din    (spu_early_flush_m),
//SC         .din    (spu_early_flush_m),
//SC         .q      (lsu_spu_early_flush_g),
//SC         .q      (lsu_spu_early_flush_g),
//SC         .clk    (clk),
//SC         .clk    (clk),
//SC         .se     (se),       .si (),          .so ()
//SC         .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//SC         );
//SC         );
 
 
//SC dff  eflushtlu_g (
//SC dff  eflushtlu_g (
//SC         .din    (spu_early_flush_m),
//SC         .din    (spu_early_flush_m),
//SC         .q      (lsu_tlu_early_flush_w),
//SC         .q      (lsu_tlu_early_flush_w),
//SC        .clk    (clk),
//SC        .clk    (clk),
//SC         .se     (se),       .si (),          .so ()
//SC         .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
 //SC        );
 //SC        );
 
 
//=========================================================================================
//=========================================================================================
//  Parity Error Checking
//  Parity Error Checking
//=========================================================================================
//=========================================================================================
Line 5265... Line 4703...
 
 
//SC dff  #(3) terr_stgd1 (
//SC dff  #(3) terr_stgd1 (
//SC         .din    ({tte_data_perror_corr,tlb_data_ue_g,asi_tte_tag_perror}),
//SC         .din    ({tte_data_perror_corr,tlb_data_ue_g,asi_tte_tag_perror}),
//SC         .q      ({lsu_ifu_tlb_data_ce,lsu_ifu_tlb_data_ue,lsu_ifu_tlb_tag_ue}),
//SC         .q      ({lsu_ifu_tlb_data_ce,lsu_ifu_tlb_data_ue,lsu_ifu_tlb_tag_ue}),
//SC         .clk    (clk),
//SC         .clk    (clk),
//SC         .se     (se),       .si (),          .so ()
//SC         .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//SC         );
//SC         );
 
 
// Dtag Parity Error
// Dtag Parity Error
// - corrected thru special mechanism
// - corrected thru special mechanism
// - correctible error
// - correctible error
// - Trap taken on data return
// - Trap taken on data return
 
 
// move parity error calculation to g stage
// move parity error calculation to g stage
 
 
dff  #(4) dva_vld_g_ff (
dff_s  #(4) dva_vld_g_ff (
         .din    (dva_vld_m[3:0]),
         .din    (dva_vld_m[3:0]),
         .q      (dva_vld_g[3:0]),
         .q      (dva_vld_g[3:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
   assign dva_vld_m_bf[3:0] = dva_vld_m[3:0];
   assign dva_vld_m_bf[3:0] = dva_vld_m[3:0];
 
 
wire    dtag_perr_en ;
wire    dtag_perr_en ;
Line 5314... Line 4752...
//=========================================================================================
//=========================================================================================
//  Error Related Traps 
//  Error Related Traps 
//=========================================================================================
//=========================================================================================
 
 
//bug6382/eco6621   
//bug6382/eco6621   
dff #(2)  derrtrp_stgm (
dff_s #(2)  derrtrp_stgm (
        .din    ({lsu_cpx_ld_dtag_perror_e & ~ignore_fill, lsu_cpx_ld_dcache_perror_e & ~ignore_fill}),
        .din    ({lsu_cpx_ld_dtag_perror_e & ~ignore_fill, lsu_cpx_ld_dcache_perror_e & ~ignore_fill}),
        .q      ({dtag_error_m,dcache_error_m}),
        .q      ({dtag_error_m,dcache_error_m}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(2)  derrtrp_stgg (
dff_s #(2)  derrtrp_stgg (
        .din    ({dtag_error_m,dcache_error_m}),
        .din    ({dtag_error_m,dcache_error_m}),
        .q      ({dtag_error_g,dcache_error_g}),
        .q      ({dtag_error_g,dcache_error_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(2)  derrtrp_stgw2 (
dff_s #(2)  derrtrp_stgw2 (
        .din    ({dtag_error_g,dcache_error_g}),
        .din    ({dtag_error_g,dcache_error_g}),
        .q      ({dtag_error_w2,dcache_error_w2}),
        .q      ({dtag_error_w2,dcache_error_w2}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  lsu_ifu_dcache_data_perror = dcache_error_w2 & ~bld_squash_err_w2;  //bug6382/eco6621
assign  lsu_ifu_dcache_data_perror = dcache_error_w2 & ~bld_squash_err_w2;  //bug6382/eco6621
assign  lsu_ifu_dcache_tag_perror  = dtag_error_w2  ;
assign  lsu_ifu_dcache_tag_perror  = dtag_error_w2  ;
 
 
assign  l2_unc_error_e  = lsu_cpx_pkt_ld_err[1] & l2fill_vld_e & ~ignore_fill  ; // Bug 4998
assign  l2_unc_error_e  = lsu_cpx_pkt_ld_err[1] & l2fill_vld_e & ~ignore_fill  ; // Bug 4998
assign  l2_corr_error_e = lsu_cpx_pkt_ld_err[0] & l2fill_vld_e & ~ignore_fill  ;
assign  l2_corr_error_e = lsu_cpx_pkt_ld_err[0] & l2fill_vld_e & ~ignore_fill  ;
 
 
dff #(2)  lerrtrp_stgm (
dff_s #(2)  lerrtrp_stgm (
        .din    ({l2_unc_error_e,l2_corr_error_e}),
        .din    ({l2_unc_error_e,l2_corr_error_e}),
        .q      ({l2_unc_error_m,l2_corr_error_m}),
        .q      ({l2_unc_error_m,l2_corr_error_m}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(2)  lerrtrp_stgg (
dff_s #(2)  lerrtrp_stgg (
        .din    ({l2_unc_error_m,l2_corr_error_m}),
        .din    ({l2_unc_error_m,l2_corr_error_m}),
        .q      ({l2_unc_error_g,l2_corr_error_g}),
        .q      ({l2_unc_error_g,l2_corr_error_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(2)  lerrtrp_stgw2 (
dff_s #(2)  lerrtrp_stgw2 (
        .din    ({l2_unc_error_g,l2_corr_error_g}),
        .din    ({l2_unc_error_g,l2_corr_error_g}),
        .q      ({l2_unc_error_w2,l2_corr_error_w2}),
        .q      ({l2_unc_error_w2,l2_corr_error_w2}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  lsu_ifu_l2_unc_error  = // Bug 4315
assign  lsu_ifu_l2_unc_error  = // Bug 4315
(l2_unc_error_w2 | bld_unc_err_pend_w2) & ~lsu_ifu_err_addr_b39 & ~bld_squash_err_w2 ;
(l2_unc_error_w2 | bld_unc_err_pend_w2) & ~lsu_ifu_err_addr_b39 & ~bld_squash_err_w2 ;
assign  lsu_ifu_l2_corr_error =
assign  lsu_ifu_l2_corr_error =
Line 5391... Line 4829...
       (dfill_thread1 & ifu_lsu_ceen[1]) |
       (dfill_thread1 & ifu_lsu_ceen[1]) |
       (dfill_thread2 & ifu_lsu_ceen[2]) |
       (dfill_thread2 & ifu_lsu_ceen[2]) |
       (dfill_thread3 & ifu_lsu_ceen[3])) ; */
       (dfill_thread3 & ifu_lsu_ceen[3])) ; */
 
 
 
 
dff #(1)  errtrp_stgm (
dff_s #(1)  errtrp_stgm (
        .din    ({unc_err_trap_e}),
        .din    ({unc_err_trap_e}),
        .q      ({unc_err_trap_m}),
        .q      ({unc_err_trap_m}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(1)  errtrp_stgg (
dff_s #(1)  errtrp_stgg (
        .din    ({unc_err_trap_m}),
        .din    ({unc_err_trap_m}),
        .q      ({unc_err_trap_g}),
        .q      ({unc_err_trap_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// The tlu should source demap_thrid for all tlb operations !!!
// The tlu should source demap_thrid for all tlb operations !!!
dff #(2)  filla_stgm (
dff_s #(2)  filla_stgm (
        .din    ({lsu_dfill_tid_e[1:0]}),
        .din    ({lsu_dfill_tid_e[1:0]}),
        .q      ({dfill_tid_m[1:0]}),
        .q      ({dfill_tid_m[1:0]}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(2)  filla_stgg (
dff_s #(2)  filla_stgg (
        .din    ({dfill_tid_m[1:0]}),
        .din    ({dfill_tid_m[1:0]}),
        .q      ({dfill_tid_g[1:0]}),
        .q      ({dfill_tid_g[1:0]}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
 
 
//=========================================================================================
//=========================================================================================
Line 5434... Line 4872...
assign  spu_trap2 = spu_trap & spu_ldxa_thread2_w2 ;
assign  spu_trap2 = spu_trap & spu_ldxa_thread2_w2 ;
assign  spu_trap3 = spu_trap & spu_ldxa_thread3_w2 ;
assign  spu_trap3 = spu_trap & spu_ldxa_thread3_w2 ;
 
 
assign  spu_ttype[6:0]   = spu_lsu_int_w2 ? 7'h70 : 7'h32 ;
assign  spu_ttype[6:0]   = spu_lsu_int_w2 ? 7'h70 : 7'h32 ;
 
 
dff #(2)   lfraw_stgw2 (
dff_s #(2)   lfraw_stgw2 (
        .din    ({ld_inst_vld_g,fp_ldst_g}),
        .din    ({ld_inst_vld_g,fp_ldst_g}),
        .q      ({ld_inst_vld_w2,fp_ldst_w2}),
        .q      ({ld_inst_vld_w2,fp_ldst_w2}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(2)   lfraw_stgw3 (
dff_s #(2)   lfraw_stgw3 (
        .din    ({ld_stb_full_raw_w2, ld_inst_vld_w2}),
        .din    ({ld_stb_full_raw_w2, ld_inst_vld_w2}),
        .q      ({ld_stb_full_raw_w3, ld_inst_vld_w3}),
        .q      ({ld_stb_full_raw_w3, ld_inst_vld_w3}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// Delay all ldbyp*vld_en by a cycle for write of unc error
// Delay all ldbyp*vld_en by a cycle for write of unc error
//dff #(4)  lbypen_stgd1 (
//dff #(4)  lbypen_stgd1 (
//        .din    ({ldbyp0_vld_en,ldbyp1_vld_en,ldbyp2_vld_en,ldbyp3_vld_en}),
//        .din    ({ldbyp0_vld_en,ldbyp1_vld_en,ldbyp2_vld_en,ldbyp3_vld_en}),
//        .q      ({ldbyp0_vld_en_d1,ldbyp1_vld_en_d1,ldbyp2_vld_en_d1,ldbyp3_vld_en_d1}),
//        .q      ({ldbyp0_vld_en_d1,ldbyp1_vld_en_d1,ldbyp2_vld_en_d1,ldbyp3_vld_en_d1}),
//        .clk    (clk),
//        .clk    (clk),
//        .se     (se),       .si (),          .so ()
//        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//        ); 
//        ); 
 
 
 
 
wire   fp_ldst_thrd0_w2,fp_ldst_thrd1_w2,fp_ldst_thrd2_w2,fp_ldst_thrd3_w2 ;
wire   fp_ldst_thrd0_w2,fp_ldst_thrd1_w2,fp_ldst_thrd2_w2,fp_ldst_thrd3_w2 ;
wire   fp_ldst_thrd0_w3,fp_ldst_thrd1_w3,fp_ldst_thrd2_w3,fp_ldst_thrd3_w3 ;
wire   fp_ldst_thrd0_w3,fp_ldst_thrd1_w3,fp_ldst_thrd2_w3,fp_ldst_thrd3_w3 ;
wire   fp_ldst_thrd0_w4,fp_ldst_thrd1_w4,fp_ldst_thrd2_w4,fp_ldst_thrd3_w4 ;
wire   fp_ldst_thrd0_w4,fp_ldst_thrd1_w4,fp_ldst_thrd2_w4,fp_ldst_thrd3_w4 ;
wire   fp_ldst_thrd0_w5,fp_ldst_thrd1_w5,fp_ldst_thrd2_w5,fp_ldst_thrd3_w5 ;
wire   fp_ldst_thrd0_w5,fp_ldst_thrd1_w5,fp_ldst_thrd2_w5,fp_ldst_thrd3_w5 ;
 
 
//RAW read STB at W3 (changed from W2)
//RAW read STB at W3 (changed from W2)
 
 
dff #(4) fp_ldst_stg_w3 (
dff_s #(4) fp_ldst_stg_w3 (
  .din ({fp_ldst_thrd0_w2,fp_ldst_thrd1_w2,fp_ldst_thrd2_w2,fp_ldst_thrd3_w2}),
  .din ({fp_ldst_thrd0_w2,fp_ldst_thrd1_w2,fp_ldst_thrd2_w2,fp_ldst_thrd3_w2}),
  .q   ({fp_ldst_thrd0_w3,fp_ldst_thrd1_w3,fp_ldst_thrd2_w3,fp_ldst_thrd3_w3}),
  .q   ({fp_ldst_thrd0_w3,fp_ldst_thrd1_w3,fp_ldst_thrd2_w3,fp_ldst_thrd3_w3}),
  .clk    (clk),
  .clk    (clk),
  .se     (se),       .si (),          .so ()
  .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
  );
  );
 
 
dff #(4) fp_ldst_stg_w4 (
dff_s #(4) fp_ldst_stg_w4 (
  .din ({fp_ldst_thrd0_w3,fp_ldst_thrd1_w3,fp_ldst_thrd2_w3,fp_ldst_thrd3_w3}),
  .din ({fp_ldst_thrd0_w3,fp_ldst_thrd1_w3,fp_ldst_thrd2_w3,fp_ldst_thrd3_w3}),
  .q   ({fp_ldst_thrd0_w4,fp_ldst_thrd1_w4,fp_ldst_thrd2_w4,fp_ldst_thrd3_w4}),
  .q   ({fp_ldst_thrd0_w4,fp_ldst_thrd1_w4,fp_ldst_thrd2_w4,fp_ldst_thrd3_w4}),
  .clk    (clk),
  .clk    (clk),
  .se     (se),       .si (),          .so ()
  .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
  );
  );
 
 
dff #(4) fp_ldst_stg_w5 (
dff_s #(4) fp_ldst_stg_w5 (
  .din ({fp_ldst_thrd0_w4,fp_ldst_thrd1_w4,fp_ldst_thrd2_w4,fp_ldst_thrd3_w4}),
  .din ({fp_ldst_thrd0_w4,fp_ldst_thrd1_w4,fp_ldst_thrd2_w4,fp_ldst_thrd3_w4}),
  .q   ({fp_ldst_thrd0_w5,fp_ldst_thrd1_w5,fp_ldst_thrd2_w5,fp_ldst_thrd3_w5}),
  .q   ({fp_ldst_thrd0_w5,fp_ldst_thrd1_w5,fp_ldst_thrd2_w5,fp_ldst_thrd3_w5}),
  .clk    (clk),
  .clk    (clk),
  .se     (se),       .si (),          .so ()
  .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
  );
  );
 
 
// THREAD 0
// THREAD 0
 
 
wire    tte_data_perror_unc_w2,asi_tte_data_perror_w2,asi_tte_tag_perror_w2 ;
wire    tte_data_perror_unc_w2,asi_tte_data_perror_w2,asi_tte_tag_perror_w2 ;
// if nceen/ceen=0, then tte_data_perror* are not logged for trap generation. Earlier error-reporting
// if nceen/ceen=0, then tte_data_perror* are not logged for trap generation. Earlier error-reporting
// is however never screened off.
// is however never screened off.
// asi_tte* however has to be logged in order to report errors thru the asiQ. Traps must be squashed. 
// asi_tte* however has to be logged in order to report errors thru the asiQ. Traps must be squashed. 
dff #(3) ltlbrd_w2 (
dff_s #(3) ltlbrd_w2 (
  .din ({tte_data_perror_unc_en,asi_tte_data_perror,asi_tte_tag_perror}),
  .din ({tte_data_perror_unc_en,asi_tte_data_perror,asi_tte_tag_perror}),
  .q   ({tte_data_perror_unc_w2,asi_tte_data_perror_w2,asi_tte_tag_perror_w2}),
  .q   ({tte_data_perror_unc_w2,asi_tte_data_perror_w2,asi_tte_tag_perror_w2}),
  .clk    (clk),
  .clk    (clk),
  .se     (se),       .si (),          .so ()
  .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
  );
  );
 
 
 
 
// Error Table for Queue
// Error Table for Queue
// ** In all cases; squash writes to irf.
// ** In all cases; squash writes to irf.
Line 5542... Line 4980...
 
 
assign   fp_ldst_thrd0_w2 = fp_ldst_w2 & thread0_w2 & ld_inst_vld_w2 ;
assign   fp_ldst_thrd0_w2 = fp_ldst_w2 & thread0_w2 & ld_inst_vld_w2 ;
 
 
// ld valid
// ld valid
wire    ldbyp0_vld_tmp ;
wire    ldbyp0_vld_tmp ;
dffre #(1)  ldbyp0_vld_ff (
dffre_s #(1)  ldbyp0_vld_ff (
        .din    (ldbyp0_vld_en),
        .din    (ldbyp0_vld_en),
        .q      (ldbyp0_vld_tmp),
        .q      (ldbyp0_vld_tmp),
        .rst    (ldbyp0_vld_rst),        .en     (ldbyp0_vld_en),
        .rst    (ldbyp0_vld_rst),        .en     (ldbyp0_vld_en),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
// Bug 5379 - make ld ue invisible in q until atm st ack resets.
// Bug 5379 - make ld ue invisible in q until atm st ack resets.
 
 
assign  ldbyp0_vld = ldbyp0_vld_tmp & ~pend_atm_ld_ue[0] ;
assign  ldbyp0_vld = ldbyp0_vld_tmp & ~pend_atm_ld_ue[0] ;
 
 
Line 5559... Line 4997...
// assumes that rw_index is not reset at mmu.
// assumes that rw_index is not reset at mmu.
wire [6:0]       misc_data_in ;
wire [6:0]       misc_data_in ;
wire [6:0]       misc_data0,misc_data1,misc_data2,misc_data3 ;
wire [6:0]       misc_data0,misc_data1,misc_data2,misc_data3 ;
wire            misc_sel ;
wire            misc_sel ;
wire [5:0]       rw_index_d1 ;
wire [5:0]       rw_index_d1 ;
dff #(6)  rwind_d1 (
dff_s #(6)  rwind_d1 (
        .din    (tlu_dtlb_rw_index_g[5:0]),
        .din    (tlu_dtlb_rw_index_g[5:0]),
        .q      (rw_index_d1[5:0]),
        .q      (rw_index_d1[5:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
assign  misc_sel = asi_tte_data_perror_w2 | asi_tte_tag_perror_w2 ;
assign  misc_sel = asi_tte_data_perror_w2 | asi_tte_tag_perror_w2 ;
assign  misc_data_in[6:0] = misc_sel ? {1'b0,rw_index_d1[5:0]} : spu_ttype[6:0] ;
assign  misc_data_in[6:0] = misc_sel ? {1'b0,rw_index_d1[5:0]} : spu_ttype[6:0] ;
 
 
dffe #(9)  ldbyp0_other_ff (
dffe_s #(9)  ldbyp0_other_ff (
        .din    ({fp_ldst_thrd0_w5,spu_trap0,misc_data_in[6:0]}),  //bug6525 fix2
        .din    ({fp_ldst_thrd0_w5,spu_trap0,misc_data_in[6:0]}),  //bug6525 fix2
        .q      ({ldbyp0_fpld,spubyp0_trap,misc_data0[6:0]}),
        .q      ({ldbyp0_fpld,spubyp0_trap,misc_data0[6:0]}),
        .en     (ldbyp0_vld_en),
        .en     (ldbyp0_vld_en),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
dffre #(5)  ldbyp0_err_ff (
dffre_s #(5)  ldbyp0_err_ff (
        .din    ({tte_data_perror_unc_w2,atm_ld_w_uerr,
        .din    ({tte_data_perror_unc_w2,atm_ld_w_uerr,
                asi_tte_data_perror_w2,asi_tte_tag_perror_w2,ifu_lsu_asi_rd_unc}),
                asi_tte_data_perror_w2,asi_tte_tag_perror_w2,ifu_lsu_asi_rd_unc}),
        .q      ({cam_perr_unc0,pend_atm_ld_ue[0],asi_data_perr0,asi_tag_perr0,
        .q      ({cam_perr_unc0,pend_atm_ld_ue[0],asi_data_perr0,asi_tag_perr0,
                ifu_unc_err0}),
                ifu_unc_err0}),
        .rst    (ldbyp0_vld_rst), .en     (ldbyp0_vld_en & ~spu_trap0 & ~lmq_byp_ldxa_sel0[1]), //bug6525 fix2
        .rst    (ldbyp0_vld_rst), .en     (ldbyp0_vld_en & ~spu_trap0 & ~lmq_byp_ldxa_sel0[1]), //bug6525 fix2
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
//assign  ldbyp0_unc_err = ldbyp0_unc_err_q & ifu_lsu_nceen[0] ;
//assign  ldbyp0_unc_err = ldbyp0_unc_err_q & ifu_lsu_nceen[0] ;
 
 
Line 5612... Line 5050...
                       tlb_err_en_w2[1]   |
                       tlb_err_en_w2[1]   |
                       spu_trap1 ;
                       spu_trap1 ;
 
 
// ld valid
// ld valid
wire    ldbyp1_vld_tmp ;
wire    ldbyp1_vld_tmp ;
dffre #(1)  ldbyp1_vld_ff (
dffre_s #(1)  ldbyp1_vld_ff (
        .din    (ldbyp1_vld_en),
        .din    (ldbyp1_vld_en),
        .q      (ldbyp1_vld_tmp),
        .q      (ldbyp1_vld_tmp),
        .rst    (ldbyp1_vld_rst),        .en     (ldbyp1_vld_en),
        .rst    (ldbyp1_vld_rst),        .en     (ldbyp1_vld_en),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
assign  ldbyp1_vld = ldbyp1_vld_tmp & ~pend_atm_ld_ue[1] ;
assign  ldbyp1_vld = ldbyp1_vld_tmp & ~pend_atm_ld_ue[1] ;
 
 
 
 
dffe #(9)  ldbyp1_other_ff (
dffe_s #(9)  ldbyp1_other_ff (
        .din    ({fp_ldst_thrd1_w5,spu_trap1,misc_data_in[6:0]}),  //bug6525 fix2
        .din    ({fp_ldst_thrd1_w5,spu_trap1,misc_data_in[6:0]}),  //bug6525 fix2
        .q      ({ldbyp1_fpld,spubyp1_trap,misc_data1[6:0]}),
        .q      ({ldbyp1_fpld,spubyp1_trap,misc_data1[6:0]}),
        .en     (ldbyp1_vld_en),
        .en     (ldbyp1_vld_en),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// The tlb rd unc errors are delayed a cycle wrt to ldxa_data
// The tlb rd unc errors are delayed a cycle wrt to ldxa_data
// No reset required
// No reset required
dffre #(5)  ldbyp1_err_ff (
dffre_s #(5)  ldbyp1_err_ff (
        .din    ({tte_data_perror_unc_w2,atm_ld_w_uerr,
        .din    ({tte_data_perror_unc_w2,atm_ld_w_uerr,
                asi_tte_data_perror_w2,asi_tte_tag_perror_w2,ifu_lsu_asi_rd_unc}),
                asi_tte_data_perror_w2,asi_tte_tag_perror_w2,ifu_lsu_asi_rd_unc}),
        .q      ({cam_perr_unc1,pend_atm_ld_ue[1],asi_data_perr1,asi_tag_perr1,
        .q      ({cam_perr_unc1,pend_atm_ld_ue[1],asi_data_perr1,asi_tag_perr1,
                ifu_unc_err1}),
                ifu_unc_err1}),
        .rst    (ldbyp1_vld_rst), .en     (ldbyp1_vld_en & ~spu_trap1 & ~lmq_byp_ldxa_sel1[1]), //bug6525 fix2
        .rst    (ldbyp1_vld_rst), .en     (ldbyp1_vld_en & ~spu_trap1 & ~lmq_byp_ldxa_sel1[1]), //bug6525 fix2
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//assign  ldbyp1_unc_err = ldbyp1_unc_err_q & ifu_lsu_nceen[1] ;
//assign  ldbyp1_unc_err = ldbyp1_unc_err_q & ifu_lsu_nceen[1] ;
 
 
// THREAD 2
// THREAD 2
Line 5666... Line 5104...
 
 
assign   fp_ldst_thrd2_w2 = fp_ldst_w2 & thread2_w2 & ld_inst_vld_w2 ;
assign   fp_ldst_thrd2_w2 = fp_ldst_w2 & thread2_w2 & ld_inst_vld_w2 ;
 
 
// ld valid
// ld valid
wire    ldbyp2_vld_tmp ;
wire    ldbyp2_vld_tmp ;
dffre #(1)  ldbyp2_vld_ff (
dffre_s #(1)  ldbyp2_vld_ff (
        .din    (ldbyp2_vld_en),
        .din    (ldbyp2_vld_en),
        .q      (ldbyp2_vld_tmp),
        .q      (ldbyp2_vld_tmp),
        .rst    (ldbyp2_vld_rst),        .en     (ldbyp2_vld_en),
        .rst    (ldbyp2_vld_rst),        .en     (ldbyp2_vld_en),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
assign  ldbyp2_vld = ldbyp2_vld_tmp & ~pend_atm_ld_ue[2] ;
assign  ldbyp2_vld = ldbyp2_vld_tmp & ~pend_atm_ld_ue[2] ;
 
 
dffe #(9)  ldbyp2_other_ff (
dffe_s #(9)  ldbyp2_other_ff (
        .din    ({fp_ldst_thrd2_w5,spu_trap2,misc_data_in[6:0]}),  //bug6525 fix2
        .din    ({fp_ldst_thrd2_w5,spu_trap2,misc_data_in[6:0]}),  //bug6525 fix2
        .q      ({ldbyp2_fpld,spubyp2_trap,misc_data2[6:0]}),
        .q      ({ldbyp2_fpld,spubyp2_trap,misc_data2[6:0]}),
        .en     (ldbyp2_vld_en),
        .en     (ldbyp2_vld_en),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dffre #(5)  ldbyp2_err_ff (
dffre_s #(5)  ldbyp2_err_ff (
        .din    ({tte_data_perror_unc_w2, atm_ld_w_uerr,
        .din    ({tte_data_perror_unc_w2, atm_ld_w_uerr,
                asi_tte_data_perror_w2,asi_tte_tag_perror_w2,ifu_lsu_asi_rd_unc}),
                asi_tte_data_perror_w2,asi_tte_tag_perror_w2,ifu_lsu_asi_rd_unc}),
        .q      ({cam_perr_unc2,pend_atm_ld_ue[2],asi_data_perr2,asi_tag_perr2,
        .q      ({cam_perr_unc2,pend_atm_ld_ue[2],asi_data_perr2,asi_tag_perr2,
                ifu_unc_err2}),
                ifu_unc_err2}),
        .rst    (ldbyp2_vld_rst), .en     (ldbyp2_vld_en & ~spu_trap2 & ~lmq_byp_ldxa_sel2[1]), //bug6525 fix2
        .rst    (ldbyp2_vld_rst), .en     (ldbyp2_vld_en & ~spu_trap2 & ~lmq_byp_ldxa_sel2[1]), //bug6525 fix2
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//assign  ldbyp2_unc_err = ldbyp2_unc_err_q & ifu_lsu_nceen[2] ;
//assign  ldbyp2_unc_err = ldbyp2_unc_err_q & ifu_lsu_nceen[2] ;
 
 
// THREAD 3
// THREAD 3
Line 5717... Line 5155...
 
 
assign   fp_ldst_thrd3_w2 = fp_ldst_w2 & thread3_w2 & ld_inst_vld_w2 ;
assign   fp_ldst_thrd3_w2 = fp_ldst_w2 & thread3_w2 & ld_inst_vld_w2 ;
 
 
// ld valid
// ld valid
wire    ldbyp3_vld_tmp ;
wire    ldbyp3_vld_tmp ;
dffre #(1)  ldbyp3_vld_ff (
dffre_s #(1)  ldbyp3_vld_ff (
        .din    (ldbyp3_vld_en),
        .din    (ldbyp3_vld_en),
        .q      (ldbyp3_vld_tmp),
        .q      (ldbyp3_vld_tmp),
        .rst    (ldbyp3_vld_rst),        .en     (ldbyp3_vld_en),
        .rst    (ldbyp3_vld_rst),        .en     (ldbyp3_vld_en),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
assign  ldbyp3_vld = ldbyp3_vld_tmp & ~pend_atm_ld_ue[3] ;
assign  ldbyp3_vld = ldbyp3_vld_tmp & ~pend_atm_ld_ue[3] ;
 
 
 
 
dffe #(9)  ldbyp3_other_ff (
dffe_s #(9)  ldbyp3_other_ff (
        .din    ({fp_ldst_thrd3_w5,spu_trap3,misc_data_in[6:0]}),  //bug6525 fix2
        .din    ({fp_ldst_thrd3_w5,spu_trap3,misc_data_in[6:0]}),  //bug6525 fix2
        .q      ({ldbyp3_fpld,spubyp3_trap,misc_data3[6:0]}),
        .q      ({ldbyp3_fpld,spubyp3_trap,misc_data3[6:0]}),
        .en     (ldbyp3_vld_en),
        .en     (ldbyp3_vld_en),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dffre #(5)  ldbyp3_err_ff (
dffre_s #(5)  ldbyp3_err_ff (
        .din    ({tte_data_perror_unc_w2,atm_ld_w_uerr,
        .din    ({tte_data_perror_unc_w2,atm_ld_w_uerr,
                asi_tte_data_perror_w2,asi_tte_tag_perror_w2,ifu_lsu_asi_rd_unc}),
                asi_tte_data_perror_w2,asi_tte_tag_perror_w2,ifu_lsu_asi_rd_unc}),
        .q      ({cam_perr_unc3,pend_atm_ld_ue[3],asi_data_perr3,asi_tag_perr3,
        .q      ({cam_perr_unc3,pend_atm_ld_ue[3],asi_data_perr3,asi_tag_perr3,
                ifu_unc_err3}),
                ifu_unc_err3}),
        .rst    (ldbyp3_vld_rst), .en     (ldbyp3_vld_en & ~spu_trap3 & ~lmq_byp_ldxa_sel3[1]), //bug6525 fix2
        .rst    (ldbyp3_vld_rst), .en     (ldbyp3_vld_en & ~spu_trap3 & ~lmq_byp_ldxa_sel3[1]), //bug6525 fix2
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//assign  ldbyp3_unc_err = ldbyp3_unc_err_q & ifu_lsu_nceen[3] ;
//assign  ldbyp3_unc_err = ldbyp3_unc_err_q & ifu_lsu_nceen[3] ;
 
 
//assign  ld_any_byp_data_vld = 
//assign  ld_any_byp_data_vld = 
//  ldbyp0_vld | ldbyp1_vld | ldbyp2_vld | ldbyp3_vld ;
//  ldbyp0_vld | ldbyp1_vld | ldbyp2_vld | ldbyp3_vld ;
 
 
dff #(4)   stgm_sqshcmplt (
dff_s #(4)   stgm_sqshcmplt (
        .din    (squash_byp_cmplt[3:0]),
        .din    (squash_byp_cmplt[3:0]),
        .q      (squash_byp_cmplt_m[3:0]),
        .q      (squash_byp_cmplt_m[3:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(4)  stgg_sqshcmplt (
dff_s #(4)  stgg_sqshcmplt (
        .din    (squash_byp_cmplt_m[3:0]),
        .din    (squash_byp_cmplt_m[3:0]),
        .q      (squash_byp_cmplt_g[3:0]),
        .q      (squash_byp_cmplt_g[3:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  fpld_byp_data_vld =
assign  fpld_byp_data_vld =
  (ld_thrd_byp_sel_g[0] & ldbyp0_fpld & ~squash_byp_cmplt_g[0]) | // Bug 4998
  (ld_thrd_byp_sel_g[0] & ldbyp0_fpld & ~squash_byp_cmplt_g[0]) | // Bug 4998
  (ld_thrd_byp_sel_g[1] & ldbyp1_fpld & ~squash_byp_cmplt_g[1]) |
  (ld_thrd_byp_sel_g[1] & ldbyp1_fpld & ~squash_byp_cmplt_g[1]) |
Line 5779... Line 5217...
        (intld_byp_cmplt[0]) | // squash now thru squash_byp_cmplt
        (intld_byp_cmplt[0]) | // squash now thru squash_byp_cmplt
        (intld_byp_cmplt[1]) |
        (intld_byp_cmplt[1]) |
        (intld_byp_cmplt[2]) |
        (intld_byp_cmplt[2]) |
        (intld_byp_cmplt[3]) ;
        (intld_byp_cmplt[3]) ;
 
 
dff   stgm_ibvld (
dff_s   stgm_ibvld (
        .din    (intld_byp_data_vld_e),
        .din    (intld_byp_data_vld_e),
        .q      (intld_byp_data_vld_m),
        .q      (intld_byp_data_vld_m),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// to be removed - intld_byp_data_vld in lsu_mon.v
// to be removed - intld_byp_data_vld in lsu_mon.v
/*
/*
dff   stgg_ibvld (
dff_s   stgg_ibvld (
        .din    (intld_byp_data_vld_m),
        .din    (intld_byp_data_vld_m),
        .q      (intld_byp_data_vld),
        .q      (intld_byp_data_vld),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
*/
*/
assign  spubyp_trap_active_e =
assign  spubyp_trap_active_e =
        //(intld_byp_cmplt[0] & spubyp0_trap) | // Bug 4040
        //(intld_byp_cmplt[0] & spubyp0_trap) | // Bug 4040
        (ld_thrd_byp_sel_e[0] & spubyp0_trap) |
        (ld_thrd_byp_sel_e[0] & spubyp0_trap) |
        (ld_thrd_byp_sel_e[1] & spubyp1_trap) |
        (ld_thrd_byp_sel_e[1] & spubyp1_trap) |
        (ld_thrd_byp_sel_e[2] & spubyp2_trap) |
        (ld_thrd_byp_sel_e[2] & spubyp2_trap) |
        (ld_thrd_byp_sel_e[3] & spubyp3_trap) ;
        (ld_thrd_byp_sel_e[3] & spubyp3_trap) ;
 
 
dff   stgm_strmtrp (
dff_s   stgm_strmtrp (
        .din    (spubyp_trap_active_e),
        .din    (spubyp_trap_active_e),
        .q      (spubyp_trap_active_m),
        .q      (spubyp_trap_active_m),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff   stgg_strmtrp (
dff_s   stgg_strmtrp (
        .din    (spubyp_trap_active_m),
        .din    (spubyp_trap_active_m),
        .q      (spubyp_trap_active_g),
        .q      (spubyp_trap_active_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  spubyp0_ttype[6:0] = misc_data0[6:0] ;
assign  spubyp0_ttype[6:0] = misc_data0[6:0] ;
assign  spubyp1_ttype[6:0] = misc_data1[6:0] ;
assign  spubyp1_ttype[6:0] = misc_data1[6:0] ;
assign  spubyp2_ttype[6:0] = misc_data2[6:0] ;
assign  spubyp2_ttype[6:0] = misc_data2[6:0] ;
Line 5838... Line 5276...
assign  intld_byp_cmplt[0] = (ld_thrd_byp_sel_e[0] & ~(ldbyp0_fpld | squash_byp_cmplt[0])) ;
assign  intld_byp_cmplt[0] = (ld_thrd_byp_sel_e[0] & ~(ldbyp0_fpld | squash_byp_cmplt[0])) ;
assign  intld_byp_cmplt[1] = (ld_thrd_byp_sel_e[1] & ~(ldbyp1_fpld | squash_byp_cmplt[1])) ;
assign  intld_byp_cmplt[1] = (ld_thrd_byp_sel_e[1] & ~(ldbyp1_fpld | squash_byp_cmplt[1])) ;
assign  intld_byp_cmplt[2] = (ld_thrd_byp_sel_e[2] & ~(ldbyp2_fpld | squash_byp_cmplt[2])) ;
assign  intld_byp_cmplt[2] = (ld_thrd_byp_sel_e[2] & ~(ldbyp2_fpld | squash_byp_cmplt[2])) ;
assign  intld_byp_cmplt[3] = (ld_thrd_byp_sel_e[3] & ~(ldbyp3_fpld | squash_byp_cmplt[3])) ;
assign  intld_byp_cmplt[3] = (ld_thrd_byp_sel_e[3] & ~(ldbyp3_fpld | squash_byp_cmplt[3])) ;
 
 
dff #(2)  stgm_l2fv (
dff_s #(2)  stgm_l2fv (
        .din    ({l2fill_vld_e,lsu_l2fill_fpld_e}),
        .din    ({l2fill_vld_e,lsu_l2fill_fpld_e}),
        .q      ({l2fill_vld_m,l2fill_fpld_m}),
        .q      ({l2fill_vld_m,l2fill_fpld_m}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(2) stgg_l2fv (
dff_s #(2) stgg_l2fv (
        .din    ({l2fill_vld_m,l2fill_fpld_m}),
        .din    ({l2fill_vld_m,l2fill_fpld_m}),
        .q      ({l2fill_vld_g,l2fill_fpld_g}),
        .q      ({l2fill_vld_g,l2fill_fpld_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// write to irf will need to be postphoned by a few cycles. 
// write to irf will need to be postphoned by a few cycles. 
// may wish to find more bubbles by counting misses !!!
// may wish to find more bubbles by counting misses !!!
//assign  lsu_irf_byp_data_src[0]  =      ld_inst_vld_unflushed ;
//assign  lsu_irf_byp_data_src[0]  =      ld_inst_vld_unflushed ;
Line 5933... Line 5371...
  //((tlu_lsu_ldxa_data_vld_w2 & tlu_lsu_ldxa_illgl_va_w2) & tlu_ldxa_thread3_w2) |
  //((tlu_lsu_ldxa_data_vld_w2 & tlu_lsu_ldxa_illgl_va_w2) & tlu_ldxa_thread3_w2) |
  ((spu_lsu_ldxa_data_vld_w2 & spu_lsu_ldxa_illgl_va_w2) & spu_ldxa_thread3_w2) |
  ((spu_lsu_ldxa_data_vld_w2 & spu_lsu_ldxa_illgl_va_w2) & spu_ldxa_thread3_w2) |
  (int_ldxa_ivld & thread3_w2) |
  (int_ldxa_ivld & thread3_w2) |
  lsu_asi_illgl_va_cmplt_w2[3] ;
  lsu_asi_illgl_va_cmplt_w2[3] ;
 
 
dff #(4)  illglva_cmplt_d1 (
dff_s #(4)  illglva_cmplt_d1 (
        .din    (ldxa_illgl_va_cmplt[3:0]),
        .din    (ldxa_illgl_va_cmplt[3:0]),
        .q      (ldxa_illgl_va_cmplt_d1[3:0]),
        .q      (ldxa_illgl_va_cmplt_d1[3:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// Thread0
// Thread0
// Should be able to remove thread qualification for full-raw.
// Should be able to remove thread qualification for full-raw.
// Could have and e stage store and w2 stage stb rd in same cycle !!! Qualify select3
// Could have and e stage store and w2 stage stb rd in same cycle !!! Qualify select3
Line 5971... Line 5409...
assign  ldst_miss3 = lsu_ldst_miss_w2 & thread3_w2 ;
assign  ldst_miss3 = lsu_ldst_miss_w2 & thread3_w2 ;
 
 
wire    fraw_annul0_d1,fraw_annul1_d1,fraw_annul2_d1,fraw_annul3_d1 ;
wire    fraw_annul0_d1,fraw_annul1_d1,fraw_annul2_d1,fraw_annul3_d1 ;
wire    ldst_miss0_d1,ldst_miss1_d1,ldst_miss2_d1,ldst_miss3_d1 ;
wire    ldst_miss0_d1,ldst_miss1_d1,ldst_miss2_d1,ldst_miss3_d1 ;
 
 
dff #(4)  fraw_d1 (
dff_s #(4)  fraw_d1 (
        .din    ({fraw_annul3,fraw_annul2,fraw_annul1,fraw_annul0}),
        .din    ({fraw_annul3,fraw_annul2,fraw_annul1,fraw_annul0}),
        .q      ({fraw_annul3_d1,fraw_annul2_d1,fraw_annul1_d1,fraw_annul0_d1}),
        .q      ({fraw_annul3_d1,fraw_annul2_d1,fraw_annul1_d1,fraw_annul0_d1}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(4)  ldstm_d1 (
dff_s #(4)  ldstm_d1 (
        .din    ({ldst_miss3,ldst_miss2,ldst_miss1,ldst_miss0}),
        .din    ({ldst_miss3,ldst_miss2,ldst_miss1,ldst_miss0}),
        .q      ({ldst_miss3_d1,ldst_miss2_d1,ldst_miss1_d1,ldst_miss0_d1}),
        .q      ({ldst_miss3_d1,ldst_miss2_d1,ldst_miss1_d1,ldst_miss0_d1}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//wire  memref_d ;
//wire  memref_d ;
//assign        memref_d = ifu_lsu_memref_d ;
//assign        memref_d = ifu_lsu_memref_d ;
/*wire  mref_vld0,mref_vld1,mref_vld2,mref_vld3;
/*wire  mref_vld0,mref_vld1,mref_vld2,mref_vld3;
Line 5996... Line 5434...
assign  mref_vld0 = (memref_d | memref_e) & ~(lsu_ldst_miss_w2 & thread0_w2) ;
assign  mref_vld0 = (memref_d | memref_e) & ~(lsu_ldst_miss_w2 & thread0_w2) ;
assign  mref_vld1 = (memref_d | memref_e) & ~(lsu_ldst_miss_w2 & thread1_w2) ;
assign  mref_vld1 = (memref_d | memref_e) & ~(lsu_ldst_miss_w2 & thread1_w2) ;
assign  mref_vld2 = (memref_d | memref_e) & ~(lsu_ldst_miss_w2 & thread2_w2) ;
assign  mref_vld2 = (memref_d | memref_e) & ~(lsu_ldst_miss_w2 & thread2_w2) ;
assign  mref_vld3 = (memref_d | memref_e) & ~(lsu_ldst_miss_w2 & thread3_w2) ;
assign  mref_vld3 = (memref_d | memref_e) & ~(lsu_ldst_miss_w2 & thread3_w2) ;
 
 
dff #(4)  mrefv_d1 (
dff_s #(4)  mrefv_d1 (
        .din    ({mref_vld3,mref_vld2,mref_vld1,mref_vld0}),
        .din    ({mref_vld3,mref_vld2,mref_vld1,mref_vld0}),
        .q      ({mref_vld3_d1,mref_vld2_d1,mref_vld1_d1,mref_vld0_d1}),
        .q      ({mref_vld3_d1,mref_vld2_d1,mref_vld1_d1,mref_vld0_d1}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );  */
        );  */
 
 
//RAW timing change   
//RAW timing change   
assign  lmq_byp_data_sel0[0] = ld_stb_full_raw_w3 & ~(ldd_force_l2access_w3 | atomic_w3 | dtlb_perror_en_w3)  & thread0_w3 & ld_inst_vld_w3 ;
assign  lmq_byp_data_sel0[0] = ld_stb_full_raw_w3 & ~(ldd_force_l2access_w3 | atomic_w3 | dtlb_perror_en_w3)  & thread0_w3 & ld_inst_vld_w3 ;
//assign  lmq_byp_data_sel0[1] = st_inst_vld_e & thread0_e & ~ifu_lsu_casa_e & ~fraw_annul0 ;
//assign  lmq_byp_data_sel0[1] = st_inst_vld_e & thread0_e & ~ifu_lsu_casa_e & ~fraw_annul0 ;
Line 6059... Line 5497...
//assign  lmq_byp_data_sel3[1] = memref_e & thread3_e & ~ifu_lsu_casa_e & ~(fraw_annul3 | fraw_annul3_d1); // Bug 3053
//assign  lmq_byp_data_sel3[1] = memref_e & thread3_e & ~ifu_lsu_casa_e & ~(fraw_annul3 | fraw_annul3_d1); // Bug 3053
assign  lmq_byp_data_sel3[2] = ~(|lmq_byp_data_sel3[1:0]) & casa_g & thread3_g & lsu_inst_vld_w & ~fraw_annul3_d1 ;
assign  lmq_byp_data_sel3[2] = ~(|lmq_byp_data_sel3[1:0]) & casa_g & thread3_g & lsu_inst_vld_w & ~fraw_annul3_d1 ;
assign  lmq_byp_data_sel3[3] = |lmq_byp_ldxa_sel3[2:0];
assign  lmq_byp_data_sel3[3] = |lmq_byp_ldxa_sel3[2:0];
 
 
 
 
dff #(4)  ff_lmq_byp_data_raw_sel_d1 (
dff_s #(4)  ff_lmq_byp_data_raw_sel_d1 (
        .din    ({lmq_byp_data_sel3[0], lmq_byp_data_sel2[0],
        .din    ({lmq_byp_data_sel3[0], lmq_byp_data_sel2[0],
                  lmq_byp_data_sel1[0], lmq_byp_data_sel0[0]}),
                  lmq_byp_data_sel1[0], lmq_byp_data_sel0[0]}),
        .q      (lmq_byp_data_raw_sel_d1[3:0]),
        .q      (lmq_byp_data_raw_sel_d1[3:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(4)  ff_lmq_byp_data_raw_sel_d2 (
dff_s #(4)  ff_lmq_byp_data_raw_sel_d2 (
        .din    (lmq_byp_data_raw_sel_d1[3:0]),
        .din    (lmq_byp_data_raw_sel_d1[3:0]),
        .q      (lmq_byp_data_raw_sel_d2[3:0]),
        .q      (lmq_byp_data_raw_sel_d2[3:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire            lsu_irf_raw_byp_e;
wire            lsu_irf_raw_byp_e;
// Includes both ldxa and raw bypass. 
// Includes both ldxa and raw bypass. 
assign  lsu_irf_raw_byp_e  =
assign  lsu_irf_raw_byp_e  =
Line 6111... Line 5549...
   //assign lsu_ld_thrd_byp_sel_e[2:0] = ld_thrd_byp_sel_e[2:0];
   //assign lsu_ld_thrd_byp_sel_e[2:0] = ld_thrd_byp_sel_e[2:0];
    bw_u1_buf_30x UZsize_lsu_ld_thrd_byp_sel_e_b2 (.a(ld_thrd_byp_sel_e[2]), .z(lsu_ld_thrd_byp_sel_e[2]));
    bw_u1_buf_30x UZsize_lsu_ld_thrd_byp_sel_e_b2 (.a(ld_thrd_byp_sel_e[2]), .z(lsu_ld_thrd_byp_sel_e[2]));
    bw_u1_buf_30x UZsize_lsu_ld_thrd_byp_sel_e_b1 (.a(ld_thrd_byp_sel_e[1]), .z(lsu_ld_thrd_byp_sel_e[1]));
    bw_u1_buf_30x UZsize_lsu_ld_thrd_byp_sel_e_b1 (.a(ld_thrd_byp_sel_e[1]), .z(lsu_ld_thrd_byp_sel_e[1]));
    bw_u1_buf_30x UZsize_lsu_ld_thrd_byp_sel_e_b0 (.a(ld_thrd_byp_sel_e[0]), .z(lsu_ld_thrd_byp_sel_e[0]));
    bw_u1_buf_30x UZsize_lsu_ld_thrd_byp_sel_e_b0 (.a(ld_thrd_byp_sel_e[0]), .z(lsu_ld_thrd_byp_sel_e[0]));
 
 
dff #(4)  tbyp_stgd1 (
dff_s #(4)  tbyp_stgd1 (
        .din    (ld_thrd_byp_sel_e[3:0]),
        .din    (ld_thrd_byp_sel_e[3:0]),
        .q      (ld_thrd_byp_sel_m[3:0]),
        .q      (ld_thrd_byp_sel_m[3:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//assign ld_thrd_byp_mxsel_m[2:0]  =    ld_thrd_byp_sel_m[2:0];
//assign ld_thrd_byp_mxsel_m[2:0]  =    ld_thrd_byp_sel_m[2:0];
//assign ld_thrd_byp_mxsel_m[3]    =  ~|ld_thrd_byp_sel_m[2:0];
//assign ld_thrd_byp_mxsel_m[3]    =  ~|ld_thrd_byp_sel_m[2:0];
 
 
assign ld_thrd_byp_mxsel_m[0]  =    ld_thrd_byp_sel_m[0] & ~rst_tri_en;
assign ld_thrd_byp_mxsel_m[0]  =    ld_thrd_byp_sel_m[0] & ~rst_tri_en;
assign ld_thrd_byp_mxsel_m[1]  =    ld_thrd_byp_sel_m[1] & ~rst_tri_en;
assign ld_thrd_byp_mxsel_m[1]  =    ld_thrd_byp_sel_m[1] & ~rst_tri_en;
assign ld_thrd_byp_mxsel_m[2]  =    ld_thrd_byp_sel_m[2] & ~rst_tri_en;
assign ld_thrd_byp_mxsel_m[2]  =    ld_thrd_byp_sel_m[2] & ~rst_tri_en;
assign ld_thrd_byp_mxsel_m[3]  =    (~|ld_thrd_byp_sel_m[2:0]) |  rst_tri_en;
assign ld_thrd_byp_mxsel_m[3]  =    (~|ld_thrd_byp_sel_m[2:0]) |  rst_tri_en;
 
 
dff #(4)  tbyp_stgd2 (
dff_s #(4)  tbyp_stgd2 (
        .din    (ld_thrd_byp_sel_m[3:0]),
        .din    (ld_thrd_byp_sel_m[3:0]),
        .q      (ld_thrd_byp_sel_g[3:0]),
        .q      (ld_thrd_byp_sel_g[3:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
  //should move to M stage 
  //should move to M stage 
 
 
//assign ld_thrd_byp_mxsel_g[2:0]  =    ld_thrd_byp_sel_g[2:0];
//assign ld_thrd_byp_mxsel_g[2:0]  =    ld_thrd_byp_sel_g[2:0];
Line 6226... Line 5664...
(atm_st_cmplt0 & pend_atm_ld_ue[0]) |
(atm_st_cmplt0 & pend_atm_ld_ue[0]) |
(atm_st_cmplt1 & pend_atm_ld_ue[1]) |
(atm_st_cmplt1 & pend_atm_ld_ue[1]) |
(atm_st_cmplt2 & pend_atm_ld_ue[2]) |
(atm_st_cmplt2 & pend_atm_ld_ue[2]) |
(atm_st_cmplt3 & pend_atm_ld_ue[3]) ;
(atm_st_cmplt3 & pend_atm_ld_ue[3]) ;
 
 
dff #(5)  stgm_tlberr (
dff_s #(5)  stgm_tlberr (
        .din    ({cam_perr_unc_e,asi_data_perr_e,
        .din    ({cam_perr_unc_e,asi_data_perr_e,
                asi_tag_perr_e,ifu_unc_err_e,atm_st_unc_err_e}),
                asi_tag_perr_e,ifu_unc_err_e,atm_st_unc_err_e}),
        .q      ({cam_perr_unc_m,asi_data_perr_m,
        .q      ({cam_perr_unc_m,asi_data_perr_m,
                asi_tag_perr_m,ifu_unc_err_m,atm_st_unc_err_m}),
                asi_tag_perr_m,ifu_unc_err_m,atm_st_unc_err_m}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
dff #(5)  stgg_tlberr (
dff_s #(5)  stgg_tlberr (
        .din    ({cam_perr_unc_m,asi_data_perr_m,
        .din    ({cam_perr_unc_m,asi_data_perr_m,
                asi_tag_perr_m,ifu_unc_err_m,atm_st_unc_err_m}),
                asi_tag_perr_m,ifu_unc_err_m,atm_st_unc_err_m}),
        .q      ({cam_perr_unc_g,asi_data_perr_g,
        .q      ({cam_perr_unc_g,asi_data_perr_g,
                asi_tag_perr_g,ifu_unc_err_g,atm_st_unc_err_g}),
                asi_tag_perr_g,ifu_unc_err_g,atm_st_unc_err_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  lsu_tlb_asi_data_perr_g = asi_data_perr_g ;
assign  lsu_tlb_asi_data_perr_g = asi_data_perr_g ;
assign  lsu_tlb_asi_tag_perr_g = asi_tag_perr_g ;
assign  lsu_tlb_asi_tag_perr_g = asi_tag_perr_g ;
 
 
Line 6268... Line 5706...
        ((~dfq_tid_m[1] & ~dfq_tid_m[0]) & lsu_nceen_d1[0]) |
        ((~dfq_tid_m[1] & ~dfq_tid_m[0]) & lsu_nceen_d1[0]) |
        ((~dfq_tid_m[1] &  dfq_tid_m[0]) & lsu_nceen_d1[1]) |
        ((~dfq_tid_m[1] &  dfq_tid_m[0]) & lsu_nceen_d1[1]) |
        (( dfq_tid_m[1] & ~dfq_tid_m[0]) & lsu_nceen_d1[2]) |
        (( dfq_tid_m[1] & ~dfq_tid_m[0]) & lsu_nceen_d1[2]) |
        (( dfq_tid_m[1] &  dfq_tid_m[0]) & lsu_nceen_d1[3]) ;
        (( dfq_tid_m[1] &  dfq_tid_m[0]) & lsu_nceen_d1[3]) ;
 
 
dff #(2)  trpen_stg (
dff_s #(2)  trpen_stg (
        .din    ({nceen_m,nceen_dfq_m}),
        .din    ({nceen_m,nceen_dfq_m}),
        .q      ({nceen_g,nceen_dfq_g}),
        .q      ({nceen_g,nceen_dfq_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
// l2c/dram
// l2c/dram
wire    atm_ld_w_uerr_m ;
wire    atm_ld_w_uerr_m ;
dff #(1)  atmldu_stm (
dff_s #(1)  atmldu_stm (
        .din    (atm_ld_w_uerr),
        .din    (atm_ld_w_uerr),
        .q      (atm_ld_w_uerr_m),
        .q      (atm_ld_w_uerr_m),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    pmem_unc_error_m,pmem_unc_error_g ;
wire    pmem_unc_error_m,pmem_unc_error_g ;
assign  pmem_unc_error_m =
assign  pmem_unc_error_m =
        l2_unc_error_m &  // bug3666
        l2_unc_error_m &  // bug3666
        ~atm_ld_w_uerr_m ; //bug4048 - squash for atm ld with error.
        ~atm_ld_w_uerr_m ; //bug4048 - squash for atm ld with error.
 
 
wire    pmem_unc_error_tmp ;
wire    pmem_unc_error_tmp ;
dff #(1)  pmem_stg (
dff_s #(1)  pmem_stg (
        .din    (pmem_unc_error_m),
        .din    (pmem_unc_error_m),
        .q      (pmem_unc_error_tmp),
        .q      (pmem_unc_error_tmp),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  pmem_unc_error_g =
assign  pmem_unc_error_g =
        (pmem_unc_error_tmp | bld_unc_err_pend_g) & ~bld_squash_err_g ;
        (pmem_unc_error_tmp | bld_unc_err_pend_g) & ~bld_squash_err_g ;
 
 
Line 6323... Line 5761...
 
 
wire [6:0]       async_ttype_m ;
wire [6:0]       async_ttype_m ;
assign  async_ttype_m[6:0] =
assign  async_ttype_m[6:0] =
        spubyp_trap_active_m ? spubyp_ttype[6:0] : 7'h32 ;
        spubyp_trap_active_m ? spubyp_ttype[6:0] : 7'h32 ;
 
 
dff #(7)  attype_stg (
dff_s #(7)  attype_stg (
        .din    (async_ttype_m[6:0]),
        .din    (async_ttype_m[6:0]),
        .q      (async_ttype_g[6:0]),
        .q      (async_ttype_g[6:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire [1:0]       async_err_tid_e,async_err_tid_m,async_err_tid_g ;
wire [1:0]       async_err_tid_e,async_err_tid_m,async_err_tid_g ;
assign  async_err_tid_e[0] = ld_thrd_byp_sel_e[1] | ld_thrd_byp_sel_e[3] ;
assign  async_err_tid_e[0] = ld_thrd_byp_sel_e[1] | ld_thrd_byp_sel_e[3] ;
assign  async_err_tid_e[1] = ld_thrd_byp_sel_e[3] | ld_thrd_byp_sel_e[2] ;
assign  async_err_tid_e[1] = ld_thrd_byp_sel_e[3] | ld_thrd_byp_sel_e[2] ;
 
 
dff #(2)  ldbyperr_stgm (
dff_s #(2)  ldbyperr_stgm (
        .din    (async_err_tid_e[1:0]),
        .din    (async_err_tid_e[1:0]),
        .q      (async_err_tid_m[1:0]),
        .q      (async_err_tid_m[1:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(2)  ldbyperr_stgg (
dff_s #(2)  ldbyperr_stgg (
        .din    (async_err_tid_m[1:0]),
        .din    (async_err_tid_m[1:0]),
        .q      (async_err_tid_g[1:0]),
        .q      (async_err_tid_g[1:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    sel_dfq_tid ;
wire    sel_dfq_tid ;
assign  sel_dfq_tid = pmem_unc_error_g | atm_st_unc_err_g ;
assign  sel_dfq_tid = pmem_unc_error_g | atm_st_unc_err_g ;
assign  async_tid_g[1:0] =
assign  async_tid_g[1:0] =
Line 6357... Line 5795...
        sel_dfq_tid ? // Bug 3335,4048
        sel_dfq_tid ? // Bug 3335,4048
        dfq_tid_g[1:0] : async_err_tid_g[1:0] ;
        dfq_tid_g[1:0] : async_err_tid_g[1:0] ;
 
 
// Delay async_trp interface to TLU by a cycle.
// Delay async_trp interface to TLU by a cycle.
 
 
dff #(10)  asynctrp_stgw2 (
dff_s #(10)  asynctrp_stgw2 (
        .din    ({async_ttype_vld_g,async_tid_g[1:0],async_ttype_g[6:0]}),
        .din    ({async_ttype_vld_g,async_tid_g[1:0],async_ttype_g[6:0]}),
        .q      ({lsu_tlu_async_ttype_vld_w2,lsu_tlu_async_tid_w2[1:0],
        .q      ({lsu_tlu_async_ttype_vld_w2,lsu_tlu_async_tid_w2[1:0],
                lsu_tlu_async_ttype_w2[6:0]}),
                lsu_tlu_async_ttype_w2[6:0]}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// Asynchronous Error Reporting to IFU 
// Asynchronous Error Reporting to IFU 
// Partial.
// Partial.
 
 
wire  sync_error_sel ;
wire  sync_error_sel ;
wire    memref_m ,memref_g;
wire    memref_m ,memref_g;
 
 
dff #(1) memref_stgg (
dff_s #(1) memref_stgg (
        .din    (memref_m),
        .din    (memref_m),
        .q      (memref_g),
        .q      (memref_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//assign  sync_error_sel = tte_data_perror_unc | tte_data_perror_corr ;
//assign  sync_error_sel = tte_data_perror_unc | tte_data_perror_corr ;
 
 
//for in1 or in2 to be selected, memref_g must be 0.
//for in1 or in2 to be selected, memref_g must be 0.
Line 6428... Line 5866...
                   );
                   );
 
 
// Can shift to m.
// Can shift to m.
//assign  lsu_tlu_derr_tid_g[1:0] = err_tid_g[1:0] ;
//assign  lsu_tlu_derr_tid_g[1:0] = err_tid_g[1:0] ;
 
 
dff #(2)  errad_stgg (
dff_s #(2)  errad_stgg (
        .din    (err_tid_g[1:0]),
        .din    (err_tid_g[1:0]),
        .q      (lsu_ifu_error_tid[1:0]),
        .q      (lsu_ifu_error_tid[1:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  lsu_ifu_io_error = //l2_unc_error_w2 & lsu_ifu_err_addr_b39 ;
assign  lsu_ifu_io_error = //l2_unc_error_w2 & lsu_ifu_err_addr_b39 ;
// extend for bld to io space.
// extend for bld to io space.
(l2_unc_error_w2 | bld_unc_err_pend_w2) & lsu_ifu_err_addr_b39 & ~bld_squash_err_w2 ;
(l2_unc_error_w2 | bld_unc_err_pend_w2) & lsu_ifu_err_addr_b39 & ~bld_squash_err_w2 ;
Line 6451... Line 5889...
~(intrpt_disp_asi_g | stxa_stall_asi_g | (ifu_nontlb_asi_g & ~ifu_asi42_flush_g) | tlb_lng_ltncy_asi_g) &
~(intrpt_disp_asi_g | stxa_stall_asi_g | (ifu_nontlb_asi_g & ~ifu_asi42_flush_g) | tlb_lng_ltncy_asi_g) &
                                        lsu_inst_vld_w & ~dctl_early_flush_w ;
                                        lsu_inst_vld_w & ~dctl_early_flush_w ;
                                        //lsu_inst_vld_w & ~dctl_flush_pipe_w ;
                                        //lsu_inst_vld_w & ~dctl_flush_pipe_w ;
 
 
// Need to add stxa's related to ifu non-tlb asi.
// Need to add stxa's related to ifu non-tlb asi.
dff  stxa_int_d1 (
dff_s  stxa_int_d1 (
        .din    (stxa_internal_cmplt),
        .din    (stxa_internal_cmplt),
        //.din    (stxa_internal & ~(stxa_stall_asi_g | tlb_lng_ltncy_asi_g) & lsu_inst_vld_w),
        //.din    (stxa_internal & ~(stxa_stall_asi_g | tlb_lng_ltncy_asi_g) & lsu_inst_vld_w),
        .q      (stxa_internal_d1),
        .q      (stxa_internal_d1),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff  stxa_int_d2 (
dff_s  stxa_int_d2 (
        .din    (stxa_internal_d1),
        .din    (stxa_internal_d1),
        .q      (stxa_internal_d2),
        .q      (stxa_internal_d2),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
//=========================================================================================
//=========================================================================================
//  Replacement Algorithm for Cache
//  Replacement Algorithm for Cache
Line 6479... Line 5917...
wire    lfsr_incr, lfsr_incr_d1 ;
wire    lfsr_incr, lfsr_incr_d1 ;
assign  lfsr_incr =
assign  lfsr_incr =
        ld_inst_vld_g & ~lsu_way_hit_or & ~ldxa_internal &
        ld_inst_vld_g & ~lsu_way_hit_or & ~ldxa_internal &
        ~ncache_pcx_rq_g ; // must be cacheable
        ~ncache_pcx_rq_g ; // must be cacheable
 
 
dff  lfsrd1_ff (
dff_s  lfsrd1_ff (
        .din    (lfsr_incr),
        .din    (lfsr_incr),
        .q      (lfsr_incr_d1),
        .q      (lfsr_incr_d1),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    lfsr_rst ;
wire    lfsr_rst ;
assign  lfsr_rst =
assign  lfsr_rst =
                reset           |
                reset           |
Line 6498... Line 5936...
lsu_dcache_lfsr lfsr(.out (lsu_dcache_rand[1:0]),
lsu_dcache_lfsr lfsr(.out (lsu_dcache_rand[1:0]),
                                           .clk  (clk),
                                           .clk  (clk),
                                           .advance (lfsr_incr_d1),
                                           .advance (lfsr_incr_d1),
                                           .reset (lfsr_rst),
                                           .reset (lfsr_rst),
                                           .se (se),
                                           .se (se),
                                           .si (),
                                           `SIMPLY_RISC_SCANIN,
                                           .so ());
                                           `SIMPLY_RISC_SCANOUT);
 
 
//assign  lsu_dcache_rand[1:0]  =  dcache_rand[1:0]; 
//assign  lsu_dcache_rand[1:0]  =  dcache_rand[1:0]; 
 
 
 
 
/*assign  dcache_rand_new[1:0] = dcache_rand[1:0] + {1'b0, lsu_ld_miss_wb} ;
/*assign  dcache_rand_new[1:0] = dcache_rand[1:0] + {1'b0, lsu_ld_miss_wb} ;
dffre #(2) drand (
dffre_s #(2) drand (
        .din    (dcache_rand_new[1:0]),
        .din    (dcache_rand_new[1:0]),
        .q      (dcache_rand[1:0]),
        .q      (dcache_rand[1:0]),
        .rst  (reset), .en    (lsu_ld_miss_wb),
        .rst  (reset), .en    (lsu_ld_miss_wb),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  lsu_dcache_rand[1:0]  =  dcache_rand[1:0]; */
assign  lsu_dcache_rand[1:0]  =  dcache_rand[1:0]; */
 
 
//=========================================================================================
//=========================================================================================
Line 6529... Line 5967...
 
 
//assign  stb_byp_pkt_vld_e = st_inst_vld_e & ~(ldsta_internal_e & alt_space_e);
//assign  stb_byp_pkt_vld_e = st_inst_vld_e & ~(ldsta_internal_e & alt_space_e);
assign  ld_pcx_pkt_vld_e = ld_inst_vld_e & ~(ldsta_internal_e & alt_space_e);
assign  ld_pcx_pkt_vld_e = ld_inst_vld_e & ~(ldsta_internal_e & alt_space_e);
 
 
 
 
dff #(5)  pktctl_stgm (
dff_s #(5)  pktctl_stgm (
        .din    ({ifu_lsu_ldst_dbl_e, ld_pcx_pkt_vld_e,
        .din    ({ifu_lsu_ldst_dbl_e, ld_pcx_pkt_vld_e,
    ifu_lsu_casa_e,ifu_lsu_ldstub_e,ifu_lsu_swap_e}),
    ifu_lsu_casa_e,ifu_lsu_ldstub_e,ifu_lsu_swap_e}),
        .q      ({ldst_dbl_m, ld_pcx_pkt_vld_m,
        .q      ({ldst_dbl_m, ld_pcx_pkt_vld_m,
    casa_m,ldstub_m,swap_m}),
    casa_m,ldstub_m,swap_m}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  atomic_m = casa_m | ldstub_m | swap_m ;
assign  atomic_m = casa_m | ldstub_m | swap_m ;
 
 
dff #(6) pktctl_stgg (
dff_s #(6) pktctl_stgg (
        .din    ({ldst_dbl_m, ld_pcx_pkt_vld_m,
        .din    ({ldst_dbl_m, ld_pcx_pkt_vld_m,
    casa_m,ldstub_m,swap_m,atomic_m}),
    casa_m,ldstub_m,swap_m,atomic_m}),
        .q      ({ldst_dbl_g, ld_pcx_pkt_vld_g,
        .q      ({ldst_dbl_g, ld_pcx_pkt_vld_g,
    casa_g,ldstub_g,swap_g,atomic_g}),
    casa_g,ldstub_g,swap_g,atomic_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(2) pktctl_stgw2 (
dff_s #(2) pktctl_stgw2 (
        .din    ({ldd_force_l2access_g, atomic_g}),
        .din    ({ldd_force_l2access_g, atomic_g}),
        .q      ({ldd_force_l2access_w2,atomic_w2}),
        .q      ({ldd_force_l2access_w2,atomic_w2}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(2) pktctl_stgw3 (
dff_s #(2) pktctl_stgw3 (
        .din    ({ldd_force_l2access_w2, atomic_w2}),
        .din    ({ldd_force_l2access_w2, atomic_w2}),
        .q      ({ldd_force_l2access_w3, atomic_w3}),
        .q      ({ldd_force_l2access_w3, atomic_w3}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  lsu_ldstub_g = ldstub_g ;
assign  lsu_ldstub_g = ldstub_g ;
assign  lsu_swap_g = swap_g ;
assign  lsu_swap_g = swap_g ;
 
 
Line 6616... Line 6054...
 
 
wire    asi_real_iomem_m,asi_real_iomem_g ;
wire    asi_real_iomem_m,asi_real_iomem_g ;
assign  asi_real_iomem_m =
assign  asi_real_iomem_m =
(dtlb_bypass_m & (phy_use_ec_asi_m | phy_byp_ec_asi_m) & lsu_alt_space_m) ;
(dtlb_bypass_m & (phy_use_ec_asi_m | phy_byp_ec_asi_m) & lsu_alt_space_m) ;
 
 
dff #(1) stgg_asir (
dff_s #(1) stgg_asir (
        .din    (asi_real_iomem_m),
        .din    (asi_real_iomem_m),
        .q      (asi_real_iomem_g),
        .q      (asi_real_iomem_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  ncache_pcx_rq_g   =
assign  ncache_pcx_rq_g   =
  atomic_g    |   // cas,ldstub,swap  
  atomic_g    |   // cas,ldstub,swap  
  asi_real_iomem_g | // real_mem, real_io
  asi_real_iomem_g | // real_mem, real_io
Line 6646... Line 6084...
//dbl_data_return will become lmq_ldd
//dbl_data_return will become lmq_ldd
//it includes quad ld, int ldd, block ld, all these cases need return data twice.    
//it includes quad ld, int ldd, block ld, all these cases need return data twice.    
   wire dbl_data_return;
   wire dbl_data_return;
   assign dbl_data_return = ldst_dbl_g & ~ (fp_ldst_g & ~ (blk_asi_g & lsu_alt_space_g));
   assign dbl_data_return = ldst_dbl_g & ~ (fp_ldst_g & ~ (blk_asi_g & lsu_alt_space_g));
 
 
assign  ld_pcx_pkt_g[65-1:40] =
assign  ld_pcx_pkt_g[`LMQ_WIDTH-1:40] =
  {lmq_pkt_vld_g,
  {lmq_pkt_vld_g,
  1'b0,                  //dflush_ld_g, bug 4580 
  1'b0,                  //dflush_ld_g, bug 4580 
  pref_inst_g,
  pref_inst_g,
  fp_ld_inst_g,
  fp_ld_inst_g,
  l1hit_sign_extend_g,
  l1hit_sign_extend_g,
Line 6678... Line 6116...
// Create 16b Write Mask based on size and va ;
// Create 16b Write Mask based on size and va ;
// This is to be put in the DFQ once the DFQ is on-line.
// This is to be put in the DFQ once the DFQ is on-line.
 
 
 
 
wire [2:0] dc_waddr_m ;
wire [2:0] dc_waddr_m ;
dff #(4) stgm_addr (
dff_s #(4) stgm_addr (
        .din    ({memref_e, dcache_wr_addr_e[2:0]}),
        .din    ({memref_e, dcache_wr_addr_e[2:0]}),
        .q      ({memref_m, dc_waddr_m[2:0]}),
        .q      ({memref_m, dc_waddr_m[2:0]}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  lsu_memref_m = memref_m ;
assign  lsu_memref_m = memref_m ;
 
 
//wire [3:0] rwaddr_enc ;
//wire [3:0] rwaddr_enc ;
Line 6739... Line 6177...
        .sel2   (thread2_e),
        .sel2   (thread2_e),
        .sel3   (thread3_e),
        .sel3   (thread3_e),
        .dout   (pstate_cle_e)
        .dout   (pstate_cle_e)
);
);
 
 
dff #(1) stgm_pstatecle (
dff_s #(1) stgm_pstatecle (
        .din    (pstate_cle_e),
        .din    (pstate_cle_e),
        .q      (pstate_cle_m),
        .q      (pstate_cle_m),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff #(1) stgg_pstatecle (
dff_s #(1) stgg_pstatecle (
        .din    (pstate_cle_m),
        .din    (pstate_cle_m),
        .q      (pstate_cle_g),
        .q      (pstate_cle_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//SPARC V9 page 52. pstate.cle should only affect implicit ASI   
//SPARC V9 page 52. pstate.cle should only affect implicit ASI   
assign  l1hit_lendian_g =
assign  l1hit_lendian_g =
    ((non_altspace_ldst_g & (pstate_cle_g ^ tlb_invert_endian_g)) |       // non altspace ldst
    ((non_altspace_ldst_g & (pstate_cle_g ^ tlb_invert_endian_g)) |       // non altspace ldst
Line 6775... Line 6213...
// m stage endian signal is predicted for in-pipe lds only.
// m stage endian signal is predicted for in-pipe lds only.
wire    bendian_pred_m, bendian_pred_g ;
wire    bendian_pred_m, bendian_pred_g ;
assign  bendian_pred_m = (ld_inst_vld_m | st_inst_vld_m) ?
assign  bendian_pred_m = (ld_inst_vld_m | st_inst_vld_m) ?
    ~l1hit_lendian_predict_m : lsu_l2fill_bendian_m ;
    ~l1hit_lendian_predict_m : lsu_l2fill_bendian_m ;
 
 
dff #(1) stgg_bendpr(
dff_s #(1) stgg_bendpr(
        .din    (bendian_pred_m),
        .din    (bendian_pred_m),
        .q      (bendian_pred_g),
        .q      (bendian_pred_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// mispredict applies to only in-pipe lds.
// mispredict applies to only in-pipe lds.
assign  endian_mispred_g =  bendian_pred_g ^ ~l1hit_lendian_g ;
assign  endian_mispred_g =  bendian_pred_g ^ ~l1hit_lendian_g ;
 
 
// Staging for alignment on read from l1 or fill to l2.
// Staging for alignment on read from l1 or fill to l2.
dff #(4) stgm_sz (
dff_s #(4) stgm_sz (
        .din    ({ldst_byte,  ldst_hword,  ldst_word,  ldst_dword}),
        .din    ({ldst_byte,  ldst_hword,  ldst_word,  ldst_dword}),
        .q      ({byte_m,hword_m,word_m,dword_m}),
        .q      ({byte_m,hword_m,word_m,dword_m}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    [7:0]    rwaddr_dcd_part ;
wire    [7:0]    rwaddr_dcd_part ;
 
 
assign  rwaddr_dcd_part[0]  = ~rwaddr_enc[2] & ~rwaddr_enc[1] & ~rwaddr_enc[0] ;
assign  rwaddr_dcd_part[0]  = ~rwaddr_enc[2] & ~rwaddr_enc[1] & ~rwaddr_enc[0] ;
Line 6923... Line 6361...
 
 
//=========================================================================================
//=========================================================================================
//  Sign/Zero-Extension
//  Sign/Zero-Extension
//=========================================================================================
//=========================================================================================
 
 
dff #(1) stgm_msb (
dff_s #(1) stgm_msb (
       .din    ({lsu_l1hit_sign_extend_e}),
       .din    ({lsu_l1hit_sign_extend_e}),
       .q      ({l1hit_sign_extend_m}),
       .q      ({l1hit_sign_extend_m}),
       .clk    (clk),
       .clk    (clk),
       .se     (se),       .si (),          .so ()
       .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
       );
       );
 
 
dff #(1) stgg_msb (
dff_s #(1) stgg_msb (
       .din    ({l1hit_sign_extend_m}),
       .din    ({l1hit_sign_extend_m}),
       .q      ({l1hit_sign_extend_g}),
       .q      ({l1hit_sign_extend_g}),
       .clk    (clk),
       .clk    (clk),
       .se     (se),       .si (),          .so ()
       .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
       );
       );
 
 
 
 
//wire [1:0] lsu_byp_misc_sz_g ;   
//wire [1:0] lsu_byp_misc_sz_g ;   
 
 
/*dff #(2) ff_lsu_byp_misc_sz_g (
/*dff #(2) ff_lsu_byp_misc_sz_g (
        .din   (lsu_byp_misc_sz_m[1:0]),
        .din   (lsu_byp_misc_sz_m[1:0]),
        .q     (lsu_byp_misc_sz_g[1:0]),
        .q     (lsu_byp_misc_sz_g[1:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );  */
        );  */
 
 
assign  misc_byte_m   = ~lsu_byp_misc_sz_m[1] & ~lsu_byp_misc_sz_m[0] ; // 00
assign  misc_byte_m   = ~lsu_byp_misc_sz_m[1] & ~lsu_byp_misc_sz_m[0] ; // 00
assign  misc_hword_m  = ~lsu_byp_misc_sz_m[1] &  lsu_byp_misc_sz_m[0] ; // 01
assign  misc_hword_m  = ~lsu_byp_misc_sz_m[1] &  lsu_byp_misc_sz_m[0] ; // 01
assign  misc_word_m   =  lsu_byp_misc_sz_m[1] & ~lsu_byp_misc_sz_m[0] ; // 10
assign  misc_word_m   =  lsu_byp_misc_sz_m[1] & ~lsu_byp_misc_sz_m[0] ; // 10
Line 6962... Line 6400...
 
 
/*assign  byp_byte_g =  (|lsu_irf_byp_data_src[2:1]) ? misc_byte_g : byte_g ;
/*assign  byp_byte_g =  (|lsu_irf_byp_data_src[2:1]) ? misc_byte_g : byte_g ;
assign  byp_hword_g = (|lsu_irf_byp_data_src[2:1]) ? misc_hword_g : hword_g ;
assign  byp_hword_g = (|lsu_irf_byp_data_src[2:1]) ? misc_hword_g : hword_g ;
assign  byp_word_g =  (|lsu_irf_byp_data_src[2:1]) ? misc_word_g : word_g ;*/
assign  byp_word_g =  (|lsu_irf_byp_data_src[2:1]) ? misc_word_g : word_g ;*/
 
 
dff #(1) bypsz_stgg(
dff_s #(1) bypsz_stgg(
        .din   ({byp_word_m}),
        .din   ({byp_word_m}),
        .q     ({byp_word_g}),
        .q     ({byp_word_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//wire [3:0]    misc_waddr_m ; 
//wire [3:0]    misc_waddr_m ; 
//assign  misc_waddr_m[3:0] = {lsu_byp_misc_addr_m[3],lsu_byp_misc_addr_m[2]^lsu_byp_ldd_oddrd_m,lsu_byp_misc_addr_m[1:0]} ;
//assign  misc_waddr_m[3:0] = {lsu_byp_misc_addr_m[3],lsu_byp_misc_addr_m[2]^lsu_byp_ldd_oddrd_m,lsu_byp_misc_addr_m[1:0]} ;
 
 
Line 7485... Line 6923...
                           .dmmu_asi58_d(dmmu_asi58_d),
                           .dmmu_asi58_d(dmmu_asi58_d),
                           .immu_asi50_d(immu_asi50_d),
                           .immu_asi50_d(immu_asi50_d),
                           // Inputs
                           // Inputs
                           .asi_d       (asi_d[7:0]));
                           .asi_d       (asi_d[7:0]));
 
 
dff #(31)  asidcd_stge (
dff_s #(31)  asidcd_stge (
        .din    ({asi_internal_d,primary_asi_d,secondary_asi_d,nucleus_asi_d,
        .din    ({asi_internal_d,primary_asi_d,secondary_asi_d,nucleus_asi_d,
    lendian_asi_d, tlb_byp_asi_d, dcache_byp_asi_d,nofault_asi_d,
    lendian_asi_d, tlb_byp_asi_d, dcache_byp_asi_d,nofault_asi_d,
    tlb_lng_ltncy_asi_d,as_if_user_asi_d,atomic_asi_d, blk_asi_d,
    tlb_lng_ltncy_asi_d,as_if_user_asi_d,atomic_asi_d, blk_asi_d,
    dc_diagnstc_asi_d,dtagv_diagnstc_asi_d,
    dc_diagnstc_asi_d,dtagv_diagnstc_asi_d,
    wr_only_asi_d, rd_only_asi_d,mmu_rd_only_asi_d,unimp_asi_d,dmmu_asi58_d, immu_asi50_d, quad_asi_d, binit_quad_asi_d,
    wr_only_asi_d, rd_only_asi_d,mmu_rd_only_asi_d,unimp_asi_d,dmmu_asi58_d, immu_asi50_d, quad_asi_d, binit_quad_asi_d,
Line 7501... Line 6939...
    dc_diagnstc_asi_e,dtagv_diagnstc_asi_e,
    dc_diagnstc_asi_e,dtagv_diagnstc_asi_e,
    wr_only_asi_e, rd_only_asi_e,mmu_rd_only_asi_e,unimp_asi_e,dmmu_asi58_e, immu_asi50_e, quad_asi_e, binit_quad_asi_e,
    wr_only_asi_e, rd_only_asi_e,mmu_rd_only_asi_e,unimp_asi_e,dmmu_asi58_e, immu_asi50_e, quad_asi_e, binit_quad_asi_e,
    ifu_nontlb_asi_e,recognized_asi_e,ifill_tlb_asi_e,
    ifu_nontlb_asi_e,recognized_asi_e,ifill_tlb_asi_e,
    dfill_tlb_asi_e,rd_only_ltlb_asi_e,wr_only_ltlb_asi_e,phy_use_ec_asi_e, phy_byp_ec_asi_e, intrpt_disp_asi_e}),
    dfill_tlb_asi_e,rd_only_ltlb_asi_e,wr_only_ltlb_asi_e,phy_use_ec_asi_e, phy_byp_ec_asi_e, intrpt_disp_asi_e}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  lsu_ffu_blk_asi_e = blk_asi_e & alt_space_e;
assign  lsu_ffu_blk_asi_e = blk_asi_e & alt_space_e;
assign  lsu_quad_asi_e = quad_asi_e ;
assign  lsu_quad_asi_e = quad_asi_e ;
 
 
wire    unimp_asi_tmp ;
wire    unimp_asi_tmp ;
dff #(23)  asidcd_stgm (
dff_s #(23)  asidcd_stgm (
        .din    ({asi_internal_e,dcache_byp_asi_e,nofault_asi_e,lendian_asi_e,tlb_lng_ltncy_asi_e,
        .din    ({asi_internal_e,dcache_byp_asi_e,nofault_asi_e,lendian_asi_e,tlb_lng_ltncy_asi_e,
    as_if_user_asi_e,atomic_asi_e, blk_asi_e,dc_diagnstc_asi_e,dtagv_diagnstc_asi_e,
    as_if_user_asi_e,atomic_asi_e, blk_asi_e,dc_diagnstc_asi_e,dtagv_diagnstc_asi_e,
    wr_only_asi_e, rd_only_asi_e,mmu_rd_only_asi_e,unimp_asi_e,dmmu_asi58_e, immu_asi50_e, quad_asi_e,binit_quad_asi_e,recognized_asi_e,
    wr_only_asi_e, rd_only_asi_e,mmu_rd_only_asi_e,unimp_asi_e,dmmu_asi58_e, immu_asi50_e, quad_asi_e,binit_quad_asi_e,recognized_asi_e,
    ifu_nontlb_asi_e,phy_use_ec_asi_e, phy_byp_ec_asi_e, intrpt_disp_asi_e}),
    ifu_nontlb_asi_e,phy_use_ec_asi_e, phy_byp_ec_asi_e, intrpt_disp_asi_e}),
        .q      ({asi_internal_m,dcache_byp_asi_m,nofault_asi_m,lendian_asi_m,tlb_lng_ltncy_asi_m,
        .q      ({asi_internal_m,dcache_byp_asi_m,nofault_asi_m,lendian_asi_m,tlb_lng_ltncy_asi_m,
    as_if_user_asi_m,atomic_asi_m, blk_asi_m,dc_diagnstc_asi_m,dtagv_diagnstc_asi_m,
    as_if_user_asi_m,atomic_asi_m, blk_asi_m,dc_diagnstc_asi_m,dtagv_diagnstc_asi_m,
    wr_only_asi_m, rd_only_asi_m,mmu_rd_only_asi_m,unimp_asi_tmp,dmmu_asi58_m, immu_asi50_m, quad_asi_m,binit_quad_asi_m,recognized_asi_tmp,
    wr_only_asi_m, rd_only_asi_m,mmu_rd_only_asi_m,unimp_asi_tmp,dmmu_asi58_m, immu_asi50_m, quad_asi_m,binit_quad_asi_m,recognized_asi_tmp,
    ifu_nontlb_asi_m,phy_use_ec_asi_m, phy_byp_ec_asi_m, intrpt_disp_asi_m}),
    ifu_nontlb_asi_m,phy_use_ec_asi_m, phy_byp_ec_asi_m, intrpt_disp_asi_m}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  lsu_blk_asi_m = blk_asi_m ;
assign  lsu_blk_asi_m = blk_asi_m ;
 
 
   wire pa_wtchpt_unimp_m ; // Bug 3408
   wire pa_wtchpt_unimp_m ; // Bug 3408
Line 7539... Line 6977...
                   pctxt_unimp_m | sctxt_unimp_m;
                   pctxt_unimp_m | sctxt_unimp_m;
 
 
assign  unimp_asi_m = unimp_asi_tmp | unimp_m ;
assign  unimp_asi_m = unimp_asi_tmp | unimp_m ;
assign  recognized_asi_m = recognized_asi_tmp | unimp_m ;
assign  recognized_asi_m = recognized_asi_tmp | unimp_m ;
 
 
dff #(12)  asidcd_stgg (
dff_s #(12)  asidcd_stgg (
        .din    ({asi_internal_m,dcache_byp_asi_m, lendian_asi_m,tlb_lng_ltncy_asi_m,
        .din    ({asi_internal_m,dcache_byp_asi_m, lendian_asi_m,tlb_lng_ltncy_asi_m,
  blk_asi_m,dc_diagnstc_asi_m,dtagv_diagnstc_asi_m,quad_asi_m,
  blk_asi_m,dc_diagnstc_asi_m,dtagv_diagnstc_asi_m,quad_asi_m,
  binit_quad_asi_m,recognized_asi_m,ifu_nontlb_asi_m,  intrpt_disp_asi_m}),
  binit_quad_asi_m,recognized_asi_m,ifu_nontlb_asi_m,  intrpt_disp_asi_m}),
        .q      ({asi_internal_g,dcache_byp_asi_g, lendian_asi_g,tlb_lng_ltncy_asi_g,
        .q      ({asi_internal_g,dcache_byp_asi_g, lendian_asi_g,tlb_lng_ltncy_asi_g,
  blk_asi_g,dc_diagnstc_asi_g,dtagv_diagnstc_asi_g,quad_asi_g,
  blk_asi_g,dc_diagnstc_asi_g,dtagv_diagnstc_asi_g,quad_asi_g,
  binit_quad_asi_g,recognized_asi_g,ifu_nontlb_asi_g,  intrpt_disp_asi_g}),
  binit_quad_asi_g,recognized_asi_g,ifu_nontlb_asi_g,  intrpt_disp_asi_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//assign lsu_quad_asi_g = quad_asi_g;
//assign lsu_quad_asi_g = quad_asi_g;
assign  ncache_asild_rq_g   = dcache_byp_asi_g & altspace_ldst_g ;
assign  ncache_asild_rq_g   = dcache_byp_asi_g & altspace_ldst_g ;
 
 
Line 7560... Line 6998...
wire stdbl_m;
wire stdbl_m;
 
 
//assign stdbl_m =  ldst_dbl_m & (~lsu_alt_space_m | (lsu_alt_space_m & ~blk_asi_m)) ;
//assign stdbl_m =  ldst_dbl_m & (~lsu_alt_space_m | (lsu_alt_space_m & ~blk_asi_m)) ;
assign stdbl_m =  ldst_dbl_m ;
assign stdbl_m =  ldst_dbl_m ;
 
 
dff #(4) ff_st_sz_m (
dff_s #(4) ff_st_sz_m (
  .din ({hw_size, wd_size, dw_size, stdbl_m }),
  .din ({hw_size, wd_size, dw_size, stdbl_m }),
  .q   ({st_sz_hw_g, st_sz_w_g, st_sz_dw_g, stdbl_g}),
  .q   ({st_sz_hw_g, st_sz_w_g, st_sz_dw_g, stdbl_g}),
  .clk (clk),
  .clk (clk),
  .se  (se), .si (), .so ()
  .se  (se), `SIMPLY_RISC_SCANIN, .so ()
);
);
 
 
 
 
//assign        bendian = lsu_bendian_access_g ;        // bendian store
//assign        bendian = lsu_bendian_access_g ;        // bendian store
 
 
Line 7584... Line 7022...
// std(a) on floating point is the same as stx(a)
// std(a) on floating point is the same as stx(a)
assign  st_w_or_dbl_le_g = ((st_sz_w_g | (stdbl_g & ~fp_ldst_g)) & ~bendian_g) &  st_inst_vld_unflushed ;
assign  st_w_or_dbl_le_g = ((st_sz_w_g | (stdbl_g & ~fp_ldst_g)) & ~bendian_g) &  st_inst_vld_unflushed ;
assign  st_x_le_g = (st_sz_dw_g & (~stdbl_g | fp_ldst_g)  & ~bendian_g) &  st_inst_vld_unflushed;
assign  st_x_le_g = (st_sz_dw_g & (~stdbl_g | fp_ldst_g)  & ~bendian_g) &  st_inst_vld_unflushed;
 
 
wire blkst_m_tmp ;
wire blkst_m_tmp ;
dff  stgm_bst (
dff_s  stgm_bst (
  .din (ffu_lsu_blk_st_e),
  .din (ffu_lsu_blk_st_e),
  .q   (blkst_m_tmp),
  .q   (blkst_m_tmp),
  .clk (clk),
  .clk (clk),
  .se     (se),       .si (),          .so ()
  .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
);
);
 
 
assign  blkst_m = blkst_m_tmp & ~(st_inst_vld_m  | flsh_inst_m
assign  blkst_m = blkst_m_tmp & ~(st_inst_vld_m  | flsh_inst_m
                | ld_inst_vld_m) ; // Bug 3444
                | ld_inst_vld_m) ; // Bug 3444
 
 
assign  lsu_blk_st_m = blkst_m ;
assign  lsu_blk_st_m = blkst_m ;
 
 
dff  stgg_bst (
dff_s  stgg_bst (
  .din (blkst_m),
  .din (blkst_m),
  .q   (blkst_g),
  .q   (blkst_g),
  .clk (clk),
  .clk (clk),
  .se     (se),       .si (),          .so ()
  .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
);
);
 
 
wire    bst_swap_sel_default_g, bst_swap_sel_default_byte_7_2_g,bst_st_hw_le_g,bst_st_w_or_dbl_le_g,bst_st_x_le_g;
wire    bst_swap_sel_default_g, bst_swap_sel_default_byte_7_2_g,bst_st_hw_le_g,bst_st_w_or_dbl_le_g,bst_st_x_le_g;
assign  lsu_swap_sel_default_g = (blkst_g ? bst_swap_sel_default_g : swap_sel_default_g) | rst_tri_en ;
assign  lsu_swap_sel_default_g = (blkst_g ? bst_swap_sel_default_g : swap_sel_default_g) | rst_tri_en ;
assign  lsu_swap_sel_default_byte_7_2_g = (blkst_g ? bst_swap_sel_default_byte_7_2_g : swap_sel_default_byte_7_2_g)
assign  lsu_swap_sel_default_byte_7_2_g = (blkst_g ? bst_swap_sel_default_byte_7_2_g : swap_sel_default_byte_7_2_g)
Line 7627... Line 7065...
assign lsu_snap_blk_st_m = snap_blk_st_m ;
assign lsu_snap_blk_st_m = snap_blk_st_m ;
 
 
wire    snap_blk_st_local_m;
wire    snap_blk_st_local_m;
assign  snap_blk_st_local_m = snap_blk_st_m & ifu_tlu_inst_vld_m ;
assign  snap_blk_st_local_m = snap_blk_st_m & ifu_tlu_inst_vld_m ;
 
 
dff  stgg_snap (
dff_s  stgg_snap (
  .din (snap_blk_st_local_m),
  .din (snap_blk_st_local_m),
  .q   (snap_blk_st_g),
  .q   (snap_blk_st_g),
  .clk (clk),
  .clk (clk),
  .se     (se),       .si (),          .so ()
  .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
);
);
 
 
// output to be used in g-stage.
// output to be used in g-stage.
dffe #(5) bst_state_g (
dffe_s #(5) bst_state_g (
        .din    ({lsu_swap_sel_default_g, lsu_swap_sel_default_byte_7_2_g, lsu_st_hw_le_g,
        .din    ({lsu_swap_sel_default_g, lsu_swap_sel_default_byte_7_2_g, lsu_st_hw_le_g,
                lsu_st_w_or_dbl_le_g,lsu_st_x_le_g}),
                lsu_st_w_or_dbl_le_g,lsu_st_x_le_g}),
        .q      ({bst_swap_sel_default_g, bst_swap_sel_default_byte_7_2_g,  bst_st_hw_le_g,
        .q      ({bst_swap_sel_default_g, bst_swap_sel_default_byte_7_2_g,  bst_st_hw_le_g,
                bst_st_w_or_dbl_le_g,bst_st_x_le_g}),
                bst_st_w_or_dbl_le_g,bst_st_x_le_g}),
        .en     (snap_blk_st_g),
        .en     (snap_blk_st_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
// snapped in g, used in m
// snapped in g, used in m
 
 
   wire [39:10] blkst_pgnum_m;
   wire [39:10] blkst_pgnum_m;
 
 
dffe #(30) bst_pg_g (
dffe_s #(30) bst_pg_g (
        .din    (tlb_pgnum[39:10]),
        .din    (tlb_pgnum[39:10]),
        .q      (blkst_pgnum_m[39:10]),
        .q      (blkst_pgnum_m[39:10]),
        .en     (snap_blk_st_g),
        .en     (snap_blk_st_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
bw_u1_minbuf_5x UZfix_lsu_blkst_pgnum_m_b10 (.a(blkst_pgnum_m[10]), .z(lsu_blkst_pgnum_m[10]));
bw_u1_minbuf_5x UZfix_lsu_blkst_pgnum_m_b10 (.a(blkst_pgnum_m[10]), .z(lsu_blkst_pgnum_m[10]));
bw_u1_minbuf_5x UZfix_lsu_blkst_pgnum_m_b11 (.a(blkst_pgnum_m[11]), .z(lsu_blkst_pgnum_m[11]));
bw_u1_minbuf_5x UZfix_lsu_blkst_pgnum_m_b11 (.a(blkst_pgnum_m[11]), .z(lsu_blkst_pgnum_m[11]));
bw_u1_minbuf_5x UZfix_lsu_blkst_pgnum_m_b12 (.a(blkst_pgnum_m[12]), .z(lsu_blkst_pgnum_m[12]));
bw_u1_minbuf_5x UZfix_lsu_blkst_pgnum_m_b12 (.a(blkst_pgnum_m[12]), .z(lsu_blkst_pgnum_m[12]));
Line 7706... Line 7144...
wire    [3:0]    pref_ackcnt_incr, pref_ackcnt_decr ;
wire    [3:0]    pref_ackcnt_incr, pref_ackcnt_decr ;
wire    [3:0]    pref_ackcnt_mx_incr, pref_ackcnt_mx_decr ;
wire    [3:0]    pref_ackcnt_mx_incr, pref_ackcnt_mx_decr ;
 
 
   wire     lsu_pref_pcx_req_d1;
   wire     lsu_pref_pcx_req_d1;
 
 
dff #(1) pref_pcx_req_stg (
dff_s #(1) pref_pcx_req_stg (
         .din (lsu_pref_pcx_req),
         .din (lsu_pref_pcx_req),
         .q   (lsu_pref_pcx_req_d1),
         .q   (lsu_pref_pcx_req_d1),
         .clk (clk),
         .clk (clk),
         .se  (se),       .si (),          .so ()
         .se  (se),       `SIMPLY_RISC_SCANIN,          .so ()
);
);
 
 
assign   lsu_pcx_pref_issue[0] =  lsu_pref_pcx_req_d1 & lsu_ld_pcx_rq_sel_d2[0] & ~lsu_pcx_req_squash_d1;
assign   lsu_pcx_pref_issue[0] =  lsu_pref_pcx_req_d1 & lsu_ld_pcx_rq_sel_d2[0] & ~lsu_pcx_req_squash_d1;
assign   lsu_pcx_pref_issue[1] =  lsu_pref_pcx_req_d1 & lsu_ld_pcx_rq_sel_d2[1] & ~lsu_pcx_req_squash_d1;
assign   lsu_pcx_pref_issue[1] =  lsu_pref_pcx_req_d1 & lsu_ld_pcx_rq_sel_d2[1] & ~lsu_pcx_req_squash_d1;
assign   lsu_pcx_pref_issue[2] =  lsu_pref_pcx_req_d1 & lsu_ld_pcx_rq_sel_d2[2] & ~lsu_pcx_req_squash_d1;
assign   lsu_pcx_pref_issue[2] =  lsu_pref_pcx_req_d1 & lsu_ld_pcx_rq_sel_d2[2] & ~lsu_pcx_req_squash_d1;
Line 7772... Line 7210...
assign  pref_ackcnt_en[1] = lsu_pcx_pref_issue[1] ^ lsu_cpx_pref_ack[1] ;
assign  pref_ackcnt_en[1] = lsu_pcx_pref_issue[1] ^ lsu_cpx_pref_ack[1] ;
assign  pref_ackcnt_en[2] = lsu_pcx_pref_issue[2] ^ lsu_cpx_pref_ack[2] ;
assign  pref_ackcnt_en[2] = lsu_pcx_pref_issue[2] ^ lsu_cpx_pref_ack[2] ;
assign  pref_ackcnt_en[3] = lsu_pcx_pref_issue[3] ^ lsu_cpx_pref_ack[3] ;
assign  pref_ackcnt_en[3] = lsu_pcx_pref_issue[3] ^ lsu_cpx_pref_ack[3] ;
 
 
// Thread0
// Thread0
dffre #(4)  pref_ackcnt0_ff (
dffre_s #(4)  pref_ackcnt0_ff (
        .din    (pref_ackcnt0_din[3:0]),
        .din    (pref_ackcnt0_din[3:0]),
        .q      (pref_ackcnt0[3:0]),
        .q      (pref_ackcnt0[3:0]),
        .rst    (reset),        .en     (pref_ackcnt_en[0]),
        .rst    (reset),        .en     (pref_ackcnt_en[0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// Thread1
// Thread1
dffre #(4)  pref_ackcnt1_ff (
dffre_s #(4)  pref_ackcnt1_ff (
        .din    (pref_ackcnt1_din[3:0]),
        .din    (pref_ackcnt1_din[3:0]),
        .q      (pref_ackcnt1[3:0]),
        .q      (pref_ackcnt1[3:0]),
        .rst    (reset),        .en     (pref_ackcnt_en[1]),
        .rst    (reset),        .en     (pref_ackcnt_en[1]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// Thread2
// Thread2
dffre #(4)  pref_ackcnt2_ff (
dffre_s #(4)  pref_ackcnt2_ff (
        .din    (pref_ackcnt2_din[3:0]),
        .din    (pref_ackcnt2_din[3:0]),
        .q      (pref_ackcnt2[3:0]),
        .q      (pref_ackcnt2[3:0]),
        .rst    (reset),        .en     (pref_ackcnt_en[2]),
        .rst    (reset),        .en     (pref_ackcnt_en[2]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// Thread3
// Thread3
dffre #(4)  pref_ackcnt3_ff (
dffre_s #(4)  pref_ackcnt3_ff (
        .din    (pref_ackcnt3_din[3:0]),
        .din    (pref_ackcnt3_din[3:0]),
        .q      (pref_ackcnt3[3:0]),
        .q      (pref_ackcnt3[3:0]),
        .rst    (reset),        .en     (pref_ackcnt_en[3]),
        .rst    (reset),        .en     (pref_ackcnt_en[3]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  no_spc_pref[0] = pref_ackcnt0[3] ;
assign  no_spc_pref[0] = pref_ackcnt0[3] ;
assign  no_spc_pref[1] = pref_ackcnt1[3] ;
assign  no_spc_pref[1] = pref_ackcnt1[3] ;
assign  no_spc_pref[2] = pref_ackcnt2[3] ;
assign  no_spc_pref[2] = pref_ackcnt2[3] ;
Line 7835... Line 7273...
       .sel2(dfq_byp_thrd_sel[2]),
       .sel2(dfq_byp_thrd_sel[2]),
       .sel3(dfq_byp_thrd_sel[3]),
       .sel3(dfq_byp_thrd_sel[3]),
       .dout({lmq_pcx_pkt_addr_din[10:0]})
       .dout({lmq_pcx_pkt_addr_din[10:0]})
);
);
 
 
dffe #(11)  lmq_pcx_pkt_addr_ff (
dffe_s #(11)  lmq_pcx_pkt_addr_ff (
           .din    ({lmq_pcx_pkt_addr_din[10:0]}),
           .din    ({lmq_pcx_pkt_addr_din[10:0]}),
           .q      ({lmq_pcx_pkt_addr[10:0]}),
           .q      ({lmq_pcx_pkt_addr[10:0]}),
           .en     (dfq_byp_ff_en),
           .en     (dfq_byp_ff_en),
           .clk    (clk),
           .clk    (clk),
           .se     (se),       .si (),          .so ()
           .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
           );
           );
 
 
 
 
   wire [10:4] lmq_pcx_pkt_addr_minbf;
   wire [10:4] lmq_pcx_pkt_addr_minbf;
   bw_u1_minbuf_5x UZfix_lmq_pcx_pkt_addr_minbf_b10 (.a(lmq_pcx_pkt_addr[10]), .z(lmq_pcx_pkt_addr_minbf[10]));
   bw_u1_minbuf_5x UZfix_lmq_pcx_pkt_addr_minbf_b10 (.a(lmq_pcx_pkt_addr[10]), .z(lmq_pcx_pkt_addr_minbf[10]));
Line 7888... Line 7326...
{4{lsu_diagnstc_wr_src_sel_e}}         & lsu_diagnstc_wr_addr_e[3:0] |
{4{lsu_diagnstc_wr_src_sel_e}}         & lsu_diagnstc_wr_addr_e[3:0] |
{4{lsu_dfq_st_vld}}                    & st_dcfill_addr[3:0] ;
{4{lsu_dfq_st_vld}}                    & st_dcfill_addr[3:0] ;
 
 
//==============================================================
//==============================================================
/*
/*
dff  #(4) lsu_thread_stgg (
dff_s  #(4) lsu_thread_stgg (
        .din    ({thread3_m, thread2_m, thread1_m,thread0_m}),
        .din    ({thread3_m, thread2_m, thread1_m,thread0_m}),
        .q      (lsu_thread_g[3:0]),
        .q      (lsu_thread_g[3:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
*/
*/
   assign lsu_thread_g[3] = thread3_g;
   assign lsu_thread_g[3] = thread3_g;
   assign lsu_thread_g[2] = thread2_g;
   assign lsu_thread_g[2] = thread2_g;
   assign lsu_thread_g[1] = thread1_g;
   assign lsu_thread_g[1] = thread1_g;
Line 7923... Line 7361...
       .sel2(dfq_byp_thrd_sel[2]),
       .sel2(dfq_byp_thrd_sel[2]),
       .sel3(dfq_byp_thrd_sel[3]),
       .sel3(dfq_byp_thrd_sel[3]),
       .dout({lmq_ldd_vld_din})
       .dout({lmq_ldd_vld_din})
);
);
 
 
dffe #(1)  lmq_ldd_vld_ff (
dffe_s #(1)  lmq_ldd_vld_ff (
           .din    ({lmq_ldd_vld_din}),
           .din    ({lmq_ldd_vld_din}),
           .q      ({lmq_ldd_vld}),
           .q      ({lmq_ldd_vld}),
           .en     (dfq_byp_ff_en),
           .en     (dfq_byp_ff_en),
           .clk    (clk),
           .clk    (clk),
           .se     (se),       .si (),          .so ()
           .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
           );
           );
 
 
//bist
//bist
wire [1:0] bist_way_enc_e;
wire [1:0] bist_way_enc_e;
wire [3:0] bist_way_e;
wire [3:0] bist_way_e;
Line 7953... Line 7391...
       dfq_byp_thrd_sel[0] & lmq0_l2fill_fpld |
       dfq_byp_thrd_sel[0] & lmq0_l2fill_fpld |
       dfq_byp_thrd_sel[1] & lmq1_l2fill_fpld |
       dfq_byp_thrd_sel[1] & lmq1_l2fill_fpld |
       dfq_byp_thrd_sel[2] & lmq2_l2fill_fpld |
       dfq_byp_thrd_sel[2] & lmq2_l2fill_fpld |
       dfq_byp_thrd_sel[3] & lmq3_l2fill_fpld ;
       dfq_byp_thrd_sel[3] & lmq3_l2fill_fpld ;
 
 
dffe #(1) lmq_l2fill_fp_ff (
dffe_s #(1) lmq_l2fill_fp_ff (
           .din (lmq_l2fill_fp_din),
           .din (lmq_l2fill_fp_din),
           .q   (lsu_l2fill_fpld_e),
           .q   (lsu_l2fill_fpld_e),
           .en  (dfq_byp_ff_en),
           .en  (dfq_byp_ff_en),
           .clk (clk),
           .clk (clk),
           .se  (se),       .si (),          .so ()
           .se  (se),       `SIMPLY_RISC_SCANIN,          .so ()
           );
           );
 
 
   wire lmq_ncache_ld_din;
   wire lmq_ncache_ld_din;
assign    lmq_ncache_ld_din =
assign    lmq_ncache_ld_din =
       dfq_byp_thrd_sel[0] & lmq0_ncache_ld |
       dfq_byp_thrd_sel[0] & lmq0_ncache_ld |
       dfq_byp_thrd_sel[1] & lmq1_ncache_ld |
       dfq_byp_thrd_sel[1] & lmq1_ncache_ld |
       dfq_byp_thrd_sel[2] & lmq2_ncache_ld |
       dfq_byp_thrd_sel[2] & lmq2_ncache_ld |
       dfq_byp_thrd_sel[3] & lmq3_ncache_ld ;
       dfq_byp_thrd_sel[3] & lmq3_ncache_ld ;
 
 
dffe #(1) lmq_ncache_ld_ff (
dffe_s #(1) lmq_ncache_ld_ff (
           .din (lmq_ncache_ld_din),
           .din (lmq_ncache_ld_din),
           .q   (lsu_ncache_ld_e),
           .q   (lsu_ncache_ld_e),
           .en  (dfq_byp_ff_en),
           .en  (dfq_byp_ff_en),
           .clk (clk),
           .clk (clk),
           .se  (se),       .si (),          .so ()
           .se  (se),       `SIMPLY_RISC_SCANIN,          .so ()
           );
           );
 
 
//lmq
//lmq
   wire [1:0]      lmq_ldfill_way_din;
   wire [1:0]      lmq_ldfill_way_din;
 
 
Line 7992... Line 7430...
       .sel3(dfq_byp_thrd_sel[3]),
       .sel3(dfq_byp_thrd_sel[3]),
       .dout({lmq_ldfill_way_din[1:0]})
       .dout({lmq_ldfill_way_din[1:0]})
);
);
   wire [1:0]      lmq_ldfill_way;
   wire [1:0]      lmq_ldfill_way;
 
 
dffe #(2)  lmq_ldfill_way_ff (
dffe_s #(2)  lmq_ldfill_way_ff (
           .din    ({lmq_ldfill_way_din[1:0]}),
           .din    ({lmq_ldfill_way_din[1:0]}),
           .q      ({lmq_ldfill_way[1:0]}),
           .q      ({lmq_ldfill_way[1:0]}),
           .en     (dfq_byp_ff_en),
           .en     (dfq_byp_ff_en),
           .clk    (clk),
           .clk    (clk),
           .se     (se),       .si (),          .so ()
           .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
           );
           );
 
 
wire [1:0] dcache_fill_way_enc_e;
wire [1:0] dcache_fill_way_enc_e;
 
 
assign dcache_fill_way_enc_e[1:0] =
assign dcache_fill_way_enc_e[1:0] =
Line 8030... Line 7468...
       .sel2(dfq_byp_thrd_sel[2]),
       .sel2(dfq_byp_thrd_sel[2]),
       .sel3(dfq_byp_thrd_sel[3]),
       .sel3(dfq_byp_thrd_sel[3]),
       .dout({lmq_ld_rq_type_din[2:0]})
       .dout({lmq_ld_rq_type_din[2:0]})
);
);
 
 
dffe #(3)  lmq_ld_rq_type_e_ff (
dffe_s #(3)  lmq_ld_rq_type_e_ff (
           .din    ({lmq_ld_rq_type_din[2:0]}),
           .din    ({lmq_ld_rq_type_din[2:0]}),
           .q      ({lmq_ld_rq_type_e[2:0]}),
           .q      ({lmq_ld_rq_type_e[2:0]}),
           .en     (dfq_byp_ff_en),
           .en     (dfq_byp_ff_en),
           .clk    (clk),
           .clk    (clk),
           .se     (se),       .si (),          .so ()
           .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
           );
           );
 
 
//================================================================
//================================================================
wire    other_flush_pipe_w ;
wire    other_flush_pipe_w ;
 
 
Line 8108... Line 7546...
                            (lmq_byp_misc_sel_e[1] ? lmq1_byp_misc_sz[1:0] : 2'b0) |
                            (lmq_byp_misc_sel_e[1] ? lmq1_byp_misc_sz[1:0] : 2'b0) |
                            (lmq_byp_misc_sel_e[2] ? lmq2_byp_misc_sz[1:0] : 2'b0) |
                            (lmq_byp_misc_sel_e[2] ? lmq2_byp_misc_sz[1:0] : 2'b0) |
                            (lmq_byp_misc_sel_e[3] ? lmq3_byp_misc_sz[1:0] : 2'b0) ;
                            (lmq_byp_misc_sel_e[3] ? lmq3_byp_misc_sz[1:0] : 2'b0) ;
 
 
 
 
dff #(5)  lmq_byp_misc_stgm (
dff_s #(5)  lmq_byp_misc_stgm (
           .din    ({byp_misc_addr_e[2:0], byp_misc_sz_e[1:0]}),
           .din    ({byp_misc_addr_e[2:0], byp_misc_sz_e[1:0]}),
           .q      ({lsu_byp_misc_addr_m[2:0], lsu_byp_misc_sz_m[1:0]}),
           .q      ({lsu_byp_misc_addr_m[2:0], lsu_byp_misc_sz_m[1:0]}),
           .clk    (clk),
           .clk    (clk),
           .se     (se),       .si (),          .so ()
           .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
           );
           );
 
 
endmodule
endmodule
 
 
 
 

powered by: WebSVN 2.1.0

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