没有项目描述
cocotb-test的Python项目详细描述
cocotb测试
cocotb-test
为cocotb提供标准的python单元测试功能
- 允许python单元测试的外观
- 不再需要makefile(包括makefile兼容模式)
- 允许轻松自定义模拟流
- 更好的Windows用户体验
- 允许对并行运行使用pytest-xdist
!概念证明!
用法:
为python安装并使用conda(可以安装在用户/本地文件夹中)。
安装Conda开发工具(仅限Windows):
conda install --yes m2w64-gcc libpython
- 通过pip: 安装包
pip install https://github.com/themperek/cocotb-test/archive/master.zip
或
git clone https://github.com/themperek/cocotb-test.git pip install -e cocotb-test
- 创建一个
test_dff.py
文件(有关更多示例,请检查test folder):
fromcocotb_test.runimportrundeftest_dff():run(verilog_sources=["dff.v"],# sourcestoplevel="dff",# top level HDLmodule="dff_cocotb"# name of cocotb test module)
- 运行pytest:
pytest -s
从cocotb运行(一些)测试和示例
对于cocotb测试/示例,请在可编辑模式下安装cocotb
git clone https://github.com/potentialventures/cocotb.git pip install -e cocotb SIM=icarus pytest -s --junitxml=test-results.xml tests