K
Kevin Neilson
Guest
I'm posting this here for my own future reference.
If you infer a mux with fewer than 2**n inputs, Vivado won't infer the F7 or F8 muxes. Here is the trick to make sure you get the best synthesis.
Example, 5-input mux:
wire [7:0] mux_inputs[0:4]; // only 5 inputs
wire [7:0] mux_out;
wire [2:0] mux_sel;
always@(posedge clk)
if (mux_sel<5)
mux_out <= mux_inputs[mux_sel];
else
mux_out <= 'bx; // assign rest of 2**3-5 inputs to don't-care
Keywords: f7, f8, multiplexer, Vivado
If you infer a mux with fewer than 2**n inputs, Vivado won't infer the F7 or F8 muxes. Here is the trick to make sure you get the best synthesis.
Example, 5-input mux:
wire [7:0] mux_inputs[0:4]; // only 5 inputs
wire [7:0] mux_out;
wire [2:0] mux_sel;
always@(posedge clk)
if (mux_sel<5)
mux_out <= mux_inputs[mux_sel];
else
mux_out <= 'bx; // assign rest of 2**3-5 inputs to don't-care
Keywords: f7, f8, multiplexer, Vivado