mirror of
https://github.com/MPSU/APS.git
synced 2026-01-11 13:15:32 +00:00
Compare commits
2 Commits
8497d91ffb
...
d72f6b424f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d72f6b424f | ||
|
|
0604def3cf |
@@ -28,8 +28,6 @@ int err_count;
|
|||||||
always #5 clk_i <= ~clk_i;
|
always #5 clk_i <= ~clk_i;
|
||||||
|
|
||||||
initial begin
|
initial begin
|
||||||
$display("\n\n===========================\n\nPress button 'Run All' (F3)\n\n===========================\n\n");
|
|
||||||
$stop();
|
|
||||||
clk_i = '0;
|
clk_i = '0;
|
||||||
exception_i = '0;
|
exception_i = '0;
|
||||||
mret_i = '0;
|
mret_i = '0;
|
||||||
@@ -383,9 +381,21 @@ endtask
|
|||||||
//logic irq, irq_ret;
|
//logic irq, irq_ret;
|
||||||
|
|
||||||
task error_info(irq, irq_ret);
|
task error_info(irq, irq_ret);
|
||||||
if (irq_o!==irq) begin $error("invalid irq_o = %b, expected value %b." , $sampled(irq_o ), irq ); err_count++; end
|
if (irq_o!==irq) begin $error("invalid irq_o = %1b, expected value %b." , $sampled(irq_o ), irq ); err_count++; end
|
||||||
if (irq_ret_o!==irq_ret) begin $error("invalid irq_ret_o = %b, expected value %b." , $sampled(irq_ret_o), irq_ret); err_count++; end
|
if (irq_ret_o!==irq_ret) begin $error("invalid irq_ret_o = %1b, expected value %b." , $sampled(irq_ret_o), irq_ret); err_count++; end
|
||||||
if (irq_cause_o!==32'h8000_0010) begin $error("invalid irq_cause_o = %h, expected value 32'h8000_0010.", $sampled(irq_cause_o) ); err_count++; end
|
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
|
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
|
endmodule
|
||||||
|
|||||||
Reference in New Issue
Block a user