Skip to content

Commit

Permalink
Added rule check for issue AsFigo#75
Browse files Browse the repository at this point in the history
  • Loading branch information
prajapati93 committed Dec 4, 2023
1 parent 17562db commit 5524b28
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 0 deletions.
2 changes: 2 additions & 0 deletions exec_dir/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ naming:
python3 ../py_src/pyslint.py -t ../sv_tests/test_issue_150_f.sv >> pyslint.log
python3 ../py_src/pyslint.py -t ../sv_tests/test_issue_151_f.sv >> pyslint.log
python3 ../py_src/pyslint.py -t ../sv_tests/test_issue_152_f.sv >> pyslint.log
python3 ../py_src/pyslint.py -t ../sv_tests/test_sv_name_chk_30_f.sv >> pyslint.log
python3 ../py_src/pyslint.py -t ../sv_tests/test_sv_name_chk_30_p_c.sv >> pyslint.log

cat pyslint.log

36 changes: 36 additions & 0 deletions exec_dir/pyslint.log
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ PySlint: Violation: [PERF_CG_NO_ABIN_W_DEF_CL]: Found Array-bins:
bins others[] = default;

While IEEE 1800 LRM allows this syntax, this is bad for Performance aspect as it ends up creating large number of bins. Recommended to remove this bin.
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [REUSE_CG_NO_ILBINS_CL]: Found 'illegal_bins' under user-defined bins:
covergroup: cg_o_sig for coverpoint: cpt_osig : o_sig_8b invalid_vals
While IEEE 1800 LRM allows this syntax, this is bad for REUSE aspect as it does not flag as UVM_ERROR or $error.
Also if coverage is turned OFF, this error is likely to go unflagged. Recommended to use 'ignore_bins' instead
from coverage perspective and add SVA or scoreboard for illegal values.
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [COMPAT_CG_OPT_PI_CL]: Found 'type_option.per_instance' inside a covergroup: cg_o_sig
IEEE 1800 LRM does not allow such usage though some tools do compile.
To avoid compatibility issues, please move the per_instance to 'option.per_instance '
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [FUNC_CNST_MISSING_CAST]: Potentially incorrect constraint expression! An expression involving the array-reduction methods sum()/product()/and()/or()/xor() was found, but is missing an explicit cast. This can lead to strange results as array reduction methods return an expression of the size of its elements, check if you need a with (int'( cast around the following expression:
num_list.sum()
PySlint: Violation: [FUNC_CNST_MISSING_CAST]: Potentially incorrect constraint expression! An expression involving the array-reduction methods sum()/product()/and()/or()/xor() was found, but is missing an explicit cast. This can lead to strange results as array reduction methods return an expression of the size of its elements, check if you need a with (int'( cast around the following expression:
Expand All @@ -21,6 +24,7 @@ PySlint: Violation: [FUNC_CNST_MISSING_CAST]: Potentially incorrect constraint e
num_list.xor()
PySlint: Violation: [FUNC_CNST_MISSING_CAST]: Potentially incorrect constraint expression! An expression involving the array-reduction methods sum()/product()/and()/or()/xor() was found, but is missing an explicit cast. This can lead to strange results as array reduction methods return an expression of the size of its elements, check if you need a with (int'( cast around the following expression:
num_list.product()
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [FUNC_DPI_NO_4STATE_IN_RETURN]: DPI functions shall use 2-state types in return value. Using 4-state type can lead to unnecessary complication as C-side does not naturally support 4-state value system Found code as:

import "DPI-C" function integer c_sum(input bit [31:0] input_array[]);
Expand All @@ -40,7 +44,11 @@ PySlint: Violation: [REUSE_NO_TDEF_IN_MOD]: A typedef was found inside a module
typedef enum logic [1:0] {S0, S1, S2} state_t;
PySlint: Violation: [NAME_INTF_SUFFIX]: Improper naming of identifier: af_sv_intf_bad: expected suffix: _if
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: af_bad_class_name: expected suffix: _c
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_CG_PREFIX]: Improper naming of identifier: bad_group_name: expected prefix: cg_
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_CG_PREFIX]: Improper naming of identifier: bad_group_name: expected prefix: cg_
PySlint: Violation: [SVA_MISSING_LABEL]: Unnamed assumption - use a meaningful label:
// BAD - unnamed SVA
Expand All @@ -67,14 +75,18 @@ PySlint: Violation: [SVA_MISSING_ENDLABEL]: Missing End Label for property: p_go
PySlint: Violation: [NAME_PROP_PREFIX]: Improper naming of property: bad_name: expected prefix: p_
PySlint: Violation: [NAME_ASM_PREFIX]: Improper naming of assume directive: wrong_label: expected prefix: m_
PySlint: Violation: [NAME_COV_PREFIX]: Improper naming of cover directive: wrong_label: expected prefix: c_
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: should_have_been_extern
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [CL_MISSING_ENDLABEL]: Missing End Label for class: ex_c
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [SVA_MISSING_FAIL_AB]: Missing FAIL Action block - use $error/`uvm_error:
a_new : assert property ((@posedge clk) p_req_cycle
PySlint: Violation: [SVA_NO_PASS_AB]: Avoid using PASS Action block - likely to cause too many vacuous prints:
a_new : assert property ((@posedge clk) p_req_cycle
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: randvar: expected suffix: _c
PySlint: Violation: [CL_MISSING_ENDLABEL]: Missing End Label for class: randvar
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [COMPAT_SVA_NO_CONC_IN_FE]: A procedural concurrent assertion was found inside a forever loop; IEEE 1800 LRM does not allow such usage though some tools do compile To avoid compatibility issues, please remodel the code:
forever_asrt: assert property(forever_pp);
PySlint: Violation: [NAME_PROP_PREFIX]: Improper naming of property: always_pp: expected prefix: p_
Expand All @@ -97,13 +109,16 @@ PySlint: Violation: [REUSE_NO_WILDC_AA_CL]: Found an associative array declarati
string fruits[*];
This is bad for reuse as it does not allow 'foreach' iterator and other handy built-in functions.
Consider using a typed key such as int/string etc.
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: alu_driver: expected suffix: _c
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: build_phase
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: connect_phase
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: run_phase
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: drive
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: extension: expected suffix: _c
PySlint: Violation: [CL_MISSING_ENDLABEL]: Missing End Label for class: extension
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_PROP_PREFIX]: Improper naming of property: ab: expected prefix: p_
PySlint: Violation: [COMPAT_SVA_NO_DEGEN_CONSEQ]: Empty match ([*0] or variants) found in a property expression.
Though some compilers allow this, IEEE 1800 LRM prevents such usage, so for maximum compatibility across EDA
Expand Down Expand Up @@ -588,7 +603,10 @@ PySlint: Violation: [NAME_AST_PREFIX]: Improper naming of assert directive: axi_
PySlint: Violation: [NAME_PROP_PREFIX]: Improper naming of property: AXI_AUXM_EXCL_OVERFLOW: expected prefix: p_
PySlint: Violation: [SVA_MISSING_ENDLABEL]: Missing End Label for property: AXI_AUXM_EXCL_OVERFLOW
PySlint: Violation: [NAME_AST_PREFIX]: Improper naming of assert directive: axi_auxm_excl_overflow: expected prefix: a_
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [REUSE_ONE_CL_PER_FILE]: Always use one-class definition per file
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [REUSE_ONE_MOD_PER_FILE]: Always use one-module definition per file
PySlint: Violation: [REUSE_NO_TDEF_IN_MOD]: A typedef was found inside a module This prevents reuse as the enum/typedef scope is module only An assertion model that binds to this module and check the states using the typedef will be harder to implement in such cases. Please move the typedef to a package and import that package inside the module
typedef logic [WIDTH-1 : 0] word_t;
Expand All @@ -611,6 +629,7 @@ PySlint: Violation: [NAME_AST_PREFIX]: Improper naming of assert directive: ap_w
PySlint: Violation: [SVA_MISSING_FAIL_AB]: Missing FAIL Action block - use $error/`uvm_error:
ap_write_on_max_buff : assert property (p_never_write_on_max_buff);
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: c_xactn: expected suffix: _c
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [REUSE_ONE_MOD_PER_FILE]: Always use one-module definition per file
PySlint: Violation: [NAME_AST_PREFIX]: Improper naming of assert directive: ap_read_after_write: expected prefix: a_
PySlint: Violation: [SVA_NO_PASS_AB]: Avoid using PASS Action block - likely to cause too many vacuous prints:
Expand Down Expand Up @@ -776,17 +795,21 @@ PySlint: Violation: [NAME_PROP_PREFIX]: Improper naming of property: pCounterMax
PySlint: Violation: [NAME_AST_PREFIX]: Improper naming of assert directive: apCounterMaxed: expected prefix: a_
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: generator: expected suffix: _c
PySlint: Violation: [CL_MISSING_ENDLABEL]: Missing End Label for class: generator
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: gen: expected suffix: _c
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: pre_randomize
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: post_randomize
PySlint: Violation: [CL_MISSING_ENDLABEL]: Missing End Label for class: gen
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: transaction: expected suffix: _c
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: display
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: copy
PySlint: Violation: [CL_MISSING_ENDLABEL]: Missing End Label for class: transaction
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: generator: expected suffix: _c
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: run
PySlint: Violation: [CL_MISSING_ENDLABEL]: Missing End Label for class: generator
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: driver: expected suffix: _c
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: reset
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: run
Expand All @@ -796,6 +819,7 @@ PySlint: Violation: [REUSE_ONE_CL_PER_FILE]: Always use one-class definition per
PySlint: Violation: [REUSE_ONE_CL_PER_FILE]: Always use one-class definition per file
PySlint: Violation: [REUSE_ONE_CL_PER_FILE]: Always use one-class definition per file
PySlint: Violation: [REUSE_ONE_CL_PER_FILE]: Always use one-class definition per file
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: monitor: expected suffix: _c
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: run
PySlint: Violation: [CL_MISSING_ENDLABEL]: Missing End Label for class: monitor
Expand All @@ -804,6 +828,7 @@ PySlint: Violation: [REUSE_ONE_CL_PER_FILE]: Always use one-class definition per
PySlint: Violation: [REUSE_ONE_CL_PER_FILE]: Always use one-class definition per file
PySlint: Violation: [REUSE_ONE_CL_PER_FILE]: Always use one-class definition per file
PySlint: Violation: [REUSE_ONE_CL_PER_FILE]: Always use one-class definition per file
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: scoreboard: expected suffix: _c
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: run
PySlint: Violation: [CL_MISSING_ENDLABEL]: Missing End Label for class: scoreboard
Expand All @@ -812,6 +837,7 @@ PySlint: Violation: [REUSE_ONE_CL_PER_FILE]: Always use one-class definition per
PySlint: Violation: [REUSE_ONE_CL_PER_FILE]: Always use one-class definition per file
PySlint: Violation: [REUSE_ONE_CL_PER_FILE]: Always use one-class definition per file
PySlint: Violation: [REUSE_ONE_CL_PER_FILE]: Always use one-class definition per file
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: environment: expected suffix: _c
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: pre_test
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: test
Expand All @@ -823,22 +849,29 @@ PySlint: Violation: [REUSE_ONE_CL_PER_FILE]: Always use one-class definition per
PySlint: Violation: [REUSE_ONE_CL_PER_FILE]: Always use one-class definition per file
PySlint: Violation: [REUSE_ONE_CL_PER_FILE]: Always use one-class definition per file
PySlint: Violation: [REUSE_ONE_CL_PER_FILE]: Always use one-class definition per file
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: distribution: expected suffix: _c
PySlint: Violation: [CL_MISSING_ENDLABEL]: Missing End Label for class: distribution
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: distribution: expected suffix: _c
PySlint: Violation: [FUNC_CNST_DIST_COL_EQ]: Potentially incorrect constraint expression! An expression involving dist ColonEquals if found And the range used with ColonEquals is large This is likely to skew the random generation and prevent other values in the dist expression to be generated less-frequently than the large range values Review to check if you intended to use ColonSlash instead of ColonEquals
data1_bad dist {0:=10, [1:30]:=60}
PySlint: Violation: [CL_MISSING_ENDLABEL]: Missing End Label for class: distribution
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: data: expected suffix: _c
PySlint: Violation: [FUNC_CNST_DIST_COL_EQ]: Potentially incorrect constraint expression! An expression involving dist ColonEquals if found And the range used with ColonEquals is large This is likely to skew the random generation and prevent other values in the dist expression to be generated less-frequently than the large range values Review to check if you intended to use ColonSlash instead of ColonEquals field1 dist {[0:31] := 1, [32:65535] := 1}
PySlint: Violation: [FUNC_CNST_DIST_COL_EQ]: Potentially incorrect constraint expression! An expression involving dist ColonEquals if found And the range used with ColonEquals is large This is likely to skew the random generation and prevent other values in the dist expression to be generated less-frequently than the large range values Review to check if you intended to use ColonSlash instead of ColonEquals field1 dist {[0:31] := 1, [32:65535] := 1}
PySlint: Violation: [CL_MISSING_ENDLABEL]: Missing End Label for class: data
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: clk: expected suffix: _c
PySlint: Violation: [CL_MISSING_ENDLABEL]: Missing End Label for class: clk
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: A: expected suffix: _c
PySlint: Violation: [CL_MISSING_ENDLABEL]: Missing End Label for class: A
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [NAME_CLASS_SUFFIX]: Improper naming of identifier: c: expected suffix: _c
PySlint: Violation: [CL_MISSING_ENDLABEL]: Missing End Label for class: c
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [FUNC_NO_2STATE_IN_INTF]: Potential DUT bug hiding construct in use: Inside SystemVerilog interface, it is recommended to use only 4-state signals/nets. Found a 2-state declaration as:
bit bad_2st;
PySlint: Violation: [FUNC_NO_2STATE_IN_INTF]: Potential DUT bug hiding construct in use: Inside SystemVerilog interface, it is recommended to use only 4-state signals/nets. Found a 2-state declaration as:
Expand Down Expand Up @@ -870,8 +903,10 @@ PySlint: Violation: [COMPAT_POST_RAND_NON_VOID]: method post_randomize not decla
To avoid compatibility issues, please declare post_randomize as void function

function post_randomize()
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: pre_randomize
PySlint: Violation: [CL_METHOD_NOT_EXTERN]: method is not declared extern: post_randomize
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
PySlint: Violation: [FUNC_DPI_FN_MISSING_RTYPE]: DPI import functions should specify
return type as per LRM. Using Implicit return type (of logic) can lead to
functional issues leading to unexpected results. Please specify return type as void/bit etc.
Expand Down Expand Up @@ -939,3 +974,4 @@ PySlint: Violation: [COMPAT_DPI_NO_MDA]: DPI method with Multi-Dimensional Array
While LRM allows this, some tools do not fully support. To avoid compatibility issues,
please remodel the code:
import "DPI-C" task bad_dpi_t_mda(input int dyn_a[][]);
PySlint: Violation: [REUSE_FL_CL_NAME_MATCH]: Always keep the file name as class name
Loading

0 comments on commit 5524b28

Please sign in to comment.