From: Paul Mackerras Date: Mon, 3 Aug 2020 00:08:33 +0000 (+1000) Subject: core: Implement the TAR register and the bctar instruction X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0fb89672902bbe7c56c419b57a5e96fc1d5cb202;p=microwatt.git core: Implement the TAR register and the bctar instruction Signed-off-by: Paul Mackerras --- diff --git a/common.vhdl b/common.vhdl index e05720b..bd9210b 100644 --- a/common.vhdl +++ b/common.vhdl @@ -26,6 +26,7 @@ package common is constant SPR_XER : spr_num_t := 1; constant SPR_LR : spr_num_t := 8; constant SPR_CTR : spr_num_t := 9; + constant SPR_TAR : spr_num_t := 815; constant SPR_DSISR : spr_num_t := 18; constant SPR_DAR : spr_num_t := 19; constant SPR_TB : spr_num_t := 268; @@ -459,6 +460,8 @@ package body common is n := 11; when SPR_XER => n := 12; + when SPR_TAR => + n := 13; when others => n := 0; return "000000"; diff --git a/decode1.vhdl b/decode1.vhdl index f553e2d..5677917 100644 --- a/decode1.vhdl +++ b/decode1.vhdl @@ -94,7 +94,7 @@ architecture behaviour of decode1 is 2#1100000010# => '1', 2#1100100010# => '1', 2#1101000010# => '1', 2#1101100010# => '1', 2#1110000010# => '1', 2#1110100010# => '1', 2#1111000010# => '1', 2#1111100010# => '1', 2#1000010000# => '1', -- bcctr 2#0000010000# => '1', -- bclr - 2#1000110000# => '0', -- bctar + 2#1000110000# => '1', -- bctar 2#0100000001# => '1', -- crand 2#0010000001# => '1', -- crandc 2#0100100001# => '1', -- creqv @@ -467,11 +467,12 @@ begin if f_in.insn(23) = '0' then v.ispr1 := fast_spr_num(SPR_CTR); end if; - -- TODO: Add TAR if f_in.insn(10) = '0' then v.ispr2 := fast_spr_num(SPR_LR); - else + elsif f_in.insn(6) = '0' then v.ispr2 := fast_spr_num(SPR_CTR); + else + v.ispr2 := fast_spr_num(SPR_TAR); end if; else -- Could be OP_RFID