question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

test_vivado.py fails

See original GitHub issue
$ pytest test_vivado.py 
===================================================================================== test session starts ======================================================================================
platform linux -- Python 3.5.3, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
rootdir: /.../edalize
collected 2 items                                                                                                                                                                              

test_vivado.py F.                                                                                                                                                                        [100%]

=========================================================================================== FAILURES ===========================================================================================
_________________________________________________________________________________________ test_vivado __________________________________________________________________________________________

    def test_vivado():
        import os
        import shutil
        from edalize_common import compare_files, setup_backend, tests_dir
    
        ref_dir      = os.path.join(tests_dir, __name__)
        paramtypes   = ['generic', 'vlogdefine', 'vlogparam']
        name         = 'test_vivado_0'
        tool         = 'vivado'
        tool_options = {
            'part' : 'xc7a35tcsg324-1',
        }
    
        (backend, work_root) = setup_backend(paramtypes, name, tool, tool_options)
        backend.configure()
    
        compare_files(ref_dir, work_root, [
            'Makefile',
            name+'.tcl',
            name+'_run.tcl',
>           name+'_pgm.tcl',
        ])

test_vivado.py:23: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

ref_dir = '/.../edalize/tests/test_vivado', work_root = '/tmp/vivado_u01cvq93'
files = ['Makefile', 'test_vivado_0.tcl', 'test_vivado_0_run.tcl', 'test_vivado_0_pgm.tcl']

    def compare_files(ref_dir, work_root, files):
        import os.path
        import shutil
    
        for f in files:
            reference_file = os.path.join(ref_dir, f)
            generated_file = os.path.join(work_root, f)
    
            assert os.path.exists(generated_file)
    
            if 'GOLDEN_RUN' in os.environ:
                shutil.copy(generated_file, reference_file)
    
            with open(reference_file) as fref, open(generated_file) as fgen:
>               assert fref.read() == fgen.read(), f
E               AssertionError: test_vivado_0.tcl

edalize_common.py:22: AssertionError
-------------------------------------------------------------------------------------- Captured log call ---------------------------------------------------------------------------------------
WARNING  edalize.vivado:vivado.py:138 qip_file.qip has unknown file type 'QIP', interpretation is up to Vivado
WARNING  edalize.vivado:vivado.py:138 qip_file.qip has unknown file type 'QIP', interpretation is up to Vivado
WARNING  edalize.vivado:vivado.py:138 qsys_file has unknown file type 'QSYS', interpretation is up to Vivado
WARNING  edalize.vivado:vivado.py:138 qsys_file has unknown file type 'QSYS', interpretation is up to Vivado
WARNING  edalize.vivado:vivado.py:138 bmm_file has unknown file type 'BMM', interpretation is up to Vivado
WARNING  edalize.vivado:vivado.py:138 bmm_file has unknown file type 'BMM', interpretation is up to Vivado
WARNING  edalize.vivado:vivado.py:138 pcf_file.pcf has unknown file type 'PCF', interpretation is up to Vivado
WARNING  edalize.vivado:vivado.py:138 pcf_file.pcf has unknown file type 'PCF', interpretation is up to Vivado
WARNING  edalize.vivado:vivado.py:138 ucf_file.ucf has unknown file type 'UCF', interpretation is up to Vivado
WARNING  edalize.vivado:vivado.py:138 ucf_file.ucf has unknown file type 'UCF', interpretation is up to Vivado
WARNING  edalize.vivado:vivado.py:138 c_file.c has unknown file type 'cSource', interpretation is up to Vivado
WARNING  edalize.vivado:vivado.py:138 c_file.c has unknown file type 'cSource', interpretation is up to Vivado
WARNING  edalize.vivado:vivado.py:138 cpp_file.cpp has unknown file type 'cppSource', interpretation is up to Vivado
WARNING  edalize.vivado:vivado.py:138 cpp_file.cpp has unknown file type 'cppSource', interpretation is up to Vivado
=================================================================================== short test summary info ====================================================================================
FAILED test_vivado.py::test_vivado - AssertionError: test_vivado_0.tcl
================================================================================= 1 failed, 1 passed in 0.24s ==================================================================================

I made some diff to see changes:

Only in test_vivado: minimal
Only in /tmp/vivado_y4p0gmip/: test_vivado_0_synth.tcl
diff test_vivado/test_vivado_0.tcl /tmp/vivado_y4p0gmip/test_vivado_0.tcl
8,10c8,10
< set_property generic {vlogparam_bool=1 vlogparam_int=42 vlogparam_str=hello } [get_filesets sources_1]
< set_property generic {generic_bool=true generic_int=42 generic_str=hello } [get_filesets sources_1]
< set_property verilog_define {vlogdefine_bool=1 vlogdefine_int=42 vlogdefine_str=hello } [get_filesets sources_1]
---
> set_property generic {vlogparam_int=42 vlogparam_bool=1 vlogparam_str=hello } [get_filesets sources_1]
> set_property generic {generic_bool=true generic_str=hello generic_int=42 } [get_filesets sources_1]
> set_property verilog_define {vlogdefine_str=hello vlogdefine_bool=1 vlogdefine_int=42 } [get_filesets sources_1]
Only in test_vivado: vivado.cmd
$ diff test_vivado/minimal/ /tmp/vivado_rf5a0p4x/
Only in /tmp/vivado_rf5a0p4x/: test_vivado_minimal_0_synth.tcl

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
GCHQDeveloper560commented, Apr 17, 2020

From #136 it looks like almost all of the tests, including this one, fail with Python 3.5 but pass for later versions. It works for me with 3.6, and looking at the CI run the only failure for 3.6 was for test_verible_lint_default that needs the reference data updated (#135).

It looks like we have a lot of cleanup to do if we want to support 3.5!

0reactions
imphilcommented, May 1, 2020

All tests are green in CI now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python unit-tests are passing even when it fails an assertion
In GitLab by @cmastalli on Aug 8, 2019, 12:54 After changing the way of that I run multiple testcases, I noticed that make...
Read more >
Execute code if a test fails with py.test - Stack Overflow
I'm doing UI test automation on Android using Appium and py.test. I'd like to be able to save a bug report using adb...
Read more >
Project X-Ray Documentation - Read the Docs
(Option 2) - Install the Python environment globally ... This step is known to fail with a compiler error while building the pyjson5...
Read more >
Test fail - Google Groups
> It is the test qutip/tests/test_steadystate.py::test_driven_cavity_power_gmres that fails and it fails every time. I am using spyder version 5.1.0 with qutip ...
Read more >
shakti-soc - cores - GitLab
Test Vivado. $ vivado -version Vivado v2018.3 (64-bit) SW ... sudo apt-get install python-serial. pyserial module provides access to the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found