183 {input, expected} cases across 10 construct files under
tests/cases/, driven by a ~180-line std-only harness (==== / ----
format). Each case asserts formatting and idempotency; #SKIP parks
known formatter bugs and fails the suite once they start passing.
Documents four real formatter bugs found while deriving expected
output (block-comment re-indent non-idempotency, comment lifted out
of expression groups, closing block labels dropped, multi-instance
declaration layout) — parked as #SKIP, to be fixed in a follow-up
feature. Also adds rustfmt.toml matching the codebase style.
Dev: Opus agent; QA: Sonnet agent; review in
docs/features/case-tables/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
179 lines
2.5 KiB
Plaintext
179 lines
2.5 KiB
Plaintext
# continuous assignment
|
|
module m;
|
|
assign y=a&b;
|
|
endmodule
|
|
----
|
|
module m;
|
|
assign y = a & b;
|
|
endmodule
|
|
====
|
|
# continuous assignment with a delay
|
|
module m;
|
|
assign #3 y = a;
|
|
endmodule
|
|
----
|
|
module m;
|
|
assign #3 y = a;
|
|
endmodule
|
|
====
|
|
# continuous assignment to a bit select and a slice
|
|
module m;
|
|
assign y[0] = a;
|
|
assign y[7:4] = b;
|
|
endmodule
|
|
----
|
|
module m;
|
|
assign y[0] = a;
|
|
assign y[7:4] = b;
|
|
endmodule
|
|
====
|
|
# several assignments in one statement
|
|
module m;
|
|
assign a = 1'b0, b = 1'b1;
|
|
endmodule
|
|
----
|
|
module m;
|
|
assign a = 1'b0, b = 1'b1;
|
|
endmodule
|
|
====
|
|
# blocking and non-blocking assignments
|
|
module m;
|
|
always @(posedge clk) begin
|
|
q<=d;
|
|
tmp=d;
|
|
end
|
|
endmodule
|
|
----
|
|
module m;
|
|
always @(posedge clk) begin
|
|
q <= d;
|
|
tmp = d;
|
|
end
|
|
endmodule
|
|
====
|
|
# assignment operators
|
|
module m;
|
|
always_comb begin
|
|
a += 1;
|
|
b -= 2;
|
|
c *= 3;
|
|
d <<= 1;
|
|
e |= mask;
|
|
end
|
|
endmodule
|
|
----
|
|
module m;
|
|
always_comb begin
|
|
a += 1;
|
|
b -= 2;
|
|
c *= 3;
|
|
d <<= 1;
|
|
e |= mask;
|
|
end
|
|
endmodule
|
|
====
|
|
# increment and decrement
|
|
module m;
|
|
always_comb begin
|
|
i++;
|
|
j--;
|
|
end
|
|
endmodule
|
|
----
|
|
module m;
|
|
always_comb begin
|
|
i++;
|
|
j--;
|
|
end
|
|
endmodule
|
|
====
|
|
# assignment with an intra-assignment delay
|
|
module m;
|
|
always begin
|
|
#5 q = d;
|
|
q <= #2 d;
|
|
end
|
|
endmodule
|
|
----
|
|
module m;
|
|
always begin
|
|
#5 q = d;
|
|
q <= #2 d;
|
|
end
|
|
endmodule
|
|
====
|
|
# assignment with an intra-assignment event control
|
|
module m;
|
|
always begin
|
|
q = @(posedge clk) d;
|
|
end
|
|
endmodule
|
|
----
|
|
module m;
|
|
always begin
|
|
q = @(posedge clk) d;
|
|
end
|
|
endmodule
|
|
====
|
|
# long right-hand side wraps under the assignment
|
|
module m;
|
|
assign result_signal_name = first_operand_name + second_operand_name + third_operand_name + fourth;
|
|
endmodule
|
|
----
|
|
module m;
|
|
assign result_signal_name =
|
|
first_operand_name + second_operand_name + third_operand_name + fourth;
|
|
endmodule
|
|
====
|
|
# non-blocking assignment of a concatenation
|
|
module m;
|
|
always_ff @(posedge clk) begin
|
|
{carry, sum} <= a + b;
|
|
end
|
|
endmodule
|
|
----
|
|
module m;
|
|
always_ff @(posedge clk) begin
|
|
{carry, sum} <= a + b;
|
|
end
|
|
endmodule
|
|
====
|
|
# assign of a ternary
|
|
module m;
|
|
assign y = sel ? a : b;
|
|
endmodule
|
|
----
|
|
module m;
|
|
assign y = sel ? a : b;
|
|
endmodule
|
|
====
|
|
# force and release
|
|
module m;
|
|
initial begin
|
|
force net = 1'b1;
|
|
release net;
|
|
end
|
|
endmodule
|
|
----
|
|
module m;
|
|
initial begin
|
|
force net = 1'b1;
|
|
release net;
|
|
end
|
|
endmodule
|
|
====
|
|
# assign inside a labeled always block
|
|
module m;
|
|
always_ff @(posedge clk or negedge rst_n) begin
|
|
if(!rst_n) q<=0;
|
|
else q<=d;
|
|
end
|
|
endmodule
|
|
----
|
|
module m;
|
|
always_ff @(posedge clk or negedge rst_n) begin
|
|
if (!rst_n) q <= 0;
|
|
else q <= d;
|
|
end
|
|
endmodule
|