Metavalue cleanup for pmu.vhdl
authorMichael Neuling <mikey@neuling.org>
Thu, 14 Jul 2022 00:32:37 +0000 (10:32 +1000)
committerMichael Neuling <mikey@neuling.org>
Thu, 28 Jul 2022 00:16:50 +0000 (10:16 +1000)
Signed-off-by: Michael Neuling <mikey@neuling.org>
pmu.vhdl

index 2967f4efe8234e534cf3880d47aad679d4585551..928d6c2573a9d25ef1cd98ea4233f750ab4ef268 100644 (file)
--- a/pmu.vhdl
+++ b/pmu.vhdl
@@ -217,7 +217,11 @@ begin
 
         -- Check for timebase events
         tbdiff := p_in.tbbits and not prev_tb;
-        tbbit := tbdiff(3 - to_integer(unsigned(mmcr0(MMCR0_TBSEL + 1 downto MMCR0_TBSEL))));
+        if is_X(mmcr0) then
+            tbbit := 'X';
+        else
+            tbbit := tbdiff(3 - to_integer(unsigned(mmcr0(MMCR0_TBSEL + 1 downto MMCR0_TBSEL))));
+        end if;
         if tbbit = '1' and mmcr0(MMCR0_TBEE) = '1' then
             event := '1';
         end if;