2015-11-30 13:45:49 -05:00
|
|
|
module oh_mux4(/*AUTOARG*/
|
|
|
|
// Outputs
|
|
|
|
out,
|
|
|
|
// Inputs
|
|
|
|
in0, in1, in2, in3, sel0, sel1, sel2, sel3
|
|
|
|
);
|
|
|
|
|
|
|
|
parameter DW=99;
|
|
|
|
|
|
|
|
//data inputs
|
|
|
|
input [DW-1:0] in0;
|
|
|
|
input [DW-1:0] in1;
|
|
|
|
input [DW-1:0] in2;
|
|
|
|
input [DW-1:0] in3;
|
|
|
|
|
|
|
|
//select inputs
|
|
|
|
input sel0;
|
|
|
|
input sel1;
|
|
|
|
input sel2;
|
|
|
|
input sel3;
|
|
|
|
|
|
|
|
output [DW-1:0] out;
|
2016-01-11 17:35:15 -05:00
|
|
|
|
|
|
|
wire error;
|
2015-11-30 13:45:49 -05:00
|
|
|
|
|
|
|
|
|
|
|
assign out[DW-1:0] = ({(DW){sel0}} & in0[DW-1:0] |
|
|
|
|
{(DW){sel1}} & in1[DW-1:0] |
|
|
|
|
{(DW){sel2}} & in2[DW-1:0] |
|
|
|
|
{(DW){sel3}} & in3[DW-1:0]);
|
|
|
|
|
2016-01-11 17:35:15 -05:00
|
|
|
|
|
|
|
assign error = (sel0 | sel1 | sel2 | sel3) &
|
|
|
|
~(sel0 ^ sel1 ^ sel2 ^ sel3);
|
|
|
|
|
2016-02-12 11:04:52 -05:00
|
|
|
`ifdef TARGET_SIM
|
2016-01-11 17:35:15 -05:00
|
|
|
always @ (posedge error)
|
2016-01-16 14:43:14 -05:00
|
|
|
$display ("ERROR at in oh_mux4 %m at ",$time);
|
2016-02-12 11:04:52 -05:00
|
|
|
`endif
|
2016-01-11 17:35:15 -05:00
|
|
|
|
2015-11-30 13:45:49 -05:00
|
|
|
endmodule // oh_mux4
|
|
|
|
|