Skip to content

Conversation

@google-labs-jules
Copy link

This refactoring moves the clock generation for the TinyALU example from the VHDL design to the cocotb testbench.

Specifically, the changes are:

  • The internal clock generation process in tinyalu.vhd has been removed.
  • The clk signal in tinyalu.vhd is now an input port.
  • The TinyAluBfm in tinyalu_utils.py now creates and starts a 2us clock on the DUT's clk pin.

This centralizes clock management within the test environment, making the setup more flexible and aligning with standard verification practices.


PR created automatically by Jules for task 8967099609063795420

Ola Groettvik and others added 16 commits September 17, 2025 15:07
Modified `tinyalu.vhd` to remove the internal clock generation and expose the `clk` signal as an input port. This allows the clock to be driven by an external source.

Updated the `TinyAluBfm` in `tinyalu_utils.py` to create and start a 2us clock using `cocotb.clock.Clock`. The clock is started in the `start_bfm` method, ensuring it is available for all tests that use the BFM.

This change centralizes clock management in the test environment, removing the need for the DUT to generate its own clock and making the test setup more flexible and realistic.
@google-labs-jules
Copy link
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

Moves the clock generation for the TinyALU example from the HDL design into the Python-based `cocotb` test environment. The clock is now created and started as a coroutine from within the `TinyAluBfm.start_bfm` method.

This change achieves the goal of centralizing clock control within the test environment for the Verilog version of the design.

The VHDL implementation and its corresponding Makefile have been reverted to their original state. This is due to unresolved simulation timeouts and VPI interface errors when attempting to drive the clock from the testbench with GHDL. The Verilog implementation is fully functional with the new clocking scheme.
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.

1 participant