OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [bench/] [verilog/] [or1200_monitor.v] - Diff between revs 477 and 485

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 477 Rev 485
Line 35... Line 35...
////                                                              ////
////                                                              ////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
 
 
`include "timescale.v"
`include "timescale.v"
`include "or1200_defines.v"
`include "or1200_defines.v"
`include "orpsoc-testbench-defines.v"
`include "or1200_monitor_defines.v"
`include "test-defines.v"
`include "test-defines.v"
 
 
//
 
// Top of TB
 
//
 
`define TB_TOP orpsoc_testbench
 
 
 
//
 
// Top of DUT
 
//
 
`define DUT_TOP `TB_TOP.dut
 
 
 
//
 
// Top of OR1200 inside test bench
 
//
 
`define OR1200_TOP `DUT_TOP.or1200_top0
 
 
 
//
 
// Define to enable lookup file generation
 
//
 
//`define OR1200_MONITOR_LOOKUP
 
 
 
//
 
// Define to enable SPR access log file generation
 
//
 
//`define OR1200_MONITOR_SPRS
 
 
 
//
 
// Enable logging of state during execution
 
//
 
//`define OR1200_MONITOR_EXEC_STATE
 
 
 
//
 
// Enable disassembly of instructions in execution state log
 
//
 
//`define OR1200_MONITOR_EXEC_LOG_DISASSEMBLY
 
 
 
//
 
// Enable verbose report l.nops (to both general log file and stdout)
 
//
 
`define OR1200_MONITOR_VERBOSE_NOPS
 
 
 
//
 
// Enable monitoring of control and execution flow (experimental)
 
//
 
//`define OR1200_SYSTEM_CHECKER
 
 
 
// Can either individually enable things above, or usually have the scripts
 
// running the simulation pass the PROCESSOR_MONITOR_ENABLE_LOGS define to
 
// enable them all.
 
 
 
`ifdef PROCESSOR_MONITOR_ENABLE_LOGS
 
 `define OR1200_MONITOR_EXEC_STATE
 
 `define OR1200_MONITOR_SPRS
 
 `define OR1200_MONITOR_LOOKUP
 
`endif
 
 
 
//
 
// Memory coherence checking (double check instruction in fetch stage against
 
// what is in memory.) Useful for cache controller development.
 
//
 
//`define MEM_COHERENCE_CHECK
 
 
 
//
 
// Top of OR1200 inside test bench
 
//
 
`define CPU or1200
 
`define CPU_cpu or1200_cpu
 
`define CPU_rf or1200_rf
 
`define CPU_except or1200_except
 
`define CPU_ctrl or1200_ctrl
 
`define CPU_sprs or1200_sprs
 
`define CPU_immu_top or1200_immu_top
 
`define CPU_immu_tlb or1200_immu_tlb
 
`define CPU_CORE_CLK `OR1200_TOP.`CPU_cpu.`CPU_ctrl.clk
 
 
 
 
 
`define OR1K_OPCODE_POS 31:26
 
`define OR1K_J_BR_IMM_POS 25:0
 
`define OR1K_RD_POS 25:21
 
`define OR1K_RA_POS 20:16
 
`define OR1K_RB_POS 15:11
 
`define OR1K_ALU_OP_POS 3:0
 
 
 
`define OR1K_SHROT_OP_POS 7:6
 
`define OR1K_SHROTI_IMM_POS 5:0
 
`define OR1K_SF_OP 25:21
 
 
 
`define OR1K_XSYNC_OP_POS 25:21
 
 
 
 
 
module or1200_monitor;
module or1200_monitor;
 
 
   integer fexe;
   integer fexe;
   integer finsn;
   integer finsn;
Line 278... Line 190...
 
 
              $fdisplay(fgeneral, "PC\t\tINSTR");
              $fdisplay(fgeneral, "PC\t\tINSTR");
              for(i=`OR1200_MONITOR_CRASH_TRACE_SIZE-1;i>=0;i=i-1) begin
              for(i=`OR1200_MONITOR_CRASH_TRACE_SIZE-1;i>=0;i=i-1) begin
                 $fdisplay(fgeneral, "%h\t%h",addr_trace[i], insn_trace[i]);
                 $fdisplay(fgeneral, "%h\t%h",addr_trace[i], insn_trace[i]);
              end
              end
 
              $display("*");
 
              $display("* or1200_monitor : OR1200 crash detected (suspected CPU PC corruption)");
 
              $display("*");
 
 
              #100 $finish;
              #100 $finish;
           end
           end
         else
         else
           begin
           begin
              for(i=`OR1200_MONITOR_CRASH_TRACE_SIZE-1;i>0;i=i-1) begin
              for(i=`OR1200_MONITOR_CRASH_TRACE_SIZE-1;i>0;i=i-1) begin

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.