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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [fpga/] [actel_m1a3pl_dev_kit/] [bench/] [verilog/] [msp_debug.v] - Diff between revs 104 and 111

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

Rev 104 Rev 111
Line 51... Line 51...
    inst_pc,                       // Instruction Program counter
    inst_pc,                       // Instruction Program counter
    inst_short,                    // Currently executed instruction (short version)
    inst_short,                    // Currently executed instruction (short version)
 
 
// INPUTs
// INPUTs
    mclk,                          // Main system clock
    mclk,                          // Main system clock
    puc                            // Main system reset
    puc_rst                        // Main system reset
);
);
 
 
// OUTPUTs
// OUTPUTs
//============
//============
output  [8*32-1:0] e_state;        // Execution state
output  [8*32-1:0] e_state;        // Execution state
Line 67... Line 67...
output  [8*32-1:0] inst_short;     // Currently executed instruction (short version)
output  [8*32-1:0] inst_short;     // Currently executed instruction (short version)
 
 
// INPUTs
// INPUTs
//============
//============
input              mclk;           // Main system clock
input              mclk;           // Main system clock
input              puc;            // Main system reset
input              puc_rst;        // Main system reset
 
 
 
 
//=============================================================================
//=============================================================================
// 1) ASCII FORMATING FUNCTIONS
// 1) ASCII FORMATING FUNCTIONS
//=============================================================================
//=============================================================================
Line 169... Line 169...
 
 
// Count instruction number & cycles
// Count instruction number & cycles
//====================================
//====================================
 
 
reg [31:0]  inst_number;
reg [31:0]  inst_number;
always @(posedge mclk or posedge puc)
always @(posedge mclk or posedge puc_rst)
  if (puc)         inst_number  <= 0;
  if (puc_rst)     inst_number  <= 0;
  else if (decode) inst_number  <= inst_number+1;
  else if (decode) inst_number  <= inst_number+1;
 
 
reg [31:0]  inst_cycle;
reg [31:0]  inst_cycle;
always @(posedge mclk or posedge puc)
always @(posedge mclk or posedge puc_rst)
  if (puc)         inst_cycle <= 0;
  if (puc_rst)     inst_cycle <= 0;
  else if (decode) inst_cycle <= 0;
  else if (decode) inst_cycle <= 0;
  else             inst_cycle <= inst_cycle+1;
  else             inst_cycle <= inst_cycle+1;
 
 
 
 
// Decode instruction
// Decode instruction
//====================================
//====================================
 
 
// Buffer opcode
// Buffer opcode
reg [15:0]  opcode;
reg [15:0]  opcode;
always @(posedge mclk or posedge puc)
always @(posedge mclk or posedge puc_rst)
  if (puc)         opcode  <= 0;
  if (puc_rst)     opcode  <= 0;
  else if (decode) opcode  <= ir;
  else if (decode) opcode  <= ir;
 
 
// Interrupts
// Interrupts
reg irq;
reg irq;
always @(posedge mclk or posedge puc)
always @(posedge mclk or posedge puc_rst)
  if (puc)         irq     <= 1'b1;
  if (puc_rst)     irq     <= 1'b1;
  else if (decode) irq     <= irq_detect;
  else if (decode) irq     <= irq_detect;
 
 
// Instruction type
// Instruction type
reg [8*32-1:0] inst_type;
reg [8*32-1:0] inst_type;
always @(opcode or irq)
always @(opcode or irq)
Line 436... Line 436...
 
 
// Instruction program counter
// Instruction program counter
//================================
//================================
 
 
reg  [15:0] inst_pc;
reg  [15:0] inst_pc;
always @(posedge mclk or posedge puc)
always @(posedge mclk or posedge puc_rst)
  if (puc)         inst_pc  <=  16'h0000;
  if (puc_rst)     inst_pc  <=  16'h0000;
  else if (decode) inst_pc  <=  pc;
  else if (decode) inst_pc  <=  pc;
 
 
 
 
endmodule // msp_debug
endmodule // msp_debug
 
 

powered by: WebSVN 2.1.0

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