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

Subversion Repositories s1_core

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

Show entire file | Details | Blame | View Log

Rev 105 Rev 113
Line 16... Line 16...
// You should have received a copy of the GNU General Public
// You should have received a copy of the GNU General Public
// License along with this work; if not, write to the Free Software
// License along with this work; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
// 
// 
// ========== Copyright Header End ============================================
// ========== Copyright Header End ============================================
 
`ifdef SIMPLY_RISC_TWEAKS
 
`define SIMPLY_RISC_SCANIN .si(0)
 
`else
 
`define SIMPLY_RISC_SCANIN .si()
 
`endif
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
 
 
/*
`include "sys.h"
/* ========== Copyright Header Begin ==========================================
`include "lsu.h"
*
 
* 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
 
// ================================
 
//
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/*
 
/* ========== 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_excpctl ( /*AUTOARG*/
module lsu_excpctl ( /*AUTOARG*/
   // Outputs
   // Outputs
   so, lsu_exu_st_dtlb_perr_g, lsu_ffu_st_dtlb_perr_g,
   so, lsu_exu_st_dtlb_perr_g, lsu_ffu_st_dtlb_perr_g,
   lsu_defr_trp_taken_g, lsu_tlu_defr_trp_taken_g,
   lsu_defr_trp_taken_g, lsu_tlu_defr_trp_taken_g,
Line 861... Line 288...
wire    priv_pg_usr_mode_m, priv_pg_usr_mode_g, priv_pg_usr_mode;
wire    priv_pg_usr_mode_m, priv_pg_usr_mode_g, priv_pg_usr_mode;
wire    nfo_pg_nonnfo_asi_m, nfo_pg_nonnfo_asi_g, nfo_pg_nonnfo_asi;
wire    nfo_pg_nonnfo_asi_m, nfo_pg_nonnfo_asi_g, nfo_pg_nonnfo_asi;
wire    spec_access_epage_m, spec_access_epage_g, spec_access_epage ;
wire    spec_access_epage_m, spec_access_epage_g, spec_access_epage ;
wire    nonwr_pg_st_access;
wire    nonwr_pg_st_access;
 
 
 
`ifdef SIMPLY_RISC_TWEAKS
 
wire va_wtchpt_en_g;
 
`endif
 
 
//=========================================================================================
//=========================================================================================
// MISCELLANEOUS
// MISCELLANEOUS
//=========================================================================================
//=========================================================================================
 
 
   wire       clk;
   wire       clk;
Line 873... Line 304...
 
 
   wire       dbb_reset_l;
   wire       dbb_reset_l;
 
 
    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 ;
 
 
bw_u1_buf_30x UZsize_stb_cam_hit_bf1  (.a(stb_cam_hit),   .z(stb_cam_hit_bf1));  //to dctl, stb_rwctl
bw_u1_buf_30x UZsize_stb_cam_hit_bf1  (.a(stb_cam_hit),   .z(stb_cam_hit_bf1));  //to dctl, stb_rwctl
bw_u1_buf_30x UZsize_stb_cam_hit_bf   (.a(stb_cam_hit),   .z(stb_cam_hit_bf ));  //to qctl1
bw_u1_buf_30x UZsize_stb_cam_hit_bf   (.a(stb_cam_hit),   .z(stb_cam_hit_bf ));  //to qctl1
 
 
wire                ld_inst_vld_m;
wire                ld_inst_vld_m;
wire                st_inst_vld_m;
wire                st_inst_vld_m;
 
 
dff #(2) inst_vld_stgm (
dff_s #(2) inst_vld_stgm (
   .din ({ld_inst_vld_e, st_inst_vld_e}),
   .din ({ld_inst_vld_e, st_inst_vld_e}),
   .q   ({ld_inst_vld_m, st_inst_vld_m}),
   .q   ({ld_inst_vld_m, st_inst_vld_m}),
   .clk    (clk),
   .clk    (clk),
   .se     (se),       .si (),          .so ()
   .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
);
);
 
 
dff #(2) inst_vld_stgg (
dff_s #(2) inst_vld_stgg (
   .din ({ld_inst_vld_m, st_inst_vld_m}),
   .din ({ld_inst_vld_m, st_inst_vld_m}),
   .q   ({ld_inst_vld_unflushed, st_inst_vld_unflushed}),
   .q   ({ld_inst_vld_unflushed, st_inst_vld_unflushed}),
   .clk    (clk),
   .clk    (clk),
   .se     (se),       .si (),          .so ()
   .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
);
);
 
 
wire    tlu_priv_trap_g ;
wire    tlu_priv_trap_g ;
dff #(1) tprivtrp_g (
dff_s #(1) tprivtrp_g (
   .din (tlu_lsu_priv_trap_m),
   .din (tlu_lsu_priv_trap_m),
   .q   (tlu_priv_trap_g),
   .q   (tlu_priv_trap_g),
   .clk    (clk),
   .clk    (clk),
   .se     (se),       .si (),          .so ()
   .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
);
);
 
 
 
 
//=========================================================================================
//=========================================================================================
//  Thread Staging
//  Thread Staging
//=========================================================================================
//=========================================================================================
 
 
wire [1:0] thrid_m, thrid_g ;
wire [1:0] thrid_m, thrid_g ;
dff #(2)  tid_stgm (
dff_s #(2)  tid_stgm (
        .din    (ifu_tlu_thrid_e[1:0]),
        .din    (ifu_tlu_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 ()
        );
        );
 
 
