Line 16... |
Line 16... |
// You should have received a copy of the GNU General Public
|
// You should have received a copy of the GNU General Public
|
// License along with this work; if not, write to the Free Software
|
// License along with this work; if not, write to the Free Software
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
//
|
//
|
// ========== Copyright Header End ============================================
|
// ========== Copyright Header End ============================================
|
|
`ifdef SIMPLY_RISC_TWEAKS
|
|
`define SIMPLY_RISC_SCANIN .si(0)
|
|
`else
|
|
`define SIMPLY_RISC_SCANIN .si()
|
|
`endif
|
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
/*
|
/*
|
// Module Name: sparc_exu_rml
|
// Module Name: sparc_exu_rml
|
// Description: Register management logic. Contains CWP, CANSAVE, CANRESTORE
|
// Description: Register management logic. Contains CWP, CANSAVE, CANRESTORE
|
// and other window management registers. Generates RF related traps
|
// and other window management registers. Generates RF related traps
|
Line 276... |
Line 281... |
assign clk = rclk;
|
assign clk = rclk;
|
// Reset flop
|
// Reset flop
|
dffrl_async rstff(.din (grst_l),
|
dffrl_async rstff(.din (grst_l),
|
.q (rml_reset_l),
|
.q (rml_reset_l),
|
.clk (clk),
|
.clk (clk),
|
.rst_l (arst_l), .se(se), .si(), .so());
|
.rst_l (arst_l), .se(se), `SIMPLY_RISC_SCANIN, .so());
|
assign reset = ~rml_reset_l;
|
assign reset = ~rml_reset_l;
|
|
|
dff #(2) tid_s2d(.din(ifu_exu_tid_s2[1:0]), .clk(clk), .q(tid_d[1:0]), .se(se), .si(), .so());
|
dff_s #(2) tid_s2d(.din(ifu_exu_tid_s2[1:0]), .clk(clk), .q(tid_d[1:0]), .se(se), `SIMPLY_RISC_SCANIN, .so());
|
dff #(2) tid_d2e(.din(tid_d[1:0]), .clk(clk), .q(tid_e[1:0]), .se(se), .si(), .so());
|
dff_s #(2) tid_d2e(.din(tid_d[1:0]), .clk(clk), .q(tid_e[1:0]), .se(se), `SIMPLY_RISC_SCANIN, .so());
|
assign thr_d[3] = tid_d[1] & tid_d[0];
|
assign thr_d[3] = tid_d[1] & tid_d[0];
|
assign thr_d[2] = tid_d[1] & ~tid_d[0];
|
assign thr_d[2] = tid_d[1] & ~tid_d[0];
|
assign thr_d[1] = ~tid_d[1] & tid_d[0];
|
assign thr_d[1] = ~tid_d[1] & tid_d[0];
|
assign thr_d[0] = ~tid_d[1] & ~tid_d[0];
|
assign thr_d[0] = ~tid_d[1] & ~tid_d[0];
|
|
|
dff save_d2e(.din(ifu_exu_save_d), .clk(clk), .q(save_e), .se(se), .si(), .so());
|
dff_s save_d2e(.din(ifu_exu_save_d), .clk(clk), .q(save_e), .se(se), `SIMPLY_RISC_SCANIN, .so());
|
dff save_e2m(.din(save_e), .clk(clk), .q(save_m), .se(se), .si(), .so());
|
dff_s save_e2m(.din(save_e), .clk(clk), .q(save_m), .se(se), `SIMPLY_RISC_SCANIN, .so());
|
dff restore_d2e(.din(ifu_exu_restore_d), .clk(clk), .q(restore_e), .se(se), .si(), .so());
|
dff_s restore_d2e(.din(ifu_exu_restore_d), .clk(clk), .q(restore_e), .se(se), `SIMPLY_RISC_SCANIN, .so());
|
|
|
// don't check flush_pipe in w if caused by rml trap. Things with a higher priority
|
// don't check flush_pipe in w if caused by rml trap. Things with a higher priority
|
// than a window trap have been accumulated into ecl_rml_kill_w
|
// than a window trap have been accumulated into ecl_rml_kill_w
|
assign vld_w = ecl_rml_inst_vld_w & (~ecl_rml_early_flush_w | win_trap_w);
|
assign vld_w = ecl_rml_inst_vld_w & (~ecl_rml_early_flush_w | win_trap_w);
|
assign rml_kill_w = ecl_rml_kill_w | ~vld_w;
|
assign rml_kill_w = ecl_rml_kill_w | ~vld_w;
|
|
|
assign win_trap_e = rml_ecl_fill_e | exu_tlu_spill_e | rml_ecl_clean_window_e;
|
assign win_trap_e = rml_ecl_fill_e | exu_tlu_spill_e | rml_ecl_clean_window_e;
|
dff win_trap_e2m(.din(win_trap_e), .clk(clk), .q(win_trap_m), .se(se), .si(), .so());
|
dff_s win_trap_e2m(.din(win_trap_e), .clk(clk), .q(win_trap_m), .se(se), `SIMPLY_RISC_SCANIN, .so());
|
dff win_trap_m2w(.din(win_trap_m), .clk(clk), .q(win_trap_w), .se(se), .si(), .so());
|
dff_s win_trap_m2w(.din(win_trap_m), .clk(clk), .q(win_trap_w), .se(se), `SIMPLY_RISC_SCANIN, .so());
|
|
|
assign canrestore_is0_e = (~rml_ecl_canrestore_e[0] & ~rml_ecl_canrestore_e[1]
|
assign canrestore_is0_e = (~rml_ecl_canrestore_e[0] & ~rml_ecl_canrestore_e[1]
|
& ~rml_ecl_canrestore_e[2]);
|
& ~rml_ecl_canrestore_e[2]);
|
assign cansave_is0_e = (~rml_ecl_cansave_e[0] & ~rml_ecl_cansave_e[1] &
|
assign cansave_is0_e = (~rml_ecl_cansave_e[0] & ~rml_ecl_cansave_e[1] &
|
~rml_ecl_cansave_e[2]);
|
~rml_ecl_cansave_e[2]);
|
Line 328... |
Line 333... |
// Spill trap on wflush with cansave != (NWINDOWS - 2 = 6)
|
// Spill trap on wflush with cansave != (NWINDOWS - 2 = 6)
|
assign spill_trap_flush = (ifu_exu_flushw_e & ~(rml_ecl_cansave_e[2] &
|
assign spill_trap_flush = (ifu_exu_flushw_e & ~(rml_ecl_cansave_e[2] &
|
rml_ecl_cansave_e[1] &
|
rml_ecl_cansave_e[1] &
|
~rml_ecl_cansave_e[0]));
|
~rml_ecl_cansave_e[0]));
|
assign exu_tlu_spill_e = (spill_trap_save | spill_trap_flush);
|
assign exu_tlu_spill_e = (spill_trap_save | spill_trap_flush);
|
dff spill_e2m(.din(exu_tlu_spill_e), .clk(clk), .q(spill_m), .se(se), .si(), .so());
|
dff_s spill_e2m(.din(exu_tlu_spill_e), .clk(clk), .q(spill_m), .se(se), `SIMPLY_RISC_SCANIN, .so());
|
|
|
// Clean window trap on save w/ cleanwin - canrestore == 0
|
// Clean window trap on save w/ cleanwin - canrestore == 0
|
// or cleanwin == canrestore
|
// or cleanwin == canrestore
|
// (not signalled on spill traps because spill is higher priority)
|
// (not signalled on spill traps because spill is higher priority)
|
assign cleanwin_xor_canrestore = rml_ecl_cleanwin_e ^ rml_ecl_canrestore_e;
|
assign cleanwin_xor_canrestore = rml_ecl_cleanwin_e ^ rml_ecl_canrestore_e;
|
Line 340... |
Line 345... |
cleanwin_xor_canrestore[1] |
|
cleanwin_xor_canrestore[1] |
|
cleanwin_xor_canrestore[0]) & save_e & ~exu_tlu_spill_e;
|
cleanwin_xor_canrestore[0]) & save_e & ~exu_tlu_spill_e;
|
|
|
// Kill signal for w1 wen bit (all others don't care)
|
// Kill signal for w1 wen bit (all others don't care)
|
assign rml_ecl_kill_e = rml_ecl_fill_e | exu_tlu_spill_e;
|
assign rml_ecl_kill_e = rml_ecl_fill_e | exu_tlu_spill_e;
|
dff rml_kill_e2m(.din(rml_ecl_kill_e), .clk(clk), .q(rml_ecl_kill_m),
|
dff_s rml_kill_e2m(.din(rml_ecl_kill_e), .clk(clk), .q(rml_ecl_kill_m),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
|
|
|
|
// WTYPE generation
|
// WTYPE generation
|
assign rml_ecl_other_d = (rml_ecl_otherwin_d[0] | rml_ecl_otherwin_d[1]
|
assign rml_ecl_other_d = (rml_ecl_otherwin_d[0] | rml_ecl_otherwin_d[1]
|
| rml_ecl_otherwin_d[2]);
|
| rml_ecl_otherwin_d[2]);
|
dff other_d2e(.din(rml_ecl_other_d), .clk(clk), .q(rml_ecl_other_e), .se(se),
|
dff_s other_d2e(.din(rml_ecl_other_d), .clk(clk), .q(rml_ecl_other_e), .se(se),
|
.si(), .so());
|
`SIMPLY_RISC_SCANIN, .so());
|
mux2ds #(3) wtype_mux(.dout(rml_ecl_wtype_d[2:0]),
|
mux2ds #(3) wtype_mux(.dout(rml_ecl_wtype_d[2:0]),
|
.in0(rml_ecl_wstate_d[2:0]),
|
.in0(rml_ecl_wstate_d[2:0]),
|
.in1(rml_ecl_wstate_d[5:3]),
|
.in1(rml_ecl_wstate_d[5:3]),
|
.sel0(~rml_ecl_other_d),
|
.sel0(~rml_ecl_other_d),
|
.sel1(rml_ecl_other_d));
|
.sel1(rml_ecl_other_d));
|
dff #(3) wtype_d2e(.din(rml_ecl_wtype_d[2:0]), .clk(clk), .q(rml_ecl_wtype_e[2:0]),
|
dff_s #(3) wtype_d2e(.din(rml_ecl_wtype_d[2:0]), .clk(clk), .q(rml_ecl_wtype_e[2:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
|
|
|
|
////////////////////////////
|
////////////////////////////
|
// Interface with IRF
|
// Interface with IRF
|
////////////////////////////
|
////////////////////////////
|
Line 373... |
Line 378... |
((restore_e | swap_outs) & ~old_cwp_e[0]);
|
((restore_e | swap_outs) & ~old_cwp_e[0]);
|
assign rml_irf_swap_even_e = ((save_e | ecl_rml_cwp_wen_e | spill_trap_flush | swap_locals_ins) & ~old_cwp_e[0]) |
|
assign rml_irf_swap_even_e = ((save_e | ecl_rml_cwp_wen_e | spill_trap_flush | swap_locals_ins) & ~old_cwp_e[0]) |
|
((restore_e | swap_outs) & old_cwp_e[0]);
|
((restore_e | swap_outs) & old_cwp_e[0]);
|
|
|
assign swap_e = save_e | restore_e | ecl_rml_cwp_wen_e | spill_trap_flush;
|
assign swap_e = save_e | restore_e | ecl_rml_cwp_wen_e | spill_trap_flush;
|
dff dff_did_restore_e2m(.din(swap_e), .clk(clk),
|
dff_s dff_did_restore_e2m(.din(swap_e), .clk(clk),
|
.q(did_restore_m), .se(se),
|
.q(did_restore_m), .se(se),
|
.si(), .so());
|
`SIMPLY_RISC_SCANIN, .so());
|
dff dff_did_restore_m2w(.din(did_restore_m), .clk(clk),
|
dff_s dff_did_restore_m2w(.din(did_restore_m), .clk(clk),
|
.q(did_restore_w), .se(se),
|
.q(did_restore_w), .se(se),
|
.si(), .so());
|
`SIMPLY_RISC_SCANIN, .so());
|
// kill restore on all saves (except those that spill) and any swaps that
|
// kill restore on all saves (except those that spill) and any swaps that
|
// get kill signals
|
// get kill signals
|
assign kill_restore_m = (~spill_m & save_m);
|
assign kill_restore_m = (~spill_m & save_m);
|
dff dff_kill_restore_m2w(.din(kill_restore_m), .clk(clk), .q(kill_restore_w),
|
dff_s dff_kill_restore_m2w(.din(kill_restore_m), .clk(clk), .q(kill_restore_w),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
assign rml_irf_kill_restore_w = kill_restore_w | (did_restore_w & rml_kill_w);
|
assign rml_irf_kill_restore_w = kill_restore_w | (did_restore_w & rml_kill_w);
|
|
|
|
|
///////////////////////////////
|
///////////////////////////////
|
// CWP logic
|
// CWP logic
|
Line 415... |
Line 420... |
.in2(spill_cwp_e[2:0]),
|
.in2(spill_cwp_e[2:0]),
|
.sel0(next_cwp_sel_inc),
|
.sel0(next_cwp_sel_inc),
|
.sel1(ecl_rml_cwp_wen_e),
|
.sel1(ecl_rml_cwp_wen_e),
|
.sel2(exu_tlu_spill_e));
|
.sel2(exu_tlu_spill_e));
|
|
|
dff cwp_wen_e2m(.din(cwp_wen_e), .clk(clk), .q(rml_cwp_wen_m),
|
dff_s cwp_wen_e2m(.din(cwp_wen_e), .clk(clk), .q(rml_cwp_wen_m),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
dff #(3) next_cwp_e2m(.din(next_cwp_e[2:0]), .clk(clk), .q(next_cwp_m[2:0]),
|
dff_s #(3) next_cwp_e2m(.din(next_cwp_e[2:0]), .clk(clk), .q(next_cwp_m[2:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
assign cwp_wen_m = rml_cwp_wen_m;
|
assign cwp_wen_m = rml_cwp_wen_m;
|
dff #(3) next_cwp_m2w(.din(next_cwp_m[2:0]), .clk(clk), .q(next_cwp_noreset_w[2:0]),
|
dff_s #(3) next_cwp_m2w(.din(next_cwp_m[2:0]), .clk(clk), .q(next_cwp_noreset_w[2:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
dff cwp_wen_m2w(.din(cwp_wen_m), .clk(clk), .q(cwp_wen_nokill_w),
|
dff_s cwp_wen_m2w(.din(cwp_wen_m), .clk(clk), .q(cwp_wen_nokill_w),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
assign cwp_wen_w = cwp_wen_nokill_w & ~rml_kill_w;
|
assign cwp_wen_w = cwp_wen_nokill_w & ~rml_kill_w;
|
assign next_cwp_w[2:0] = next_cwp_noreset_w[2:0];
|
assign next_cwp_w[2:0] = next_cwp_noreset_w[2:0];
|
|
|
assign full_swap_e = (exu_tlu_spill_e | ecl_rml_cwp_wen_e);
|
assign full_swap_e = (exu_tlu_spill_e | ecl_rml_cwp_wen_e);
|
|
|
Line 440... |
Line 445... |
wire [3:0] oddwin_w;
|
wire [3:0] oddwin_w;
|
assign oddwin_m[3] = (cwp_wen_m & ecl_rml_thr_m[3])? next_cwp_m[0]: oddwin_w[3];
|
assign oddwin_m[3] = (cwp_wen_m & ecl_rml_thr_m[3])? next_cwp_m[0]: oddwin_w[3];
|
assign oddwin_m[2] = (cwp_wen_m & ecl_rml_thr_m[2])? next_cwp_m[0]: oddwin_w[2];
|
assign oddwin_m[2] = (cwp_wen_m & ecl_rml_thr_m[2])? next_cwp_m[0]: oddwin_w[2];
|
assign oddwin_m[1] = (cwp_wen_m & ecl_rml_thr_m[1])? next_cwp_m[0]: oddwin_w[1];
|
assign oddwin_m[1] = (cwp_wen_m & ecl_rml_thr_m[1])? next_cwp_m[0]: oddwin_w[1];
|
assign oddwin_m[0] = (cwp_wen_m & ecl_rml_thr_m[0])? next_cwp_m[0]: oddwin_w[0];
|
assign oddwin_m[0] = (cwp_wen_m & ecl_rml_thr_m[0])? next_cwp_m[0]: oddwin_w[0];
|
dff #(4) oddwin_dff(.din(oddwin_m[3:0]), .clk(clk), .q(exu_ifu_oddwin_s[3:0]),
|
dff_s #(4) oddwin_dff(.din(oddwin_m[3:0]), .clk(clk), .q(exu_ifu_oddwin_s[3:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
|
|
sparc_exu_rml_cwp cwp(
|
sparc_exu_rml_cwp cwp(
|
.swap_outs (swap_outs),
|
.swap_outs (swap_outs),
|
.swap_locals_ins(swap_locals_ins),
|
.swap_locals_ins(swap_locals_ins),
|
.rml_ecl_cwp_e (rml_ecl_cwp_e[2:0]),
|
.rml_ecl_cwp_e (rml_ecl_cwp_e[2:0]),
|
Line 507... |
Line 512... |
mux2ds #(3) next_cansave_mux(.dout(next_cansave_e[2:0]),
|
mux2ds #(3) next_cansave_mux(.dout(next_cansave_e[2:0]),
|
.in0(ecl_rml_xor_data_e[2:0]),
|
.in0(ecl_rml_xor_data_e[2:0]),
|
.in1(rml_next_cansave_e[2:0]),
|
.in1(rml_next_cansave_e[2:0]),
|
.sel0(~cansave_wen_e),
|
.sel0(~cansave_wen_e),
|
.sel1(cansave_wen_e));
|
.sel1(cansave_wen_e));
|
dff cansave_wen_e2m(.din(cansave_wen_e), .clk(clk), .q(cansave_wen_m),
|
dff_s cansave_wen_e2m(.din(cansave_wen_e), .clk(clk), .q(cansave_wen_m),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
dff #(3) next_cansave_e2m(.din(next_cansave_e[2:0]), .clk(clk), .q(next_cansave_m[2:0]),
|
dff_s #(3) next_cansave_e2m(.din(next_cansave_e[2:0]), .clk(clk), .q(next_cansave_m[2:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
assign cansave_wen_valid_m = cansave_wen_m;
|
assign cansave_wen_valid_m = cansave_wen_m;
|
dff cansave_wen_m2w(.din(cansave_wen_valid_m), .clk(clk), .q(rml_cansave_wen_w),
|
dff_s cansave_wen_m2w(.din(cansave_wen_valid_m), .clk(clk), .q(rml_cansave_wen_w),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
dff #(3) next_cansave_m2w(.din(next_cansave_m[2:0]), .clk(clk), .q(next_cansave_w[2:0]),
|
dff_s #(3) next_cansave_m2w(.din(next_cansave_m[2:0]), .clk(clk), .q(next_cansave_w[2:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
assign cansave_wen_w = (rml_cansave_wen_w | ecl_rml_cansave_wen_w) & ~rml_kill_w;
|
assign cansave_wen_w = (rml_cansave_wen_w | ecl_rml_cansave_wen_w) & ~rml_kill_w;
|
|
|
///////////////////////////////
|
///////////////////////////////
|
// Canrestore logic
|
// Canrestore logic
|
///////////////////////////////
|
///////////////////////////////
|
Line 535... |
Line 540... |
mux2ds #(3) next_canrestore_mux(.dout(next_canrestore_e[2:0]),
|
mux2ds #(3) next_canrestore_mux(.dout(next_canrestore_e[2:0]),
|
.in0(ecl_rml_xor_data_e[2:0]),
|
.in0(ecl_rml_xor_data_e[2:0]),
|
.in1(rml_next_canrestore_e[2:0]),
|
.in1(rml_next_canrestore_e[2:0]),
|
.sel0(~canrestore_wen_e),
|
.sel0(~canrestore_wen_e),
|
.sel1(canrestore_wen_e));
|
.sel1(canrestore_wen_e));
|
dff canrestore_wen_e2m(.din(canrestore_wen_e), .clk(clk), .q(canrestore_wen_m),
|
dff_s canrestore_wen_e2m(.din(canrestore_wen_e), .clk(clk), .q(canrestore_wen_m),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
dff #(3) next_canrestore_e2m(.din(next_canrestore_e[2:0]), .clk(clk), .q(next_canrestore_m[2:0]),
|
dff_s #(3) next_canrestore_e2m(.din(next_canrestore_e[2:0]), .clk(clk), .q(next_canrestore_m[2:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
assign canrestore_wen_valid_m = canrestore_wen_m;
|
assign canrestore_wen_valid_m = canrestore_wen_m;
|
dff canrestore_wen_m2w(.din(canrestore_wen_valid_m), .clk(clk), .q(rml_canrestore_wen_w),
|
dff_s canrestore_wen_m2w(.din(canrestore_wen_valid_m), .clk(clk), .q(rml_canrestore_wen_w),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
dff #(3) next_canrestore_m2w(.din(next_canrestore_m[2:0]), .clk(clk), .q(next_canrestore_w[2:0]),
|
dff_s #(3) next_canrestore_m2w(.din(next_canrestore_m[2:0]), .clk(clk), .q(next_canrestore_w[2:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
assign canrestore_wen_w = (rml_canrestore_wen_w | ecl_rml_canrestore_wen_w) & ~rml_kill_w;
|
assign canrestore_wen_w = (rml_canrestore_wen_w | ecl_rml_canrestore_wen_w) & ~rml_kill_w;
|
|
|
///////////////////////////////
|
///////////////////////////////
|
// Otherwin logic
|
// Otherwin logic
|
///////////////////////////////
|
///////////////////////////////
|
Line 562... |
Line 567... |
mux2ds #(3) next_otherwin_mux(.dout(next_otherwin_e[2:0]),
|
mux2ds #(3) next_otherwin_mux(.dout(next_otherwin_e[2:0]),
|
.in0(ecl_rml_xor_data_e[2:0]),
|
.in0(ecl_rml_xor_data_e[2:0]),
|
.in1(rml_next_otherwin_e[2:0]),
|
.in1(rml_next_otherwin_e[2:0]),
|
.sel0(~otherwin_wen_e),
|
.sel0(~otherwin_wen_e),
|
.sel1(otherwin_wen_e));
|
.sel1(otherwin_wen_e));
|
dff otherwin_wen_e2m(.din(otherwin_wen_e), .clk(clk), .q(otherwin_wen_m),
|
dff_s otherwin_wen_e2m(.din(otherwin_wen_e), .clk(clk), .q(otherwin_wen_m),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
dff #(3) next_otherwin_e2m(.din(next_otherwin_e[2:0]), .clk(clk), .q(next_otherwin_m[2:0]),
|
dff_s #(3) next_otherwin_e2m(.din(next_otherwin_e[2:0]), .clk(clk), .q(next_otherwin_m[2:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
assign otherwin_wen_valid_m = otherwin_wen_m;
|
assign otherwin_wen_valid_m = otherwin_wen_m;
|
dff otherwin_wen_m2w(.din(otherwin_wen_valid_m), .clk(clk), .q(rml_otherwin_wen_w),
|
dff_s otherwin_wen_m2w(.din(otherwin_wen_valid_m), .clk(clk), .q(rml_otherwin_wen_w),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
dff #(3) next_otherwin_m2w(.din(next_otherwin_m[2:0]), .clk(clk), .q(next_otherwin_w[2:0]),
|
dff_s #(3) next_otherwin_m2w(.din(next_otherwin_m[2:0]), .clk(clk), .q(next_otherwin_w[2:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
assign otherwin_wen_w = (rml_otherwin_wen_w | ecl_rml_otherwin_wen_w) & ~rml_kill_w;
|
assign otherwin_wen_w = (rml_otherwin_wen_w | ecl_rml_otherwin_wen_w) & ~rml_kill_w;
|
|
|
///////////////////////////////
|
///////////////////////////////
|
// Cleanwin logic
|
// Cleanwin logic
|
///////////////////////////////
|
///////////////////////////////
|
Line 590... |
Line 595... |
mux2ds #(3) next_cleanwin_mux(.dout(next_cleanwin_e[2:0]),
|
mux2ds #(3) next_cleanwin_mux(.dout(next_cleanwin_e[2:0]),
|
.in0(ecl_rml_xor_data_e[2:0]),
|
.in0(ecl_rml_xor_data_e[2:0]),
|
.in1(rml_next_cleanwin_e[2:0]),
|
.in1(rml_next_cleanwin_e[2:0]),
|
.sel0(~cleanwin_wen_e),
|
.sel0(~cleanwin_wen_e),
|
.sel1(cleanwin_wen_e));
|
.sel1(cleanwin_wen_e));
|
dff cleanwin_wen_e2m(.din(cleanwin_wen_e), .clk(clk), .q(cleanwin_wen_m),
|
dff_s cleanwin_wen_e2m(.din(cleanwin_wen_e), .clk(clk), .q(cleanwin_wen_m),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
dff #(3) next_cleanwin_e2m(.din(next_cleanwin_e[2:0]), .clk(clk), .q(next_cleanwin_m[2:0]),
|
dff_s #(3) next_cleanwin_e2m(.din(next_cleanwin_e[2:0]), .clk(clk), .q(next_cleanwin_m[2:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
assign cleanwin_wen_valid_m = cleanwin_wen_m;
|
assign cleanwin_wen_valid_m = cleanwin_wen_m;
|
dff cleanwin_wen_m2w(.din(cleanwin_wen_valid_m), .clk(clk), .q(rml_cleanwin_wen_w),
|
dff_s cleanwin_wen_m2w(.din(cleanwin_wen_valid_m), .clk(clk), .q(rml_cleanwin_wen_w),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
dff #(3) next_cleanwin_m2w(.din(next_cleanwin_m[2:0]), .clk(clk), .q(next_cleanwin_w[2:0]),
|
dff_s #(3) next_cleanwin_m2w(.din(next_cleanwin_m[2:0]), .clk(clk), .q(next_cleanwin_w[2:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
assign cleanwin_wen_w = (rml_cleanwin_wen_w | ecl_rml_cleanwin_wen_w) & ~rml_kill_w;
|
assign cleanwin_wen_w = (rml_cleanwin_wen_w | ecl_rml_cleanwin_wen_w) & ~rml_kill_w;
|
|
|
///////////////////////////////
|
///////////////////////////////
|
// WSTATE logic
|
// WSTATE logic
|
///////////////////////////////
|
///////////////////////////////
|
Line 613... |
Line 618... |
///////////////////////////////
|
///////////////////////////////
|
sparc_exu_reg cansave_reg(.clk(clk), .se(se),
|
sparc_exu_reg cansave_reg(.clk(clk), .se(se),
|
.data_out(rml_ecl_cansave_d[2:0]), .thr_out(thr_d[3:0]),
|
.data_out(rml_ecl_cansave_d[2:0]), .thr_out(thr_d[3:0]),
|
.thr_w(ecl_rml_thr_w[3:0]),
|
.thr_w(ecl_rml_thr_w[3:0]),
|
.wen_w(cansave_wen_w), .data_in_w(next_cansave_w[2:0]));
|
.wen_w(cansave_wen_w), .data_in_w(next_cansave_w[2:0]));
|
dff #(3) cansave_d2e(.din(rml_ecl_cansave_d[2:0]), .clk(clk), .q(rml_ecl_cansave_e[2:0]), .se(se),
|
dff_s #(3) cansave_d2e(.din(rml_ecl_cansave_d[2:0]), .clk(clk), .q(rml_ecl_cansave_e[2:0]), .se(se),
|
.si(), .so());
|
`SIMPLY_RISC_SCANIN, .so());
|
sparc_exu_reg canrestore_reg(.clk(clk), .se(se),
|
sparc_exu_reg canrestore_reg(.clk(clk), .se(se),
|
.data_out(rml_ecl_canrestore_d[2:0]), .thr_out(thr_d[3:0]),
|
.data_out(rml_ecl_canrestore_d[2:0]), .thr_out(thr_d[3:0]),
|
.thr_w(ecl_rml_thr_w[3:0]),
|
.thr_w(ecl_rml_thr_w[3:0]),
|
.wen_w(canrestore_wen_w),
|
.wen_w(canrestore_wen_w),
|
.data_in_w(next_canrestore_w[2:0]));
|
.data_in_w(next_canrestore_w[2:0]));
|
dff #(3) canrestore_d2e(.din(rml_ecl_canrestore_d[2:0]), .clk(clk), .q(rml_ecl_canrestore_e[2:0]),
|
dff_s #(3) canrestore_d2e(.din(rml_ecl_canrestore_d[2:0]), .clk(clk), .q(rml_ecl_canrestore_e[2:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
sparc_exu_reg otherwin_reg(.clk(clk), .se(se),
|
sparc_exu_reg otherwin_reg(.clk(clk), .se(se),
|
.data_out(rml_ecl_otherwin_d[2:0]), .thr_out(thr_d[3:0]),
|
.data_out(rml_ecl_otherwin_d[2:0]), .thr_out(thr_d[3:0]),
|
.thr_w(ecl_rml_thr_w[3:0]),
|
.thr_w(ecl_rml_thr_w[3:0]),
|
.wen_w(otherwin_wen_w), .data_in_w(next_otherwin_w[2:0]));
|
.wen_w(otherwin_wen_w), .data_in_w(next_otherwin_w[2:0]));
|
dff #(3) otherwin_d2e(.din(rml_ecl_otherwin_d[2:0]), .clk(clk), .q(rml_ecl_otherwin_e[2:0]),
|
dff_s #(3) otherwin_d2e(.din(rml_ecl_otherwin_d[2:0]), .clk(clk), .q(rml_ecl_otherwin_e[2:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
sparc_exu_reg cleanwin_reg(.clk(clk), .se(se),
|
sparc_exu_reg cleanwin_reg(.clk(clk), .se(se),
|
.data_out(rml_ecl_cleanwin_d[2:0]), .thr_out(thr_d[3:0]),
|
.data_out(rml_ecl_cleanwin_d[2:0]), .thr_out(thr_d[3:0]),
|
.thr_w(ecl_rml_thr_w[3:0]),
|
.thr_w(ecl_rml_thr_w[3:0]),
|
.wen_w(cleanwin_wen_w), .data_in_w(next_cleanwin_w[2:0]));
|
.wen_w(cleanwin_wen_w), .data_in_w(next_cleanwin_w[2:0]));
|
dff #(3) cleanwin_d2e(.din(rml_ecl_cleanwin_d[2:0]), .clk(clk), .q(rml_ecl_cleanwin_e[2:0]),
|
dff_s #(3) cleanwin_d2e(.din(rml_ecl_cleanwin_d[2:0]), .clk(clk), .q(rml_ecl_cleanwin_e[2:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
sparc_exu_reg hi_wstate_reg(.clk(clk), .se(se),
|
sparc_exu_reg hi_wstate_reg(.clk(clk), .se(se),
|
.data_out(rml_ecl_wstate_d[5:3]), .thr_out(thr_d[3:0]),
|
.data_out(rml_ecl_wstate_d[5:3]), .thr_out(thr_d[3:0]),
|
.thr_w(ecl_rml_thr_w[3:0]),
|
.thr_w(ecl_rml_thr_w[3:0]),
|
.wen_w(wstate_wen_w),
|
.wen_w(wstate_wen_w),
|
.data_in_w(exu_tlu_wsr_data_w[5:3]));
|
.data_in_w(exu_tlu_wsr_data_w[5:3]));
|
Line 653... |
Line 658... |
//----------------------------
|
//----------------------------
|
/////////////////////////////////
|
/////////////////////////////////
|
assign rml_irf_new_agp[1:0] = tlu_exu_agp[1:0];
|
assign rml_irf_new_agp[1:0] = tlu_exu_agp[1:0];
|
assign agp_tid[1:0] = tlu_exu_agp_tid[1:0];
|
assign agp_tid[1:0] = tlu_exu_agp_tid[1:0];
|
|
|
|
`ifdef FPGA_SYN_1THREAD
|
|
assign rml_irf_old_agp[1:0] = agp_thr0[1:0];
|
|
assign agp_wen_thr0_w = (agp_thr[0] & agp_wen) | reset;
|
|
// mux between new and current value
|
|
mux2ds #(2) agp_next0_mux(.dout(agp_thr0_next[1:0]),
|
|
.in0(agp_thr0[1:0]),
|
|
.in1(new_agp[1:0]),
|
|
.sel0(~agp_wen_thr0_w),
|
|
.sel1(agp_wen_thr0_w));
|
|
dff_s #(2) dff_agp_thr0(.din(agp_thr0_next[1:0]), .clk(clk), .q(agp_thr0[1:0]),
|
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
|
// generation of controls
|
|
assign agp_wen = tlu_exu_agp_swap;
|
|
assign rml_irf_swap_global = agp_wen;
|
|
assign rml_irf_global_tid[1:0] = agp_tid[1:0];
|
|
|
|
// decode tids
|
|
assign agp_thr[0] = ~agp_tid[1] & ~agp_tid[0];
|
|
// Decode agp input
|
|
assign new_agp[1:0] = rml_irf_new_agp[1:0] | {2{reset}};
|
|
|
|
// send current global level to ecl for error logging
|
|
assign rml_ecl_gl_e[1:0] = agp_thr0[1:0];
|
|
|
|
`else
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Output selection for current agp
|
// Output selection for current agp
|
mux4ds #(2) mux_agp_out1(.dout(rml_irf_old_agp[1:0]),
|
mux4ds #(2) mux_agp_out1(.dout(rml_irf_old_agp[1:0]),
|
.sel0(agp_thr[0]),
|
.sel0(agp_thr[0]),
|
.sel1(agp_thr[1]),
|
.sel1(agp_thr[1]),
|
Line 723... |
Line 728... |
.in1(new_agp[1:0]),
|
.in1(new_agp[1:0]),
|
.sel0(~agp_wen_thr3_w),
|
.sel0(~agp_wen_thr3_w),
|
.sel1(agp_wen_thr3_w));
|
.sel1(agp_wen_thr3_w));
|
|
|
// store new value
|
// store new value
|
dff #(2) dff_agp_thr0(.din(agp_thr0_next[1:0]), .clk(clk), .q(agp_thr0[1:0]),
|
dff_s #(2) dff_agp_thr0(.din(agp_thr0_next[1:0]), .clk(clk), .q(agp_thr0[1:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
dff #(2) dff_agp_thr1(.din(agp_thr1_next[1:0]), .clk(clk), .q(agp_thr1[1:0]),
|
dff_s #(2) dff_agp_thr1(.din(agp_thr1_next[1:0]), .clk(clk), .q(agp_thr1[1:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
dff #(2) dff_agp_thr2(.din(agp_thr2_next[1:0]), .clk(clk), .q(agp_thr2[1:0]),
|
dff_s #(2) dff_agp_thr2(.din(agp_thr2_next[1:0]), .clk(clk), .q(agp_thr2[1:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
dff #(2) dff_agp_thr3(.din(agp_thr3_next[1:0]), .clk(clk), .q(agp_thr3[1:0]),
|
dff_s #(2) dff_agp_thr3(.din(agp_thr3_next[1:0]), .clk(clk), .q(agp_thr3[1:0]),
|
.se(se), .si(), .so());
|
.se(se), `SIMPLY_RISC_SCANIN, .so());
|
|
|
// generation of controls
|
// generation of controls
|
assign agp_wen = tlu_exu_agp_swap;
|
assign agp_wen = tlu_exu_agp_swap;
|
assign rml_irf_swap_global = agp_wen;
|
assign rml_irf_swap_global = agp_wen;
|
assign rml_irf_global_tid[1:0] = agp_tid[1:0];
|
assign rml_irf_global_tid[1:0] = agp_tid[1:0];
|
Line 751... |
Line 756... |
// send current global level to ecl for error logging
|
// send current global level to ecl for error logging
|
assign rml_ecl_gl_e[1:0] = ((tid_e[1:0] == 2'b00)? agp_thr0[1:0]:
|
assign rml_ecl_gl_e[1:0] = ((tid_e[1:0] == 2'b00)? agp_thr0[1:0]:
|
(tid_e[1:0] == 2'b01)? agp_thr1[1:0]:
|
(tid_e[1:0] == 2'b01)? agp_thr1[1:0]:
|
(tid_e[1:0] == 2'b10)? agp_thr2[1:0]:
|
(tid_e[1:0] == 2'b10)? agp_thr2[1:0]:
|
agp_thr3[1:0]);
|
agp_thr3[1:0]);
|
// !`ifdef FPGA_SYN_1THREAD
|
`endif // !`ifdef FPGA_SYN_1THREAD
|
|
|
endmodule // sparc_exu_rml
|
endmodule // sparc_exu_rml
|
|
|
No newline at end of file
|
No newline at end of file
|