Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Cocotb SnippetsNew to Visual Studio Code? Get it now.
Cocotb Snippets

Cocotb Snippets

Amrit Sharma Poudel

|
470 installs
| (1) | Free
Snippets for Cocotb, tailored for FPGA/RTL developers.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Cocotb Snippets

Welcome to the Cocotb Snippets extension! This extension provides a collection of code snippets tailored for Cocotb, a coroutine-based co-simulation testbench framework for writing testbenches in Python. These snippets help you quickly generate boilerplate code and common patterns used in Cocotb, making your development process more efficient.

Features

  • Basic Cocotb Testbench Structure: Quickly scaffold a basic testbench with a simple test case.
  • Clock Generator: Insert a ready-to-use clock generator for driving clock signals.
  • Makefile template: Basic Makefile for the verilog files.

Additional snippets and updates will be provided in future releases.

Usage

  • Install the extension.
  • In the Python test file / Makefile, type "coco" to initialise intellisense.
  • Select the desired snippet.

Snippets

Python test file:

  • cocotesttemplate: Template of a basic Cocotb test.
  • cocotestfunction: Create a basic Cocotb test function
  • cococlock: Create a clock of desired precision..
  • cocowaitclockcycles: Wait for number of clock cycles.
  • cocowaittimer: Wait for a certain amount of time.

Makefile:

  • cocomakeverilog: Makefile template for a basic Cocotb test.

Additional snippets and updates will be provided in future releases.

Requirements

To use this extension, ensure you have the following:

  • Cocotb: A Python library for writing co-simulation testbenches.

Release Notes

1.0.2

Added functionality of bare minimal cocotb testbench.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft