|
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
//// ////
|
|
//// ////
|
|
//// This file is part of the project ////
|
|
//// "instruction_list_pipelined_processor_with_peripherals" ////
|
|
//// ////
|
|
//// http://opencores.org/project,instruction_list_pipelined_processor_with_peripherals ////
|
|
//// ////
|
|
//// ////
|
|
//// Author: ////
|
|
//// - Mahesh Sukhdeo Palve ////
|
|
//// ////
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
//// ////
|
|
//// ////
|
|
//// ////
|
|
//// This source file may be used and distributed without ////
|
|
//// restriction provided that this copyright statement is not ////
|
|
//// removed from the file and that any derivative work contains ////
|
|
//// the original copyright notice and the associated disclaimer. ////
|
|
//// ////
|
|
//// This source file is free software; you can redistribute it ////
|
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
|
//// Public License as published by the Free Software Foundation; ////
|
|
//// either version 2.1 of the License, or (at your option) any ////
|
|
//// later version. ////
|
|
//// ////
|
|
//// This source is distributed in the hope that it will be ////
|
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
|
//// details. ////
|
|
//// ////
|
|
//// You should have received a copy of the GNU Lesser General ////
|
|
//// Public License along with this source; if not, download it ////
|
|
//// from http://www.opencores.org/lgpl.shtml ////
|
|
//// ////
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
`include "timescale.v"
|
`include "timescale.v"
|
`include "defines.v"
|
`include "defines.v"
|
|
|
|
|
module accumulatorMUX (accMuxSel, immData, aluOut
|
module accumulatorMUX (accMuxSel, immData, aluOut
|
`ifdef timerAndCounter_peripheral
|
`ifdef timerAndCounter_peripheral
|
, tcLoadIn, tcAccIn
|
, tcLoadIn, tcAccIn
|
`endif
|
`endif
|
`ifdef UART_peripheral
|
`ifdef UART_peripheral
|
, uartDataIn, uartStatIn
|
, uartDataIn, uartStatIn
|
`endif
|
`endif
|
`ifdef SPI_peripheral
|
`ifdef SPI_peripheral
|
, spiStatIn, spiBufIn
|
, spiStatIn, spiBufIn
|
`endif
|
`endif
|
, accMuxOut
|
, accMuxOut
|
);
|
);
|
|
|
input [`accMuxSelLen-1:0] accMuxSel;
|
input [`accMuxSelLen-1:0] accMuxSel;
|
input [`immDataLen-1:0] immData;
|
input [`immDataLen-1:0] immData;
|
input [7:0] aluOut;
|
input [7:0] aluOut;
|
`ifdef timerAndCounter_peripheral
|
`ifdef timerAndCounter_peripheral
|
input [7:0] tcLoadIn, tcAccIn;
|
input [7:0] tcLoadIn, tcAccIn;
|
`endif
|
`endif
|
`ifdef UART_peripheral
|
`ifdef UART_peripheral
|
input [7:0] uartDataIn, uartStatIn;
|
input [7:0] uartDataIn, uartStatIn;
|
`endif
|
`endif
|
`ifdef SPI_peripheral
|
`ifdef SPI_peripheral
|
input [7:0] spiStatIn, spiBufIn;
|
input [7:0] spiStatIn, spiBufIn;
|
`endif
|
`endif
|
|
|
output [7:0] accMuxOut;
|
output [7:0] accMuxOut;
|
|
|
reg [7:0] accMuxOut;
|
reg [7:0] accMuxOut;
|
|
|
|
|
always @ *
|
always @ *
|
begin
|
begin
|
|
|
case (accMuxSel)
|
case (accMuxSel)
|
|
|
`accMuxSelImmData : begin
|
`accMuxSelImmData : begin
|
accMuxOut = immData;
|
accMuxOut = immData;
|
end
|
end
|
|
|
`accMuxSelAluOut : begin
|
`accMuxSelAluOut : begin
|
accMuxOut = aluOut;
|
accMuxOut = aluOut;
|
end
|
end
|
|
|
`ifdef timerAndCounter_peripheral
|
`ifdef timerAndCounter_peripheral
|
`accMuxSelTcLoad : begin
|
`accMuxSelTcLoad : begin
|
accMuxOut = tcLoadIn;
|
accMuxOut = tcLoadIn;
|
end
|
end
|
|
|
`accMuxSelTcAcc : begin
|
`accMuxSelTcAcc : begin
|
accMuxOut = tcAccIn;
|
accMuxOut = tcAccIn;
|
end
|
end
|
`endif
|
`endif
|
|
|
`ifdef UART_peripheral
|
`ifdef UART_peripheral
|
`accMuxSelUartData : begin
|
`accMuxSelUartData : begin
|
accMuxOut = uartDataIn;
|
accMuxOut = uartDataIn;
|
end
|
end
|
|
|
`accMuxSelUartStat : begin
|
`accMuxSelUartStat : begin
|
accMuxOut = uartStatIn;
|
accMuxOut = uartStatIn;
|
end
|
end
|
`endif
|
`endif
|
|
|
`ifdef SPI_peripheral
|
`ifdef SPI_peripheral
|
`accMuxSelSpiStat : begin
|
`accMuxSelSpiStat : begin
|
accMuxOut = spiStatIn;
|
accMuxOut = spiStatIn;
|
end
|
end
|
|
|
`accMuxSelSpiBuf : begin
|
`accMuxSelSpiBuf : begin
|
accMuxOut = spiBufIn;
|
accMuxOut = spiBufIn;
|
end
|
end
|
`endif
|
`endif
|
|
|
|
|
default : begin
|
default : begin
|
accMuxOut = 8'bzzzzzzzz;
|
accMuxOut = 8'bzzzzzzzz;
|
end
|
end
|
|
|
endcase
|
endcase
|
|
|
end
|
end
|
|
|
|
|
endmodule
|
endmodule
|
|
|