core_debug: Reduce metavalue warnings
authorPaul Mackerras <paulus@ozlabs.org>
Fri, 12 Aug 2022 09:46:09 +0000 (19:46 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Fri, 12 Aug 2022 10:22:30 +0000 (20:22 +1000)
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
core_debug.vhdl

index 592cf85d4b674e1b07757b838ceaeef2dd8be281..afebc7c45dec03db0be78826654b900533a7cb04 100644 (file)
@@ -173,6 +173,7 @@ begin
                 terminated <= '0';
                 log_trigger_delay <= 0;
                 gspr_index <= (others => '0');
+                log_dmi_addr <= (others => '0');
             else
                 if do_log_trigger = '1' or log_trigger_delay /= 0 then
                     if log_trigger_delay = 255 or
@@ -334,6 +335,7 @@ begin
                               addr : std_ulogic_vector(31 downto 0)) return std_ulogic_vector is
             variable firstbit : integer;
         begin
+            assert not is_X(addr);
             firstbit := to_integer(unsigned(addr(1 downto 0))) * 64;
             return data(firstbit + 63 downto firstbit);
         end;
@@ -351,9 +353,14 @@ begin
         begin
             if rising_edge(clk) then
                 if log_wr_enable = '1' then
+                    assert not is_X(log_wr_ptr);
                     log_array(to_integer(log_wr_ptr)) <= log_data;
                 end if;
-                log_rd <= log_array(to_integer(log_rd_ptr_latched));
+                if is_X(log_rd_ptr_latched) then
+                    log_rd <= (others => 'X');
+                else
+                    log_rd <= log_array(to_integer(log_rd_ptr_latched));
+                end if;
             end if;
         end process;
 
@@ -366,6 +373,7 @@ begin
                 if rst = '1' then
                     log_wr_ptr <= (others => '0');
                     log_toggle <= '0';
+                    log_rd_ptr_latched <= (others => '0');
                 elsif log_wr_enable = '1' then
                     if log_wr_ptr = to_unsigned(LOG_LENGTH - 1, LOG_INDEX_BITS) then
                         log_toggle <= not log_toggle;