core_debug: Stop logging 256 cycles after trigger
authorPaul Mackerras <paulus@ozlabs.org>
Tue, 15 Dec 2020 22:34:56 +0000 (09:34 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Fri, 15 Jan 2021 01:40:09 +0000 (12:40 +1100)
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
core_debug.vhdl

index 09e3e4831fa1e7a6915a4bde2ec78882623edbff..a81f7e08041682436562aeb68eeda01c752c4a50 100644 (file)
@@ -114,6 +114,7 @@ architecture behave of core_debug is
     signal do_dmi_log_rd : std_ulogic;
     signal dmi_read_log_data : std_ulogic;
     signal dmi_read_log_data_1 : std_ulogic;
+    signal log_trigger_delay : integer range 0 to 255 := 0;
 
 begin
        -- Single cycle register accesses on DMI except for GSPR data
@@ -152,9 +153,15 @@ begin
            if (rst) then
                stopping <= '0';
                terminated <= '0';
+                log_trigger_delay <= 0;
            else
-                if do_log_trigger = '1' then
-                    log_dmi_trigger(1) <= '1';
+                if do_log_trigger = '1' or log_trigger_delay /= 0 then
+                    if log_trigger_delay = 255 then
+                        log_dmi_trigger(1) <= '1';
+                        log_trigger_delay <= 0;
+                    else
+                        log_trigger_delay <= log_trigger_delay + 1;
+                    end if;
                 end if;
                -- Edge detect on dmi_req for 1-shot pulses
                dmi_req_1 <= dmi_req;