Line 29... |
Line 29... |
//
|
//
|
// *Author(s):
|
// *Author(s):
|
// - Olivier Girard, olgirard@gmail.com
|
// - Olivier Girard, olgirard@gmail.com
|
//
|
//
|
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
// $Rev: 34 $
|
// $Rev: 101 $
|
// $LastChangedBy: olivier.girard $
|
// $LastChangedBy: olivier.girard $
|
// $LastChangedDate: 2009-12-29 20:10:34 +0100 (Tue, 29 Dec 2009) $
|
// $LastChangedDate: 2011-03-04 21:17:50 +0100 (Fri, 04 Mar 2011) $
|
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
`include "timescale.v"
|
`include "timescale.v"
|
`include "openMSP430_defines.v"
|
`include "openMSP430_defines.v"
|
|
|
module omsp_alu (
|
module omsp_alu (
|
Line 145... |
Line 145... |
wire [15:0] op_src_inv = {16{op_src_inv_cmd}} ^ op_src;
|
wire [15:0] op_src_inv = {16{op_src_inv_cmd}} ^ op_src;
|
|
|
|
|
// Mask the bit 8 for the Byte instructions for correct flags generation
|
// Mask the bit 8 for the Byte instructions for correct flags generation
|
wire op_bit8_msk = ~exec_cycle | ~inst_bw;
|
wire op_bit8_msk = ~exec_cycle | ~inst_bw;
|
wire [16:0] op_src_in = {1'b0, op_src_inv[15:9], op_src_inv[8] & op_bit8_msk, op_src_inv[7:0]};
|
wire [16:0] op_src_in = {1'b0, {op_src_inv[15:8] & {8{op_bit8_msk}}}, op_src_inv[7:0]};
|
wire [16:0] op_dst_in = {1'b0, op_dst[15:9], op_dst[8] & op_bit8_msk, op_dst[7:0]};
|
wire [16:0] op_dst_in = {1'b0, {op_dst[15:8] & {8{op_bit8_msk}}}, op_dst[7:0]};
|
|
|
// Clear the source operand (= jump offset) for conditional jumps
|
// Clear the source operand (= jump offset) for conditional jumps
|
wire jmp_not_taken = (inst_jmp[`JL] & ~(status[3]^status[2])) |
|
wire jmp_not_taken = (inst_jmp[`JL] & ~(status[3]^status[2])) |
|
(inst_jmp[`JGE] & (status[3]^status[2])) |
|
(inst_jmp[`JGE] & (status[3]^status[2])) |
|
(inst_jmp[`JN] & ~status[2]) |
|
(inst_jmp[`JN] & ~status[2]) |
|