Line 124... |
Line 124... |
|
|
|
|
// Test NMI falling edge
|
// Test NMI falling edge
|
//--------------------------
|
//--------------------------
|
@(r15==16'h3000);
|
@(r15==16'h3000);
|
|
`ifdef WATCHDOG
|
$display(" Test NMI falling edge");
|
$display(" Test NMI falling edge");
|
|
`else
|
|
$display(" Skip NMI falling edge (Watchdog is not included)");
|
|
`endif
|
|
|
@(r15==16'h3001);
|
@(r15==16'h3001);
|
|
|
#(2000);
|
#(2000);
|
inst_cnt = 0;
|
inst_cnt = 0;
|
Line 136... |
Line 140... |
if (inst_cnt !==16'h0000) tb_error("====== NMI falling edge: CPU is not sleeping =====");
|
if (inst_cnt !==16'h0000) tb_error("====== NMI falling edge: CPU is not sleeping =====");
|
#(2000);
|
#(2000);
|
nmi = 1'b1;
|
nmi = 1'b1;
|
|
|
#(2000);
|
#(2000);
|
|
`ifdef WATCHDOG
|
if (r6 !==16'h0000) tb_error("====== NMI falling edge: NMI irq was taken with rising edge =====");
|
if (r6 !==16'h0000) tb_error("====== NMI falling edge: NMI irq was taken with rising edge =====");
|
if (inst_cnt !==16'h0000) tb_error("====== NMI falling edge: CPU is not sleeping =====");
|
if (inst_cnt !==16'h0000) tb_error("====== NMI falling edge: CPU is not sleeping =====");
|
#(2000);
|
#(2000);
|
if (inst_cnt !==16'h0000) tb_error("====== NMI falling edge: CPU is not sleeping =====");
|
if (inst_cnt !==16'h0000) tb_error("====== NMI falling edge: CPU is not sleeping =====");
|
|
`else
|
|
#(2000);
|
|
`endif
|
#(2000);
|
#(2000);
|
nmi = 1'b0;
|
nmi = 1'b0;
|
|
|
#(2000);
|
#(2000);
|
if (r6 !==16'h0001) tb_error("====== NMI falling edge: NMI irq was not taken first time =====");
|
if (r6 !==16'h0001) tb_error("====== NMI falling edge: NMI irq was not taken first time =====");
|
Line 153... |
Line 161... |
if (inst_cnt !==16'h0000) tb_error("====== NMI falling edge: CPU is not sleeping =====");
|
if (inst_cnt !==16'h0000) tb_error("====== NMI falling edge: CPU is not sleeping =====");
|
#(2000);
|
#(2000);
|
nmi = 1'b1;
|
nmi = 1'b1;
|
|
|
#(2000);
|
#(2000);
|
|
`ifdef WATCHDOG
|
if (r6 !==16'h0001) tb_error("====== NMI falling edge: NMI irq was taken with rising edge =====");
|
if (r6 !==16'h0001) tb_error("====== NMI falling edge: NMI irq was taken with rising edge =====");
|
if (inst_cnt !==16'h0000) tb_error("====== NMI falling edge: CPU is not sleeping =====");
|
if (inst_cnt !==16'h0000) tb_error("====== NMI falling edge: CPU is not sleeping =====");
|
#(2000);
|
#(2000);
|
if (inst_cnt !==16'h0000) tb_error("====== NMI falling edge: CPU is not sleeping =====");
|
if (inst_cnt !==16'h0000) tb_error("====== NMI falling edge: CPU is not sleeping =====");
|
|
`else
|
|
#(2000);
|
|
`endif
|
#(2000);
|
#(2000);
|
nmi = 1'b0;
|
nmi = 1'b0;
|
|
|
#(2000);
|
#(2000);
|
if (r6 !==16'h0002) tb_error("====== NMI falling edge: NMI irq was not taken second time =====");
|
if (r6 !==16'h0002) tb_error("====== NMI falling edge: NMI irq was not taken second time =====");
|
Line 168... |
Line 180... |
inst_cnt = 0;
|
inst_cnt = 0;
|
#(2000);
|
#(2000);
|
if (inst_cnt ===16'h0000) tb_error("====== NMI falling edge: CPU is not out of LPM4 =====");
|
if (inst_cnt ===16'h0000) tb_error("====== NMI falling edge: CPU is not out of LPM4 =====");
|
#(2000);
|
#(2000);
|
|
|
|
|
// Test NMI nested from Maskable-IRQ
|
// Test NMI nested from Maskable-IRQ
|
//-----------------------------------
|
//-----------------------------------
|
@(r15==16'h4000);
|
@(r15==16'h4000);
|
$display(" Test NMI nested from Maskable-IRQ");
|
$display(" Test NMI nested from Maskable-IRQ");
|
|
|
Line 204... |
Line 215... |
`endif
|
`endif
|
|
|
stimulus_done = 1;
|
stimulus_done = 1;
|
end
|
end
|
|
|
|
|
No newline at end of file
|
No newline at end of file
|