Configuring Conditional Multiline Indent Rules
There are rules which will check alignment of multiline conditional expressions and conditional waveforms.
There are several options to these rules:
Option |
Values |
Default |
Description |
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The options can be combined to format the conditional expression or conditional waveform.
This is an example of how to configure these options.
rule :
concurrent_009:
align_left : 'no'
align_paren : 'no'
align_when_keywords : 'no'
wrap_at_when : 'no'
align_else_keywords : 'no'
The following code snippet is used for all examples and is formatted with the configuration above
output <= '1' when input = "0000" or (input = "1111" and
input2 = "0101") else
sig_a or sig_b when input = "0001" and
input2 = "1001" else
sig_c and sig_d when input = "0010" else
'0';
Note
Formatting in the following examples is performed by a separate rule.
Example: align_left
set to yes
output <= '1' when input = "0000" or (input = "1111" and
input2) = "0101" else
sig_a or sig_b when input = "0001" and
input = "1001" else
sig_c and sig_d when input = "0010" else
'0';
Example: align_paren
set to yes
output <= '1' when input = "0000" or (input = "1111" and
input2) = "0101" else
sig_a or sig_b when input = "0001" and
input = "1001" else
sig_c and sig_d when input = "0010" else
'0';
Example: align_when_keywords
set to yes
output <= '1' when input = "0000" or (input = "1111" and
input2) = "0101" else
sig_a or sig_b when input = "0001" and
input = "1001" else
sig_c and sig_d when input = "0010" else
'0';
Example: wrap_at_when
set to yes
output <= '1' when input = "0000" or (input = "1111" and
input2) = "0101" else
sig_a or sig_b when input = "0001" and
input = "1001" else
sig_c and sig_d when input = "0010" else
'0';
Example: align_else_keywords
set to yes
output <= '1' when input = "0000" or (input = "1111" and
input2) = "0101" else
sig_a or sig_b when input = "0001" and
input = "1001" else
sig_c and sig_d when input = "0010" else
'0';
Example: Default configuration
Using the following configuration:
rule :
concurrent_009:
align_left : 'no'
align_paren : 'yes'
align_when_keywords : 'no'
wrap_at_when : 'yes'
align_else_keywords : 'no'
would result in the following formatting:
output <= '1' when input = "0000" or (input = "1111" and
input2) = "0101" else
sig_a or sig_b when input = "0001" and
input = "1001" else
sig_c and sig_d when input = "0010" else
'0';
Example: Setting all options to yes
except align_left
set to no
Using the following configuration:
rule :
concurrent_009:
align_left : 'no'
align_paren : 'yes'
align_when_keywords : 'yes'
wrap_at_when : 'yes'
align_else_keywords : 'yes'
would result in the following formatting:
output <= '1' when input = "0000" or (input = "1111" and
input2) = "0101" else
sig_a or sig_b when input = "0001" and
input = "1001" else
sig_c and sig_d when input = "0010" else
'0';