WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

cocotb/copra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copra - Type Stubs for Cocotb

Generates type stubs for HDL designs to enable IDE autocomplete in cocotb testbenches.

Quick Start

  1. Add copra to your test dependencies
  2. Add copra to your Makefile:
    COCOTB_TEST_MODULES = copra.integration.autostub,your_test_module
  3. Run your cocotb tests - stubs generated in copra_stubs.pyi

Configuration

You can configure how copra works by setting environment variables:

Variable name Description Default
COPRA_STUB_DIRECTORY Directory to save stub file to .
COPRA_STUB_FILENAME Filename of file to store stubs in. Stub files should end in .pyi copra_stubs.pyi
COPRA_MAX_DEPTH Maximum recursion depth of type discovery. 100

How it Works

Copra introspects the live cocotb hierarchy and maps HDL signals to cocotb handle types:

  • Single logic → LogicObject
  • Logic arrays → LogicArrayObject
  • Unpacked arrays → ArrayObject[...]
  • Generate blocks → HierarchyArrayObject[...]
  • Modules → HierarchyObject
  • Parameters → IntegerObject

See examples directory.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages