Git Product home page Git Product logo

Comments (9)

themperek avatar themperek commented on August 23, 2024

Something like this: https://docs.pytest.org/en/latest/example/special.html ?

If use pytest can use all stand procedures

from cocotb-test.

themperek avatar themperek commented on August 23, 2024

BTW: What is the use case for this?

from cocotb-test.

qarlosalberto avatar qarlosalberto commented on August 23, 2024

We are working in a cocotb-test front-end for TerosHDL:

https://github.com/TerosTechnology/triel

We would like to get two things that we already have implemented with VUnit:

  • Test selection: the user has the possibility to list the tests and choose which test to run.

vunit

  • Independent output by simulator (.vcd): the user can open the waveform of each test. Un ejemplo sería este:
def test_adder_vhdl():
    tests = list("test_adder")
    for x in tests:
        run(vhdl_sources=["../../../hdl/adder.vhd"],
            simulation_args=["--vcd=func"+x[name]+".vcd"],
            toplevel="adder",
            module="test_adder",
            test=x["name"]
            toplevel_lang="vhdl"
        )

vunit2

from cocotb-test.

themperek avatar themperek commented on August 23, 2024

There is no explicit list of test it is handled by pytest and there are ways to get it (see: pytest-dev/pytest#1613) some IDE are doing this.

Verilog simulator typically does not take VCD output as a parameter it can be defined in Verilog file itself. As far as I can see one would need to do this via define or similar.

from cocotb-test.

qarlosalberto avatar qarlosalberto commented on August 23, 2024

I think that I can't list the cocotb tests with pytest. In this example:

https://github.com/qarlosalberto/cocotbExamples/blob/master/tools/cocotb/simple/cocotest_test_adder.py
https://github.com/qarlosalberto/cocotbExamples/blob/master/tools/cocotb/simple/test_adder.py

I can discover: def test_adder_vhdl()
But I cant discover: def adder_basic_test(dut), def adder_basic2_test(dut), def adder_random_test(dut

I would like to be able to define with cocotb-test a different output folder (SIM_BUILD) for each cocotb test (adder_basic_test,adder_basic2_test,adder_random_test).

It would also be nice if I could select the tests (TESTCASE)

from cocotb-test.

themperek avatar themperek commented on August 23, 2024

You can set testcase and sim_build now.

For the list of tests you can try to do something like below and parse std (looks bit ugly):

import py                                                                                                                                                                                                                                                                                                             
import pytest

capture = py.io.StdCapture() 
pytest.main(['--collect-only', '-q']) 
std, err = capture.reset() 
print(std.split("\n")) 

from cocotb-test.

qarlosalberto avatar qarlosalberto commented on August 23, 2024

Ok! I will try, thank you!

from cocotb-test.

themperek avatar themperek commented on August 23, 2024

Did this work?

from cocotb-test.

themperek avatar themperek commented on August 23, 2024

I will close. Feel free to re-open if needed.

from cocotb-test.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.