user6110002
user6110002

Reputation: 53

Is it possible to set breakpoints in PyGears?

As far as I understood I can use any text editor for writing PyGears. Actually, I need just Python IDE. Does this mean that I can set breakpoints in any of these tools?

Upvotes: 1

Views: 26

Answers (1)

Bogdan Vukobratovic
Bogdan Vukobratovic

Reputation: 161

Yes, you can use any Python IDE to develop with PyGears. Breakpoints can also be freely used for debugging.

There are two major phases when a design is simulated with PyGears: compile time and run time.

  1. During compile time, the structure of the design is built. Modules are instantiated, parameterized and connected using interfaces. In this phase non-async functions are executed, i.e. the functions defined as:

    @gear
    def func(...):
        ...
    

    So placing breakpoints in these functions will help you track, for an example, which exact values are used as module parameters, or to inspect the data types of the interfaces between the modules.

  2. Once sim() is called, PyGears simulator will execute the design structure by invoking the async modules, i.e. the functions defined as:

    @gear
    async def func(...):
        ...
    

    or,

    @datagear
    def func(...):
        ...
    

    Placing breakpoints in these functions lets you debug the functionality of the modules, as well as understand the timing when some of the modules receive input data and produce the outputs.

    However, debugging more complex designs over thousands of clock cycles is usually tedious to perform using breakpoints, so you should also consider using Gearbox (the PyGears IDE), inspecting waveforms, and logging important events.

Upvotes: 0

Related Questions