From d72f6b424f8b7c8651851971d799bd8984737c14 Mon Sep 17 00:00:00 2001 From: Andrei Solodovnikov Date: Fri, 28 Nov 2025 09:24:14 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=A010.=20=D0=94=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=81=D1=82=D0=B0?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=BA=D0=B8=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5?= =?UTF-8?q?=2010=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA=20=D0=B2=20tb=5Fir?= =?UTF-8?q?q?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Labs/10. Interrupt subsystem/lab_10.tb_irq.sv | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Labs/10. Interrupt subsystem/lab_10.tb_irq.sv b/Labs/10. Interrupt subsystem/lab_10.tb_irq.sv index bcf0702..7a217bb 100644 --- a/Labs/10. Interrupt subsystem/lab_10.tb_irq.sv +++ b/Labs/10. Interrupt subsystem/lab_10.tb_irq.sv @@ -28,8 +28,6 @@ int err_count; always #5 clk_i <= ~clk_i; initial begin - $display("\n\n===========================\n\nPress button 'Run All' (F3)\n\n===========================\n\n"); - $stop(); clk_i = '0; exception_i = '0; mret_i = '0; @@ -388,4 +386,16 @@ task error_info(irq, irq_ret); if (irq_cause_o!==32'h8000_0010) begin $error("invalid irq_cause_o = %08h, expected value 32'h8000_0010.", $sampled(irq_cause_o) ); err_count++; end endtask +initial begin + automatic int not_stopped = 1; + forever begin + @(posedge clk_i); + if((err_count >= 10) && not_stopped) begin + $display("Simulation stopped after ten errors."); + $stop(); + not_stopped = 0; + end + end +end + endmodule