Line 50... |
Line 50... |
inst_number, // Instruction number since last system reset
|
inst_number, // Instruction number since last system reset
|
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
|
core_select // Core selection
|
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 66... |
Line 65... |
output [15:0] inst_pc; // Instruction Program counter
|
output [15:0] inst_pc; // Instruction Program counter
|
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 core_select; // Core selection
|
input puc_rst; // Main system reset
|
|
|
|
|
|
//=============================================================================
|
//=============================================================================
|
// 1) ASCII FORMATING FUNCTIONS
|
// 1) ASCII FORMATING FUNCTIONS
|
//=============================================================================
|
//=============================================================================
|
Line 110... |
Line 108... |
|
|
//=============================================================================
|
//=============================================================================
|
// 2) CONNECTIONS TO MSP430 CORE INTERNALS
|
// 2) CONNECTIONS TO MSP430 CORE INTERNALS
|
//=============================================================================
|
//=============================================================================
|
|
|
wire [2:0] i_state_bin = tb_openMSP430_fpga.dut.omsp_system_0_inst.openMSP430_0.frontend_0.i_state;
|
//-------------------------
|
wire [3:0] e_state_bin = tb_openMSP430_fpga.dut.omsp_system_0_inst.openMSP430_0.frontend_0.e_state;
|
// CPU 0
|
|
//-------------------------
|
|
wire [2:0] omsp0_i_state_bin = tb_openMSP430_fpga.dut.omsp_system_0_inst.openMSP430_0.frontend_0.i_state;
|
|
wire [3:0] omsp0_e_state_bin = tb_openMSP430_fpga.dut.omsp_system_0_inst.openMSP430_0.frontend_0.e_state;
|
|
|
|
wire omsp0_decode = tb_openMSP430_fpga.dut.omsp_system_0_inst.openMSP430_0.frontend_0.decode;
|
|
wire [15:0] omsp0_ir = tb_openMSP430_fpga.dut.omsp_system_0_inst.openMSP430_0.frontend_0.ir;
|
|
wire omsp0_irq_detect = tb_openMSP430_fpga.dut.omsp_system_0_inst.openMSP430_0.frontend_0.irq_detect;
|
|
wire [3:0] omsp0_irq_num = tb_openMSP430_fpga.dut.omsp_system_0_inst.openMSP430_0.frontend_0.irq_num;
|
|
wire [15:0] omsp0_pc = tb_openMSP430_fpga.dut.omsp_system_0_inst.openMSP430_0.frontend_0.pc;
|
|
|
|
wire omsp0_mclk = tb_openMSP430_fpga.dut.omsp_system_0_inst.mclk;
|
|
wire omsp0_puc_rst = tb_openMSP430_fpga.dut.omsp_system_0_inst.puc_rst;
|
|
|
|
//-------------------------
|
|
// CPU 1
|
|
//-------------------------
|
|
wire [2:0] omsp1_i_state_bin = tb_openMSP430_fpga.dut.omsp_system_1_inst.openMSP430_0.frontend_0.i_state;
|
|
wire [3:0] omsp1_e_state_bin = tb_openMSP430_fpga.dut.omsp_system_1_inst.openMSP430_0.frontend_0.e_state;
|
|
|
|
wire omsp1_decode = tb_openMSP430_fpga.dut.omsp_system_1_inst.openMSP430_0.frontend_0.decode;
|
|
wire [15:0] omsp1_ir = tb_openMSP430_fpga.dut.omsp_system_1_inst.openMSP430_0.frontend_0.ir;
|
|
wire omsp1_irq_detect = tb_openMSP430_fpga.dut.omsp_system_1_inst.openMSP430_0.frontend_0.irq_detect;
|
|
wire [3:0] omsp1_irq_num = tb_openMSP430_fpga.dut.omsp_system_1_inst.openMSP430_0.frontend_0.irq_num;
|
|
wire [15:0] omsp1_pc = tb_openMSP430_fpga.dut.omsp_system_1_inst.openMSP430_0.frontend_0.pc;
|
|
|
|
wire omsp1_mclk = tb_openMSP430_fpga.dut.omsp_system_1_inst.mclk;
|
|
wire omsp1_puc_rst = tb_openMSP430_fpga.dut.omsp_system_1_inst.puc_rst;
|
|
|
|
//-------------------------
|
|
// CPU Selection
|
|
//-------------------------
|
|
wire [2:0] i_state_bin = core_select ? omsp1_i_state_bin : omsp0_i_state_bin;
|
|
wire [3:0] e_state_bin = core_select ? omsp1_e_state_bin : omsp0_e_state_bin;
|
|
|
|
wire decode = core_select ? omsp1_decode : omsp0_decode;
|
|
wire [15:0] ir = core_select ? omsp1_ir : omsp0_ir;
|
|
wire irq_detect = core_select ? omsp1_irq_detect : omsp0_irq_detect;
|
|
wire [3:0] irq_num = core_select ? omsp1_irq_num : omsp0_irq_num;
|
|
wire [15:0] pc = core_select ? omsp1_pc : omsp0_pc;
|
|
|
wire decode = tb_openMSP430_fpga.dut.omsp_system_0_inst.openMSP430_0.frontend_0.decode;
|
wire mclk = core_select ? omsp1_mclk : omsp0_mclk;
|
wire [15:0] ir = tb_openMSP430_fpga.dut.omsp_system_0_inst.openMSP430_0.frontend_0.ir;
|
wire puc_rst = core_select ? omsp1_puc_rst : omsp0_puc_rst;
|
wire irq_detect = tb_openMSP430_fpga.dut.omsp_system_0_inst.openMSP430_0.frontend_0.irq_detect;
|
|
wire [3:0] irq_num = tb_openMSP430_fpga.dut.omsp_system_0_inst.openMSP430_0.frontend_0.irq_num;
|
|
wire [15:0] pc = tb_openMSP430_fpga.dut.omsp_system_0_inst.openMSP430_0.frontend_0.pc;
|
|
|
|
|
|
//=============================================================================
|
//=============================================================================
|
// 3) GENERATE DEBUG SIGNALS
|
// 3) GENERATE DEBUG SIGNALS
|
//=============================================================================
|
//=============================================================================
|