I have a Simulink Enabled subsytem, with the input directly driving the output.
A previous HDL coder generation a few years ago using Matlab 2019b generated this code:
module Enabled_block
(CLK_DSP_DFT,
RST_DSP_DFT_N,
In1,
Enable,
Out1);
input CLK_DSP_DFT;
input RST_DSP_DFT_N;
input signed [21:0] In1; // sfix13
input Enable;
output signed [21:0] Out1; // sfix13
wire Enable_out2;
reg signed [21:0] In1_hold; // sfix13
assign Enable_out2 = Enable;
always @(posedge CLK_DSP_DFT or negedge RST_DSP_DFT_N)
begin : Out1_hold_process
if (RST_DSP_DFT_N == 1'b0) begin
In1_hold <= 22'sb0000000000000000000000;
end
else begin
if (Enable_out2) begin
In1_hold <= In1;
end
end
end
assign Out1 = In1_hold;
endmodule // Enabled_block
Using the same block with HDL coder on 2020a today I get this:
module Enabled_block
(CLK_DSP_DFT,
RST_DSP_DFT_N,
In1,
Enable,
Out1);
input CLK_DSP_DFT;
input RST_DSP_DFT_N;
input signed [12:0] In1; // sfix13
input Enable;
output signed [12:0] Out1; // sfix13
wire Enable_out2;
wire signed [12:0] In1_bypass; // sfix13
reg signed [12:0] In1_last_value; // sfix13
assign Enable_out2 = Enable;
always @(posedge CLK_DSP_DFT or negedge RST_DSP_DFT_N)
begin : Out1_bypass_process
if (RST_DSP_DFT_N == 1'b0) begin
In1_last_value <= 13'sb0000000000000;
end
else begin
if (Enable_out2) begin
In1_last_value <= In1_bypass;
end
end
end
assign In1_bypass = (Enable == 1'b0 ? In1_last_value :
In1);
assign Out1 = In1_bypass;
endmodule // Enabled_block
The current HDL code from 2020a has a bypass system put in place. I want the code generated from 2020a to match what was generated previously. I've tried everything I can find that I think would make a difference, but I can't get the bypass to go away and be left with just an enabled hold signal. I don't have access to the orgianal designer and person who generated the previous code.
Does anyone know how to get the bypass to go away?