Line 29... |
Line 29... |
//
|
//
|
// *Author(s):
|
// *Author(s):
|
// - Olivier Girard, olgirard@gmail.com
|
// - Olivier Girard, olgirard@gmail.com
|
//
|
//
|
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
// $Rev: 37 $
|
// $Rev: 104 $
|
// $LastChangedBy: olivier.girard $
|
// $LastChangedBy: olivier.girard $
|
// $LastChangedDate: 2009-12-29 21:58:14 +0100 (Tue, 29 Dec 2009) $
|
// $LastChangedDate: 2011-03-06 21:02:27 +0100 (Sun, 06 Mar 2011) $
|
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
`include "timescale.v"
|
`ifdef OMSP_NO_INCLUDE
|
|
`else
|
`include "openMSP430_defines.v"
|
`include "openMSP430_defines.v"
|
|
`endif
|
|
|
module omsp_alu (
|
module omsp_alu (
|
|
|
// OUTPUTs
|
// OUTPUTs
|
alu_out, // ALU output value
|
alu_out, // ALU output value
|
Line 145... |
Line 147... |
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]) |
|
Line 243... |
Line 245... |
assign alu_stat_wr = (inst_alu[`ALU_STAT_F] & exec_cycle) ? 4'b1111 : 4'b0000;
|
assign alu_stat_wr = (inst_alu[`ALU_STAT_F] & exec_cycle) ? 4'b1111 : 4'b0000;
|
|
|
|
|
endmodule // omsp_alu
|
endmodule // omsp_alu
|
|
|
|
`ifdef OMSP_NO_INCLUDE
|
|
`else
|
`include "openMSP430_undefines.v"
|
`include "openMSP430_undefines.v"
|
|
`endif
|
|
|
No newline at end of file
|
No newline at end of file
|