<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/monokai-sublime.min.css">
imageNamaste FPGA
image

COCOTB 2.0 for RTL Verification

5.0(2 reviews)5 hours139 items Certificate
SubtitlesEnglish
What you'll learn

9 skills you'll walk away with

Course content

139 items across 11 sections

98 lectures5 hours total
Course details

Know what you're signing up for

Requirements
  • Basic understanding of digital design and RTL concepts
  • Familiarity with Verilog or SystemVerilog syntax
  • Basic understanding of Python programming (variables, functions, and modules)
  • Basic knowledge of simulation workflows and HDL simulators
  • Basic computer skills and command-line usage
Who this course is for
  • Anyone wish to understand RTL verification with COCOTB
Why this course exists

COCOTB 2.0 (released in September 2025, with a 2.0.1 patch in November 2025) is a major release that introduces many breaking API changes. The focus was on modernizing the codebase, removing long-deprecated features, improving maintainability, adding better Python typing support, and making the API cleaner and more consistent with modern Python. COCOTB 2.0, released in September 2025, removes most deprecated features to make the API cleaner and consistent with Python 3+. Python has the yield keyword which can return values on demand. cocotb 1.0 exploited this behavior to pause coroutine execution and resume it whenever an event occurred in the Verilog simulator. However, this approach did not align well with native Python IDEs and tooling. cocotb 2.0 therefore removed generators completely and switched to native async/await, which naturally supports the pause and resume capabilities required for RTL verification where we wait for simulator events and then perform actions. The second major change is replacing fork with start_soon. With fork, if the scheduler is currently executing a coroutine and fork is called, the new coroutine may start executing immediately without waiting for the current coroutine to finish. This could lead to inconsistent trigger ordering and scheduler re-entrancy issues. start_soon instead queues the coroutine and allows the current coroutine to complete before the new coroutine begins execution. cocotb 2.0 also allows awaiting tasks directly. A coroutine can be awaited to wait for its completion, and tasks can be cancelled using cancel(), which raises a CancelledError exception inside the coroutine. This allows the coroutine to perform proper cleanup using normal Python exception handling. BinaryValue was the default data type used when accessing signals of the DUT. BinaryValue stored values as binary strings, which meant the HDL bit order and Python indexing were effectively reversed. Users often had to convert the value to a string and reverse it before using it. Accessing individual bits also required converting to a string, reversing the string, and then indexing the character representing the bit. This process was cumbersome and error-prone. cocotb 2.0 removed BinaryValue and introduced Logic and LogicArray types. These provide consistent indexing with HDL and allow direct access to individual bits without string conversion. BinaryValue supported only binary strings and therefore did not fully support all 9 logic levels used in HDL. Values other than 0 and 1 could be silently converted to 0, which sometimes caused mismatches between DUT and testbench values. Logic and LogicArray support all 9 logic levels. The Clock class now supports period_high, allowing variable duty cycles. In cocotb 1.0, TestFactory was used to generate multiple tests and failures were reported by raising special cocotb exceptions. cocotb 2.0 introduces decorators similar to pytest and uses normal Python assertions for test failures, aligning test writing with standard Python testing practices. Interprocess communication has also been simplified, and Event objects no longer require name or data attributes. With these changes, cocotb 2.0 becomes more powerful and easier to use compared to cocotb 1.0. We are happy to launch the COCOTB 2.0 foundation course to help you get familiar with the newer cocotb 2.0 and learn how to write cleaner, more Pythonic testbenches.

Requirements

What you should know going in

  • Basic understanding of digital design and RTL concepts
  • Familiarity with Verilog or SystemVerilog syntax
  • Basic understanding of Python programming (variables, functions, and modules)
  • Basic knowledge of simulation workflows and HDL simulators
  • Basic computer skills and command-line usage
Description

Why this course exists