wire    thread0_m, thread1_m, thread2_m, thread3_m;
wire    thread0_m, thread1_m, thread2_m, thread3_m;
 
 
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] ;
assign  thread3_m =  thrid_m[1] &  thrid_m[0] ;
assign  thread3_m =  thrid_m[1] &  thrid_m[0] ;
 
 
wire thread0_g, thread1_g, thread2_g, thread3_g ;
wire thread0_g, thread1_g, thread2_g, thread3_g ;
dff #(4)  tid_stgg (
dff_s #(4)  tid_stgg (
        .din    ({thread0_m, thread1_m, thread2_m, thread3_m}),
        .din    ({thread0_m, thread1_m, thread2_m, thread3_m}),
        .q      ({thread0_g, thread1_g, thread2_g, thread3_g}),
        .q      ({thread0_g, thread1_g, thread2_g, thread3_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
//=========================================================================================
//=========================================================================================
//  INST_VLD_W GENERATION
//  INST_VLD_W GENERATION
//=========================================================================================
//=========================================================================================
Line 949... Line 380...
wire    lsu_flush_pipe_w;
wire    lsu_flush_pipe_w;
assign  flush_w_inst_vld_m =
assign  flush_w_inst_vld_m =
        ifu_tlu_inst_vld_m &
        ifu_tlu_inst_vld_m &
        ~(lsu_flush_pipe_w & (thrid_m[1:0] == thrid_g[1:0])) ; // really lsu_flush_pipe_w
        ~(lsu_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 ()
        );
        );
 
 
//========================================================================
//========================================================================
//      Miscellaneous
//      Miscellaneous
//========================================================================
//========================================================================
Line 999... Line 430...
   wire pstate_am_m ;
   wire pstate_am_m ;
 
 
assign lsu_va_match_m = ((lsu_va_match_b47_b32_m & lsu_va_match_b31_b3_m) & ~pstate_am_m) |
assign lsu_va_match_m = ((lsu_va_match_b47_b32_m & lsu_va_match_b31_b3_m) & ~pstate_am_m) |
                          (lsu_va_match_b31_b3_m & pstate_am_m);
                          (lsu_va_match_b31_b3_m & pstate_am_m);
 
 
dff #(3)  stgwtch_g (
dff_s #(3)  stgwtch_g (
        .din    ({va_wtchpt_en_m,
        .din    ({va_wtchpt_en_m,
                  lsu_va_match_m,
                  lsu_va_match_m,
                  va_wtchpt_msk_match_m}),
                  va_wtchpt_msk_match_m}),
        .q      ({va_wtchpt_en_g,
        .q      ({va_wtchpt_en_g,
                  va_match_g,
                  va_match_g,
                  va_wtchpt_msk_match_g}),
                  va_wtchpt_msk_match_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
// These signals will eventually generate exceptions.
// These signals will eventually generate exceptions.
   wire va_wtchpt_match;
   wire va_wtchpt_match;
Line 1029... Line 460...
 
 
assign  tlb_daccess_excptn_e  =
assign  tlb_daccess_excptn_e  =
  ((rd_only_ltlb_asi_e &  st_inst_vld_e)  |
  ((rd_only_ltlb_asi_e &  st_inst_vld_e)  |
   (wr_only_ltlb_asi_e &  ld_inst_vld_e)) & ifu_lsu_alt_space_e   ;
   (wr_only_ltlb_asi_e &  ld_inst_vld_e)) & ifu_lsu_alt_space_e   ;
 
 
dff  #(1) tlbex_stgm (
dff_s  #(1) tlbex_stgm (
        .din    ({tlb_daccess_excptn_e}),
        .din    ({tlb_daccess_excptn_e}),
        .q      ({tlb_daccess_excptn_e_d1}),
        .q      ({tlb_daccess_excptn_e_d1}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign tlb_daccess_excptn_m = tlb_daccess_excptn_e_d1 | tlb_illgl_pgsz_m;
assign tlb_daccess_excptn_m = tlb_daccess_excptn_e_d1 | tlb_illgl_pgsz_m;
 
 
wire pstate_priv_m;
wire pstate_priv_m;
Line 1057... Line 488...
 
 
//dff #(1)  priv_stgg (
//dff #(1)  priv_stgg (
//        .din    (pstate_priv_m),
//        .din    (pstate_priv_m),
//        .q      (pstate_priv),
//        .q      (pstate_priv),
//        .clk    (clk),
//        .clk    (clk),
//        .se     (se),       .si (),          .so ()
//        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//        );
//        );
 
 
// privilege violation - priv page accessed in user mode
// privilege violation - priv page accessed in user mode
//timing 
//timing 
//assign  priv_pg_usr_mode =  // data access exception; TT=h30
//assign  priv_pg_usr_mode =  // data access exception; TT=h30
Line 1069... Line 500...
 
 
//SC2   wire hpv_priv_m;
//SC2   wire hpv_priv_m;
 
 
   assign priv_pg_usr_mode_m = (ld_inst_vld_m | st_inst_vld_m) & ~(pstate_priv_m | hpv_priv_m);
   assign priv_pg_usr_mode_m = (ld_inst_vld_m | st_inst_vld_m) & ~(pstate_priv_m | hpv_priv_m);
 
 
dff #(1) priv_pg_usr_mode_stgg  (
dff_s #(1) priv_pg_usr_mode_stgg  (
        .din    (priv_pg_usr_mode_m),
        .din    (priv_pg_usr_mode_m),
        .q      (priv_pg_usr_mode_g),
        .q      (priv_pg_usr_mode_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
   assign priv_pg_usr_mode = priv_pg_usr_mode_g & tlb_rd_tte_data_pbit ;
   assign priv_pg_usr_mode = priv_pg_usr_mode_g & tlb_rd_tte_data_pbit ;
 
 
// protection violation - store to a page that does not have write permission
// protection violation - store to a page that does not have write permission
Line 1101... Line 532...
//  & tlb_rd_tte_data_nfobit ;
//  & tlb_rd_tte_data_nfobit ;
 
 
assign nfo_pg_nonnfo_asi_m = (ld_inst_vld_m | st_inst_vld_m) &
assign nfo_pg_nonnfo_asi_m = (ld_inst_vld_m | st_inst_vld_m) &
                             ((~nofault_asi_m & lsu_alt_space_m) | ~lsu_alt_space_m) ;
                             ((~nofault_asi_m & lsu_alt_space_m) | ~lsu_alt_space_m) ;
 
 
dff #(1) nfo_pg_nonnfo_asi_stgg   (
dff_s #(1) nfo_pg_nonnfo_asi_stgg   (
        .din    (nfo_pg_nonnfo_asi_m),
        .din    (nfo_pg_nonnfo_asi_m),
        .q      (nfo_pg_nonnfo_asi_g),
        .q      (nfo_pg_nonnfo_asi_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
assign    nfo_pg_nonnfo_asi = nfo_pg_nonnfo_asi_g & tlb_rd_tte_data_nfobit ;
assign    nfo_pg_nonnfo_asi = nfo_pg_nonnfo_asi_g & tlb_rd_tte_data_nfobit ;
 
 
// as_if_usr asi accesses priv page.
// as_if_usr asi accesses priv page.
//timing
//timing
Line 1118... Line 549...
//      tlb_rd_tte_data_pbit ;
//      tlb_rd_tte_data_pbit ;
 
 
   wire   as_if_usr_priv_pg_m, as_if_usr_priv_pg_g, as_if_usr_priv_pg;
   wire   as_if_usr_priv_pg_m, as_if_usr_priv_pg_g, as_if_usr_priv_pg;
   assign as_if_usr_priv_pg_m = (ld_inst_vld_m | st_inst_vld_m) & as_if_user_asi_m & lsu_alt_space_m;
   assign as_if_usr_priv_pg_m = (ld_inst_vld_m | st_inst_vld_m) & as_if_user_asi_m & lsu_alt_space_m;
 
 
dff #(1) as_if_usr_priv_pg_stgg   (
dff_s #(1) as_if_usr_priv_pg_stgg   (
        .din    (as_if_usr_priv_pg_m),
        .din    (as_if_usr_priv_pg_m),
        .q      (as_if_usr_priv_pg_g),
        .q      (as_if_usr_priv_pg_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
   assign  as_if_usr_priv_pg =  as_if_usr_priv_pg_g & tlb_rd_tte_data_pbit ;
   assign  as_if_usr_priv_pg =  as_if_usr_priv_pg_g & tlb_rd_tte_data_pbit ;
 
 
// non-cacheable address - iospace PA[39] = 1 
// non-cacheable address - iospace PA[39] = 1 
// atomic access to non-cacheable space.
// atomic access to non-cacheable space.
   wire    atm_access_w_nc, atomic_g;
   wire    atm_access_w_nc, atomic_g;
 
 
dff #(1) atm_stgg (
dff_s #(1) atm_stgg (
        .din    (atomic_m),
        .din    (atomic_m),
        .q      (atomic_g),
        .q      (atomic_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
assign  atm_access_w_nc = atomic_g & tlb_pgnum_b39 ; // io space 
assign  atm_access_w_nc = atomic_g & tlb_pgnum_b39 ; // io space 
 
 
Line 1147... Line 578...
//assign  atm_access_unsup_asi = atomic_g & ~atomic_asi_g & lsu_alt_space_g ;
//assign  atm_access_unsup_asi = atomic_g & ~atomic_asi_g & lsu_alt_space_g ;
   wire atm_access_unsup_asi_m, atm_access_unsup_asi;
   wire atm_access_unsup_asi_m, atm_access_unsup_asi;
 
 
assign  atm_access_unsup_asi_m = atomic_m & ~atomic_asi_m & lsu_alt_space_m;
assign  atm_access_unsup_asi_m = atomic_m & ~atomic_asi_m & lsu_alt_space_m;
 
 
dff #(1) atm_access_unsup_asi_stgg   (
dff_s #(1) atm_access_unsup_asi_stgg   (
        .din    (atm_access_unsup_asi_m),
        .din    (atm_access_unsup_asi_m),
        .q      (atm_access_unsup_asi),
        .q      (atm_access_unsup_asi),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
//timing
//timing
//assign  tlb_tte_vld_g = ~lsu_dtlb_bypass_g & tlb_cam_hit_g ;
//assign  tlb_tte_vld_g = ~lsu_dtlb_bypass_g & tlb_cam_hit_g ;
Line 1164... Line 595...
assign  tlb_tte_vld_m = ~dtlb_bypass_m & tlb_cam_hit &
assign  tlb_tte_vld_m = ~dtlb_bypass_m & tlb_cam_hit &
                        ~((unimp_asi_m | asi_internal_m | ~recognized_asi_m) &
                        ~((unimp_asi_m | asi_internal_m | ~recognized_asi_m) &
                                lsu_alt_space_m) & // Bug 3541,5186
                                lsu_alt_space_m) & // Bug 3541,5186
                        ~dmmu_va_oor_m ; // Bug 5070
                        ~dmmu_va_oor_m ; // Bug 5070
 
 
dff #(1) tlb_tte_vld_stgg   (
dff_s #(1) tlb_tte_vld_stgg   (
        .din    (tlb_tte_vld_m),
        .din    (tlb_tte_vld_m),
        .q      (tlb_tte_vld_g),
        .q      (tlb_tte_vld_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire  pg_with_ebit_m, pg_with_ebit_g, pg_with_ebit  ;
wire  pg_with_ebit_m, pg_with_ebit_g, pg_with_ebit  ;
//timing   
//timing   
//assign        pg_with_ebit = 
//assign        pg_with_ebit = 
Line 1184... Line 615...
        (dtlb_bypass_m & ~(phy_use_ec_asi_m & lsu_alt_space_m) &
        (dtlb_bypass_m & ~(phy_use_ec_asi_m & lsu_alt_space_m) &
        (lsu_ldst_va_b39_m & ~pstate_am_m)) |
        (lsu_ldst_va_b39_m & ~pstate_am_m)) |
        // regular bypass // Bug 4296,5050 related.
        // regular bypass // Bug 4296,5050 related.
        (dtlb_bypass_m & (phy_byp_ec_asi_m & lsu_alt_space_m)) ; // phy_byp
        (dtlb_bypass_m & (phy_byp_ec_asi_m & lsu_alt_space_m)) ; // phy_byp
 
 
dff #(1) pg_with_ebit_stgg   (
dff_s #(1) pg_with_ebit_stgg   (
        .din    (pg_with_ebit_m),
        .din    (pg_with_ebit_m),
        .q      (pg_with_ebit_g),
        .q      (pg_with_ebit_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
assign  pg_with_ebit = (tlb_rd_tte_data_ebit & tlb_tte_vld_g)  | // tte  
assign  pg_with_ebit = (tlb_rd_tte_data_ebit & tlb_tte_vld_g)  | // tte  
                              pg_with_ebit_g;
                              pg_with_ebit_g;
 
 
//timing
//timing
Line 1203... Line 634...
////  tlb_rd_tte_data_ebit ; // page with side effects
////  tlb_rd_tte_data_ebit ; // page with side effects
 
 
assign  spec_access_epage_m =
assign  spec_access_epage_m =
// Bug 5166
// Bug 5166
((ld_inst_vld_m & ~atomic_m) & nofault_asi_m & lsu_alt_space_m);   // spec load
((ld_inst_vld_m & ~atomic_m) & nofault_asi_m & lsu_alt_space_m);   // spec load
dff #(1) spec_access_epage_stgg   (
dff_s #(1) spec_access_epage_stgg   (
        .din    (spec_access_epage_m),
        .din    (spec_access_epage_m),
        .q      (spec_access_epage_g),
        .q      (spec_access_epage_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
// remove flsh_inst_g ??   
// remove flsh_inst_g ??   
//assign spec_access_epage = (spec_access_epage_g  | flsh_inst_g) & pg_with_ebit;
//assign spec_access_epage = (spec_access_epage_g  | flsh_inst_g) & pg_with_ebit;
assign spec_access_epage = (spec_access_epage_g) & pg_with_ebit;
assign spec_access_epage = (spec_access_epage_g) & pg_with_ebit;
 
 
Line 1242... Line 673...
((ld_inst_vld_m | st_inst_vld_m) & asi_internal_m & fp_ldst_m & lsu_alt_space_m) | // Bug 4382
((ld_inst_vld_m | st_inst_vld_m) & asi_internal_m & fp_ldst_m & lsu_alt_space_m) | // Bug 4382
blk_asi_non_ldstdfa_m |
blk_asi_non_ldstdfa_m |
quad_asi_non_ldstda_m |
quad_asi_non_ldstda_m |
true_quad_non_ldda_m  ;
true_quad_non_ldda_m  ;
 
 
dff #(1) illegal_asi_trap_stgg   (
dff_s #(1) illegal_asi_trap_stgg   (
        .din    (illegal_asi_trap_m),
        .din    (illegal_asi_trap_m),
        .q      (illegal_asi_trap_m_d1),
        .q      (illegal_asi_trap_m_d1),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
   //need lsu_inst_vld_w ??
   //need lsu_inst_vld_w ??
//   assign illegal_asi_trap_g = illegal_asi_trap_m_d1 & lsu_inst_vld_w;
//   assign illegal_asi_trap_g = illegal_asi_trap_m_d1 & lsu_inst_vld_w;
   assign illegal_asi_trap_g = illegal_asi_trap_m_d1;
   assign illegal_asi_trap_g = illegal_asi_trap_m_d1;
 
 
Line 1265... Line 696...
 
 
/*dff #(1) wr_to_strm_sync_stgg   (
/*dff #(1) wr_to_strm_sync_stgg   (
        .din    (wr_to_strm_sync_m),
        .din    (wr_to_strm_sync_m),
        .q      (wr_to_strm_sync),
        .q      (wr_to_strm_sync),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );*/
        );*/
 
 
 
 
// HPV Changes 
// HPV Changes 
// Push back into previous stage.
// Push back into previous stage.
Line 1306... Line 737...
 
 
//SC2 dff #(2) hpv_stgm (
//SC2 dff #(2) hpv_stgm (
//SC2        .din    ({hpv_priv_e, hpstate_en_e}),
//SC2        .din    ({hpv_priv_e, hpstate_en_e}),
//SC2        .q         ({hpv_priv_m, hpstate_en_m}),
//SC2        .q         ({hpv_priv_m, hpstate_en_m}),
//SC2        .clk    (clk),
//SC2        .clk    (clk),
//SC2        .se     (se),       .si (),          .so ()
//SC2        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//SC2        );
//SC2        );
//SC2   wire hpv_priv, hpstate_en;
//SC2   wire hpv_priv, hpstate_en;
 
 
 
 
//SC2 dff #(2) hpv_stgg (
//SC2 dff #(2) hpv_stgg (
//SC2        .din    ({hpv_priv_m, hpstate_en_m}),
//SC2        .din    ({hpv_priv_m, hpstate_en_m}),
//SC2        .q         ({hpv_priv,   hpstate_en}),
//SC2        .q         ({hpv_priv,   hpstate_en}),
//SC2        .clk    (clk),
//SC2        .clk    (clk),
//SC2        .se     (se),       .si (),          .so ()
//SC2        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
//SC2        );
//SC2        );
 
 
/*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 1331... Line 762...
      ~pstate_priv_m & ~(hpv_priv_m & hpstate_en_m) ;
      ~pstate_priv_m & ~(hpv_priv_m & hpstate_en_m) ;
 
 
/*assign  priv_action_m = (ld_inst_vld_m | st_inst_vld_m) & ~lsu_excpctl_asi_state_m[7] &
/*assign  priv_action_m = (ld_inst_vld_m | st_inst_vld_m) & ~lsu_excpctl_asi_state_m[7] &
      ~pstate_priv_m & ~(hpv_priv_m & hpstate_en_m) & lsu_alt_space_m ;*/
      ~pstate_priv_m & ~(hpv_priv_m & hpstate_en_m) & lsu_alt_space_m ;*/
 
 
dff  pact_stgg (
dff_s  pact_stgg (
        .din    (priv_action_m),
        .din    (priv_action_m),
        .q      (priv_action),
        .q      (priv_action),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// Take data_access exception if supervisor uses hypervisor asi  
// Take data_access exception if supervisor uses hypervisor asi  
   wire hpv_asi_range_m;
   wire hpv_asi_range_m;
   wire spv_use_hpv_m ;
   wire spv_use_hpv_m ;
Line 1444... Line 875...
assign  asi_related_trap_m = wr_to_rd_only_asi | rd_of_wr_only_asi | unimp_asi_used | asi_internal_non_xdw ;
assign  asi_related_trap_m = wr_to_rd_only_asi | rd_of_wr_only_asi | unimp_asi_used | asi_internal_non_xdw ;
 
 
// Illegal page size for tlb fill
// Illegal page size for tlb fill
 
 
wire    [2:0]    pgszr_m,pgszv_m ;
wire    [2:0]    pgszr_m,pgszv_m ;
dff #(6)   pgsz_stgm (
dff_s #(6)   pgsz_stgm (
        .din    ({lsu_sun4r_pgsz_b2t0_e[2:0],lsu_sun4v_pgsz_b2t0_e[2:0]}),
        .din    ({lsu_sun4r_pgsz_b2t0_e[2:0],lsu_sun4v_pgsz_b2t0_e[2:0]}),
        .q      ({pgszr_m[2:0],pgszv_m[2:0]}),
        .q      ({pgszr_m[2:0],pgszv_m[2:0]}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    [2:0]    pgsz_m ;
wire    [2:0]    pgsz_m ;
 
 
assign  pgsz_m[2:0] = lsu_sun4r_va_m_l ? pgszv_m[2:0] : pgszr_m[2:0] ;
assign  pgsz_m[2:0] = lsu_sun4r_va_m_l ? pgszv_m[2:0] : pgszr_m[2:0] ;
Line 1463... Line 894...
        ( pgsz_m[2] & ~pgsz_m[1] & ~pgsz_m[0]) | // 100 ; 32M
        ( pgsz_m[2] & ~pgsz_m[1] & ~pgsz_m[0]) | // 100 ; 32M
        ( pgsz_m[2] &  pgsz_m[1] & ~pgsz_m[0]) | // 110 ; 2G
        ( pgsz_m[2] &  pgsz_m[1] & ~pgsz_m[0]) | // 110 ; 2G
        ( pgsz_m[2] &  pgsz_m[1] &  pgsz_m[0]) ; // 111 ; 16G
        ( pgsz_m[2] &  pgsz_m[1] &  pgsz_m[0]) ; // 111 ; 16G
 
 
wire    ifill_tlb_asi_m,dfill_tlb_asi_m ;
wire    ifill_tlb_asi_m,dfill_tlb_asi_m ;
dff #(2)   idfill_stgm (
dff_s #(2)   idfill_stgm (
        .din    ({ifill_tlb_asi_e,dfill_tlb_asi_e}),
        .din    ({ifill_tlb_asi_e,dfill_tlb_asi_e}),
        .q      ({ifill_tlb_asi_m,dfill_tlb_asi_m}),
        .q      ({ifill_tlb_asi_m,dfill_tlb_asi_m}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  tlb_illgl_pgsz_m =
assign  tlb_illgl_pgsz_m =
        (ifill_tlb_asi_m | dfill_tlb_asi_m) & st_inst_vld_m & lsu_alt_space_m & illgl_pgsz_m ;
        (ifill_tlb_asi_m | dfill_tlb_asi_m) & st_inst_vld_m & lsu_alt_space_m & illgl_pgsz_m ;
 
 
Line 1488... Line 919...
assign  early_ttype_m[8:0] =
assign  early_ttype_m[8:0] =
      stdf_maddr_not_align ? 9'h036 :
      stdf_maddr_not_align ? 9'h036 :
        lddf_maddr_not_align ? 9'h035 :
        lddf_maddr_not_align ? 9'h035 :
           mem_addr_not_align ?  9'h034 : 9'hxxx ;
           mem_addr_not_align ?  9'h034 : 9'hxxx ;
 
 
dff #(10)   etrp_stgg (
dff_s #(10)   etrp_stgg (
        .din    ({early_ttype_m[8:0],early_trap_vld_m}),
        .din    ({early_ttype_m[8:0],early_trap_vld_m}),
        .q      ({early_ttype_g[8:0],early_trap_vld_g}),
        .q      ({early_ttype_g[8:0],early_trap_vld_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire daccess_excptn_early_m, daccess_excptn_early_g ;
wire daccess_excptn_early_m, daccess_excptn_early_g ;
 
 
wire atm_access_w_nc_byp_m,atm_access_w_nc_byp_g ;
wire atm_access_w_nc_byp_m,atm_access_w_nc_byp_g ;
assign atm_access_w_nc_byp_m =
assign atm_access_w_nc_byp_m =
atomic_m & dtlb_bypass_m & (lsu_ldst_va_b39_m & ~pstate_am_m) ;
atomic_m & dtlb_bypass_m & (lsu_ldst_va_b39_m & ~pstate_am_m) ;
                                                //Bug 5050
                                                //Bug 5050
 
 
dff   atmbyp_stgg (
dff_s   atmbyp_stgg (
        .din    (atm_access_w_nc_byp_m),
        .din    (atm_access_w_nc_byp_m),
        .q      (atm_access_w_nc_byp_g),
        .q      (atm_access_w_nc_byp_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign daccess_excptn_early_m =
assign daccess_excptn_early_m =
    asi_related_trap_m | tlb_daccess_excptn_m |
    asi_related_trap_m | tlb_daccess_excptn_m |
    spv_use_hpv_m |
    spv_use_hpv_m |
    atm_access_w_nc_byp_m ; // Bug 4281.
    atm_access_w_nc_byp_m ; // Bug 4281.
 
 
dff  #(1) dearly_stgg (
dff_s  #(1) dearly_stgg (
        .din    (daccess_excptn_early_m),
        .din    (daccess_excptn_early_m),
        .q      (daccess_excptn_early_g),
        .q      (daccess_excptn_early_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
   wire daccess_excptn;
   wire daccess_excptn;
 
 
assign  daccess_excptn =
assign  daccess_excptn =
Line 1530... Line 961...
      atm_access_w_nc ) & tlb_tte_vld_g |
      atm_access_w_nc ) & tlb_tte_vld_g |
      illegal_asi_trap_g | daccess_excptn_early_g | atm_access_unsup_asi | //bug4622
      illegal_asi_trap_g | daccess_excptn_early_g | atm_access_unsup_asi | //bug4622
        spec_access_epage ;
        spec_access_epage ;
 
 
   wire [3:0] lsu_nceen_d1;
   wire [3:0] lsu_nceen_d1;
dff #(4)  nceen_d1_ff (
dff_s #(4)  nceen_d1_ff (
        .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 ()
        );
        );
 
 
wire nceen_pipe_g ;
wire nceen_pipe_g ;
assign  nceen_pipe_g =
assign  nceen_pipe_g =
  (thread0_g & lsu_nceen_d1[0]) | (thread1_g & lsu_nceen_d1[1]) |
  (thread0_g & lsu_nceen_d1[0]) | (thread1_g & lsu_nceen_d1[1]) |
Line 1553... Line 984...
assign dmmu_miss_m =
assign dmmu_miss_m =
  ~tlb_cam_hit & ~dtlb_bypass_m &
  ~tlb_cam_hit & ~dtlb_bypass_m &
  (ld_inst_vld_m | st_inst_vld_m) &
  (ld_inst_vld_m | st_inst_vld_m) &
  ~(lda_internal_m | sta_internal_m | early_trap_vld_m) ;
  ~(lda_internal_m | sta_internal_m | early_trap_vld_m) ;
 
 
dff #(1)  dmmu_miss_stgg (
dff_s #(1)  dmmu_miss_stgg (
        .din    (dmmu_miss_m),
        .din    (dmmu_miss_m),
        .q      (dmmu_miss_m_d1),
        .q      (dmmu_miss_m_d1),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
//need lsu_inst_vld_w ??
//need lsu_inst_vld_w ??
   wire dmmu_miss_g;
   wire dmmu_miss_g;
 
 
   assign dmmu_miss_g = dmmu_miss_m_d1 & lsu_inst_vld_w;
   assign dmmu_miss_g = dmmu_miss_m_d1 & lsu_inst_vld_w;
 
 
 
 
wire [8:0] dmiss_type ;
wire [8:0] dmiss_type ;
   wire    cam_real_g;
   wire    cam_real_g;
 
 
dff #(1) cam_real_stgg (
dff_s #(1) cam_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        dmiss_type[8:0] = cam_real_g ? 9'h03f : 9'h068 ;
 assign        dmiss_type[8:0] = cam_real_g ? 9'h03f : 9'h068 ;
 
 
// two wtchpt matches
// two wtchpt matches
//assign  lsu_tlu_ttype_m2[8:0] = 
//assign  lsu_tlu_ttype_m2[8:0] = 
Line 1656... Line 1087...
assign  lsu_tlu_flt_ld_nfo_pg_g = nfo_pg_nonnfo_asi & tlb_tte_vld_g ;
assign  lsu_tlu_flt_ld_nfo_pg_g = nfo_pg_nonnfo_asi & tlb_tte_vld_g ;
 
 
wire illgl_asi_action_pre_m,illgl_asi_action_pre_g ;
wire illgl_asi_action_pre_m,illgl_asi_action_pre_g ;
assign  illgl_asi_action_pre_m = asi_related_trap_m | tlb_daccess_excptn_m | illegal_asi_trap_m | spv_use_hpv_m ; // bug 4181; //bug3660        
assign  illgl_asi_action_pre_m = asi_related_trap_m | tlb_daccess_excptn_m | illegal_asi_trap_m | spv_use_hpv_m ; // bug 4181; //bug3660        
 
 
dff  illglasi_g (
dff_s  illglasi_g (
        .din    (illgl_asi_action_pre_m),
        .din    (illgl_asi_action_pre_m),
        .q      (illgl_asi_action_pre_g),
        .q      (illgl_asi_action_pre_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire lsu_tlu_illegal_asi_action_g;
wire lsu_tlu_illegal_asi_action_g;
assign  lsu_tlu_illegal_asi_action_g =
assign  lsu_tlu_illegal_asi_action_g =
atm_access_unsup_asi | (illgl_asi_action_pre_g) & // Bug 4825
atm_access_unsup_asi | (illgl_asi_action_pre_g) & // Bug 4825
Line 1716... Line 1147...
        /*asi_related_trap_m    |       // Bug 2592
        /*asi_related_trap_m    |       // Bug 2592
        spv_use_hpv_m       |
        spv_use_hpv_m       |
        wr_to_strm_sync_m;*/
        wr_to_strm_sync_m;*/
 
 
 
 
dff  eflushspu_g (
dff_s  eflushspu_g (
        .din    (early_flush_m),
        .din    (early_flush_m),
        .q      (lsu_spu_early_flush_g),
        .q      (lsu_spu_early_flush_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff  eflushspu2_g (
dff_s  eflushspu2_g (
        .din    (early_flush_m),
        .din    (early_flush_m),
        .q      (lsu_local_early_flush_g),
        .q      (lsu_local_early_flush_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff  eflushtlu_g (
dff_s  eflushtlu_g (
        .din    (early_flush_m),
        .din    (early_flush_m),
        .q      (lsu_tlu_early_flush_w),
        .q      (lsu_tlu_early_flush_w),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
dff  eflushtlu2_g (
dff_s  eflushtlu2_g (
        .din    (early_flush_m),
        .din    (early_flush_m),
        .q      (lsu_tlu_early_flush2_w),
        .q      (lsu_tlu_early_flush2_w),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
 
 
//=========================================================================================
//=========================================================================================
//  Parity Error Checking
//  Parity Error Checking
Line 1841... Line 1272...
wire    st_noatom_dtlb_perr_en ;
wire    st_noatom_dtlb_perr_en ;
wire    st_dtlb_perr_en ;
wire    st_dtlb_perr_en ;
assign  st_noatom_dtlb_perr_en = st_dtlb_perr_en & ~atomic_g ;
assign  st_noatom_dtlb_perr_en = st_dtlb_perr_en & ~atomic_g ;
 
 
// rm corr err. reporting
// rm corr err. reporting
dff  #(3) terr_stgd1 (
dff_s  #(3) terr_stgd1 (
        .din    ({tlb_data_su_g,tlb_data_ue_g,lsu_tlb_asi_tag_perr_g}),
        .din    ({tlb_data_su_g,tlb_data_ue_g,lsu_tlb_asi_tag_perr_g}),
        //.din    ({st_noatom_dtlb_perr,tlb_data_ue_g,lsu_tlb_asi_tag_perr_g}),
        //.din    ({st_noatom_dtlb_perr,tlb_data_ue_g,lsu_tlb_asi_tag_perr_g}),
        .q      ({lsu_ifu_tlb_data_su,lsu_ifu_tlb_data_ue,lsu_ifu_tlb_tag_ue}),
        .q      ({lsu_ifu_tlb_data_su,lsu_ifu_tlb_data_ue,lsu_ifu_tlb_tag_ue}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// If st dtlb parity error detected, then need to invalidate st in stb.
// If st dtlb parity error detected, then need to invalidate st in stb.
// Considered unrecoverable for the thread itself.
// Considered unrecoverable for the thread itself.
 
 
Line 1905... Line 1336...
((st_defr_trp2 | st_defr_trp_en2) & thread2_m & flush_w_inst_vld_m);
((st_defr_trp2 | st_defr_trp_en2) & thread2_m & flush_w_inst_vld_m);
assign  stpend_rst3_m = reset |
assign  stpend_rst3_m = reset |
((st_defr_trp3 | st_defr_trp_en3) & thread3_m & flush_w_inst_vld_m);
((st_defr_trp3 | st_defr_trp_en3) & thread3_m & flush_w_inst_vld_m);
 
 
// Postphone reset by a cycle - 4916
// Postphone reset by a cycle - 4916
dff #(4)  stpend_d1 (
dff_s #(4)  stpend_d1 (
           .din    ({stpend_rst3_m,stpend_rst2_m,stpend_rst1_m,stpend_rst0_m}),
           .din    ({stpend_rst3_m,stpend_rst2_m,stpend_rst1_m,stpend_rst0_m}),
           .q      ({stpend_rst3_w,stpend_rst2_w,stpend_rst1_w,stpend_rst0_w}),
           .q      ({stpend_rst3_w,stpend_rst2_w,stpend_rst1_w,stpend_rst0_w}),
           .clk    (clk),
           .clk    (clk),
           .se     (se),       .si (),          .so ()
           .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
           );
           );
 
 
// Prevent reset if inst is flushed by ifu.
// Prevent reset if inst is flushed by ifu.
assign  stpend_rst3 = stpend_rst3_w & ~ifu_lsu_flush_w ;
assign  stpend_rst3 = stpend_rst3_w & ~ifu_lsu_flush_w ;
assign  stpend_rst2 = stpend_rst2_w & ~ifu_lsu_flush_w ;
assign  stpend_rst2 = stpend_rst2_w & ~ifu_lsu_flush_w ;
assign  stpend_rst1 = stpend_rst1_w & ~ifu_lsu_flush_w ;
assign  stpend_rst1 = stpend_rst1_w & ~ifu_lsu_flush_w ;
assign  stpend_rst0 = stpend_rst0_w & ~ifu_lsu_flush_w ;
assign  stpend_rst0 = stpend_rst0_w & ~ifu_lsu_flush_w ;
 
 
dffre #(1)  deftrp_t0 (
dffre_s #(1)  deftrp_t0 (
           .din    (st_defr_trp_en0),
           .din    (st_defr_trp_en0),
           .q      (st_defr_trp0),
           .q      (st_defr_trp0),
           .rst    (stpend_rst0),
           .rst    (stpend_rst0),
           .en     (st_defr_trp_en0),
           .en     (st_defr_trp_en0),
           .clk    (clk),
           .clk    (clk),
           .se     (se),       .si (),          .so ()
           .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
           );
           );
 
 
dffre #(1)  deftrp_t1 (
dffre_s #(1)  deftrp_t1 (
           .din    (st_defr_trp_en1),
           .din    (st_defr_trp_en1),
           .q      (st_defr_trp1),
           .q      (st_defr_trp1),
           .rst    (stpend_rst1),
           .rst    (stpend_rst1),
           .en     (st_defr_trp_en1),
           .en     (st_defr_trp_en1),
           .clk    (clk),
           .clk    (clk),
           .se     (se),       .si (),          .so ()
           .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
           );
           );
 
 
dffre #(1)  deftrp_t2 (
dffre_s #(1)  deftrp_t2 (
           .din    (st_defr_trp_en2),
           .din    (st_defr_trp_en2),
           .q      (st_defr_trp2),
           .q      (st_defr_trp2),
           .rst    (stpend_rst2),
           .rst    (stpend_rst2),
           .en     (st_defr_trp_en2),
           .en     (st_defr_trp_en2),
           .clk    (clk),
           .clk    (clk),
           .se     (se),       .si (),          .so ()
           .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
           );
           );
 
 
dffre #(1)  deftrp_t3 (
dffre_s #(1)  deftrp_t3 (
           .din    (st_defr_trp_en3),
           .din    (st_defr_trp_en3),
           .q      (st_defr_trp3),
           .q      (st_defr_trp3),
           .rst    (stpend_rst3),
           .rst    (stpend_rst3),
           .en     (st_defr_trp_en3),
           .en     (st_defr_trp_en3),
           .clk    (clk),
           .clk    (clk),
           .se     (se),       .si (),          .so ()
           .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
           );
           );
 
 
// Deferred trap can be taken on any instruction.
// Deferred trap can be taken on any instruction.
// Selection is based on next thread available.
// Selection is based on next thread available.
 
 
Line 1979... Line 1410...
        (st_defr_trp_en3 & thread3_m) );
        (st_defr_trp_en3 & thread3_m) );
 
 
 
 
assign defr_trp_taken_m_din = defr_trp_taken_m |  defr_trp_taken_byp;
assign defr_trp_taken_m_din = defr_trp_taken_m |  defr_trp_taken_byp;
 
 
dff #(1) defr_trp_taken_stgg (
dff_s #(1) defr_trp_taken_stgg (
     .din (defr_trp_taken_m_din),
     .din (defr_trp_taken_m_din),
     .q   (defr_trp_taken),
     .q   (defr_trp_taken),
     .clk    (clk),
     .clk    (clk),
     .se     (se),       .si (),          .so ()
     .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
    );
    );
 
 
assign  lsu_defr_trp_taken_g = defr_trp_taken ;
assign  lsu_defr_trp_taken_g = defr_trp_taken ;
assign  lsu_tlu_defr_trp_taken_g = defr_trp_taken ;
assign  lsu_tlu_defr_trp_taken_g = defr_trp_taken ;
assign  lsu_mmu_defr_trp_taken_g = defr_trp_taken ;
assign  lsu_mmu_defr_trp_taken_g = defr_trp_taken ;
Line 1998... Line 1429...
 
 
 
 
 
 
wire    [3:0]    pstate_cle,pstate_am ;
wire    [3:0]    pstate_cle,pstate_am ;
// flop'n use to prevent timing path.
// flop'n use to prevent timing path.
dff #(8)  cle_stg (
dff_s #(8)  cle_stg (
        .din    ({tlu_lsu_pstate_cle[3:0],tlu_lsu_pstate_am[3:0]}),
        .din    ({tlu_lsu_pstate_cle[3:0],tlu_lsu_pstate_am[3:0]}),
        .q      ({pstate_cle[3:0],pstate_am[3:0]}),
        .q      ({pstate_cle[3:0],pstate_am[3:0]}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    pstate_cle_m ;
wire    pstate_cle_m ;
assign  pstate_cle_m =
assign  pstate_cle_m =
        (thread0_m & pstate_cle[0]) |
        (thread0_m & pstate_cle[0]) |
Line 2030... Line 1461...
/*assign  dsfsr_asi_sel_m[4] =  // assigned asi
/*assign  dsfsr_asi_sel_m[4] =  // assigned asi
        ~(exu_tlu_misalign_addr_jmpl_rtn_m | lsu_tlu_nonalt_ldst_m);*/
        ~(exu_tlu_misalign_addr_jmpl_rtn_m | lsu_tlu_nonalt_ldst_m);*/
 
 
wire    [7:0]    asi_state_g ;
wire    [7:0]    asi_state_g ;
// flop'n use to prevent timing path.
// flop'n use to prevent timing path.
dff #(8)  asistate_stgg (
dff_s #(8)  asistate_stgg (
        .din    (lsu_excpctl_asi_state_m[7:0]),
        .din    (lsu_excpctl_asi_state_m[7:0]),
        .q      (asi_state_g[7:0]),
        .q      (asi_state_g[7:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    [7:0]    dsfsr_asi_g ;
wire    [7:0]    dsfsr_asi_g ;
wire    [3:0]    dsfsr_asi_sel_g ;
wire    [3:0]    dsfsr_asi_sel_g ;
 
 
Line 2058... Line 1489...
        (thread3_m & pstate_am[3]);
        (thread3_m & pstate_am[3]);
 
 
assign  dmmu_va_oor_m = exu_tlu_va_oor_m & ~pstate_am_m & lsu_memref_m & ~lsu_squash_va_oor_m;
assign  dmmu_va_oor_m = exu_tlu_va_oor_m & ~pstate_am_m & lsu_memref_m & ~lsu_squash_va_oor_m;
 
 
wire    [3:0]     dsfsr_flt_vld;
wire    [3:0]     dsfsr_flt_vld;
dff #(4)  fltvld_stgd1 (
dff_s #(4)  fltvld_stgd1 (
        .din    (tlu_dsfsr_flt_vld[3:0]),
        .din    (tlu_dsfsr_flt_vld[3:0]),
        .q      (dsfsr_flt_vld[3:0]),
        .q      (dsfsr_flt_vld[3:0]),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
wire    dsfsr_flt_vld_m ;
wire    dsfsr_flt_vld_m ;
assign  dsfsr_flt_vld_m =
assign  dsfsr_flt_vld_m =
        (thread0_m & dsfsr_flt_vld[0]) |
        (thread0_m & dsfsr_flt_vld[0]) |
Line 2077... Line 1508...
wire    ldst_xslate_g,flsh_inst_g,dsfsr_flt_vld_g,dsfsr_wr_op_g ;
wire    ldst_xslate_g,flsh_inst_g,dsfsr_flt_vld_g,dsfsr_wr_op_g ;
wire    misalign_addr_jmpl_rtn_g,misalign_addr_ldst_atm_g ;
wire    misalign_addr_jmpl_rtn_g,misalign_addr_ldst_atm_g ;
wire    [2:0]    dsfsr_ctxt_sel ;
wire    [2:0]    dsfsr_ctxt_sel ;
 
 
// flop flt_vld and use
// flop flt_vld and use
dff #(14)  dsfsr_stgg (
dff_s #(14)  dsfsr_stgg (
        .din    ({dsfsr_asi_sel_m[3:0],dmmu_va_oor_m,// memref_m,
        .din    ({dsfsr_asi_sel_m[3:0],dmmu_va_oor_m,// memref_m,
                lsu_tlu_xslating_ldst_m,lsu_flsh_inst_m,lsu_tlu_ctxt_sel_m[2:0],
                lsu_tlu_xslating_ldst_m,lsu_flsh_inst_m,lsu_tlu_ctxt_sel_m[2:0],
                dsfsr_flt_vld_m,lsu_tlu_write_op_m,exu_tlu_misalign_addr_jmpl_rtn_m,
                dsfsr_flt_vld_m,lsu_tlu_write_op_m,exu_tlu_misalign_addr_jmpl_rtn_m,
                lsu_tlu_misalign_addr_ldst_atm_m}),
                lsu_tlu_misalign_addr_ldst_atm_m}),
        .q      ({dsfsr_asi_sel_g[3:0],dmmu_va_oor_g,ldst_xslate_g,// memref_g,
        .q      ({dsfsr_asi_sel_g[3:0],dmmu_va_oor_g,ldst_xslate_g,// memref_g,
                flsh_inst_g,dsfsr_ctxt_sel[2:0],dsfsr_flt_vld_g, dsfsr_wr_op_g,
                flsh_inst_g,dsfsr_ctxt_sel[2:0],dsfsr_flt_vld_g, dsfsr_wr_op_g,
                misalign_addr_jmpl_rtn_g,misalign_addr_ldst_atm_g}),
                misalign_addr_jmpl_rtn_g,misalign_addr_ldst_atm_g}),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
// To be set only for data_access_exception traps - only one can be
// To be set only for data_access_exception traps - only one can be
// reported at any time.        
// reported at any time.        
 
 
Line 2147... Line 1578...
        // spec_access_epage_m | // Bug 3515
        // spec_access_epage_m | // Bug 3515
        priv_action_m |
        priv_action_m |
        exu_tlu_misalign_addr_jmpl_rtn_m |
        exu_tlu_misalign_addr_jmpl_rtn_m |
        lsu_tlu_misalign_addr_ldst_atm_m ;
        lsu_tlu_misalign_addr_ldst_atm_m ;
 
 
dff   dsfsrtrg_stgg (
dff_s   dsfsrtrg_stgg (
        .din    (dsfsr_trp_wr_pre_m),
        .din    (dsfsr_trp_wr_pre_m),
        .q      (dsfsr_trp_wr_pre_g),
        .q      (dsfsr_trp_wr_pre_g),
        .clk    (clk),
        .clk    (clk),
        .se     (se),       .si (),          .so ()
        .se     (se),       `SIMPLY_RISC_SCANIN,          .so ()
        );
        );
 
 
assign  dsfsr_trp_wr_g =
assign  dsfsr_trp_wr_g =
        ((lsu_tlu_priv_violtn_g  |
        ((lsu_tlu_priv_violtn_g  |
        lsu_tlu_spec_access_epage_g |   // Bug 3515 - uncomment out.
        lsu_tlu_spec_access_epage_g |   // Bug 3515 - uncomment out.

powered by: WebSVN 2.1.0

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