sonar/testbench.py
def cpp_vivado(
        cls, name, clk_period="20ns", reset_low=True, version="2018.1"
    ):
        """
        Creates a default cpp module with the given name, language and HLS tool

        Args:
            name (str): Name of the module to create
            clk_period (str, optional): Defaults to 20ns. Clock period to use
            reset_low (bool, optional): Defaults to True. Enable active low reset
                Set False to use active high reset
            version (str, optional): Defaults to 2018.1. Vivado tool version

        Returns:
            Module: Object representing a module
        """

        module = cls().cpp(name, "cpp", "vivado", version)
        # assumes that all Vivado HLS IPs add a clock/reset with these names.
        # if this behavior changes, this needs to be updated
        module.add_clock_port("ap_clk", clk_period)
        if reset_low:
            module.add_reset_port("ap_rst_n")
        else:
            module.add_reset_port("ap_rst")
        return module

        Creates a default cpp module with the given name, language and HLS tool

        Args:
            name (str): Name of the module to create
            clk_period (str, optional): Defaults to 20ns. Clock period to use
            reset_low (bool, optional): Defaults to True. Enable active low reset
                Set False to use active high reset
            version (str, optional): Defaults to 2018.1. Vivado tool version

        Returns:
            Module: Object representing a module
        
Creates a default cpp module with the given name, language and HLS tool
Creates a default cpp module with the given name language and HLS tool
def cpp_vivado(
        cls, name, clk_period="20ns", reset_low=True, version="2018.1"
    ):
        module = cls().cpp(name, "cpp", "vivado", version)
        module.add_clock_port("ap_clk", clk_period)
        if reset_low:
            module.add_reset_port("ap_rst_n")
        else:
            module.add_reset_port("ap_rst")
        return module
def cpp_vivado ( cls , name , clk_period = "20ns" , reset_low = True , version = "2018.1" ) : module = cls ( ) . cpp ( name , "cpp" , "vivado" , version ) module . add_clock_port ( "ap_clk" , clk_period ) if reset_low : module . add_reset_port ( "ap_rst_n" ) else : module . add_reset_port ( "ap_rst" ) return module
Creates a default cpp module with the given name, language and HLS tool
Creates a default cpp module with the given name language and HLS tool
"""
        Creates a default cpp module with the given name, language and HLS tool

        Args:
            name (str): Name of the module to create
            clk_period (str, optional): Defaults to 20ns. Clock period to use
            reset_low (bool, optional): Defaults to True. Enable active low reset
                Set False to use active high reset
            version (str, optional): Defaults to 2018.1. Vivado tool version

        Returns:
            Module: Object representing a module
        """ # assumes that all Vivado HLS IPs add a clock/reset with these names. # if this behavior changes, this needs to be updated
Object representing a module
Object representing a module
Module
cls
name
Name of the module to create
Name of the module to create
clk_period
Defaults to 20ns. Clock period to use
Defaults to 20ns . Clock period to use
reset_low
Defaults to True. Enable active low reset
Set False to use active high reset
Defaults to True . Enable active low reset Set False to use active high reset
version
None