Line 43... |
Line 43... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.1 2002/01/14 06:19:35 lampret
|
|
// Added debug model for testing du. Updated or1200_monitor.
|
|
//
|
//
|
//
|
//
|
//
|
|
|
`include "dbg_defines.v"
|
`include "dbg_defines.v"
|
|
|
Line 167... |
Line 170... |
wr_reg((6 << 11) + 20, 32'h2000);
|
wr_reg((6 << 11) + 20, 32'h2000);
|
|
|
// Set NPC
|
// Set NPC
|
wr_npc(32'h8000_0004);
|
wr_npc(32'h8000_0004);
|
|
|
// Set DMR1[ST]
|
// Set step-bit (DMR1[ST])
|
wr_reg((6 << 11) + 16, 1 << 22);
|
wr_reg((6 << 11) + 16, 1 << 22);
|
|
|
// Single-step
|
// Single-step
|
for (i = 1; i < 10; i = i + 1)
|
for (i = 1; i < 10; i = i + 1)
|
unstall;
|
unstall;
|
Line 346... |
Line 349... |
|
|
$display("Read npc = %h ppc = %h r1 = %h", npc, ppc, r1);
|
$display("Read npc = %h ppc = %h r1 = %h", npc, ppc, r1);
|
$display("Expected npc = %h ppc = %h r1 = %h\n", 32'h80000010, 32'h8000000c, 99);
|
$display("Expected npc = %h ppc = %h r1 = %h\n", 32'h80000010, 32'h8000000c, 99);
|
result = npc + ppc + r1 + result;
|
result = npc + ppc + r1 + result;
|
|
|
$display("result = %h\n", result + 32'h5eaddc4b);
|
// Set step-bit (DMR1[ST])
|
|
wr_reg((6 << 11) + 16, 1 << 22);
|
|
|
|
// Single-step
|
|
for (i = 0; i < 5; i = i + 1)
|
|
unstall;
|
|
|
|
/* Read NPC */
|
|
rd_reg((0 << 11) + 16, npc);
|
|
|
|
/* Read PPC */
|
|
rd_reg((0 << 11) + 18, ppc);
|
|
|
|
/* Read R1 */
|
|
rd_reg(32'h401, r1);
|
|
|
|
$display("Read npc = %h ppc = %h r1 = %h", npc, ppc, r1);
|
|
$display("Expected npc = %h ppc = %h r1 = %h\n", 32'h80000024, 32'h80000020, 101);
|
|
result = npc + ppc + r1 + result;
|
|
|
|
/* Set PC */
|
|
wr_npc(32'h8000_0020);
|
|
|
|
// Single-step
|
|
for (i = 0; i < 2; i = i + 1)
|
|
unstall;
|
|
|
|
/* Read NPC */
|
|
rd_reg((0 << 11) + 16, npc);
|
|
|
|
/* Read PPC */
|
|
rd_reg((0 << 11) + 18, ppc);
|
|
|
|
/* Read R1 */
|
|
rd_reg(32'h401, r1);
|
|
|
|
$display("Read npc = %h ppc = %h r1 = %h", npc, ppc, r1);
|
|
$display("Expected npc = %h ppc = %h r1 = %h\n", 32'h8000000c, 32'h80000024, 201);
|
|
result = npc + ppc + r1 + result;
|
|
|
|
$display("result = %h\n", result + 32'h5eaddaa9);
|
|
|
#100 $finish;
|
#100 $finish;
|
end
|
end
|
|
|
task stall;
|
task stall;
|