Configuring Array Multiline Structure Rules
There are rules which will check indent and formatting of multiline expressions and conditions.
The alignment of multiline rules is handled by a corresponding rule. Both rules are required to ensure proper formatting of multiline expressions and conditions. The corresponding rule will be noted in the rule documentation.
There are several options to these rules:
Option | Values | Default | Description |
---|---|---|---|
first_paren_new_line |
yes , no , ignore |
yes |
|
last_paren_new_line |
yes , no , ignore |
yes |
|
open_paren_new_line |
yes , no , ignore |
yes |
|
close_paren_new_line |
yes , no , ignore |
yes |
|
new_line_after_comma |
yes , no , ignore , ignore_positional |
yes |
|
assign_on_single_line |
yes , ignore |
yes |
|
ignore_single_line |
yes , no |
yes |
|
The options can be combined to format arrays.
This is an example of how to configure these options.
rule :
constant_016:
first_paren_new_line : 'yes'
last_paren_new_line : 'yes'
open_paren_new_line : 'yes'
close_paren_new_line : 'yes'
new_line_after_comma : 'ignore'
assign_on_single_line : 'yes'
ignore_single_line : 'no'
The following code snippet is used in the following examples:
constant c_stimulus : t_stimulus_array := ((name => "Hold in reset", clk_in => "01", rst_in => "11", cnt_en_in => "00", cnt_out => "00"), (name => "Not enabled", clk_in => "01", rst_in => "00", cnt_en_in => "00", cnt_out => "00")); -- Define test vectors
constant c_stimulus : t_stimulus_array :=
(
(
name =>
"Hold in reset",
clk_in => "01",
rst_in => "11",
cnt_en_in => "00",
cnt_out => "00"
),
(
name =>
"Not enabled",
clk_in => "01",
rst_in => "00",
cnt_en_in => "00",
cnt_out => "00"
)
); -- Define test vectors
Note
The indenting in the following examples are performed by a different rule.
Example: first_paren_new_line
set to yes
constant c_stimulus : t_stimulus_array :=
((name => "Hold in reset", clk_in => "01", rst_in => "11", cnt_en_in => "00", cnt_out => "00"), (name => "Not enabled", clk_in => "01", rst_in => "00", cnt_en_in => "00", cnt_out => "00")); -- Define test vectors
constant c_stimulus : t_stimulus_array :=
(
(
name =>
"Hold in reset",
clk_in => "01",
rst_in => "11",
cnt_en_in => "00",
cnt_out => "00"
),
(
name =>
"Not enabled",
clk_in => "01",
rst_in => "00",
cnt_en_in => "00",
cnt_out => "00"
)
); -- Define test vectors
Example: first_paren_new_line
set to no
constant c_stimulus : t_stimulus_array := ((name => "Hold in reset", clk_in => "01", rst_in => "11", cnt_en_in => "00", cnt_out => "00"), (name => "Not enabled", clk_in => "01", rst_in => "00", cnt_en_in => "00", cnt_out => "00")); -- Define test vectors
constant c_stimulus : t_stimulus_array := (
(
name =>
"Hold in reset",
clk_in => "01",
rst_in => "11",
cnt_en_in => "00",
cnt_out => "00"
),
(
name =>
"Not enabled",
clk_in => "01",
rst_in => "00",
cnt_en_in => "00",
cnt_out => "00"
)
); -- Define test vectors
Example: last_paren_new_line
set to yes
constant c_stimulus : t_stimulus_array := ((name => "Hold in reset", clk_in => "01", rst_in => "11", cnt_en_in => "00", cnt_out => "00"), (name => "Not enabled", clk_in => "01", rst_in => "00", cnt_en_in => "00", cnt_out => "00")
); -- Define test vectors
constant c_stimulus : t_stimulus_array :=
(
(
name =>
"Hold in reset",
clk_in => "01",
rst_in => "11",
cnt_en_in => "00",
cnt_out => "00"
),
(
name =>
"Not enabled",
clk_in => "01",
rst_in => "00",
cnt_en_in => "00",
cnt_out => "00"
)
); -- Define test vectors
Example: last_paren_new_line
set to no
constant c_stimulus : t_stimulus_array := ((name => "Hold in reset", clk_in => "01", rst_in => "11", cnt_en_in => "00", cnt_out => "00"), (name => "Not enabled", clk_in => "01", rst_in => "00", cnt_en_in => "00", cnt_out => "00")); -- Define test vectors
constant c_stimulus : t_stimulus_array := (
(
name =>
"Hold in reset",
clk_in => "01",
rst_in => "11",
cnt_en_in => "00",
cnt_out => "00"
),
(
name =>
"Not enabled",
clk_in => "01",
rst_in => "00",
cnt_en_in => "00",
cnt_out => "00"
)); -- Define test vectors
Example: open_paren_new_line
set to yes
constant c_stimulus : t_stimulus_array := (
(
name => "Hold in reset", clk_in => "01", rst_in => "11", cnt_en_in => "00", cnt_out => "00"), (
name => "Not enabled", clk_in => "01", rst_in => "00", cnt_en_in => "00", cnt_out => "00")); -- Define test vectors
constant c_stimulus : t_stimulus_array :=
(
(
name =>
"Hold in reset",
clk_in => "01",
rst_in => "11",
cnt_en_in => "00",
cnt_out => "00"
),
(
name =>
"Not enabled",
clk_in => "01",
rst_in => "00",
cnt_en_in => "00",
cnt_out => "00"
)
); -- Define test vectors
Example: open_paren_new_line
set to no
constant c_stimulus : t_stimulus_array := ((name => "Hold in reset", clk_in => "01", rst_in => "11", cnt_en_in => "00", cnt_out => "00"), (name => "Not enabled", clk_in => "01", rst_in => "00", cnt_en_in => "00", cnt_out => "00")); -- Define test vectors
constant c_stimulus : t_stimulus_array := ((name =>
"Hold in reset",
clk_in => "01",
rst_in => "11",
cnt_en_in => "00",
cnt_out => "00"
),
(name =>
"Not enabled",
clk_in => "01",
rst_in => "00",
cnt_en_in => "00",
cnt_out => "00"
)); -- Define test vectors
Example: close_paren_new_line
set to yes
constant c_stimulus : t_stimulus_array := ((name => "Hold in reset", clk_in => "01", rst_in => "11", cnt_en_in => "00", cnt_out => "00"
), (name => "Not enabled", clk_in => "01", rst_in => "00", cnt_en_in => "00", cnt_out => "00"
)
); -- Define test vectors
constant c_stimulus : t_stimulus_array :=
(
(
name =>
"Hold in reset",
clk_in => "01",
rst_in => "11",
cnt_en_in => "00",
cnt_out => "00"
),
(
name =>
"Not enabled",
clk_in => "01",
rst_in => "00",
cnt_en_in => "00",
cnt_out => "00"
)
); -- Define test vectors
Example: close_paren_new_line
set to no
constant c_stimulus : t_stimulus_array := ((name => "Hold in reset", clk_in => "01", rst_in => "11", cnt_en_in => "00", cnt_out => "00"), (name => "Not enabled", clk_in => "01", rst_in => "00", cnt_en_in => "00", cnt_out => "00")); -- Define test vectors
constant c_stimulus : t_stimulus_array := ((name =>
"Hold in reset",
clk_in => "01",
rst_in => "11",
cnt_en_in => "00",
cnt_out => "00"),
(name =>
"Not enabled",
clk_in => "01",
rst_in => "00",
cnt_en_in => "00",
cnt_out => "00")); -- Define test vectors
Example: new_line_after_comma
set to yes
constant c_stimulus : t_stimulus_array := ((name => "Hold in reset",
clk_in => "01",
rst_in => "11",
cnt_en_in => "00",
cnt_out => "00"),
(name => "Not enabled",
clk_in => "01",
rst_in => "00",
cnt_en_in => "00",
cnt_out => "00")); -- Define test vectors
constant c_stimulus : t_stimulus_array :=
(
(
name =>
"Hold in reset",
clk_in => "01",
rst_in => "11",
cnt_en_in => "00",
cnt_out => "00"
),
(
name =>
"Not enabled",
clk_in => "01",
rst_in => "00",
cnt_en_in => "00",
cnt_out => "00"
)
); -- Define test vectors
Example: new_line_after_comma
set to no
constant c_stimulus : t_stimulus_array := ((name => "Hold in reset", clk_in => "01", rst_in => "11", cnt_en_in => "00", cnt_out => "00"), (name => "Not enabled", clk_in => "01", rst_in => "00", cnt_en_in => "00", cnt_out => "00")); -- Define test vectors
constant c_stimulus : t_stimulus_array := ((name =>
"Hold in reset", clk_in => "01", rst_in => "11", cnt_en_in => "00", cnt_out => "00"), (name =>
"Not enabled", clk_in => "01", rst_in => "00", cnt_en_in => "00", cnt_out => "00")); -- Define test vectors
Example: assign_on_single_line
set to yes
constant c_stimulus : t_stimulus_array :=
((name => "Hold in reset", clk_in => "01", rst_in => "11", cnt_en_in => "00", cnt_out => "00"), (name => "Not enabled", clk_in => "01", rst_in => "00", cnt_en_in => "00", cnt_out => "00")); -- Define test vectors
constant c_stimulus : t_stimulus_array :=
(
(
name => "Hold in reset",
clk_in => "01",
rst_in => "11",
cnt_en_in => "00",
cnt_out => "00"
),
(
name => "Not enabled",
clk_in => "01",
rst_in => "00",
cnt_en_in => "00",
cnt_out => "00"
)
); -- Define test vectors
Example: Keep all assignments on single line
Using the following configuration:
rule :
constant_016:
first_paren_new_line : 'no'
last_paren_new_line : 'yes'
open_paren_new_line : 'yes'
close_paren_new_line : 'yes'
new_line_after_comma : 'no'
assign_on_single_line : 'yes'
ignore_single_line : 'no'
would result in the following formatting:
constant c_stimulus : t_stimulus_array := (
(
name => "Hold in reset", clk_in => "01", rst_in => "11", cnt_en_in => "00", cnt_out => "00"
), (
name => "Not enabled", clk_in => "01", rst_in => "00", cnt_en_in => "00", cnt_out => "00"
)
); -- Define test vectors
constant c_stimulus : t_stimulus_array := (
(
name => "Hold in reset", clk_in => "01", rst_in => "11", cnt_en_in => "00", cnt_out => "00"
), (
name => "Not enabled", clk_in => "01", rst_in => "00", cnt_en_in => "00", cnt_out => "00"
)
); -- Define test vectors
Example: Fully expand expression
Using the following configuration:
rule :
constant_016:
first_paren_new_line : 'yes'
last_paren_new_line : 'yes'
open_paren_new_line : 'yes'
close_paren_new_line : 'yes'
new_line_after_comma : 'yes'
assign_on_single_line : 'yes'
ignore_single_line : 'no'
would result in the following formatting:
constant c_stimulus : t_stimulus_array :=
(
(
name => "Hold in reset",
clk_in => "01",
rst_in => "11",
cnt_en_in => "00",
cnt_out => "00"
),
(
name => "Not enabled",
clk_in => "01",
rst_in => "00",
cnt_en_in => "00",
cnt_out => "00"
)
); -- Define test vectors
constant c_stimulus : t_stimulus_array :=
(
(
name => "Hold in reset",
clk_in => "01",
rst_in => "11",
cnt_en_in => "00",
cnt_out => "00"
),
(
name => "Not enabled",
clk_in => "01",
rst_in => "00",
cnt_en_in => "00",
cnt_out => "00"
)
); -- Define test vectors