python control file/function (instead of Makefile)
See original GitHub issueWhat would be your opinion to have python control file for the cocotb instead of makefile.
Initially one can start with simple a wrapper for Makefile. A module that will generate a local Makefile based on python code and execute it (subprocess). This should be backward compatible. Later can recede makefiles to just compile liberalises and run simulator directly form python.
Could look something like this at the end of test file:
from cocotb.runcontrol import Run
def test_run():
Run(
sources = ['../hdl/dff.v'],
top_level = 'dff',
incdir = ['../hdl'],
defines=['TEST=1'],
)
if __name__ == "__main__":
test_run()
This could automatic discoverable by pytest. If we get #517 we could run in parallel.
It needs bit of thinking and trying but would like to know your opinion. Somehow related to #437, #508, #667 In case of positive feedback can make a working demo.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:11 (9 by maintainers)
Top Results From Across the Web
Creating a Python Makefile - Earthly Blog
It is a tool which controls the generation of executable and other non-source files from a program's source file. It can automate the...
Read more >Python Tutorial - File and Text Processing
If you just want to read or write a file, use built-in function open() . If you just want to manipulate paths (files,...
Read more >How to Write a Makefile - Automating Python Setup ...
Makefile uses the make utility, and if we're to be completely accurate, Makefile is just a file that houses the code that the...
Read more >How do I create a file at a specific path? - python
The file path "c:\Test\blah" will have a tab character for the `\T'. You need to use either: "C:\\Test". or r"C:\Test".
Read more >3. Configure Python — Python 3.11.1 documentation
Compile the Python main() function and link Python executable with C++ ... Build the _decimal extension module using a thread-local context rather than...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve done something going into this direction with cocotb-testrunner (https://github.com/imphil/cocotb-testrunner). It works like this:
We use this testrunner extensively internally, and in Open SoC Debug and in OpTiMSoC. Unfortunately, none of the test runs are publicly available in CI since we mostly use Synopsys VCS.
Actually one should be able to do something like this: