Skip to content

Conversation

@Subhankar-hub
Copy link

Summary

  • Update Makefile to use cocotb v2 API (--lib-dir, COCOTB_TEST_MODULES, PYGPI_PYTHON_BIN)
  • Fix deprecated units parameter to unit in Clock()
  • Convert LogicArray values to int before arithmetic operations

Problem

The project doesn't work with cocotb v2.x due to API changes:

cocotb-config: error: unrecognized arguments: --prefix
PYGPI_PYTHON_BIN variable not set. Can't initialize Python interpreter!
TypeError: unsupported operand type(s) for *: 'LogicArray' and 'LogicArray'

Test plan

  • make test_matadd passes
  • make test_matmul passes

Tested with cocotb v2.0.1, Python 3.13, Icarus Verilog 12.0

- Update Makefile to use cocotb v2 API:
  - Replace `--prefix` with `--lib-dir` for cocotb-config
  - Rename `MODULE` to `COCOTB_TEST_MODULES`
  - Add required `PYGPI_PYTHON_BIN` environment variable

- Fix test/helpers/setup.py:
  - Rename deprecated `units` parameter to `unit` in Clock()

- Fix test/helpers/format.py:
  - Convert LogicArray values to int before arithmetic operations
  - Use `int(handle.value)` instead of deprecated `int(handle)`

Tested with cocotb v2.0.1, Python 3.13, Icarus Verilog 12.0
@Subhankar-hub
Copy link
Author

Please Review.

@Qianshui-Jiang
Copy link

Same issue I've meet, thanks for your fix.

@Subhankar-hub
Copy link
Author

Glad I could help, p.s: used Cursor though 🙄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants