Add default case statements to avoid inferring latches

This commit is contained in:
Alex Forencich 2015-11-09 14:54:14 -08:00
parent 0d22a35bd8
commit 7a9fdb5fc3
8 changed files with 50 additions and 0 deletions

View File

@ -129,6 +129,10 @@ always @* begin
current_output_tready = output_{{p}}_axis_tready;
end
{%- endfor %}
default: begin
current_output_tvalid = 1'b0;
current_output_tready = 1'b0;
end
endcase
end

View File

@ -116,6 +116,10 @@ always @* begin
current_output_tvalid = output_3_axis_tvalid;
current_output_tready = output_3_axis_tready;
end
default: begin
current_output_tvalid = 1'b0;
current_output_tready = 1'b0;
end
endcase
end

View File

@ -133,6 +133,10 @@ always @* begin
current_output_tready = output_{{p}}_axis_tready;
end
{%- endfor %}
default: begin
current_output_tvalid = 1'b0;
current_output_tready = 1'b0;
end
endcase
end

View File

@ -123,6 +123,10 @@ always @* begin
current_output_tvalid = output_3_axis_tvalid;
current_output_tready = output_3_axis_tready;
end
default: begin
current_output_tvalid = 1'b0;
current_output_tready = 1'b0;
end
endcase
end

View File

@ -127,6 +127,7 @@ always @* begin
{%- for p in ports %}
{{w}}'d{{p}}: selected_input_tvalid = input_{{p}}_axis_tvalid;
{%- endfor %}
default: selected_input_tvalid = 1'b0;
endcase
end
@ -147,6 +148,13 @@ always @* begin
current_input_tuser = input_{{p}}_axis_tuser;
end
{%- endfor %}
default: begin
current_input_tdata = {DATA_WIDTH{1'b0}};
current_input_tvalid = 1'b0;
current_input_tready = 1'b0;
current_input_tlast = 1'b0;
current_input_tuser = 1'b0;
end
endcase
end

View File

@ -109,6 +109,7 @@ always @* begin
2'd1: selected_input_tvalid = input_1_axis_tvalid;
2'd2: selected_input_tvalid = input_2_axis_tvalid;
2'd3: selected_input_tvalid = input_3_axis_tvalid;
default: selected_input_tvalid = 1'b0;
endcase
end
@ -148,6 +149,13 @@ always @* begin
current_input_tlast = input_3_axis_tlast;
current_input_tuser = input_3_axis_tuser;
end
default: begin
current_input_tdata = {DATA_WIDTH{1'b0}};
current_input_tvalid = 1'b0;
current_input_tready = 1'b0;
current_input_tlast = 1'b0;
current_input_tuser = 1'b0;
end
endcase
end

View File

@ -131,6 +131,7 @@ always @* begin
{%- for p in ports %}
{{w}}'d{{p}}: selected_input_tvalid = input_{{p}}_axis_tvalid;
{%- endfor %}
default: selected_input_tvalid = 1'b0;
endcase
end
@ -153,6 +154,14 @@ always @* begin
current_input_tuser = input_{{p}}_axis_tuser;
end
{%- endfor %}
default: begin
current_input_tdata = {DATA_WIDTH{1'b0}};
current_input_tkeep = {KEEP_WIDTH{1'b0}};
current_input_tvalid = 1'b0;
current_input_tready = 1'b0;
current_input_tlast = 1'b0;
current_input_tuser = 1'b0;
end
endcase
end

View File

@ -116,6 +116,7 @@ always @* begin
2'd1: selected_input_tvalid = input_1_axis_tvalid;
2'd2: selected_input_tvalid = input_2_axis_tvalid;
2'd3: selected_input_tvalid = input_3_axis_tvalid;
default: selected_input_tvalid = 1'b0;
endcase
end
@ -160,6 +161,14 @@ always @* begin
current_input_tlast = input_3_axis_tlast;
current_input_tuser = input_3_axis_tuser;
end
default: begin
current_input_tdata = {DATA_WIDTH{1'b0}};
current_input_tkeep = {KEEP_WIDTH{1'b0}};
current_input_tvalid = 1'b0;
current_input_tready = 1'b0;
current_input_tlast = 1'b0;
current_input_tuser = 1'b0;
end
endcase
end