From 17fc77cef28990033e7b12486befcc7fa9867e16 Mon Sep 17 00:00:00 2001 From: Jordan Niethe Date: Tue, 7 Jul 2020 20:37:52 +1000 Subject: [PATCH] core: Implement PVR register Microwatt has been allocated a PVR version of 0x0063. Implement a PVR with this value. Signed-off-by: Jordan Niethe --- common.vhdl | 3 +++ execute1.vhdl | 3 +++ 2 files changed, 6 insertions(+) diff --git a/common.vhdl b/common.vhdl index 18378d5..a193df1 100644 --- a/common.vhdl +++ b/common.vhdl @@ -6,6 +6,8 @@ library work; use work.decode_types.all; package common is + -- Processor Version Number + constant PVR_MICROWATT : std_ulogic_vector(31 downto 0) := x"00630000"; -- MSR bit numbers constant MSR_SF : integer := (63 - 0); -- Sixty-Four bit mode @@ -43,6 +45,7 @@ package common is constant SPR_HSPRG1 : spr_num_t := 305; constant SPR_PID : spr_num_t := 48; constant SPR_PRTBL : spr_num_t := 720; + constant SPR_PVR : spr_num_t := 287; -- GPR indices in the register file (GPR only) subtype gpr_index_t is std_ulogic_vector(4 downto 0); diff --git a/execute1.vhdl b/execute1.vhdl index a1cd008..3b2007a 100644 --- a/execute1.vhdl +++ b/execute1.vhdl @@ -766,6 +766,9 @@ begin spr_val := ctrl.dec; when SPR_CFAR => spr_val := ctrl.cfar; + when SPR_PVR => + spr_val(63 downto 32) := (others => '0'); + spr_val(31 downto 0) := PVR_MICROWATT; when 724 => -- LOG_ADDR SPR spr_val := log_wr_addr & r.log_addr_spr; when 725 => -- LOG_DATA SPR -- 2.30.2