COCOTB 2.0 (released in September 2025, with a 2.0.1 patch in November 2025) is a major release that introduces many breaking API changes. The focus was on modernizing the codebase, removing long-deprecated features, improving maintainability, adding better Python typing support, and making the API cleaner and more consistent with modern Python. COCOTB 2.0, released in September 2025, removes most deprecated features to make the API cleaner and consistent with Python 3+. Python has the yield keyword which can return values on demand. cocotb 1.0 exploited this behavior to pause coroutine execution and resume it whenever an event occurred in the Verilog simulator. However, this approach did not align well with native Python IDEs and tooling. cocotb 2.0 therefore removed generators completely and switched to native async/await, which naturally supports the pause and resume capabilities required for RTL verification where we wait for simulator events and then perform actions. The second major change is replacing fork with start_soon. With fork, if the scheduler is currently executing a coroutine and fork is called, the new coroutine may start executing immediately without waiting for the current coroutine to finish. This could lead to inconsistent trigger ordering and scheduler re-entrancy issues. start_soon instead queues the coroutine and allows the current coroutine to complete before the new coroutine begins execution. cocotb 2.0 also allows awaiting tasks directly. A coroutine can be awaited to wait for its completion, and tasks can be cancelled using cancel(), which raises a CancelledError exception inside the coroutine. This allows the coroutine to perform proper cleanup using normal Python exception handling. BinaryValue was the default data type used when accessing signals of the DUT. BinaryValue stored values as binary strings, which meant the HDL bit order and Python indexing were effectively reversed. Users often had to convert the value to a string and reverse it before using it. Accessing individual bits also required converting to a string, reversing the string, and then indexing the character representing the bit. This process was cumbersome and error-prone. cocotb 2.0 removed BinaryValue and introduced Logic and LogicArray types. These provide consistent indexing with HDL and allow direct access to individual bits without string conversion. BinaryValue supported only binary strings and therefore did not fully support all 9 logic levels used in HDL. Values other than 0 and 1 could be silently converted to 0, which sometimes caused mismatches between DUT and testbench values. Logic and LogicArray support all 9 logic levels. The Clock class now supports period_high, allowing variable duty cycles. In cocotb 1.0, TestFactory was used to generate multiple tests and failures were reported by raising special cocotb exceptions. cocotb 2.0 introduces decorators similar to pytest and uses normal Python assertions for test failures, aligning test writing with standard Python testing practices. Interprocess communication has also been simplified, and Event objects no longer require name or data attributes. With these changes, cocotb 2.0 becomes more powerful and easier to use compared to cocotb 1.0. We are happy to launch the COCOTB 2.0 foundation course to help you get familiar with the newer cocotb 2.0 and learn how to write cleaner, more Pythonic testbenches.

Who it's for

Who this course is for

  • Anyone wish to understand RTL verification with COCOTB
Instructor

Taught by Kumar Khandagle

KK

Kumar Khandagle

Founder, Namaste FPGA · Mumbai, India

4.5 instructor rating60,000+ engineers34 courses15+ yrs silicon

15 years of production silicon — from high-frequency trading on Xilinx Alveo, to India's indigenous MRI machine, to training engineers at Mumbai University. Top 1K instructor on Udemy. Every course here comes from work he's actually shipped.

Reviews

What learners are saying

5.0
2 reviews
LJ
Lakshay jain
6 months ago

I recently completed the Cocotb course by Namste FPGA, and it was an outstanding learning experience. The course is very well-structured, starting from the basics and gradually moving towards advanced concepts, making it perfect for both beginners and intermediate learners. The explanations are clear, concise, and highly practical. I especially appreciated the hands-on approach, which helped me understand how to implement Cocotb in real verification scenarios rather than just learning theory. The examples and exercises were relevant and reinforced the concepts effectively. The instructor did a great job in simplifying complex topics and making them easy to follow. This course has significantly improved my understanding of verification using Python and Cocotb, and I now feel confident in applying these skills in real projects. Overall, I highly recommend this course to anyone looking to get started with Cocotb or enhance their FPGA verification skills. Great job by the Namste FPGA team!

RA
Rigoberto Acosta-González
6 months ago

The ability to hide the playlist and generate subtitles in other languages. Otherwise, the content on Cocotb is of the highest quality.

$ 6.99One-time payment