Line 29... |
Line 29... |
//
|
//
|
// *Author(s):
|
// *Author(s):
|
// - Olivier Girard, olgirard@gmail.com
|
// - Olivier Girard, olgirard@gmail.com
|
//
|
//
|
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
// $Rev: 103 $
|
// $Rev: 106 $
|
// $LastChangedBy: olivier.girard $
|
// $LastChangedBy: olivier.girard $
|
// $LastChangedDate: 2011-03-05 15:44:48 +0100 (Sat, 05 Mar 2011) $
|
// $LastChangedDate: 2011-03-25 23:01:03 +0100 (Fri, 25 Mar 2011) $
|
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
`ifdef OMSP_NO_INCLUDE
|
`ifdef OMSP_NO_INCLUDE
|
`else
|
`else
|
`include "openMSP430_defines.v"
|
`include "openMSP430_defines.v"
|
`endif
|
`endif
|
Line 51... |
Line 51... |
eu_mdb_in, // Execution Unit Memory data bus input
|
eu_mdb_in, // Execution Unit Memory data bus input
|
fe_mdb_in, // Frontend Memory data bus input
|
fe_mdb_in, // Frontend Memory data bus input
|
fe_pmem_wait, // Frontend wait for Instruction fetch
|
fe_pmem_wait, // Frontend wait for Instruction fetch
|
per_addr, // Peripheral address
|
per_addr, // Peripheral address
|
per_din, // Peripheral data input
|
per_din, // Peripheral data input
|
per_wen, // Peripheral write enable (high active)
|
per_we, // Peripheral write enable (high active)
|
per_en, // Peripheral enable (high active)
|
per_en, // Peripheral enable (high active)
|
pmem_addr, // Program Memory address
|
pmem_addr, // Program Memory address
|
pmem_cen, // Program Memory chip enable (low active)
|
pmem_cen, // Program Memory chip enable (low active)
|
pmem_din, // Program Memory data input (optional)
|
pmem_din, // Program Memory data input (optional)
|
pmem_wen, // Program Memory write enable (low active) (optional)
|
pmem_wen, // Program Memory write enable (low active) (optional)
|
Line 89... |
Line 89... |
output [15:0] eu_mdb_in; // Execution Unit Memory data bus input
|
output [15:0] eu_mdb_in; // Execution Unit Memory data bus input
|
output [15:0] fe_mdb_in; // Frontend Memory data bus input
|
output [15:0] fe_mdb_in; // Frontend Memory data bus input
|
output fe_pmem_wait; // Frontend wait for Instruction fetch
|
output fe_pmem_wait; // Frontend wait for Instruction fetch
|
output [7:0] per_addr; // Peripheral address
|
output [7:0] per_addr; // Peripheral address
|
output [15:0] per_din; // Peripheral data input
|
output [15:0] per_din; // Peripheral data input
|
output [1:0] per_wen; // Peripheral write enable (high active)
|
output [1:0] per_we; // Peripheral write enable (high active)
|
output per_en; // Peripheral enable (high active)
|
output per_en; // Peripheral enable (high active)
|
output [`PMEM_MSB:0] pmem_addr; // Program Memory address
|
output [`PMEM_MSB:0] pmem_addr; // Program Memory address
|
output pmem_cen; // Program Memory chip enable (low active)
|
output pmem_cen; // Program Memory chip enable (low active)
|
output [15:0] pmem_din; // Program Memory data input (optional)
|
output [15:0] pmem_din; // Program Memory data input (optional)
|
output [1:0] pmem_wen; // Program Memory write enable (low active) (optional)
|
output [1:0] pmem_wen; // Program Memory write enable (low active) (optional)
|
Line 175... |
Line 175... |
wire dbg_per_en = dbg_mem_en & (dbg_mem_addr[15:9]==7'h00);
|
wire dbg_per_en = dbg_mem_en & (dbg_mem_addr[15:9]==7'h00);
|
wire eu_per_en = eu_mb_en & (eu_mab[14:8]==7'h00);
|
wire eu_per_en = eu_mb_en & (eu_mab[14:8]==7'h00);
|
|
|
wire [7:0] per_addr = dbg_mem_en ? dbg_mem_addr[8:1] : eu_mab[7:0];
|
wire [7:0] per_addr = dbg_mem_en ? dbg_mem_addr[8:1] : eu_mab[7:0];
|
wire [15:0] per_din = dbg_mem_en ? dbg_mem_dout : eu_mdb_out;
|
wire [15:0] per_din = dbg_mem_en ? dbg_mem_dout : eu_mdb_out;
|
wire [1:0] per_wen = dbg_mem_en ? dbg_mem_wr : eu_mb_wr;
|
wire [1:0] per_we = dbg_mem_en ? dbg_mem_wr : eu_mb_wr;
|
wire per_en = dbg_mem_en ? dbg_per_en : eu_per_en;
|
wire per_en = dbg_mem_en ? dbg_per_en : eu_per_en;
|
|
|
reg [15:0] per_dout_val;
|
reg [15:0] per_dout_val;
|
always @ (posedge mclk or posedge puc)
|
always @ (posedge mclk or posedge puc)
|
if (puc) per_dout_val <= 16'h0000;
|
if (puc) per_dout_val <= 16'h0000;
|
Line 229... |
Line 229... |
|
|
// Debug interface data Mux
|
// Debug interface data Mux
|
//---------------------------------
|
//---------------------------------
|
|
|
// Select between peripherals, RAM and ROM
|
// Select between peripherals, RAM and ROM
|
|
`ifdef DBG_EN
|
reg [1:0] dbg_mem_din_sel;
|
reg [1:0] dbg_mem_din_sel;
|
always @(posedge mclk or posedge puc)
|
always @(posedge mclk or posedge puc)
|
if (puc) dbg_mem_din_sel <= 2'b00;
|
if (puc) dbg_mem_din_sel <= 2'b00;
|
else dbg_mem_din_sel <= {~dbg_pmem_cen, dbg_per_en};
|
else dbg_mem_din_sel <= {~dbg_pmem_cen, dbg_per_en};
|
|
|
|
`else
|
|
wire [1:0] dbg_mem_din_sel = 2'b00;
|
|
`endif
|
|
|
// Mux
|
// Mux
|
assign dbg_mem_din = dbg_mem_din_sel[1] ? pmem_dout :
|
assign dbg_mem_din = dbg_mem_din_sel[1] ? pmem_dout :
|
dbg_mem_din_sel[0] ? per_dout_val : dmem_dout;
|
dbg_mem_din_sel[0] ? per_dout_val : dmem_dout;
|
|
|
|
|