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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [bench/] [verilog/] [vpi/] [verilog/] [vpi_debug_module.v] - Diff between revs 46 and 49

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

Rev 46 Rev 49
Line 200... Line 200...
             `CMD_CPU_WR_REG :
             `CMD_CPU_WR_REG :
               begin
               begin
 
 
                  $get_command_address(cmd_adr);
                  $get_command_address(cmd_adr);
 
 
                  $get_command_data(cmd_data);
                  $get_command_data(block_cmd_length);
 
 
 
                  $get_command_block_data(block_cmd_length, data_storage);
 
 
 
                  if (block_cmd_length > 4)
 
                    cpu_write_block(cmd_adr, block_cmd_length);
 
                  else
 
                    begin
 
                       cmd_data = data_storage[0]; // Get the single word we'll write
 
                       cpu_write_32(cmd_data, cmd_adr,16'h3);
`ifdef VPI_DEBUG_INFO
`ifdef VPI_DEBUG_INFO
                  $display("CPU reg write. adr: 0x%x (reg group: %d reg#: %d), val: 0x%x",
                  $display("CPU reg write. adr: 0x%x (reg group: %d reg#: %d), val: 0x%x",
                           cmd_adr,cmd_adr[15:11], cmd_adr[10:0], cmd_data);
                           cmd_adr,cmd_adr[15:11], cmd_adr[10:0], cmd_data);
`endif
`endif
 
                    end
 
 
 
 
                  cpu_write_32(cmd_data, cmd_adr,16'h3);
 
 
 
               end
               end
 
 
             `CMD_CPU_RD_REG :
             `CMD_CPU_RD_REG :
               begin
               begin
 
 
                  $get_command_address(cmd_adr);
                  $get_command_address(cmd_adr);
 
 
 
                  $get_command_data(block_cmd_length); // Added 090901 --jb
 
 
 
                  /* Depending on size, issue a block or single read */
 
                  if (block_cmd_length > 4 )
 
                    cpu_read_block(cmd_adr, block_cmd_length);
 
                  else
                  cpu_read_32(cmd_data, cmd_adr, 16'h3);
                  cpu_read_32(cmd_data, cmd_adr, 16'h3);
 
 
 
 
`ifdef VPI_DEBUG_INFO
`ifdef VPI_DEBUG_INFO
 
                  if (cmd_size > 4 )
 
                    $display("CPU reg read. block adr: 0x%x (reg group: %d reg#: %d), num: %d",
 
                                cmd_adr,cmd_adr[15:11], cmd_adr[10:0],  block_cmd_length);
 
                  else
                  $display("CPU reg read. adr: 0x%x (reg group: %d reg#: %d), val: 0x%x",
                  $display("CPU reg read. adr: 0x%x (reg group: %d reg#: %d), val: 0x%x",
                           cmd_adr,cmd_adr[15:11], cmd_adr[10:0], cmd_data);
                           cmd_adr,cmd_adr[15:11], cmd_adr[10:0], cmd_data);
`endif
`endif
 
 
                  $return_command_data(cmd_data);
 
 
                  $return_command_block_data(block_cmd_length, data_storage);
 
 
               end
               end
 
 
             `CMD_WB_WR :
             `CMD_WB_WR :
               begin
               begin
Line 1253... Line 1274...
           $display("WARNING: Only first data word is returned( See module %m.)");
           $display("WARNING: Only first data word is returned( See module %m.)");
 
 
      end
      end
   endtask
   endtask
 
 
 
   // block of 32-bit reads from cpu
 
   task cpu_read_block;
 
      //output [31:0] data;
 
      input [`DBG_WB_ADR_LEN -1:0] addr;
 
      input [`DBG_WB_LEN_LEN -1:0] length;
 
 
 
      reg [31:0]                    tmp;
 
 
 
      begin
 
         debug_cpu_wr_comm(`DBG_CPU_READ, addr, length-1, 1'b0);
 
 
 
         last_cpu_cmd = `DBG_CPU_READ;  last_cpu_cmd_text = "DBG_CPU_READ";
 
 
 
         length_global = length;
 
 
 
         debug_cpu_go(1'b0, 1'b0);
 
 
 
         //data = data_storage[0];
 
 
 
         //if (length>3)
 
         //  $display("WARNING: Only first data word is returned( See module %m.)");
 
 
 
      end
 
   endtask
 
 
 
 
   // 32-bit write to cpu
   // 32-bit write to cpu
   task cpu_write_32;
   task cpu_write_32;
      input [31:0] data;
      input [31:0] data;
Line 1274... Line 1319...
         if (length>3)
         if (length>3)
           $display("WARNING: Only first data word is stored for writting ( See module %m)");
           $display("WARNING: Only first data word is stored for writting ( See module %m)");
      end
      end
   endtask
   endtask
 
 
 
   // block of 32-bit writes to cpu
 
   // Data will already be in data_storage
 
   task cpu_write_block;
 
      //input [31:0] data;
 
      input [`DBG_WB_ADR_LEN -1:0] addr;
 
      input [`DBG_WB_LEN_LEN -1:0] length;
 
 
 
      reg [31:0]                    tmp;
 
 
 
      begin
 
         debug_cpu_wr_comm(`DBG_CPU_WRITE, addr, length-1, 1'b0);
 
         last_cpu_cmd = `DBG_CPU_WRITE;  last_cpu_cmd_text = "DBG_CPU_WRITE";
 
         length_global = length;
 
         debug_cpu_go(1'b0, 1'b0);
 
      end
 
   endtask
 
 
 
 
   task debug_cpu_wr_comm;
   task debug_cpu_wr_comm;
      input [`DBG_CPU_ACC_TYPE_LEN -1:0]  acc_type;
      input [`DBG_CPU_ACC_TYPE_LEN -1:0]  acc_type;
      input [`DBG_CPU_ADR_LEN -1:0]        addr;
      input [`DBG_CPU_ADR_LEN -1:0]        addr;

powered by: WebSVN 2.1.0

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