hdlConvertor icon indicating copy to clipboard operation
hdlConvertor copied to clipboard

(System)Verilog parallel_case attribute is not supported

Open KatCe opened this issue 1 year ago • 1 comments

Hello.

hdlConvertor does not support the parallel_case attribute. An example can be found here: https://github.com/KatCe/hdlConvertor_issue_185

Using the python script in the repo I tried all 3 language settings mentioned and saved the ast as text files (ast_v.txt: Language.VERILOG, ast_v2005.txt: Language.VERILOG_2005, ast_sv2017.txt: Language.SYSTEM_VERILOG_2017).

The parallel_case attribute was not understood by hdlConvertor. Error output:

python3 ast_to_json.py > ast_v.txt
./picorv32_sv2v_out.v:276:2: AttributeParser.visitAttribute_instance Conversion to Python object not implemented
    ...(*parallel_case*)...
./picorv32_sv2v_out.v:331:2: AttributeParser.visitAttribute_instance Conversion to Python object not implemented
    ...(*full_case*)...
./picorv32_sv2v_out.v:1017:3: AttributeParser.visitAttribute_instance Conversion to Python object not implemented
    ...(*parallel_case*)...
./picorv32_sv2v_out.v:1139:2: AttributeParser.visitAttribute_instance Conversion to Python object not implemented
    ...(*parallel_case,full_case*)...
./picorv32_sv2v_out.v:1149:2: AttributeParser.visitAttribute_instance Conversion to Python object not implemented
    ...(*parallel_case,full_case*)...
./picorv32_sv2v_out.v:1178:3: AttributeParser.visitAttribute_instance Conversion to Python object not implemented
    ...(*parallel_case*)...
./picorv32_sv2v_out.v:1289:3: AttributeParser.visitAttribute_instance Conversion to Python object not implemented
    ...(*parallel_case,full_case*)...
./picorv32_sv2v_out.v:1296:5: AttributeParser.visitAttribute_instance Conversion to Python object not implemented
    ...(*parallel_case*)...
./picorv32_sv2v_out.v:1372:5: AttributeParser.visitAttribute_instance Conversion to Python object not implemented
    ...(*parallel_case*)...
./picorv32_sv2v_out.v:1412:7: AttributeParser.visitAttribute_instance Conversion to Python object not implemented
    ...(*parallel_case,full_case*)...
./picorv32_sv2v_out.v:1506:8: AttributeParser.visitAttribute_instance Conversion to Python object not implemented
    ...(*parallel_case*)...
./picorv32_sv2v_out.v:1534:5: AttributeParser.visitAttribute_instance Conversion to Python object not implemented
    ...(*parallel_case*)...
./picorv32_sv2v_out.v:1603:6: AttributeParser.visitAttribute_instance Conversion to Python object not implemented
    ...(*parallel_case,full_case*)...
./picorv32_sv2v_out.v:1612:6: AttributeParser.visitAttribute_instance Conversion to Python object not implemented
    ...(*parallel_case,full_case*)...
./picorv32_sv2v_out.v:1626:7: AttributeParser.visitAttribute_instance Conversion to Python object not implemented
    ...(*parallel_case,full_case*)...
./picorv32_sv2v_out.v:1650:7: AttributeParser.visitAttribute_instance Conversion to Python object not implemented
    ...(*parallel_case,full_case*)...
./picorv32_sv2v_out.v:1667:7: AttributeParser.visitAttribute_instance Conversion to Python object not implemented
    ...(*parallel_case,full_case*)...

The parallel_case in line 1139/1140 of picorv32_sv2v_out.v is a good example where the case statement without attribute has a different semantic than with it, so the attribute should not be dropped. Corresponding line in ast_v.txt:31946.

KatCe avatar Oct 17 '23 16:10 KatCe

should be fixed in 2800920f94a52682b706cd16014b2c4c218780ca

@KatCe , do you think you would be able to find some minimal examples with SV attributes? Now I have to make a test suite for this functionality and there are many places where attribute can appear. I was wondering if you know about where are examples of this feature (other than SV specification).

Also, what are you using hdlConvertor for?

Last week I was talking with qarlosalberto about some not yet public projects. I am going to publish some projects which are using hdlConvertor to analyze hierarchy and file dependencies. (+- this weekend) There are several other project like this, focused mainly on circuit visualization but it takes an effort to make them public. So, if you describe what are interested in, there is a probability that I will be able to share something useful for you.

Nic30 avatar Oct 23 '23 14:10 Nic30