hexsha
stringlengths
40
40
repo
stringlengths
7
114
path
stringlengths
4
124
license
listlengths
1
9
language
stringclasses
1 value
identifier
stringlengths
1
71
return_type
stringlengths
1
749
⌀
original_string
stringlengths
76
22.7k
original_docstring
stringlengths
16
7.61k
docstring
stringlengths
16
2.47k
docstring_tokens
listlengths
6
477
code
stringlengths
14
10.2k
code_tokens
listlengths
6
996
short_docstring
stringlengths
2
644
short_docstring_tokens
listlengths
1
116
comment
listlengths
1
89
parameters
listlengths
0
64
docstring_params
dict
098620d3840a1ca17782a092e9f07ba30023b67e
gunnarpope/python
json/pyjson.py
[ "MIT" ]
Python
jsonLoad
<not_specific>
def jsonLoad(filename): """ Import a .json file into a Python dictionary INPUT: filename.json file OUTPUT: json object """ with open(filename, 'r') as f: return json.load(f)
Import a .json file into a Python dictionary INPUT: filename.json file OUTPUT: json object
Import a .json file into a Python dictionary INPUT: filename.json file OUTPUT: json object
[ "Import", "a", ".", "json", "file", "into", "a", "Python", "dictionary", "INPUT", ":", "filename", ".", "json", "file", "OUTPUT", ":", "json", "object" ]
def jsonLoad(filename): with open(filename, 'r') as f: return json.load(f)
[ "def", "jsonLoad", "(", "filename", ")", ":", "with", "open", "(", "filename", ",", "'r'", ")", "as", "f", ":", "return", "json", ".", "load", "(", "f", ")" ]
Import a .json file into a Python dictionary INPUT: filename.json file OUTPUT: json object
[ "Import", "a", ".", "json", "file", "into", "a", "Python", "dictionary", "INPUT", ":", "filename", ".", "json", "file", "OUTPUT", ":", "json", "object" ]
[ "\"\"\"\tImport a .json file into a Python dictionary\n\t \tINPUT: filename.json file\n\t\tOUTPUT: json object\n\t \"\"\"" ]
[ { "param": "filename", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "filename", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c7061ccaf420bd29f30393917afc1c2e1d2aac1e
gunnarpope/python
eda_serialcoms.py
[ "MIT" ]
Python
sendCommand
<not_specific>
def sendCommand(self,command): """Input type is a BYTE Returns 1 if BTYE is returned from UART """ self.con.flush() self.con.readlines() self.con.write(command) time.sleep(0.1) self.con.flush() try: rx = self.con.read(1) ...
Input type is a BYTE Returns 1 if BTYE is returned from UART
Input type is a BYTE Returns 1 if BTYE is returned from UART
[ "Input", "type", "is", "a", "BYTE", "Returns", "1", "if", "BTYE", "is", "returned", "from", "UART" ]
def sendCommand(self,command): self.con.flush() self.con.readlines() self.con.write(command) time.sleep(0.1) self.con.flush() try: rx = self.con.read(1) if (rx == command): return 1 except: return 0
[ "def", "sendCommand", "(", "self", ",", "command", ")", ":", "self", ".", "con", ".", "flush", "(", ")", "self", ".", "con", ".", "readlines", "(", ")", "self", ".", "con", ".", "write", "(", "command", ")", "time", ".", "sleep", "(", "0.1", ")",...
Input type is a BYTE Returns 1 if BTYE is returned from UART
[ "Input", "type", "is", "a", "BYTE", "Returns", "1", "if", "BTYE", "is", "returned", "from", "UART" ]
[ "\"\"\"Input type is a BYTE\n Returns 1 if BTYE is returned from UART\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "command", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "command", "type": null, "docstring": null, "docstring_tokens"...
2112f11ea638d6066e300a9a696700701770134b
sharm294/sonar
sonar/interfaces/axi4_lite_slave.py
[ "MIT" ]
Python
add_endpoint
null
def add_endpoint(self, endpoint, **kwargs): """ Add an endpoint to this AXI4-Lite interface Args: endpoint (str): Identifier for the endpoint kwargs (?): Keyworded arguments for the endpoint """ endpoint_obj = None if endpoint == "manual": ...
Add an endpoint to this AXI4-Lite interface Args: endpoint (str): Identifier for the endpoint kwargs (?): Keyworded arguments for the endpoint
Add an endpoint to this AXI4-Lite interface
[ "Add", "an", "endpoint", "to", "this", "AXI4", "-", "Lite", "interface" ]
def add_endpoint(self, endpoint, **kwargs): endpoint_obj = None if endpoint == "manual": endpoint_obj = EndpointManual if endpoint_obj: super().add_endpoint(endpoint_obj, **kwargs)
[ "def", "add_endpoint", "(", "self", ",", "endpoint", ",", "**", "kwargs", ")", ":", "endpoint_obj", "=", "None", "if", "endpoint", "==", "\"manual\"", ":", "endpoint_obj", "=", "EndpointManual", "if", "endpoint_obj", ":", "super", "(", ")", ".", "add_endpoin...
Add an endpoint to this AXI4-Lite interface
[ "Add", "an", "endpoint", "to", "this", "AXI4", "-", "Lite", "interface" ]
[ "\"\"\"\n Add an endpoint to this AXI4-Lite interface\n\n Args:\n endpoint (str): Identifier for the endpoint\n kwargs (?): Keyworded arguments for the endpoint\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "endpoint", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "endpoint", "type": null, "docstring": "Identifier for the endpoint"...
2112f11ea638d6066e300a9a696700701770134b
sharm294/sonar
sonar/interfaces/axi4_lite_slave.py
[ "MIT" ]
Python
read
null
def read(self, thread, register, expected_value): """ Read data from a register to verify its value Args: thread (Thread): Thread in which to read from register (str): Name of the register to read expected_value (number): Expected value that the register shou...
Read data from a register to verify its value Args: thread (Thread): Thread in which to read from register (str): Name of the register to read expected_value (number): Expected value that the register should have
Read data from a register to verify its value
[ "Read", "data", "from", "a", "register", "to", "verify", "its", "value" ]
def read(self, thread, register, expected_value): address = None for index, reg in enumerate(self.registers): if reg == register: address = self.addresses[index] break transaction = { "interface": { "type": "axi4_lite_slave"...
[ "def", "read", "(", "self", ",", "thread", ",", "register", ",", "expected_value", ")", ":", "address", "=", "None", "for", "index", ",", "reg", "in", "enumerate", "(", "self", ".", "registers", ")", ":", "if", "reg", "==", "register", ":", "address", ...
Read data from a register to verify its value
[ "Read", "data", "from", "a", "register", "to", "verify", "its", "value" ]
[ "\"\"\"\n Read data from a register to verify its value\n\n Args:\n thread (Thread): Thread in which to read from\n register (str): Name of the register to read\n expected_value (number): Expected value that the register should have\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "thread", "type": null }, { "param": "register", "type": null }, { "param": "expected_value", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "thread", "type": null, "docstring": "Thread in which to read from",...
2112f11ea638d6066e300a9a696700701770134b
sharm294/sonar
sonar/interfaces/axi4_lite_slave.py
[ "MIT" ]
Python
add_register
null
def add_register(self, name, address): """ Add a register to this interface Args: name (str): Name of the register to add address (number): Address of the register """ self.registers.append(name) self.addresses.append(address)
Add a register to this interface Args: name (str): Name of the register to add address (number): Address of the register
Add a register to this interface
[ "Add", "a", "register", "to", "this", "interface" ]
def add_register(self, name, address): self.registers.append(name) self.addresses.append(address)
[ "def", "add_register", "(", "self", ",", "name", ",", "address", ")", ":", "self", ".", "registers", ".", "append", "(", "name", ")", "self", ".", "addresses", ".", "append", "(", "address", ")" ]
Add a register to this interface
[ "Add", "a", "register", "to", "this", "interface" ]
[ "\"\"\"\n Add a register to this interface\n\n Args:\n name (str): Name of the register to add\n address (number): Address of the register\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "name", "type": null }, { "param": "address", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "name", "type": null, "docstring": "Name of the register to add", ...
2112f11ea638d6066e300a9a696700701770134b
sharm294/sonar
sonar/interfaces/axi4_lite_slave.py
[ "MIT" ]
Python
del_register
null
def del_register(self, name): """ Delete a register from this interface Args: name (str): Name of the register to delete """ for index, name_ in enumerate(self.registers): if name_ == name: del self.registers[index] del se...
Delete a register from this interface Args: name (str): Name of the register to delete
Delete a register from this interface
[ "Delete", "a", "register", "from", "this", "interface" ]
def del_register(self, name): for index, name_ in enumerate(self.registers): if name_ == name: del self.registers[index] del self.addresses[index] break
[ "def", "del_register", "(", "self", ",", "name", ")", ":", "for", "index", ",", "name_", "in", "enumerate", "(", "self", ".", "registers", ")", ":", "if", "name_", "==", "name", ":", "del", "self", ".", "registers", "[", "index", "]", "del", "self", ...
Delete a register from this interface
[ "Delete", "a", "register", "from", "this", "interface" ]
[ "\"\"\"\n Delete a register from this interface\n\n Args:\n name (str): Name of the register to delete\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "name", "type": null, "docstring": "Name of the register to delete",...
2112f11ea638d6066e300a9a696700701770134b
sharm294/sonar
sonar/interfaces/axi4_lite_slave.py
[ "MIT" ]
Python
init_signals
null
def init_signals( self, mode, data_width=None, addr_width=None, upper_case=True ): """ Initialize the signals associated with this AXILite interface. Initialize means to specify the names, types and widths of all the signals. Args: mode (str): Name of a s...
Initialize the signals associated with this AXILite interface. Initialize means to specify the names, types and widths of all the signals. Args: mode (str): Name of a signal preset to use. Options are: 'default': standard AXI-Lite without cache or prot ...
Initialize the signals associated with this AXILite interface. Initialize means to specify the names, types and widths of all the signals.
[ "Initialize", "the", "signals", "associated", "with", "this", "AXILite", "interface", ".", "Initialize", "means", "to", "specify", "the", "names", "types", "and", "widths", "of", "all", "the", "signals", "." ]
def init_signals( self, mode, data_width=None, addr_width=None, upper_case=True ): if mode == "default": if addr_width < 12: addr_width = ( 12 ) signals = { "awvalid": sonar.base_types.Signal("awvalid", 1),...
[ "def", "init_signals", "(", "self", ",", "mode", ",", "data_width", "=", "None", ",", "addr_width", "=", "None", ",", "upper_case", "=", "True", ")", ":", "if", "mode", "==", "\"default\"", ":", "if", "addr_width", "<", "12", ":", "addr_width", "=", "(...
Initialize the signals associated with this AXILite interface.
[ "Initialize", "the", "signals", "associated", "with", "this", "AXILite", "interface", "." ]
[ "\"\"\"\n Initialize the signals associated with this AXILite interface.\n Initialize means to specify the names, types and widths of all the\n signals.\n\n Args:\n mode (str): Name of a signal preset to use. Options are:\n 'default': standard AXI-Lite without c...
[ { "param": "self", "type": null }, { "param": "mode", "type": null }, { "param": "data_width", "type": null }, { "param": "addr_width", "type": null }, { "param": "upper_case", "type": null } ]
{ "returns": [], "raises": [ { "docstring": "Unhandled exception if bad mode entered", "docstring_tokens": [ "Unhandled", "exception", "if", "bad", "mode", "entered" ], "type": "NotImplementedError" }, { "docstring": "Error in...
2112f11ea638d6066e300a9a696700701770134b
sharm294/sonar
sonar/interfaces/axi4_lite_slave.py
[ "MIT" ]
Python
asdict
<not_specific>
def asdict(self): """ Returns this object as a dictionary Returns: dict: The fields of this object as a dictionary """ tmp = super().asdict() tmp["clock"] = self.clock tmp["reset"] = self.reset tmp["registers"] = self.registers tmp["ad...
Returns this object as a dictionary Returns: dict: The fields of this object as a dictionary
Returns this object as a dictionary
[ "Returns", "this", "object", "as", "a", "dictionary" ]
def asdict(self): tmp = super().asdict() tmp["clock"] = self.clock tmp["reset"] = self.reset tmp["registers"] = self.registers tmp["addresses"] = self.addresses tmp["addr_offset"] = self.addr_offset tmp["addr_range"] = self.addr_range return tmp
[ "def", "asdict", "(", "self", ")", ":", "tmp", "=", "super", "(", ")", ".", "asdict", "(", ")", "tmp", "[", "\"clock\"", "]", "=", "self", ".", "clock", "tmp", "[", "\"reset\"", "]", "=", "self", ".", "reset", "tmp", "[", "\"registers\"", "]", "=...
Returns this object as a dictionary
[ "Returns", "this", "object", "as", "a", "dictionary" ]
[ "\"\"\"\n Returns this object as a dictionary\n\n Returns:\n dict: The fields of this object as a dictionary\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "The fields of this object as a dictionary", "docstring_tokens": [ "The", "fields", "of", "this", "object", "as", "a", "dictionary" ], "type": "dict" } ], "raises": [], "params": [ {...
2112f11ea638d6066e300a9a696700701770134b
sharm294/sonar
sonar/interfaces/axi4_lite_slave.py
[ "MIT" ]
Python
import_packages_global
<not_specific>
def import_packages_global(): """ Specifies any packages that must be imported once per testbench Returns: str: Packages to be imported """ imports = "" # versionInfo = subprocess.check_output("vivado -version", shell=True) version = os.getenv("SONAR...
Specifies any packages that must be imported once per testbench Returns: str: Packages to be imported
Specifies any packages that must be imported once per testbench
[ "Specifies", "any", "packages", "that", "must", "be", "imported", "once", "per", "testbench" ]
def import_packages_global(): imports = "" version = os.getenv("SONAR_CAD_VERSION") if version == "2017.2": imports += "import axi_vip_v1_0_2_pkg::*;\n" else: imports += "import axi_vip_pkg::*;\n" return imports
[ "def", "import_packages_global", "(", ")", ":", "imports", "=", "\"\"", "version", "=", "os", ".", "getenv", "(", "\"SONAR_CAD_VERSION\"", ")", "if", "version", "==", "\"2017.2\"", ":", "imports", "+=", "\"import axi_vip_v1_0_2_pkg::*;\\n\"", "else", ":", "imports...
Specifies any packages that must be imported once per testbench
[ "Specifies", "any", "packages", "that", "must", "be", "imported", "once", "per", "testbench" ]
[ "\"\"\"\n Specifies any packages that must be imported once per testbench\n\n Returns:\n str: Packages to be imported\n \"\"\"", "# versionInfo = subprocess.check_output(\"vivado -version\", shell=True)", "# version = versionInfo.split()[1].decode(\"utf-8\")" ]
[]
{ "returns": [ { "docstring": "Packages to be imported", "docstring_tokens": [ "Packages", "to", "be", "imported" ], "type": "str" } ], "raises": [], "params": [], "outlier_params": [], "others": [] }
2112f11ea638d6066e300a9a696700701770134b
sharm294/sonar
sonar/interfaces/axi4_lite_slave.py
[ "MIT" ]
Python
import_packages_local
<not_specific>
def import_packages_local(interface): """ Specifies any packages that must be imported once per interface Args: interface (AXI4LiteSlave): AXI4LiteSlave instance Returns: str: Packages to be imported """ return ( "import vip_bd_" + st...
Specifies any packages that must be imported once per interface Args: interface (AXI4LiteSlave): AXI4LiteSlave instance Returns: str: Packages to be imported
Specifies any packages that must be imported once per interface
[ "Specifies", "any", "packages", "that", "must", "be", "imported", "once", "per", "interface" ]
def import_packages_local(interface): return ( "import vip_bd_" + str(interface.index) + "_axi_vip_0_0_pkg::*;\n" )
[ "def", "import_packages_local", "(", "interface", ")", ":", "return", "(", "\"import vip_bd_\"", "+", "str", "(", "interface", ".", "index", ")", "+", "\"_axi_vip_0_0_pkg::*;\\n\"", ")" ]
Specifies any packages that must be imported once per interface
[ "Specifies", "any", "packages", "that", "must", "be", "imported", "once", "per", "interface" ]
[ "\"\"\"\n Specifies any packages that must be imported once per interface\n\n Args:\n interface (AXI4LiteSlave): AXI4LiteSlave instance\n\n Returns:\n str: Packages to be imported\n \"\"\"" ]
[ { "param": "interface", "type": null } ]
{ "returns": [ { "docstring": "Packages to be imported", "docstring_tokens": [ "Packages", "to", "be", "imported" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "interface", "type": null, "docstring": null, ...
2112f11ea638d6066e300a9a696700701770134b
sharm294/sonar
sonar/interfaces/axi4_lite_slave.py
[ "MIT" ]
Python
initial_blocks
<not_specific>
def initial_blocks(indent): """ Any text that should be inside an initial block Args: indent (str): Indentation to add to each line Returns: list[str]: List of strings that go into separate initial blocks """ prologue = ( indent ...
Any text that should be inside an initial block Args: indent (str): Indentation to add to each line Returns: list[str]: List of strings that go into separate initial blocks
Any text that should be inside an initial block
[ "Any", "text", "that", "should", "be", "inside", "an", "initial", "block" ]
def initial_blocks(indent): prologue = ( indent + '$$agent = new("master vip agent", vip_bd_$$index_i.axi_vip_0.inst.IF);\n' ) prologue += indent + '$$agent.set_agent_tag("$$agent");\n' prologue += indent + "$$agent.start_master();\n" return [prologue]
[ "def", "initial_blocks", "(", "indent", ")", ":", "prologue", "=", "(", "indent", "+", "'$$agent = new(\"master vip agent\", vip_bd_$$index_i.axi_vip_0.inst.IF);\\n'", ")", "prologue", "+=", "indent", "+", "'$$agent.set_agent_tag(\"$$agent\");\\n'", "prologue", "+=", "indent"...
Any text that should be inside an initial block
[ "Any", "text", "that", "should", "be", "inside", "an", "initial", "block" ]
[ "\"\"\"\n Any text that should be inside an initial block\n\n Args:\n indent (str): Indentation to add to each line\n\n Returns:\n list[str]: List of strings that go into separate initial blocks\n \"\"\"" ]
[ { "param": "indent", "type": null } ]
{ "returns": [ { "docstring": "List of strings that go into separate initial blocks", "docstring_tokens": [ "List", "of", "strings", "that", "go", "into", "separate", "initial", "blocks" ], "type": "list[str]" } ...
2112f11ea638d6066e300a9a696700701770134b
sharm294/sonar
sonar/interfaces/axi4_lite_slave.py
[ "MIT" ]
Python
prologue
<not_specific>
def prologue(indent): """ Any text that should be part of the testbench as a prologue outside any blocks such as variable declarations. Args: indent (str): Indentation to add to each line Returns: str: Updated prologue """ prologue = inde...
Any text that should be part of the testbench as a prologue outside any blocks such as variable declarations. Args: indent (str): Indentation to add to each line Returns: str: Updated prologue
Any text that should be part of the testbench as a prologue outside any blocks such as variable declarations.
[ "Any", "text", "that", "should", "be", "part", "of", "the", "testbench", "as", "a", "prologue", "outside", "any", "blocks", "such", "as", "variable", "declarations", "." ]
def prologue(indent): prologue = indent + "logic [$$dataWidth-1:0] rdata_$$index;\n" prologue += indent + "xil_axi_resp_t rresp_$$index;\n" prologue += indent + "xil_axi_resp_t wresp_$$index;\n" prologue += ( indent + "vip_bd_$$index_axi_vip_0_0_mst_t master_agent_$$index;\n"...
[ "def", "prologue", "(", "indent", ")", ":", "prologue", "=", "indent", "+", "\"logic [$$dataWidth-1:0] rdata_$$index;\\n\"", "prologue", "+=", "indent", "+", "\"xil_axi_resp_t rresp_$$index;\\n\"", "prologue", "+=", "indent", "+", "\"xil_axi_resp_t wresp_$$index;\\n\"", "pr...
Any text that should be part of the testbench as a prologue outside any blocks such as variable declarations.
[ "Any", "text", "that", "should", "be", "part", "of", "the", "testbench", "as", "a", "prologue", "outside", "any", "blocks", "such", "as", "variable", "declarations", "." ]
[ "\"\"\"\n Any text that should be part of the testbench as a prologue outside any\n blocks such as variable declarations.\n\n Args:\n indent (str): Indentation to add to each line\n\n Returns:\n str: Updated prologue\n \"\"\"" ]
[ { "param": "indent", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "indent", "type": null, "docstring": "Indentation to add to each line", "docstring_tokens": [ "Indentation"...
2112f11ea638d6066e300a9a696700701770134b
sharm294/sonar
sonar/interfaces/axi4_lite_slave.py
[ "MIT" ]
Python
source_tcl
null
def source_tcl(interface, path): """ Any TCL files that should be sourced as part of initializing the interface Args: interface (AXI4LiteSlave): AXI4LiteSlave object path (str): Path where to place the TCL source files """ tcl_file_name = os.path...
Any TCL files that should be sourced as part of initializing the interface Args: interface (AXI4LiteSlave): AXI4LiteSlave object path (str): Path where to place the TCL source files
Any TCL files that should be sourced as part of initializing the interface
[ "Any", "TCL", "files", "that", "should", "be", "sourced", "as", "part", "of", "initializing", "the", "interface" ]
def source_tcl(interface, path): tcl_file_name = os.path.join( os.path.dirname(__file__), "axi4_lite_slave_vip.tcl" ) with open(tcl_file_name) as f: tcl_file = f.read() tcl_file = tcl_file.replace( "#DESIGN_NAME#", "vip_bd_" + str(interface.ind...
[ "def", "source_tcl", "(", "interface", ",", "path", ")", ":", "tcl_file_name", "=", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "__file__", ")", ",", "\"axi4_lite_slave_vip.tcl\"", ")", "with", "open", "(", "tcl_file_name",...
Any TCL files that should be sourced as part of initializing the interface
[ "Any", "TCL", "files", "that", "should", "be", "sourced", "as", "part", "of", "initializing", "the", "interface" ]
[ "\"\"\"\n Any TCL files that should be sourced as part of initializing the\n interface\n\n Args:\n interface (AXI4LiteSlave): AXI4LiteSlave object\n path (str): Path where to place the TCL source files\n \"\"\"" ]
[ { "param": "interface", "type": null }, { "param": "path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "interface", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": null, "is_optional": false }, { "identifier": "path", "type": null, "docstring": "Path...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
default
<not_specific>
def default(cls, module_name): """ Initializes a Testbench with default metadata values Args: module_name (str): Name of the DUT module Returns: Testbench: the Testbench object represents the whole testbench """ testbench = cls() testben...
Initializes a Testbench with default metadata values Args: module_name (str): Name of the DUT module Returns: Testbench: the Testbench object represents the whole testbench
Initializes a Testbench with default metadata values
[ "Initializes", "a", "Testbench", "with", "default", "metadata", "values" ]
def default(cls, module_name): testbench = cls() testbench.metadata = { "Module_Name": module_name, "Timescale": "1ns / 1ps", "Time_Format": {"unit": "1us", "precision": 3}, "Flag_Count": 1, "Timeout_Value": "10s", "Headers": [], ...
[ "def", "default", "(", "cls", ",", "module_name", ")", ":", "testbench", "=", "cls", "(", ")", "testbench", ".", "metadata", "=", "{", "\"Module_Name\"", ":", "module_name", ",", "\"Timescale\"", ":", "\"1ns / 1ps\"", ",", "\"Time_Format\"", ":", "{", "\"uni...
Initializes a Testbench with default metadata values
[ "Initializes", "a", "Testbench", "with", "default", "metadata", "values" ]
[ "\"\"\"\n Initializes a Testbench with default metadata values\n\n Args:\n module_name (str): Name of the DUT module\n\n Returns:\n Testbench: the Testbench object represents the whole testbench\n \"\"\"", "# arbitrary large amount" ]
[ { "param": "cls", "type": null }, { "param": "module_name", "type": null } ]
{ "returns": [ { "docstring": "the Testbench object represents the whole testbench", "docstring_tokens": [ "the", "Testbench", "object", "represents", "the", "whole", "testbench" ], "type": "Testbench" } ], "raises": [], "pa...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
add_metadata
null
def add_metadata(self, key, value): """ Adds metadata to the Sonar object Args: key (str): Key to store the value against value (str): Metadata to store Raises: KeyError: Raised if the requested key already exists """ if key in self....
Adds metadata to the Sonar object Args: key (str): Key to store the value against value (str): Metadata to store Raises: KeyError: Raised if the requested key already exists
Adds metadata to the Sonar object
[ "Adds", "metadata", "to", "the", "Sonar", "object" ]
def add_metadata(self, key, value): if key in self.metadata: raise KeyError("Key " + key + " already exists in metadata") self.metadata[key] = value
[ "def", "add_metadata", "(", "self", ",", "key", ",", "value", ")", ":", "if", "key", "in", "self", ".", "metadata", ":", "raise", "KeyError", "(", "\"Key \"", "+", "key", "+", "\" already exists in metadata\"", ")", "self", ".", "metadata", "[", "key", "...
Adds metadata to the Sonar object
[ "Adds", "metadata", "to", "the", "Sonar", "object" ]
[ "\"\"\"\n Adds metadata to the Sonar object\n\n Args:\n key (str): Key to store the value against\n value (str): Metadata to store\n\n Raises:\n KeyError: Raised if the requested key already exists\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "key", "type": null }, { "param": "value", "type": null } ]
{ "returns": [], "raises": [ { "docstring": "Raised if the requested key already exists", "docstring_tokens": [ "Raised", "if", "the", "requested", "key", "already", "exists" ], "type": "KeyError" } ], "params": [ { ...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
add_dut
null
def add_dut(self, module): """ Add the device-under-test to the testbench Args: module (Module): Module to add to this testbench """ module.name = "DUT" self.modules["DUT"] = module
Add the device-under-test to the testbench Args: module (Module): Module to add to this testbench
Add the device-under-test to the testbench
[ "Add", "the", "device", "-", "under", "-", "test", "to", "the", "testbench" ]
def add_dut(self, module): module.name = "DUT" self.modules["DUT"] = module
[ "def", "add_dut", "(", "self", ",", "module", ")", ":", "module", ".", "name", "=", "\"DUT\"", "self", ".", "modules", "[", "\"DUT\"", "]", "=", "module" ]
Add the device-under-test to the testbench
[ "Add", "the", "device", "-", "under", "-", "test", "to", "the", "testbench" ]
[ "\"\"\"\n Add the device-under-test to the testbench\n\n Args:\n module (Module): Module to add to this testbench\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "module", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "module", "type": null, "docstring": "Module to add to this testbenc...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
asdict
<not_specific>
def asdict(self): """ Converts the object to a dictionary Returns: dict: Dictionary representing the object """ sonar_dict = {} sonar_dict["metadata"] = self.metadata modules = {} for _, module in self.modules.items(): modules[mod...
Converts the object to a dictionary Returns: dict: Dictionary representing the object
Converts the object to a dictionary
[ "Converts", "the", "object", "to", "a", "dictionary" ]
def asdict(self): sonar_dict = {} sonar_dict["metadata"] = self.metadata modules = {} for _, module in self.modules.items(): modules[module.name] = module.asdict() sonar_dict["modules"] = modules sonar_dict["wait_conditions"] = self.wait_conditions vec...
[ "def", "asdict", "(", "self", ")", ":", "sonar_dict", "=", "{", "}", "sonar_dict", "[", "\"metadata\"", "]", "=", "self", ".", "metadata", "modules", "=", "{", "}", "for", "_", ",", "module", "in", "self", ".", "modules", ".", "items", "(", ")", ":...
Converts the object to a dictionary
[ "Converts", "the", "object", "to", "a", "dictionary" ]
[ "\"\"\"\n Converts the object to a dictionary\n\n Returns:\n dict: Dictionary representing the object\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "Dictionary representing the object", "docstring_tokens": [ "Dictionary", "representing", "the", "object" ], "type": "dict" } ], "raises": [], "params": [ { "identifier": "self", "type": null, "do...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
asjson
<not_specific>
def asjson(self): """ Converts the testbench into JSON format for further processing or printing Returns: str: Testbench object dumped as JSON string """ return json.dumps(self.asdict(), indent=2)
Converts the testbench into JSON format for further processing or printing Returns: str: Testbench object dumped as JSON string
Converts the testbench into JSON format for further processing or printing
[ "Converts", "the", "testbench", "into", "JSON", "format", "for", "further", "processing", "or", "printing" ]
def asjson(self): return json.dumps(self.asdict(), indent=2)
[ "def", "asjson", "(", "self", ")", ":", "return", "json", ".", "dumps", "(", "self", ".", "asdict", "(", ")", ",", "indent", "=", "2", ")" ]
Converts the testbench into JSON format for further processing or printing
[ "Converts", "the", "testbench", "into", "JSON", "format", "for", "further", "processing", "or", "printing" ]
[ "\"\"\"\n Converts the testbench into JSON format for further processing or\n printing\n\n Returns:\n str: Testbench object dumped as JSON string\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "Testbench object dumped as JSON string", "docstring_tokens": [ "Testbench", "object", "dumped", "as", "JSON", "string" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "self", ...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
generate_tb
null
def generate_tb(self, tb_filepath, languages, force=False): """ After the Testbench object is complete, this will invoke the Sonar Core to generate the testbench(es) based on the information Args: tb_filepath (str): path to the sonar testbench script languages (s...
After the Testbench object is complete, this will invoke the Sonar Core to generate the testbench(es) based on the information Args: tb_filepath (str): path to the sonar testbench script languages (str): sv or all to choose which languages force (bool, optio...
After the Testbench object is complete, this will invoke the Sonar Core to generate the testbench(es) based on the information
[ "After", "the", "Testbench", "object", "is", "complete", "this", "will", "invoke", "the", "Sonar", "Core", "to", "generate", "the", "testbench", "(", "es", ")", "based", "on", "the", "information" ]
def generate_tb(self, tb_filepath, languages, force=False): generate.sonar(self, tb_filepath, languages, force)
[ "def", "generate_tb", "(", "self", ",", "tb_filepath", ",", "languages", ",", "force", "=", "False", ")", ":", "generate", ".", "sonar", "(", "self", ",", "tb_filepath", ",", "languages", ",", "force", ")" ]
After the Testbench object is complete, this will invoke the Sonar Core to generate the testbench(es) based on the information
[ "After", "the", "Testbench", "object", "is", "complete", "this", "will", "invoke", "the", "Sonar", "Core", "to", "generate", "the", "testbench", "(", "es", ")", "based", "on", "the", "information" ]
[ "\"\"\"\n After the Testbench object is complete, this will invoke the Sonar Core\n to generate the testbench(es) based on the information\n\n Args:\n tb_filepath (str): path to the sonar testbench script\n languages (str): sv or all to choose which languages\n ...
[ { "param": "self", "type": null }, { "param": "tb_filepath", "type": null }, { "param": "languages", "type": null }, { "param": "force", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "tb_filepath", "type": null, "docstring": "path to the sonar testben...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
default
<not_specific>
def default(cls, name): """ Creates a default module with the given name Args: name (str): Name of the module to create Returns: Module: Object representing a module """ module = cls() module.name = name return module
Creates a default module with the given name Args: name (str): Name of the module to create Returns: Module: Object representing a module
Creates a default module with the given name
[ "Creates", "a", "default", "module", "with", "the", "given", "name" ]
def default(cls, name): module = cls() module.name = name return module
[ "def", "default", "(", "cls", ",", "name", ")", ":", "module", "=", "cls", "(", ")", "module", ".", "name", "=", "name", "return", "module" ]
Creates a default module with the given name
[ "Creates", "a", "default", "module", "with", "the", "given", "name" ]
[ "\"\"\"\n Creates a default module with the given name\n\n Args:\n name (str): Name of the module to create\n\n Returns:\n Module: Object representing a module\n \"\"\"" ]
[ { "param": "cls", "type": null }, { "param": "name", "type": null } ]
{ "returns": [ { "docstring": "Object representing a module", "docstring_tokens": [ "Object", "representing", "a", "module" ], "type": "Module" } ], "raises": [], "params": [ { "identifier": "cls", "type": null, "docstring": n...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
cpp
<not_specific>
def cpp(cls, name, lang, hls, hls_version): """ Creates a default cpp module with the given name, language and HLS tool Args: name (str): Name of the module to create lang (str): Language used for the module hls (str): HLS tool used to synthesize ...
Creates a default cpp module with the given name, language and HLS tool Args: name (str): Name of the module to create lang (str): Language used for the module hls (str): HLS tool used to synthesize hls_version (str): HLS tool version Returns: ...
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(cls, name, lang, hls, hls_version): module = cls() module.type["lang"] = lang module.type["hls"] = hls module.type["hls_version"] = hls_version module.name = name return module
[ "def", "cpp", "(", "cls", ",", "name", ",", "lang", ",", "hls", ",", "hls_version", ")", ":", "module", "=", "cls", "(", ")", "module", ".", "type", "[", "\"lang\"", "]", "=", "lang", "module", ".", "type", "[", "\"hls\"", "]", "=", "hls", "modul...
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" ]
[ "\"\"\"\n Creates a default cpp module with the given name, language and HLS tool\n\n Args:\n name (str): Name of the module to create\n lang (str): Language used for the module\n hls (str): HLS tool used to synthesize\n hls_version (str): HLS tool version\n...
[ { "param": "cls", "type": null }, { "param": "name", "type": null }, { "param": "lang", "type": null }, { "param": "hls", "type": null }, { "param": "hls_version", "type": null } ]
{ "returns": [ { "docstring": "Object representing a module", "docstring_tokens": [ "Object", "representing", "a", "module" ], "type": "Module" } ], "raises": [], "params": [ { "identifier": "cls", "type": null, "docstring": n...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
cpp_vivado
<not_specific>
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 pe...
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 ...
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...
[ "def", "cpp_vivado", "(", "cls", ",", "name", ",", "clk_period", "=", "\"20ns\"", ",", "reset_low", "=", "True", ",", "version", "=", "\"2018.1\"", ")", ":", "module", "=", "cls", "(", ")", ".", "cpp", "(", "name", ",", "\"cpp\"", ",", "\"vivado\"", ...
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" ]
[ "\"\"\"\n Creates a default cpp module with the given name, language and HLS tool\n\n Args:\n name (str): Name of the module to create\n clk_period (str, optional): Defaults to 20ns. Clock period to use\n reset_low (bool, optional): Defaults to True. Enable active low ...
[ { "param": "cls", "type": null }, { "param": "name", "type": null }, { "param": "clk_period", "type": null }, { "param": "reset_low", "type": null }, { "param": "version", "type": null } ]
{ "returns": [ { "docstring": "Object representing a module", "docstring_tokens": [ "Object", "representing", "a", "module" ], "type": "Module" } ], "raises": [], "params": [ { "identifier": "cls", "type": null, "docstring": n...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
add_port
null
def add_port(self, name, direction, size=1): """ Adds a port to this module for a generic signal Args: name (str): Name of the signal direction (str): Must be one of (input|output) size (int, optional): Defaults to 1. Width of the port in bits """ ...
Adds a port to this module for a generic signal Args: name (str): Name of the signal direction (str): Must be one of (input|output) size (int, optional): Defaults to 1. Width of the port in bits
Adds a port to this module for a generic signal
[ "Adds", "a", "port", "to", "this", "module", "for", "a", "generic", "signal" ]
def add_port(self, name, direction, size=1): signal = base.SignalPort(name, size, direction) self.ports.add_signal(signal)
[ "def", "add_port", "(", "self", ",", "name", ",", "direction", ",", "size", "=", "1", ")", ":", "signal", "=", "base", ".", "SignalPort", "(", "name", ",", "size", ",", "direction", ")", "self", ".", "ports", ".", "add_signal", "(", "signal", ")" ]
Adds a port to this module for a generic signal
[ "Adds", "a", "port", "to", "this", "module", "for", "a", "generic", "signal" ]
[ "\"\"\"\n Adds a port to this module for a generic signal\n\n Args:\n name (str): Name of the signal\n direction (str): Must be one of (input|output)\n size (int, optional): Defaults to 1. Width of the port in bits\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "name", "type": null }, { "param": "direction", "type": null }, { "param": "size", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "name", "type": null, "docstring": "Name of the signal", "docs...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
add_parameter
null
def add_parameter(self, name, value): """ Add a named parameter to this module's instantiation Args: name (str): Name of parameter value (str): Value to assign to parameter """ self.parameters.append((name, value))
Add a named parameter to this module's instantiation Args: name (str): Name of parameter value (str): Value to assign to parameter
Add a named parameter to this module's instantiation
[ "Add", "a", "named", "parameter", "to", "this", "module", "'", "s", "instantiation" ]
def add_parameter(self, name, value): self.parameters.append((name, value))
[ "def", "add_parameter", "(", "self", ",", "name", ",", "value", ")", ":", "self", ".", "parameters", ".", "append", "(", "(", "name", ",", "value", ")", ")" ]
Add a named parameter to this module's instantiation
[ "Add", "a", "named", "parameter", "to", "this", "module", "'", "s", "instantiation" ]
[ "\"\"\"\n Add a named parameter to this module's instantiation\n\n Args:\n name (str): Name of parameter\n value (str): Value to assign to parameter\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "name", "type": null }, { "param": "value", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "name", "type": null, "docstring": "Name of parameter", "docst...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
add_clock_port
null
def add_clock_port(self, name, period): """ Adds an input clock port to this module (only for TB generated clocks) Args: name (str): Name of the clock signal period (str): Period of the clock (e.g. 20ns, 10ps etc.) """ signal = base.ClockPort(name, 1, pe...
Adds an input clock port to this module (only for TB generated clocks) Args: name (str): Name of the clock signal period (str): Period of the clock (e.g. 20ns, 10ps etc.)
Adds an input clock port to this module (only for TB generated clocks)
[ "Adds", "an", "input", "clock", "port", "to", "this", "module", "(", "only", "for", "TB", "generated", "clocks", ")" ]
def add_clock_port(self, name, period): signal = base.ClockPort(name, 1, period, "input") self.ports.add_clock(signal) endpoint = sonar.endpoints.PeriodicSignal endpoint.arguments = { "name": name, "value": 1, "period": period, "size": 1, ...
[ "def", "add_clock_port", "(", "self", ",", "name", ",", "period", ")", ":", "signal", "=", "base", ".", "ClockPort", "(", "name", ",", "1", ",", "period", ",", "\"input\"", ")", "self", ".", "ports", ".", "add_clock", "(", "signal", ")", "endpoint", ...
Adds an input clock port to this module (only for TB generated clocks)
[ "Adds", "an", "input", "clock", "port", "to", "this", "module", "(", "only", "for", "TB", "generated", "clocks", ")" ]
[ "\"\"\"\n Adds an input clock port to this module (only for TB generated clocks)\n\n Args:\n name (str): Name of the clock signal\n period (str): Period of the clock (e.g. 20ns, 10ps etc.)\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "name", "type": null }, { "param": "period", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "name", "type": null, "docstring": "Name of the clock signal", ...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
add_reset_port
null
def add_reset_port(self, name): """ Adds an input reset port to this module Args: name (str): Name of the reset signal """ signal = base.SignalPort(name, 1, "input") self.ports.add_reset(signal)
Adds an input reset port to this module Args: name (str): Name of the reset signal
Adds an input reset port to this module
[ "Adds", "an", "input", "reset", "port", "to", "this", "module" ]
def add_reset_port(self, name): signal = base.SignalPort(name, 1, "input") self.ports.add_reset(signal)
[ "def", "add_reset_port", "(", "self", ",", "name", ")", ":", "signal", "=", "base", ".", "SignalPort", "(", "name", ",", "1", ",", "\"input\"", ")", "self", ".", "ports", ".", "add_reset", "(", "signal", ")" ]
Adds an input reset port to this module
[ "Adds", "an", "input", "reset", "port", "to", "this", "module" ]
[ "\"\"\"\n Adds an input reset port to this module\n\n Args:\n name (str): Name of the reset signal\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "name", "type": null, "docstring": "Name of the reset signal", ...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
add_interface
null
def add_interface(self, interface): """ Adds an interface port to this module Args: interface (BaseInterface): Represents the interface port and must be a child class of BaseInterface. """ port = interface if port.interface_type not in self.p...
Adds an interface port to this module Args: interface (BaseInterface): Represents the interface port and must be a child class of BaseInterface.
Adds an interface port to this module
[ "Adds", "an", "interface", "port", "to", "this", "module" ]
def add_interface(self, interface): port = interface if port.interface_type not in self.ports.interfaces.count: self.ports.interfaces.count[port.interface_type] = 0 else: self.ports.interfaces.count[port.interface_type] += 1 port.index = self.ports.interfaces.coun...
[ "def", "add_interface", "(", "self", ",", "interface", ")", ":", "port", "=", "interface", "if", "port", ".", "interface_type", "not", "in", "self", ".", "ports", ".", "interfaces", ".", "count", ":", "self", ".", "ports", ".", "interfaces", ".", "count"...
Adds an interface port to this module
[ "Adds", "an", "interface", "port", "to", "this", "module" ]
[ "\"\"\"\n Adds an interface port to this module\n\n Args:\n interface (BaseInterface): Represents the interface port and\n must be a child class of BaseInterface.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "interface", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "interface", "type": null, "docstring": "Represents the interface po...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
add_endpoint
null
def add_endpoint(self, port, endpoint): """ Add an endpoint to a port on the module Args: port (str): Name of the port endpoint (Endpoint): Endpoint to add """ if port not in self.endpoints: self.endpoints[port] = [] self.endpoints[por...
Add an endpoint to a port on the module Args: port (str): Name of the port endpoint (Endpoint): Endpoint to add
Add an endpoint to a port on the module
[ "Add", "an", "endpoint", "to", "a", "port", "on", "the", "module" ]
def add_endpoint(self, port, endpoint): if port not in self.endpoints: self.endpoints[port] = [] self.endpoints[port].append(endpoint)
[ "def", "add_endpoint", "(", "self", ",", "port", ",", "endpoint", ")", ":", "if", "port", "not", "in", "self", ".", "endpoints", ":", "self", ".", "endpoints", "[", "port", "]", "=", "[", "]", "self", ".", "endpoints", "[", "port", "]", ".", "appen...
Add an endpoint to a port on the module
[ "Add", "an", "endpoint", "to", "a", "port", "on", "the", "module" ]
[ "\"\"\"\n Add an endpoint to a port on the module\n\n Args:\n port (str): Name of the port\n endpoint (Endpoint): Endpoint to add\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "port", "type": null }, { "param": "endpoint", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "port", "type": null, "docstring": "Name of the port", "docstr...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
asdict
<not_specific>
def asdict(self): """ Converts the object to a dictionary Returns: dict: Dictionary representing the object """ module = {} module["name"] = self.name module["ports"] = self.ports.asdict() module["parameters"] = self.parameters module[...
Converts the object to a dictionary Returns: dict: Dictionary representing the object
Converts the object to a dictionary
[ "Converts", "the", "object", "to", "a", "dictionary" ]
def asdict(self): module = {} module["name"] = self.name module["ports"] = self.ports.asdict() module["parameters"] = self.parameters module["endpoints"] = self.endpoints module["type"] = self.type return module
[ "def", "asdict", "(", "self", ")", ":", "module", "=", "{", "}", "module", "[", "\"name\"", "]", "=", "self", ".", "name", "module", "[", "\"ports\"", "]", "=", "self", ".", "ports", ".", "asdict", "(", ")", "module", "[", "\"parameters\"", "]", "=...
Converts the object to a dictionary
[ "Converts", "the", "object", "to", "a", "dictionary" ]
[ "\"\"\"\n Converts the object to a dictionary\n\n Returns:\n dict: Dictionary representing the object\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "Dictionary representing the object", "docstring_tokens": [ "Dictionary", "representing", "the", "object" ], "type": "dict" } ], "raises": [], "params": [ { "identifier": "self", "type": null, "do...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
add_thread
<not_specific>
def add_thread(self, thread=None): """ Adds a thread to the TestVector. If a thread is provided as an argument, it's added to the TestVector. Otherwise, an empty one is created, added and returned. Args: thread (Thread, optional): Defaults to None. The thread to add ...
Adds a thread to the TestVector. If a thread is provided as an argument, it's added to the TestVector. Otherwise, an empty one is created, added and returned. Args: thread (Thread, optional): Defaults to None. The thread to add Returns: Thread: The adde...
Adds a thread to the TestVector. If a thread is provided as an argument, it's added to the TestVector. Otherwise, an empty one is created, added and returned.
[ "Adds", "a", "thread", "to", "the", "TestVector", ".", "If", "a", "thread", "is", "provided", "as", "an", "argument", "it", "'", "s", "added", "to", "the", "TestVector", ".", "Otherwise", "an", "empty", "one", "is", "created", "added", "and", "returned",...
def add_thread(self, thread=None): if thread is None: thread = Thread() self.threads.append(thread) return thread
[ "def", "add_thread", "(", "self", ",", "thread", "=", "None", ")", ":", "if", "thread", "is", "None", ":", "thread", "=", "Thread", "(", ")", "self", ".", "threads", ".", "append", "(", "thread", ")", "return", "thread" ]
Adds a thread to the TestVector.
[ "Adds", "a", "thread", "to", "the", "TestVector", "." ]
[ "\"\"\"\n Adds a thread to the TestVector. If a thread is provided as an argument,\n it's added to the TestVector. Otherwise, an empty one is created, added\n and returned.\n\n Args:\n thread (Thread, optional): Defaults to None. The thread to add\n\n Returns:\n ...
[ { "param": "self", "type": null }, { "param": "thread", "type": null } ]
{ "returns": [ { "docstring": "The added thread is returned", "docstring_tokens": [ "The", "added", "thread", "is", "returned" ], "type": "Thread" } ], "raises": [], "params": [ { "identifier": "self", "type": null, "d...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
asdict
<not_specific>
def asdict(self): """ Converts the object to a dictionary Returns: dict: Dictionary representing the object """ threads = [] for thread in self.threads: threads.append(thread.asdict()) return threads
Converts the object to a dictionary Returns: dict: Dictionary representing the object
Converts the object to a dictionary
[ "Converts", "the", "object", "to", "a", "dictionary" ]
def asdict(self): threads = [] for thread in self.threads: threads.append(thread.asdict()) return threads
[ "def", "asdict", "(", "self", ")", ":", "threads", "=", "[", "]", "for", "thread", "in", "self", ".", "threads", ":", "threads", ".", "append", "(", "thread", ".", "asdict", "(", ")", ")", "return", "threads" ]
Converts the object to a dictionary
[ "Converts", "the", "object", "to", "a", "dictionary" ]
[ "\"\"\"\n Converts the object to a dictionary\n\n Returns:\n dict: Dictionary representing the object\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "Dictionary representing the object", "docstring_tokens": [ "Dictionary", "representing", "the", "object" ], "type": "dict" } ], "raises": [], "params": [ { "identifier": "self", "type": null, "do...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
add_delay
null
def add_delay(self, delay): """ Add a timed delay to the thread Args: delay (str): String representing delay length e.g. '40ns' """ self.commands.append({"delay": delay}) self._print_timestamp()
Add a timed delay to the thread Args: delay (str): String representing delay length e.g. '40ns'
Add a timed delay to the thread
[ "Add", "a", "timed", "delay", "to", "the", "thread" ]
def add_delay(self, delay): self.commands.append({"delay": delay}) self._print_timestamp()
[ "def", "add_delay", "(", "self", ",", "delay", ")", ":", "self", ".", "commands", ".", "append", "(", "{", "\"delay\"", ":", "delay", "}", ")", "self", ".", "_print_timestamp", "(", ")" ]
Add a timed delay to the thread
[ "Add", "a", "timed", "delay", "to", "the", "thread" ]
[ "\"\"\"\n Add a timed delay to the thread\n\n Args:\n delay (str): String representing delay length e.g. '40ns'\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "delay", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "delay", "type": null, "docstring": "String representing delay lengt...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
call_dut
null
def call_dut(self, num): """ Call the DUT function some number of times (only for C++ TBs) Args: num (int): Number of times to call the DUT function """ self.commands.append({"call_dut": num})
Call the DUT function some number of times (only for C++ TBs) Args: num (int): Number of times to call the DUT function
Call the DUT function some number of times (only for C++ TBs)
[ "Call", "the", "DUT", "function", "some", "number", "of", "times", "(", "only", "for", "C", "++", "TBs", ")" ]
def call_dut(self, num): self.commands.append({"call_dut": num})
[ "def", "call_dut", "(", "self", ",", "num", ")", ":", "self", ".", "commands", ".", "append", "(", "{", "\"call_dut\"", ":", "num", "}", ")" ]
Call the DUT function some number of times (only for C++ TBs)
[ "Call", "the", "DUT", "function", "some", "number", "of", "times", "(", "only", "for", "C", "++", "TBs", ")" ]
[ "\"\"\"\n Call the DUT function some number of times (only for C++ TBs)\n\n Args:\n num (int): Number of times to call the DUT function\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "num", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "num", "type": null, "docstring": "Number of times to call the DUT f...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
enable_timestamps
null
def enable_timestamps(self, prefix, index): """ Each subsequent command (until disabled) will print the time after it finishes with the given prefix and an index which starts at the provided one. Args: prefix (str): String to prefix the timestamp with index (int)...
Each subsequent command (until disabled) will print the time after it finishes with the given prefix and an index which starts at the provided one. Args: prefix (str): String to prefix the timestamp with index (int): Integer to start indexing the timestamps at
Each subsequent command (until disabled) will print the time after it finishes with the given prefix and an index which starts at the provided one.
[ "Each", "subsequent", "command", "(", "until", "disabled", ")", "will", "print", "the", "time", "after", "it", "finishes", "with", "the", "given", "prefix", "and", "an", "index", "which", "starts", "at", "the", "provided", "one", "." ]
def enable_timestamps(self, prefix, index): self._enable_timestamps = True self.timestamp_prefix = prefix self.timestamp_index = index self.commands.append({"timestamp": prefix + str(index)}) self.timestamp_index += 1
[ "def", "enable_timestamps", "(", "self", ",", "prefix", ",", "index", ")", ":", "self", ".", "_enable_timestamps", "=", "True", "self", ".", "timestamp_prefix", "=", "prefix", "self", ".", "timestamp_index", "=", "index", "self", ".", "commands", ".", "appen...
Each subsequent command (until disabled) will print the time after it finishes with the given prefix and an index which starts at the provided one.
[ "Each", "subsequent", "command", "(", "until", "disabled", ")", "will", "print", "the", "time", "after", "it", "finishes", "with", "the", "given", "prefix", "and", "an", "index", "which", "starts", "at", "the", "provided", "one", "." ]
[ "\"\"\"\n Each subsequent command (until disabled) will print the time after it finishes\n with the given prefix and an index which starts at the provided one.\n\n Args:\n prefix (str): String to prefix the timestamp with\n index (int): Integer to start indexing the timest...
[ { "param": "self", "type": null }, { "param": "prefix", "type": null }, { "param": "index", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "prefix", "type": null, "docstring": "String to prefix the timestamp...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
_print_timestamp
null
def _print_timestamp(self): """ Used internally to add a timestamping command after certain Thread commands """ if self._enable_timestamps: self.commands.append( { "timestamp": self.timestamp_prefix + str(self.timestamp...
Used internally to add a timestamping command after certain Thread commands
Used internally to add a timestamping command after certain Thread commands
[ "Used", "internally", "to", "add", "a", "timestamping", "command", "after", "certain", "Thread", "commands" ]
def _print_timestamp(self): if self._enable_timestamps: self.commands.append( { "timestamp": self.timestamp_prefix + str(self.timestamp_index) } ) self.timestamp_index += 1
[ "def", "_print_timestamp", "(", "self", ")", ":", "if", "self", ".", "_enable_timestamps", ":", "self", ".", "commands", ".", "append", "(", "{", "\"timestamp\"", ":", "self", ".", "timestamp_prefix", "+", "str", "(", "self", ".", "timestamp_index", ")", "...
Used internally to add a timestamping command after certain Thread commands
[ "Used", "internally", "to", "add", "a", "timestamping", "command", "after", "certain", "Thread", "commands" ]
[ "\"\"\"\n Used internally to add a timestamping command after certain Thread commands\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
init_timer
null
def init_timer(self): """ Set the timer to zero to begin timestamping """ self.commands.append({"timestamp": "INIT"})
Set the timer to zero to begin timestamping
Set the timer to zero to begin timestamping
[ "Set", "the", "timer", "to", "zero", "to", "begin", "timestamping" ]
def init_timer(self): self.commands.append({"timestamp": "INIT"})
[ "def", "init_timer", "(", "self", ")", ":", "self", ".", "commands", ".", "append", "(", "{", "\"timestamp\"", ":", "\"INIT\"", "}", ")" ]
Set the timer to zero to begin timestamping
[ "Set", "the", "timer", "to", "zero", "to", "begin", "timestamping" ]
[ "\"\"\"\n Set the timer to zero to begin timestamping\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
print_elapsed_time
null
def print_elapsed_time(self, time_id): """ Prints the elapsed time since the last init_timer command Args: id (str): String to print out with the timestamp for identification """ self.commands.append({"timestamp": time_id})
Prints the elapsed time since the last init_timer command Args: id (str): String to print out with the timestamp for identification
Prints the elapsed time since the last init_timer command
[ "Prints", "the", "elapsed", "time", "since", "the", "last", "init_timer", "command" ]
def print_elapsed_time(self, time_id): self.commands.append({"timestamp": time_id})
[ "def", "print_elapsed_time", "(", "self", ",", "time_id", ")", ":", "self", ".", "commands", ".", "append", "(", "{", "\"timestamp\"", ":", "time_id", "}", ")" ]
Prints the elapsed time since the last init_timer command
[ "Prints", "the", "elapsed", "time", "since", "the", "last", "init_timer", "command" ]
[ "\"\"\"\n Prints the elapsed time since the last init_timer command\n\n Args:\n id (str): String to print out with the timestamp for identification\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "time_id", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "time_id", "type": null, "docstring": null, "docstring_tokens"...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
display
null
def display(self, string): """ Print the string to the console (note, must not contain spaces) Args: string (str): String to print """ self.commands.append({"display": string})
Print the string to the console (note, must not contain spaces) Args: string (str): String to print
Print the string to the console (note, must not contain spaces)
[ "Print", "the", "string", "to", "the", "console", "(", "note", "must", "not", "contain", "spaces", ")" ]
def display(self, string): self.commands.append({"display": string})
[ "def", "display", "(", "self", ",", "string", ")", ":", "self", ".", "commands", ".", "append", "(", "{", "\"display\"", ":", "string", "}", ")" ]
Print the string to the console (note, must not contain spaces)
[ "Print", "the", "string", "to", "the", "console", "(", "note", "must", "not", "contain", "spaces", ")" ]
[ "\"\"\"\n Print the string to the console (note, must not contain spaces)\n\n Args:\n string (str): String to print\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "string", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "string", "type": null, "docstring": "String to print", "docst...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
wait_flag
null
def wait_flag(self, flag_id): """ Wait for the flag with the given ID to become 1. The number of flags available is set in the metadata of the testbench. Flags can be used to synchronize between threads. e.g. one thread can set a flag that another will wait for. Args: ...
Wait for the flag with the given ID to become 1. The number of flags available is set in the metadata of the testbench. Flags can be used to synchronize between threads. e.g. one thread can set a flag that another will wait for. Args: flag_id (number): ID of the fla...
Wait for the flag with the given ID to become 1. The number of flags available is set in the metadata of the testbench. Flags can be used to synchronize between threads.
[ "Wait", "for", "the", "flag", "with", "the", "given", "ID", "to", "become", "1", ".", "The", "number", "of", "flags", "available", "is", "set", "in", "the", "metadata", "of", "the", "testbench", ".", "Flags", "can", "be", "used", "to", "synchronize", "...
def wait_flag(self, flag_id): self.commands.append({"wait": {"key": "flag", "args": [flag_id]}}) self._print_timestamp() self.commands.append({"flag": {"clear_flag": flag_id}})
[ "def", "wait_flag", "(", "self", ",", "flag_id", ")", ":", "self", ".", "commands", ".", "append", "(", "{", "\"wait\"", ":", "{", "\"key\"", ":", "\"flag\"", ",", "\"args\"", ":", "[", "flag_id", "]", "}", "}", ")", "self", ".", "_print_timestamp", ...
Wait for the flag with the given ID to become 1.
[ "Wait", "for", "the", "flag", "with", "the", "given", "ID", "to", "become", "1", "." ]
[ "\"\"\"\n Wait for the flag with the given ID to become 1. The number of flags\n available is set in the metadata of the testbench. Flags can be used to\n synchronize between threads. e.g. one thread can set a flag that another\n will wait for.\n\n Args:\n flag_id (numb...
[ { "param": "self", "type": null }, { "param": "flag_id", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "flag_id", "type": null, "docstring": "ID of the flag to wait on (ra...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
_statement
null
def _statement(self, condition, *args): """ Add a line to the thread, which is a complete Systemverilog line that that will be inserted verbatim into the TB. Any variables used in the statement will be replaced. Args: condition (str): SV-compatible statement (e.g. wa...
Add a line to the thread, which is a complete Systemverilog line that that will be inserted verbatim into the TB. Any variables used in the statement will be replaced. Args: condition (str): SV-compatible statement (e.g. wait(); or @();) args (int): Conditions c...
Add a line to the thread, which is a complete Systemverilog line that that will be inserted verbatim into the TB. Any variables used in the statement will be replaced. condition (str): SV-compatible statement ; or @();) args (int): Conditions can use variables and their values can be passed in as args
[ "Add", "a", "line", "to", "the", "thread", "which", "is", "a", "complete", "Systemverilog", "line", "that", "that", "will", "be", "inserted", "verbatim", "into", "the", "TB", ".", "Any", "variables", "used", "in", "the", "statement", "will", "be", "replace...
def _statement(self, condition, *args): self.commands.append({"wait": {"key": condition, "args": args}}) self._print_timestamp()
[ "def", "_statement", "(", "self", ",", "condition", ",", "*", "args", ")", ":", "self", ".", "commands", ".", "append", "(", "{", "\"wait\"", ":", "{", "\"key\"", ":", "condition", ",", "\"args\"", ":", "args", "}", "}", ")", "self", ".", "_print_tim...
Add a line to the thread, which is a complete Systemverilog line that that will be inserted verbatim into the TB.
[ "Add", "a", "line", "to", "the", "thread", "which", "is", "a", "complete", "Systemverilog", "line", "that", "that", "will", "be", "inserted", "verbatim", "into", "the", "TB", "." ]
[ "\"\"\"\n Add a line to the thread, which is a complete Systemverilog line that\n that will be inserted verbatim into the TB. Any variables used in the\n statement will be replaced.\n\n Args:\n condition (str): SV-compatible statement (e.g. wait(); or @();)\n args (...
[ { "param": "self", "type": null }, { "param": "condition", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "condition", "type": null, "docstring": null, "docstring_token...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
wait_level
null
def wait_level(self, condition, *args): """ Add a level-wait condition (wait until the signal value matches) to the thread. Args: condition (str): SV-compatible statement (e.g. 'signal == 1') args (int): Conditions can use 'args[x]' as variables and their ...
Add a level-wait condition (wait until the signal value matches) to the thread. Args: condition (str): SV-compatible statement (e.g. 'signal == 1') args (int): Conditions can use 'args[x]' as variables and their values can be passed in as args
Add a level-wait condition (wait until the signal value matches) to the thread.
[ "Add", "a", "level", "-", "wait", "condition", "(", "wait", "until", "the", "signal", "value", "matches", ")", "to", "the", "thread", "." ]
def wait_level(self, condition, *args): condition_tmp = "wait(" + condition + ");" self._statement(condition_tmp, *args)
[ "def", "wait_level", "(", "self", ",", "condition", ",", "*", "args", ")", ":", "condition_tmp", "=", "\"wait(\"", "+", "condition", "+", "\");\"", "self", ".", "_statement", "(", "condition_tmp", ",", "*", "args", ")" ]
Add a level-wait condition (wait until the signal value matches) to the thread.
[ "Add", "a", "level", "-", "wait", "condition", "(", "wait", "until", "the", "signal", "value", "matches", ")", "to", "the", "thread", "." ]
[ "\"\"\"\n Add a level-wait condition (wait until the signal value matches) to the\n thread.\n\n Args:\n condition (str): SV-compatible statement (e.g. 'signal == 1')\n args (int): Conditions can use 'args[x]' as variables and their\n values can be passed in ...
[ { "param": "self", "type": null }, { "param": "condition", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "condition", "type": null, "docstring": null, "docstring_token...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
assert_value
null
def assert_value(self, condition, *args): """ Add an assertion condition (assert the signal value matches) to the thread. Args: condition (str): SV-compatible statement (e.g. 'signal == 1') args (int): Conditions can use 'args[x]' as variables and their ...
Add an assertion condition (assert the signal value matches) to the thread. Args: condition (str): SV-compatible statement (e.g. 'signal == 1') args (int): Conditions can use 'args[x]' as variables and their values can be passed in as args
Add an assertion condition (assert the signal value matches) to the thread.
[ "Add", "an", "assertion", "condition", "(", "assert", "the", "signal", "value", "matches", ")", "to", "the", "thread", "." ]
def assert_value(self, condition, *args): condition_tmp = "assert(" + condition + ");" self._statement(condition_tmp, *args)
[ "def", "assert_value", "(", "self", ",", "condition", ",", "*", "args", ")", ":", "condition_tmp", "=", "\"assert(\"", "+", "condition", "+", "\");\"", "self", ".", "_statement", "(", "condition_tmp", ",", "*", "args", ")" ]
Add an assertion condition (assert the signal value matches) to the thread.
[ "Add", "an", "assertion", "condition", "(", "assert", "the", "signal", "value", "matches", ")", "to", "the", "thread", "." ]
[ "\"\"\"\n Add an assertion condition (assert the signal value matches) to the\n thread.\n\n Args:\n condition (str): SV-compatible statement (e.g. 'signal == 1')\n args (int): Conditions can use 'args[x]' as variables and their\n values can be passed in as a...
[ { "param": "self", "type": null }, { "param": "condition", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "condition", "type": null, "docstring": null, "docstring_token...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
wait_posedge
null
def wait_posedge(self, signal): """ Add a positive-edge sensitive wait condition on a signal. Args: signal (str): Name of the signal to wait on """ self._wait_edge("posedge", signal)
Add a positive-edge sensitive wait condition on a signal. Args: signal (str): Name of the signal to wait on
Add a positive-edge sensitive wait condition on a signal.
[ "Add", "a", "positive", "-", "edge", "sensitive", "wait", "condition", "on", "a", "signal", "." ]
def wait_posedge(self, signal): self._wait_edge("posedge", signal)
[ "def", "wait_posedge", "(", "self", ",", "signal", ")", ":", "self", ".", "_wait_edge", "(", "\"posedge\"", ",", "signal", ")" ]
Add a positive-edge sensitive wait condition on a signal.
[ "Add", "a", "positive", "-", "edge", "sensitive", "wait", "condition", "on", "a", "signal", "." ]
[ "\"\"\"\n Add a positive-edge sensitive wait condition on a signal.\n\n Args:\n signal (str): Name of the signal to wait on\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "signal", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "signal", "type": null, "docstring": "Name of the signal to wait on"...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
wait_negedge
null
def wait_negedge(self, signal): """ Add a negative-edge sensitive wait condition on a signal. Args: signal (str): Name of the signal to wait on """ self._wait_edge("negedge", signal)
Add a negative-edge sensitive wait condition on a signal. Args: signal (str): Name of the signal to wait on
Add a negative-edge sensitive wait condition on a signal.
[ "Add", "a", "negative", "-", "edge", "sensitive", "wait", "condition", "on", "a", "signal", "." ]
def wait_negedge(self, signal): self._wait_edge("negedge", signal)
[ "def", "wait_negedge", "(", "self", ",", "signal", ")", ":", "self", ".", "_wait_edge", "(", "\"negedge\"", ",", "signal", ")" ]
Add a negative-edge sensitive wait condition on a signal.
[ "Add", "a", "negative", "-", "edge", "sensitive", "wait", "condition", "on", "a", "signal", "." ]
[ "\"\"\"\n Add a negative-edge sensitive wait condition on a signal.\n\n Args:\n signal (str): Name of the signal to wait on\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "signal", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "signal", "type": null, "docstring": "Name of the signal to wait on"...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
_wait_edge
null
def _wait_edge(self, edge, signal): """ Adds a edge sensitive wait condition on a signal Args: edge (str): posedge or negedge signal (str): Name of the signal to wait on Raises: ValueError: Raised if edge is not posedge or negedge """ ...
Adds a edge sensitive wait condition on a signal Args: edge (str): posedge or negedge signal (str): Name of the signal to wait on Raises: ValueError: Raised if edge is not posedge or negedge
Adds a edge sensitive wait condition on a signal
[ "Adds", "a", "edge", "sensitive", "wait", "condition", "on", "a", "signal" ]
def _wait_edge(self, edge, signal): if edge not in ("posedge", "negedge"): raise ValueError() condition_tmp = "@(" + edge + " " + signal + ");" self._statement(condition_tmp)
[ "def", "_wait_edge", "(", "self", ",", "edge", ",", "signal", ")", ":", "if", "edge", "not", "in", "(", "\"posedge\"", ",", "\"negedge\"", ")", ":", "raise", "ValueError", "(", ")", "condition_tmp", "=", "\"@(\"", "+", "edge", "+", "\" \"", "+", "signa...
Adds a edge sensitive wait condition on a signal
[ "Adds", "a", "edge", "sensitive", "wait", "condition", "on", "a", "signal" ]
[ "\"\"\"\n Adds a edge sensitive wait condition on a signal\n\n Args:\n edge (str): posedge or negedge\n signal (str): Name of the signal to wait on\n\n Raises:\n ValueError: Raised if edge is not posedge or negedge\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "edge", "type": null }, { "param": "signal", "type": null } ]
{ "returns": [], "raises": [ { "docstring": "Raised if edge is not posedge or negedge", "docstring_tokens": [ "Raised", "if", "edge", "is", "not", "posedge", "or", "negedge" ], "type": "ValueError" } ], "params": [ ...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
_add_transaction
null
def _add_transaction(self, transaction): """ Adds a valid transaction to the thread. Since this is raw, it is not recommended for user use. Args: transaction (object): Some object representing a transaction """ self.commands.append(transaction) self....
Adds a valid transaction to the thread. Since this is raw, it is not recommended for user use. Args: transaction (object): Some object representing a transaction
Adds a valid transaction to the thread. Since this is raw, it is not recommended for user use.
[ "Adds", "a", "valid", "transaction", "to", "the", "thread", ".", "Since", "this", "is", "raw", "it", "is", "not", "recommended", "for", "user", "use", "." ]
def _add_transaction(self, transaction): self.commands.append(transaction) self._print_timestamp()
[ "def", "_add_transaction", "(", "self", ",", "transaction", ")", ":", "self", ".", "commands", ".", "append", "(", "transaction", ")", "self", ".", "_print_timestamp", "(", ")" ]
Adds a valid transaction to the thread.
[ "Adds", "a", "valid", "transaction", "to", "the", "thread", "." ]
[ "\"\"\"\n Adds a valid transaction to the thread. Since this is raw, it is not\n recommended for user use.\n\n Args:\n transaction (object): Some object representing a transaction\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "transaction", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "transaction", "type": null, "docstring": "Some object representing ...
8d417861def3cd36d5b254e410013b95e5398e9a
sharm294/sonar
sonar/testbench.py
[ "MIT" ]
Python
asdict
<not_specific>
def asdict(self): """ Converts the object to a dictionary Returns: dict: Dictionary representing the object """ commands = [] for command in self.commands: commands.append(command) return commands
Converts the object to a dictionary Returns: dict: Dictionary representing the object
Converts the object to a dictionary
[ "Converts", "the", "object", "to", "a", "dictionary" ]
def asdict(self): commands = [] for command in self.commands: commands.append(command) return commands
[ "def", "asdict", "(", "self", ")", ":", "commands", "=", "[", "]", "for", "command", "in", "self", ".", "commands", ":", "commands", ".", "append", "(", "command", ")", "return", "commands" ]
Converts the object to a dictionary
[ "Converts", "the", "object", "to", "a", "dictionary" ]
[ "\"\"\"\n Converts the object to a dictionary\n\n Returns:\n dict: Dictionary representing the object\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "Dictionary representing the object", "docstring_tokens": [ "Dictionary", "representing", "the", "object" ], "type": "dict" } ], "raises": [], "params": [ { "identifier": "self", "type": null, "do...
20f42112b88adee734ddf058f7a9f29c92140610
sharm294/sonar
sonar/core/backends/sv.py
[ "MIT" ]
Python
add_timeformat
<not_specific>
def add_timeformat(testbench_config, testbench): """ Configure the time format for the testbench Args: testbench_config (Testbench): The testbench configuration testbench (str): The testbench being generated Raises: SonarInvalidArgError: Invalid time format Returns: ...
Configure the time format for the testbench Args: testbench_config (Testbench): The testbench configuration testbench (str): The testbench being generated Raises: SonarInvalidArgError: Invalid time format Returns: str: Updated testbench
Configure the time format for the testbench
[ "Configure", "the", "time", "format", "for", "the", "testbench" ]
def add_timeformat(testbench_config, testbench): time_format_str = "$timeformat(" precision = str(testbench_config.metadata["Time_Format"]["precision"]) time_format = testbench_config.metadata["Time_Format"]["unit"] if time_format.endswith("fs"): time_format_str += "-15, " + precision + ', " fs"...
[ "def", "add_timeformat", "(", "testbench_config", ",", "testbench", ")", ":", "time_format_str", "=", "\"$timeformat(\"", "precision", "=", "str", "(", "testbench_config", ".", "metadata", "[", "\"Time_Format\"", "]", "[", "\"precision\"", "]", ")", "time_format", ...
Configure the time format for the testbench
[ "Configure", "the", "time", "format", "for", "the", "testbench" ]
[ "\"\"\"\n Configure the time format for the testbench\n\n Args:\n testbench_config (Testbench): The testbench configuration\n testbench (str): The testbench being generated\n\n Raises:\n SonarInvalidArgError: Invalid time format\n\n Returns:\n str: Updated testbench\n \"\"...
[ { "param": "testbench_config", "type": null }, { "param": "testbench", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "str" } ], "raises": [ { "docstring": "Invalid time format", "docstring_tokens": [ "Invalid", "time", "format" ], "type": "SonarInvalidArgError" ...
20f42112b88adee734ddf058f7a9f29c92140610
sharm294/sonar
sonar/core/backends/sv.py
[ "MIT" ]
Python
add_exerciser_ports
<not_specific>
def add_exerciser_ports(testbench_config, testbench, used_interfaces): """ Add the ports of the Exerciser Args: testbench_config (Testbench): The testbench configuration testbench (str): The testbench being generated used_interfaces (dict): Each used interface appears once Retu...
Add the ports of the Exerciser Args: testbench_config (Testbench): The testbench configuration testbench (str): The testbench being generated used_interfaces (dict): Each used interface appears once Returns: str: Updated testbench
Add the ports of the Exerciser
[ "Add", "the", "ports", "of", "the", "Exerciser" ]
def add_exerciser_ports(testbench_config, testbench, used_interfaces): def add_interfaces(exerciser_ports): interfaces = testbench_config.get_from_dut("interfaces_dict") for direction in ["slave", "master", "mixed"]: for interface in interfaces[direction]: curr_interface ...
[ "def", "add_exerciser_ports", "(", "testbench_config", ",", "testbench", ",", "used_interfaces", ")", ":", "def", "add_interfaces", "(", "exerciser_ports", ")", ":", "interfaces", "=", "testbench_config", ".", "get_from_dut", "(", "\"interfaces_dict\"", ")", "for", ...
Add the ports of the Exerciser
[ "Add", "the", "ports", "of", "the", "Exerciser" ]
[ "\"\"\"\n Add the ports of the Exerciser\n\n Args:\n testbench_config (Testbench): The testbench configuration\n testbench (str): The testbench being generated\n used_interfaces (dict): Each used interface appears once\n\n Returns:\n str: Updated testbench\n \"\"\"" ]
[ { "param": "testbench_config", "type": null }, { "param": "testbench", "type": null }, { "param": "used_interfaces", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "testbench_config", "type": null, "docstring": "The testbench configuration", "docstring_tokens": [ "The", ...
20f42112b88adee734ddf058f7a9f29c92140610
sharm294/sonar
sonar/core/backends/sv.py
[ "MIT" ]
Python
modify_signal_name
<not_specific>
def modify_signal_name(original_name, dut_type): """ For Vivado HLS, some signal names are changed from the source file in the generated Verilog. Here, we address that change Args: original_name (str): The original name of the port from the src file dut_type (dict): Information from the...
For Vivado HLS, some signal names are changed from the source file in the generated Verilog. Here, we address that change Args: original_name (str): The original name of the port from the src file dut_type (dict): Information from the testbench config describing the type of DUT tha...
For Vivado HLS, some signal names are changed from the source file in the generated Verilog. Here, we address that change original_name (str): The original name of the port from the src file dut_type (dict): Information from the testbench config describing the type of DUT that is being used. The modified name of the ...
[ "For", "Vivado", "HLS", "some", "signal", "names", "are", "changed", "from", "the", "source", "file", "in", "the", "generated", "Verilog", ".", "Here", "we", "address", "that", "change", "original_name", "(", "str", ")", ":", "The", "original", "name", "of...
def modify_signal_name(original_name, dut_type): port_name = original_name if dut_type["lang"] != "sv": if dut_type["hls"] == "vivado" and dut_type["hls_version"] == "2018.1": port_name = original_name + "_V" return port_name
[ "def", "modify_signal_name", "(", "original_name", ",", "dut_type", ")", ":", "port_name", "=", "original_name", "if", "dut_type", "[", "\"lang\"", "]", "!=", "\"sv\"", ":", "if", "dut_type", "[", "\"hls\"", "]", "==", "\"vivado\"", "and", "dut_type", "[", "...
For Vivado HLS, some signal names are changed from the source file in the generated Verilog.
[ "For", "Vivado", "HLS", "some", "signal", "names", "are", "changed", "from", "the", "source", "file", "in", "the", "generated", "Verilog", "." ]
[ "\"\"\"\n For Vivado HLS, some signal names are changed from the source file in the\n generated Verilog. Here, we address that change\n\n Args:\n original_name (str): The original name of the port from the src file\n dut_type (dict): Information from the testbench config describing the\n ...
[ { "param": "original_name", "type": null }, { "param": "dut_type", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "original_name", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "dut_type", "type": null, "docstring": null, "docstri...
20f42112b88adee734ddf058f7a9f29c92140610
sharm294/sonar
sonar/core/backends/sv.py
[ "MIT" ]
Python
instantiate_dut
<not_specific>
def instantiate_dut(testbench_config, testbench): """ Instantiate the device-under-test Args: testbench_config (Testbench): The testbench configuration testbench (str): The testbench being generated Returns: str: Updated testbench """ # pylint: disable=too-many-locals ...
Instantiate the device-under-test Args: testbench_config (Testbench): The testbench configuration testbench (str): The testbench being generated Returns: str: Updated testbench
Instantiate the device-under-test
[ "Instantiate", "the", "device", "-", "under", "-", "test" ]
def instantiate_dut(testbench_config, testbench): dut = testbench_config.modules["DUT"] clocks_in = dut.ports.get_clocks("input") signals_in = dut.ports.get_signals("input") resets_in = dut.ports.get_resets("input") signals_out = dut.ports.get_signals("output") parameters = testbench_config.get_...
[ "def", "instantiate_dut", "(", "testbench_config", ",", "testbench", ")", ":", "dut", "=", "testbench_config", ".", "modules", "[", "\"DUT\"", "]", "clocks_in", "=", "dut", ".", "ports", ".", "get_clocks", "(", "\"input\"", ")", "signals_in", "=", "dut", "."...
Instantiate the device-under-test
[ "Instantiate", "the", "device", "-", "under", "-", "test" ]
[ "\"\"\"\n Instantiate the device-under-test\n\n Args:\n testbench_config (Testbench): The testbench configuration\n testbench (str): The testbench being generated\n\n Returns:\n str: Updated testbench\n \"\"\"", "# pylint: disable=too-many-locals" ]
[ { "param": "testbench_config", "type": null }, { "param": "testbench", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "testbench_config", "type": null, "docstring": "The testbench configuration", "docstring_tokens": [ "The", ...
20f42112b88adee734ddf058f7a9f29c92140610
sharm294/sonar
sonar/core/backends/sv.py
[ "MIT" ]
Python
declare_signals
<not_specific>
def declare_signals(testbench_config, testbench): """ Declare all signals used to connect to the DUT Args: testbench_config (Testbench): The testbench configuration testbench (str): The testbench being generated Returns: str: Updated testbench """ dut = testbench_config...
Declare all signals used to connect to the DUT Args: testbench_config (Testbench): The testbench configuration testbench (str): The testbench being generated Returns: str: Updated testbench
Declare all signals used to connect to the DUT
[ "Declare", "all", "signals", "used", "to", "connect", "to", "the", "DUT" ]
def declare_signals(testbench_config, testbench): dut = testbench_config.modules["DUT"] clocks_in = dut.ports.get_clocks("input") signals = dut.ports.get_signals() resets = dut.ports.get_resets() interfaces = testbench_config.get_from_dut("interfaces") tb_signal_list = "" max_signal_size = 0...
[ "def", "declare_signals", "(", "testbench_config", ",", "testbench", ")", ":", "dut", "=", "testbench_config", ".", "modules", "[", "\"DUT\"", "]", "clocks_in", "=", "dut", ".", "ports", ".", "get_clocks", "(", "\"input\"", ")", "signals", "=", "dut", ".", ...
Declare all signals used to connect to the DUT
[ "Declare", "all", "signals", "used", "to", "connect", "to", "the", "DUT" ]
[ "\"\"\"\n Declare all signals used to connect to the DUT\n\n Args:\n testbench_config (Testbench): The testbench configuration\n testbench (str): The testbench being generated\n\n Returns:\n str: Updated testbench\n \"\"\"" ]
[ { "param": "testbench_config", "type": null }, { "param": "testbench", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "testbench_config", "type": null, "docstring": "The testbench configuration", "docstring_tokens": [ "The", ...
20f42112b88adee734ddf058f7a9f29c92140610
sharm294/sonar
sonar/core/backends/sv.py
[ "MIT" ]
Python
create_clocks
<not_specific>
def create_clocks(testbench_config, testbench): """ Create clocks used in the testbench Args: testbench_config (Testbench): The testbench configuration testbench (str): The testbench being generated Returns: str: Updated testbench """ # TODO make the initial state of th...
Create clocks used in the testbench Args: testbench_config (Testbench): The testbench configuration testbench (str): The testbench being generated Returns: str: Updated testbench
Create clocks used in the testbench
[ "Create", "clocks", "used", "in", "the", "testbench" ]
def create_clocks(testbench_config, testbench): dut = testbench_config.modules["DUT"] clocks_in = dut.ports.get_clocks("input") largest_clock = "" largest_period = 0 regex_int_str = re.compile(r"([0-9]+([\.][0-9]+)*)([a-z]+)") for clock in clocks_in: regex_match = regex_int_str.match(clo...
[ "def", "create_clocks", "(", "testbench_config", ",", "testbench", ")", ":", "dut", "=", "testbench_config", ".", "modules", "[", "\"DUT\"", "]", "clocks_in", "=", "dut", ".", "ports", ".", "get_clocks", "(", "\"input\"", ")", "largest_clock", "=", "\"\"", "...
Create clocks used in the testbench
[ "Create", "clocks", "used", "in", "the", "testbench" ]
[ "\"\"\"\n Create clocks used in the testbench\n\n Args:\n testbench_config (Testbench): The testbench configuration\n testbench (str): The testbench being generated\n\n Returns:\n str: Updated testbench\n \"\"\"", "# TODO make the initial state of the clock configurable (i.e. for ...
[ { "param": "testbench_config", "type": null }, { "param": "testbench", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "testbench_config", "type": null, "docstring": "The testbench configuration", "docstring_tokens": [ "The", ...
20f42112b88adee734ddf058f7a9f29c92140610
sharm294/sonar
sonar/core/backends/sv.py
[ "MIT" ]
Python
count_commands
<not_specific>
def count_commands(commands): """ Count the number of actual commands from a list of commands that may contain "macro" commands Args: commands (list): List of commands Returns: int: The true number of commands """ sv_commands = [ "delay", "wait", "si...
Count the number of actual commands from a list of commands that may contain "macro" commands Args: commands (list): List of commands Returns: int: The true number of commands
Count the number of actual commands from a list of commands that may contain "macro" commands
[ "Count", "the", "number", "of", "actual", "commands", "from", "a", "list", "of", "commands", "that", "may", "contain", "\"", "macro", "\"", "commands" ]
def count_commands(commands): sv_commands = [ "delay", "wait", "signal", "end", "timestamp", "display", "flag", ] count = 0 for command in commands: for sv_command in sv_commands: if sv_command in command: count ...
[ "def", "count_commands", "(", "commands", ")", ":", "sv_commands", "=", "[", "\"delay\"", ",", "\"wait\"", ",", "\"signal\"", ",", "\"end\"", ",", "\"timestamp\"", ",", "\"display\"", ",", "\"flag\"", ",", "]", "count", "=", "0", "for", "command", "in", "c...
Count the number of actual commands from a list of commands that may contain "macro" commands
[ "Count", "the", "number", "of", "actual", "commands", "from", "a", "list", "of", "commands", "that", "may", "contain", "\"", "macro", "\"", "commands" ]
[ "\"\"\"\n Count the number of actual commands from a list of commands that may contain\n \"macro\" commands\n\n Args:\n commands (list): List of commands\n\n Returns:\n int: The true number of commands\n \"\"\"" ]
[ { "param": "commands", "type": null } ]
{ "returns": [ { "docstring": "The true number of commands", "docstring_tokens": [ "The", "true", "number", "of", "commands" ], "type": "int" } ], "raises": [], "params": [ { "identifier": "commands", "type": null, "do...
20f42112b88adee734ddf058f7a9f29c92140610
sharm294/sonar
sonar/core/backends/sv.py
[ "MIT" ]
Python
write_line
<not_specific>
def write_line(data_file, command, vector_id): """ Write one command to the data file Args: data_file (list): List of commands to write command (dict): Current command being written vector_id (int): Index of the test vector this command belongs to Returns: list: Updated...
Write one command to the data file Args: data_file (list): List of commands to write command (dict): Current command being written vector_id (int): Index of the test vector this command belongs to Returns: list: Updated data_file
Write one command to the data file
[ "Write", "one", "command", "to", "the", "data", "file" ]
def write_line(data_file, command, vector_id): if "interface" in command: curr_interface = include.get_interface(command["interface"]["type"]) line = curr_interface.write_sv(command["interface"]) if line != "": data_file.append(line) elif "wait" in command: if "value"...
[ "def", "write_line", "(", "data_file", ",", "command", ",", "vector_id", ")", ":", "if", "\"interface\"", "in", "command", ":", "curr_interface", "=", "include", ".", "get_interface", "(", "command", "[", "\"interface\"", "]", "[", "\"type\"", "]", ")", "lin...
Write one command to the data file
[ "Write", "one", "command", "to", "the", "data", "file" ]
[ "\"\"\"\n Write one command to the data file\n\n Args:\n data_file (list): List of commands to write\n command (dict): Current command being written\n vector_id (int): Index of the test vector this command belongs to\n\n Returns:\n list: Updated data_file\n \"\"\"", "# pyli...
[ { "param": "data_file", "type": null }, { "param": "command", "type": null }, { "param": "vector_id", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "list" } ], "raises": [], "params": [ { "identifier": "data_file", "type": null, "docstring": "List of commands to write", "docstring_tokens": [ "List", ...
20f42112b88adee734ddf058f7a9f29c92140610
sharm294/sonar
sonar/core/backends/sv.py
[ "MIT" ]
Python
calculate_seeks
<not_specific>
def calculate_seeks( data_file, max_repeat, update_str, seek_str, count_str, converged ): """ This function repeats over the generated data file for systemverilog and calculates the character counts for the different packets/parallel sections so the fseek function can work properly during readback. ...
This function repeats over the generated data file for systemverilog and calculates the character counts for the different packets/parallel sections so the fseek function can work properly during readback. It's repeated until all the values converge to a static value. Args: data_file (list...
This function repeats over the generated data file for systemverilog and calculates the character counts for the different packets/parallel sections so the fseek function can work properly during readback. It's repeated until all the values converge to a static value.
[ "This", "function", "repeats", "over", "the", "generated", "data", "file", "for", "systemverilog", "and", "calculates", "the", "character", "counts", "for", "the", "different", "packets", "/", "parallel", "sections", "so", "the", "fseek", "function", "can", "wor...
def calculate_seeks( data_file, max_repeat, update_str, seek_str, count_str, converged ): i = 0 while i < max_repeat: char_count = 0 continue_count = 0 section_found = False continue_count_2 = 0 index_to_edit = 0 old_size = 0 updated = False cu...
[ "def", "calculate_seeks", "(", "data_file", ",", "max_repeat", ",", "update_str", ",", "seek_str", ",", "count_str", ",", "converged", ")", ":", "i", "=", "0", "while", "i", "<", "max_repeat", ":", "char_count", "=", "0", "continue_count", "=", "0", "secti...
This function repeats over the generated data file for systemverilog and calculates the character counts for the different packets/parallel sections so the fseek function can work properly during readback.
[ "This", "function", "repeats", "over", "the", "generated", "data", "file", "for", "systemverilog", "and", "calculates", "the", "character", "counts", "for", "the", "different", "packets", "/", "parallel", "sections", "so", "the", "fseek", "function", "can", "wor...
[ "\"\"\"\n This function repeats over the generated data file for systemverilog and\n calculates the character counts for the different packets/parallel sections\n so the fseek function can work properly during readback. It's repeated\n until all the values converge to a static value.\n\n Args:\n ...
[ { "param": "data_file", "type": null }, { "param": "max_repeat", "type": null }, { "param": "update_str", "type": null }, { "param": "seek_str", "type": null }, { "param": "count_str", "type": null }, { "param": "converged", "type": null } ]
{ "returns": [ { "docstring": "tuple(list, bool): The data file and converged state", "docstring_tokens": [ "tuple", "(", "list", "bool", ")", ":", "The", "data", "file", "and", "converged", "state" ]...
af7054a646b2584bce725a60cb2a3a4e1dcad3c0
sharm294/sonar
sonar/core/backends/include.py
[ "MIT" ]
Python
replace_variables
str
def replace_variables( input_string: str, interface: Any, key: Union[int, None] = None ) -> str: """ In a string, attempt to replace all the "$$X" variables with their definitions from the interface. If not found in the interface, it skips the variable, leaving it to the user to replace afterwards ...
In a string, attempt to replace all the "$$X" variables with their definitions from the interface. If not found in the interface, it skips the variable, leaving it to the user to replace afterwards Args: input_string (str): String containing $$X variables interface (Any): An interface ...
In a string, attempt to replace all the "$$X" variables with their definitions from the interface. If not found in the interface, it skips the variable, leaving it to the user to replace afterwards
[ "In", "a", "string", "attempt", "to", "replace", "all", "the", "\"", "$$X", "\"", "variables", "with", "their", "definitions", "from", "the", "interface", ".", "If", "not", "found", "in", "the", "interface", "it", "skips", "the", "variable", "leaving", "it...
def replace_variables( input_string: str, interface: Any, key: Union[int, None] = None ) -> str: regex_variable = re.compile(r"\$\$[^_|\W]+") for variable in re.findall(regex_variable, input_string): try: new_variable = getattr(interface, variable[2:]) except AttributeError: ...
[ "def", "replace_variables", "(", "input_string", ":", "str", ",", "interface", ":", "Any", ",", "key", ":", "Union", "[", "int", ",", "None", "]", "=", "None", ")", "->", "str", ":", "regex_variable", "=", "re", ".", "compile", "(", "r\"\\$\\$[^_|\\W]+\"...
In a string, attempt to replace all the "$$X" variables with their definitions from the interface.
[ "In", "a", "string", "attempt", "to", "replace", "all", "the", "\"", "$$X", "\"", "variables", "with", "their", "definitions", "from", "the", "interface", "." ]
[ "\"\"\"\n In a string, attempt to replace all the \"$$X\" variables with their\n definitions from the interface. If not found in the interface, it skips the\n variable, leaving it to the user to replace afterwards\n\n Args:\n input_string (str): String containing $$X variables\n interface ...
[ { "param": "input_string", "type": "str" }, { "param": "interface", "type": "Any" }, { "param": "key", "type": "Union[int, None]" } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "input_string", "type": "str", "docstring": "String containing $$X variables", "docstring_tokens": [ "Strin...
af7054a646b2584bce725a60cb2a3a4e1dcad3c0
sharm294/sonar
sonar/core/backends/include.py
[ "MIT" ]
Python
replace_block
<not_specific>
def replace_block(target_string, command, interface, indent, key=None): """ For multi-line code blocks, replace the $$X variables in it while respecting indentation Args: target_string (str): The preceding string to append this block onto command (str): The block in which to replace thi...
For multi-line code blocks, replace the $$X variables in it while respecting indentation Args: target_string (str): The preceding string to append this block onto command (str): The block in which to replace things interface (???): An interface indent (str): String to add a...
For multi-line code blocks, replace the $$X variables in it while respecting indentation
[ "For", "multi", "-", "line", "code", "blocks", "replace", "the", "$$X", "variables", "in", "it", "while", "respecting", "indentation" ]
def replace_block(target_string, command, interface, indent, key=None): command = replace_variables(command, interface, key) command = command.replace("\n", "\n" + indent) target_string += indent + command + "\n" return target_string
[ "def", "replace_block", "(", "target_string", ",", "command", ",", "interface", ",", "indent", ",", "key", "=", "None", ")", ":", "command", "=", "replace_variables", "(", "command", ",", "interface", ",", "key", ")", "command", "=", "command", ".", "repla...
For multi-line code blocks, replace the $$X variables in it while respecting indentation
[ "For", "multi", "-", "line", "code", "blocks", "replace", "the", "$$X", "variables", "in", "it", "while", "respecting", "indentation" ]
[ "\"\"\"\n For multi-line code blocks, replace the $$X variables in it while respecting\n indentation\n\n Args:\n target_string (str): The preceding string to append this block onto\n command (str): The block in which to replace things\n interface (???): An interface\n indent (st...
[ { "param": "target_string", "type": null }, { "param": "command", "type": null }, { "param": "interface", "type": null }, { "param": "indent", "type": null }, { "param": "key", "type": null } ]
{ "returns": [ { "docstring": "The updated target_string", "docstring_tokens": [ "The", "updated", "target_string" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "target_string", "type": null, "docstring": "The preced...
af7054a646b2584bce725a60cb2a3a4e1dcad3c0
sharm294/sonar
sonar/core/backends/include.py
[ "MIT" ]
Python
replace_signals
<not_specific>
def replace_signals(interface, action, command, target_string, indent, args): """ This function performs duplication and text replacement for $$signals Args: interface (???): An interface action (dict): command (str): The string in which to replace signals target_string (str...
This function performs duplication and text replacement for $$signals Args: interface (???): An interface action (dict): command (str): The string in which to replace signals target_string (str): The preceding string to append this block to indent (str): String to add a...
This function performs duplication and text replacement for $$signals
[ "This", "function", "performs", "duplication", "and", "text", "replacement", "for", "$$signals" ]
def replace_signals(interface, action, command, target_string, indent, args): for signal_type, signal in interface.signals.items(): if signal_type in action["signals"]: command_copy = copy.deepcopy(command) command_copy = command_copy.replace("$$signal", signal_type) comm...
[ "def", "replace_signals", "(", "interface", ",", "action", ",", "command", ",", "target_string", ",", "indent", ",", "args", ")", ":", "for", "signal_type", ",", "signal", "in", "interface", ".", "signals", ".", "items", "(", ")", ":", "if", "signal_type",...
This function performs duplication and text replacement for $$signals
[ "This", "function", "performs", "duplication", "and", "text", "replacement", "for", "$$signals" ]
[ "\"\"\"\n This function performs duplication and text replacement for $$signals\n\n Args:\n interface (???): An interface\n action (dict):\n command (str): The string in which to replace signals\n target_string (str): The preceding string to append this block to\n indent (st...
[ { "param": "interface", "type": null }, { "param": "action", "type": null }, { "param": "command", "type": null }, { "param": "target_string", "type": null }, { "param": "indent", "type": null }, { "param": "args", "type": null } ]
{ "returns": [ { "docstring": "The updated target_string", "docstring_tokens": [ "The", "updated", "target_string" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "interface", "type": null, "docstring": null, "do...
af7054a646b2584bce725a60cb2a3a4e1dcad3c0
sharm294/sonar
sonar/core/backends/include.py
[ "MIT" ]
Python
command_var_replace
<not_specific>
def command_var_replace( target_string, interface, indent, language, action_type, endpoint ): """ This function replaces the variables in an interface action block. There are two named variables: $$name (referring to the interface name) and $$signal (referring to a particular side signal). All other...
This function replaces the variables in an interface action block. There are two named variables: $$name (referring to the interface name) and $$signal (referring to a particular side signal). All other $$ variables must be keys in the interface declaration in the configuration file. Args: ...
This function replaces the variables in an interface action block. There are two named variables: $$name (referring to the interface name) and signal (referring to a particular side signal). All other $$ variables must be keys in the interface declaration in the configuration file.
[ "This", "function", "replaces", "the", "variables", "in", "an", "interface", "action", "block", ".", "There", "are", "two", "named", "variables", ":", "$$name", "(", "referring", "to", "the", "interface", "name", ")", "and", "signal", "(", "referring", "to",...
def command_var_replace( target_string, interface, indent, language, action_type, endpoint ): actions = endpoint.actions[language][action_type] for action in actions: if isinstance(action, dict): if "signals" in action: for command in action["commands"]: ...
[ "def", "command_var_replace", "(", "target_string", ",", "interface", ",", "indent", ",", "language", ",", "action_type", ",", "endpoint", ")", ":", "actions", "=", "endpoint", ".", "actions", "[", "language", "]", "[", "action_type", "]", "for", "action", "...
This function replaces the variables in an interface action block.
[ "This", "function", "replaces", "the", "variables", "in", "an", "interface", "action", "block", "." ]
[ "\"\"\"\n This function replaces the variables in an interface action block. There\n are two named variables: $$name (referring to the interface name) and\n $$signal (referring to a particular side signal). All other $$ variables\n must be keys in the interface declaration in the configuration file.\n\n...
[ { "param": "target_string", "type": null }, { "param": "interface", "type": null }, { "param": "indent", "type": null }, { "param": "language", "type": null }, { "param": "action_type", "type": null }, { "param": "endpoint", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "target_string", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "interface", "type": null, "docstring": null, "docstr...
24300bbfb23df13a82841e93c8a4cb6953567b91
sharm294/sonar
sonar/database.py
[ "MIT" ]
Python
init
null
def init(): """ Initialize the database with empty sections """ os.makedirs(Constants.SONAR_PATH, exist_ok=True) with shelve.open(Constants.SONAR_DB_PATH) as db: db["active"] = { "cad": None, "hls": None, "sim": None, "board": None, ...
Initialize the database with empty sections
Initialize the database with empty sections
[ "Initialize", "the", "database", "with", "empty", "sections" ]
def init(): os.makedirs(Constants.SONAR_PATH, exist_ok=True) with shelve.open(Constants.SONAR_DB_PATH) as db: db["active"] = { "cad": None, "hls": None, "sim": None, "board": None, "repo": None, } Tool.clear() Env.clear() Bo...
[ "def", "init", "(", ")", ":", "os", ".", "makedirs", "(", "Constants", ".", "SONAR_PATH", ",", "exist_ok", "=", "True", ")", "with", "shelve", ".", "open", "(", "Constants", ".", "SONAR_DB_PATH", ")", "as", "db", ":", "db", "[", "\"active\"", "]", "=...
Initialize the database with empty sections
[ "Initialize", "the", "database", "with", "empty", "sections" ]
[ "\"\"\"\n Initialize the database with empty sections\n \"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
24300bbfb23df13a82841e93c8a4cb6953567b91
sharm294/sonar
sonar/database.py
[ "MIT" ]
Python
add
null
def add(tool_name, version, cad_exe, hls_exe, sim_exe, script): """ Add a new tool to the database Args: tool_name (str): Name of the tool version (str): Tool version cad_exe (str): Name of CAD tool executable. None if not applicable hls_exe (str)...
Add a new tool to the database Args: tool_name (str): Name of the tool version (str): Tool version cad_exe (str): Name of CAD tool executable. None if not applicable hls_exe (str): Name of HLS tool executable. None if not applicable sim_exe (...
Add a new tool to the database
[ "Add", "a", "new", "tool", "to", "the", "database" ]
def add(tool_name, version, cad_exe, hls_exe, sim_exe, script): with shelve.open(Constants.SONAR_DB_PATH) as db: tools = db["tool"] try: _dict = tools[tool_name] except KeyError: _dict = {"versions": [], "executable": {}, "script": {}} ...
[ "def", "add", "(", "tool_name", ",", "version", ",", "cad_exe", ",", "hls_exe", ",", "sim_exe", ",", "script", ")", ":", "with", "shelve", ".", "open", "(", "Constants", ".", "SONAR_DB_PATH", ")", "as", "db", ":", "tools", "=", "db", "[", "\"tool\"", ...
Add a new tool to the database
[ "Add", "a", "new", "tool", "to", "the", "database" ]
[ "\"\"\"\n Add a new tool to the database\n\n Args:\n tool_name (str): Name of the tool\n version (str): Tool version\n cad_exe (str): Name of CAD tool executable. None if not applicable\n hls_exe (str): Name of HLS tool executable. None if not applicable\n ...
[ { "param": "tool_name", "type": null }, { "param": "version", "type": null }, { "param": "cad_exe", "type": null }, { "param": "hls_exe", "type": null }, { "param": "sim_exe", "type": null }, { "param": "script", "type": null } ]
{ "returns": [], "raises": [ { "docstring": "Raised if attempting to add an already existing\ntool.", "docstring_tokens": [ "Raised", "if", "attempting", "to", "add", "an", "already", "existing", "tool", "." ], ...
24300bbfb23df13a82841e93c8a4cb6953567b91
sharm294/sonar
sonar/database.py
[ "MIT" ]
Python
clear
null
def clear(): """ Clear all tools from the database """ with shelve.open(Constants.SONAR_DB_PATH) as db: db["tool"] = {} active = db["active"] for key in ("cad", "hls", "sim"): active[key] = None db["active"] = active
Clear all tools from the database
Clear all tools from the database
[ "Clear", "all", "tools", "from", "the", "database" ]
def clear(): with shelve.open(Constants.SONAR_DB_PATH) as db: db["tool"] = {} active = db["active"] for key in ("cad", "hls", "sim"): active[key] = None db["active"] = active
[ "def", "clear", "(", ")", ":", "with", "shelve", ".", "open", "(", "Constants", ".", "SONAR_DB_PATH", ")", "as", "db", ":", "db", "[", "\"tool\"", "]", "=", "{", "}", "active", "=", "db", "[", "\"active\"", "]", "for", "key", "in", "(", "\"cad\"", ...
Clear all tools from the database
[ "Clear", "all", "tools", "from", "the", "database" ]
[ "\"\"\"\n Clear all tools from the database\n \"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
24300bbfb23df13a82841e93c8a4cb6953567b91
sharm294/sonar
sonar/database.py
[ "MIT" ]
Python
add
null
def add(name, cad_tool, hls_tool, sim_tool, board, repo): """ Add a new environment to the database Args: name (str): Name of environment cad_tool (str): Name of CAD tool hls_tool (str): Name of HLS tool sim_tool (str): Name of SIM tool ...
Add a new environment to the database Args: name (str): Name of environment cad_tool (str): Name of CAD tool hls_tool (str): Name of HLS tool sim_tool (str): Name of SIM tool board (str): Name of board repo (str): Name of reposito...
Add a new environment to the database
[ "Add", "a", "new", "environment", "to", "the", "database" ]
def add(name, cad_tool, hls_tool, sim_tool, board, repo): _dict = {} _dict["cad"] = cad_tool _dict["hls"] = hls_tool _dict["sim"] = sim_tool _dict["board"] = board _dict["repo"] = repo with shelve.open(Constants.SONAR_DB_PATH) as db: env = db["env"] ...
[ "def", "add", "(", "name", ",", "cad_tool", ",", "hls_tool", ",", "sim_tool", ",", "board", ",", "repo", ")", ":", "_dict", "=", "{", "}", "_dict", "[", "\"cad\"", "]", "=", "cad_tool", "_dict", "[", "\"hls\"", "]", "=", "hls_tool", "_dict", "[", "...
Add a new environment to the database
[ "Add", "a", "new", "environment", "to", "the", "database" ]
[ "\"\"\"\n Add a new environment to the database\n\n Args:\n name (str): Name of environment\n cad_tool (str): Name of CAD tool\n hls_tool (str): Name of HLS tool\n sim_tool (str): Name of SIM tool\n board (str): Name of board\n repo (st...
[ { "param": "name", "type": null }, { "param": "cad_tool", "type": null }, { "param": "hls_tool", "type": null }, { "param": "sim_tool", "type": null }, { "param": "board", "type": null }, { "param": "repo", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "name", "type": null, "docstring": "Name of environment", "docstring_tokens": [ "Name", "of", "environment" ], "default": null, "is_optional": false }, { "identifier": "ca...
24300bbfb23df13a82841e93c8a4cb6953567b91
sharm294/sonar
sonar/database.py
[ "MIT" ]
Python
clear
null
def clear(): """ Clear all environments from the database """ with shelve.open(Constants.SONAR_DB_PATH) as db: db["env"] = {}
Clear all environments from the database
Clear all environments from the database
[ "Clear", "all", "environments", "from", "the", "database" ]
def clear(): with shelve.open(Constants.SONAR_DB_PATH) as db: db["env"] = {}
[ "def", "clear", "(", ")", ":", "with", "shelve", ".", "open", "(", "Constants", ".", "SONAR_DB_PATH", ")", "as", "db", ":", "db", "[", "\"env\"", "]", "=", "{", "}" ]
Clear all environments from the database
[ "Clear", "all", "environments", "from", "the", "database" ]
[ "\"\"\"\n Clear all environments from the database\n \"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
24300bbfb23df13a82841e93c8a4cb6953567b91
sharm294/sonar
sonar/database.py
[ "MIT" ]
Python
remove
null
def remove(name): """ Remove a particular environment from the database Args: name (str): Name of environment """ with shelve.open(Constants.SONAR_DB_PATH) as db: env = db["env"] del env[name] db["env"] = env
Remove a particular environment from the database Args: name (str): Name of environment
Remove a particular environment from the database
[ "Remove", "a", "particular", "environment", "from", "the", "database" ]
def remove(name): with shelve.open(Constants.SONAR_DB_PATH) as db: env = db["env"] del env[name] db["env"] = env
[ "def", "remove", "(", "name", ")", ":", "with", "shelve", ".", "open", "(", "Constants", ".", "SONAR_DB_PATH", ")", "as", "db", ":", "env", "=", "db", "[", "\"env\"", "]", "del", "env", "[", "name", "]", "db", "[", "\"env\"", "]", "=", "env" ]
Remove a particular environment from the database
[ "Remove", "a", "particular", "environment", "from", "the", "database" ]
[ "\"\"\"\n Remove a particular environment from the database\n\n Args:\n name (str): Name of environment\n \"\"\"" ]
[ { "param": "name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "name", "type": null, "docstring": "Name of environment", "docstring_tokens": [ "Name", "of", "environment" ], "default": null, "is_optional": false } ], "outlier_params": [], ...
24300bbfb23df13a82841e93c8a4cb6953567b91
sharm294/sonar
sonar/database.py
[ "MIT" ]
Python
add
null
def add(path): """ Add a new board to the database Args: path (str): Path to the board files """ with shelve.open(Constants.SONAR_DB_PATH) as db: boards = db["board"] board_name = os.path.basename(path) boards[board_name] = path ...
Add a new board to the database Args: path (str): Path to the board files
Add a new board to the database
[ "Add", "a", "new", "board", "to", "the", "database" ]
def add(path): with shelve.open(Constants.SONAR_DB_PATH) as db: boards = db["board"] board_name = os.path.basename(path) boards[board_name] = path db["board"] = boards
[ "def", "add", "(", "path", ")", ":", "with", "shelve", ".", "open", "(", "Constants", ".", "SONAR_DB_PATH", ")", "as", "db", ":", "boards", "=", "db", "[", "\"board\"", "]", "board_name", "=", "os", ".", "path", ".", "basename", "(", "path", ")", "...
Add a new board to the database
[ "Add", "a", "new", "board", "to", "the", "database" ]
[ "\"\"\"\n Add a new board to the database\n\n Args:\n path (str): Path to the board files\n \"\"\"" ]
[ { "param": "path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "path", "type": null, "docstring": "Path to the board files", "docstring_tokens": [ "Path", "to", "the", "board", "files" ], "default": null, "is_optional": false } ...
24300bbfb23df13a82841e93c8a4cb6953567b91
sharm294/sonar
sonar/database.py
[ "MIT" ]
Python
remove
null
def remove(name): """ Remove a board from the database Args: name (str): Name of board to remove """ with shelve.open(Constants.SONAR_DB_PATH) as db: boards = db["board"] del boards[name] db["board"] = boards
Remove a board from the database Args: name (str): Name of board to remove
Remove a board from the database
[ "Remove", "a", "board", "from", "the", "database" ]
def remove(name): with shelve.open(Constants.SONAR_DB_PATH) as db: boards = db["board"] del boards[name] db["board"] = boards
[ "def", "remove", "(", "name", ")", ":", "with", "shelve", ".", "open", "(", "Constants", ".", "SONAR_DB_PATH", ")", "as", "db", ":", "boards", "=", "db", "[", "\"board\"", "]", "del", "boards", "[", "name", "]", "db", "[", "\"board\"", "]", "=", "b...
Remove a board from the database
[ "Remove", "a", "board", "from", "the", "database" ]
[ "\"\"\"\n Remove a board from the database\n\n Args:\n name (str): Name of board to remove\n \"\"\"" ]
[ { "param": "name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "name", "type": null, "docstring": "Name of board to remove", "docstring_tokens": [ "Name", "of", "board", "to", "remove" ], "default": null, "is_optional": false } ...
24300bbfb23df13a82841e93c8a4cb6953567b91
sharm294/sonar
sonar/database.py
[ "MIT" ]
Python
clear
null
def clear(): """ Remove all boards from the database """ with shelve.open(Constants.SONAR_DB_PATH) as db: db["board"] = {} active = db["active"] active["board"] = None db["active"] = active
Remove all boards from the database
Remove all boards from the database
[ "Remove", "all", "boards", "from", "the", "database" ]
def clear(): with shelve.open(Constants.SONAR_DB_PATH) as db: db["board"] = {} active = db["active"] active["board"] = None db["active"] = active
[ "def", "clear", "(", ")", ":", "with", "shelve", ".", "open", "(", "Constants", ".", "SONAR_DB_PATH", ")", "as", "db", ":", "db", "[", "\"board\"", "]", "=", "{", "}", "active", "=", "db", "[", "\"active\"", "]", "active", "[", "\"board\"", "]", "=...
Remove all boards from the database
[ "Remove", "all", "boards", "from", "the", "database" ]
[ "\"\"\"\n Remove all boards from the database\n \"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
24300bbfb23df13a82841e93c8a4cb6953567b91
sharm294/sonar
sonar/database.py
[ "MIT" ]
Python
clear
null
def clear(): """ Clear all repositories from the database and deactivate the active repo """ with shelve.open(Constants.SONAR_DB_PATH) as db: db["repo"] = {} active = db["active"] active["repo"] = None db["active"] = active
Clear all repositories from the database and deactivate the active repo
Clear all repositories from the database and deactivate the active repo
[ "Clear", "all", "repositories", "from", "the", "database", "and", "deactivate", "the", "active", "repo" ]
def clear(): with shelve.open(Constants.SONAR_DB_PATH) as db: db["repo"] = {} active = db["active"] active["repo"] = None db["active"] = active
[ "def", "clear", "(", ")", ":", "with", "shelve", ".", "open", "(", "Constants", ".", "SONAR_DB_PATH", ")", "as", "db", ":", "db", "[", "\"repo\"", "]", "=", "{", "}", "active", "=", "db", "[", "\"active\"", "]", "active", "[", "\"repo\"", "]", "=",...
Clear all repositories from the database and deactivate the active repo
[ "Clear", "all", "repositories", "from", "the", "database", "and", "deactivate", "the", "active", "repo" ]
[ "\"\"\"\n Clear all repositories from the database and deactivate the active repo\n \"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
24300bbfb23df13a82841e93c8a4cb6953567b91
sharm294/sonar
sonar/database.py
[ "MIT" ]
Python
add_new
null
def add_new(name, path): """ Add a new IP to the database Args: name (str): Name of the IP path (str): Path for the IP """ active_repo = Repo.get_active() repo = Repo.get(active_repo) repo_path = repo["path"] init_toml = os.path.jo...
Add a new IP to the database Args: name (str): Name of the IP path (str): Path for the IP
Add a new IP to the database
[ "Add", "a", "new", "IP", "to", "the", "database" ]
def add_new(name, path): active_repo = Repo.get_active() repo = Repo.get(active_repo) repo_path = repo["path"] init_toml = os.path.join(repo_path, Constants.SONAR_CONFIG_FILE_PATH) init_dict = toml.load(init_toml) init_dict["project"]["ips"] = [name] if "ips" not ...
[ "def", "add_new", "(", "name", ",", "path", ")", ":", "active_repo", "=", "Repo", ".", "get_active", "(", ")", "repo", "=", "Repo", ".", "get", "(", "active_repo", ")", "repo_path", "=", "repo", "[", "\"path\"", "]", "init_toml", "=", "os", ".", "pat...
Add a new IP to the database
[ "Add", "a", "new", "IP", "to", "the", "database" ]
[ "\"\"\"\n Add a new IP to the database\n\n Args:\n name (str): Name of the IP\n path (str): Path for the IP\n \"\"\"" ]
[ { "param": "name", "type": null }, { "param": "path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "name", "type": null, "docstring": "Name of the IP", "docstring_tokens": [ "Name", "of", "the", "IP" ], "default": null, "is_optional": false }, { "identifier": "p...
9540a25f45b4cdecbedc7421b1a8c766d4a1e954
sharm294/sonar
sonar/core/backends/cpp.py
[ "MIT" ]
Python
declare_signals
<not_specific>
def declare_signals(testbench_config, testbench): """ Declare and instantiate the variables used for the signals in the testbench Args: testbench_config (Testbench): The testbench configuration testbench (str): The testbench being generated Returns: str: Updated testbench "...
Declare and instantiate the variables used for the signals in the testbench Args: testbench_config (Testbench): The testbench configuration testbench (str): The testbench being generated Returns: str: Updated testbench
Declare and instantiate the variables used for the signals in the testbench
[ "Declare", "and", "instantiate", "the", "variables", "used", "for", "the", "signals", "in", "the", "testbench" ]
def declare_signals(testbench_config, testbench): dut = testbench_config.modules["DUT"] signals = dut.ports.get_signals() interfaces = testbench_config.get_from_dut("interfaces") tb_signal_list = "" max_signal_size = 0 leading_spaces = include.get_indentation("SONAR_TB_SIGNAL_LIST", testbench) ...
[ "def", "declare_signals", "(", "testbench_config", ",", "testbench", ")", ":", "dut", "=", "testbench_config", ".", "modules", "[", "\"DUT\"", "]", "signals", "=", "dut", ".", "ports", ".", "get_signals", "(", ")", "interfaces", "=", "testbench_config", ".", ...
Declare and instantiate the variables used for the signals in the testbench
[ "Declare", "and", "instantiate", "the", "variables", "used", "for", "the", "signals", "in", "the", "testbench" ]
[ "\"\"\"\n Declare and instantiate the variables used for the signals in the testbench\n\n Args:\n testbench_config (Testbench): The testbench configuration\n testbench (str): The testbench being generated\n\n Returns:\n str: Updated testbench\n \"\"\"", "# TODO fix leading spaces ...
[ { "param": "testbench_config", "type": null }, { "param": "testbench", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "testbench_config", "type": null, "docstring": "The testbench configuration", "docstring_tokens": [ "The", ...
9540a25f45b4cdecbedc7421b1a8c766d4a1e954
sharm294/sonar
sonar/core/backends/cpp.py
[ "MIT" ]
Python
write_line
<not_specific>
def write_line(data_file, command, vector_id): """ Write one line to the data file Args: data_file (list): List of commands for the data file command (dict): Current command to write vector_id (int): Index of the current test vector Returns: list: Updated data_file ...
Write one line to the data file Args: data_file (list): List of commands for the data file command (dict): Current command to write vector_id (int): Index of the current test vector Returns: list: Updated data_file
Write one line to the data file
[ "Write", "one", "line", "to", "the", "data", "file" ]
def write_line(data_file, command, vector_id): if "interface" in command: curr_interface = include.get_interface(command["interface"]["type"]) line = curr_interface.write_cpp(command["interface"]) if line != "": data_file.append(line) elif "wait" in command: pass ...
[ "def", "write_line", "(", "data_file", ",", "command", ",", "vector_id", ")", ":", "if", "\"interface\"", "in", "command", ":", "curr_interface", "=", "include", ".", "get_interface", "(", "command", "[", "\"interface\"", "]", "[", "\"type\"", "]", ")", "lin...
Write one line to the data file
[ "Write", "one", "line", "to", "the", "data", "file" ]
[ "\"\"\"\n Write one line to the data file\n\n Args:\n data_file (list): List of commands for the data file\n command (dict): Current command to write\n vector_id (int): Index of the current test vector\n\n Returns:\n list: Updated data_file\n \"\"\"", "# data_file.append(",...
[ { "param": "data_file", "type": null }, { "param": "command", "type": null }, { "param": "vector_id", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "list" } ], "raises": [], "params": [ { "identifier": "data_file", "type": null, "docstring": "List of commands for the data file", "docstring_tokens": [ "List"...
9540a25f45b4cdecbedc7421b1a8c766d4a1e954
sharm294/sonar
sonar/core/backends/cpp.py
[ "MIT" ]
Python
write_data_file
<not_specific>
def write_data_file(testbench_config): """ Based on the test vectors, write the data file Args: testbench_config (Testbench): The testbench configuration Returns: list: List of commands to write to the data file """ data_file = [] for i, vector in enumerate(testbench_config...
Based on the test vectors, write the data file Args: testbench_config (Testbench): The testbench configuration Returns: list: List of commands to write to the data file
Based on the test vectors, write the data file
[ "Based", "on", "the", "test", "vectors", "write", "the", "data", "file" ]
def write_data_file(testbench_config): data_file = [] for i, vector in enumerate(testbench_config.vectors): for thread in vector.threads: for command in thread.commands: data_file = write_line( data_file, command, i,...
[ "def", "write_data_file", "(", "testbench_config", ")", ":", "data_file", "=", "[", "]", "for", "i", ",", "vector", "in", "enumerate", "(", "testbench_config", ".", "vectors", ")", ":", "for", "thread", "in", "vector", ".", "threads", ":", "for", "command"...
Based on the test vectors, write the data file
[ "Based", "on", "the", "test", "vectors", "write", "the", "data", "file" ]
[ "\"\"\"\n Based on the test vectors, write the data file\n\n Args:\n testbench_config (Testbench): The testbench configuration\n\n Returns:\n list: List of commands to write to the data file\n \"\"\"" ]
[ { "param": "testbench_config", "type": null } ]
{ "returns": [ { "docstring": "List of commands to write to the data file", "docstring_tokens": [ "List", "of", "commands", "to", "write", "to", "the", "data", "file" ], "type": "list" } ], "raises": [], "par...
3ff99e7156481e3c6520089236ad30d435cc64ca
sharm294/sonar
sonar/endpoints.py
[ "MIT" ]
Python
import_packages_local
<not_specific>
def import_packages_local(_interface): """ Specifies any packages that must be imported once per endpoint Args: interface (Interface): The interface belonging to the endpoint Returns: str: Packages to be imported """ return ""
Specifies any packages that must be imported once per endpoint Args: interface (Interface): The interface belonging to the endpoint Returns: str: Packages to be imported
Specifies any packages that must be imported once per endpoint
[ "Specifies", "any", "packages", "that", "must", "be", "imported", "once", "per", "endpoint" ]
def import_packages_local(_interface): return ""
[ "def", "import_packages_local", "(", "_interface", ")", ":", "return", "\"\"" ]
Specifies any packages that must be imported once per endpoint
[ "Specifies", "any", "packages", "that", "must", "be", "imported", "once", "per", "endpoint" ]
[ "\"\"\"\n Specifies any packages that must be imported once per endpoint\n\n Args:\n interface (Interface): The interface belonging to the endpoint\n\n Returns:\n str: Packages to be imported\n \"\"\"" ]
[ { "param": "_interface", "type": null } ]
{ "returns": [ { "docstring": "Packages to be imported", "docstring_tokens": [ "Packages", "to", "be", "imported" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "_interface", "type": null, "docstring": null, ...
3ff99e7156481e3c6520089236ad30d435cc64ca
sharm294/sonar
sonar/endpoints.py
[ "MIT" ]
Python
initial_blocks
<not_specific>
def initial_blocks(_indent): """ Any text that should be inside an initial block Args: indent (str): Indentation to add to each line Returns: list[str]: List of strings that go into separate initial blocks """ return []
Any text that should be inside an initial block Args: indent (str): Indentation to add to each line Returns: list[str]: List of strings that go into separate initial blocks
Any text that should be inside an initial block
[ "Any", "text", "that", "should", "be", "inside", "an", "initial", "block" ]
def initial_blocks(_indent): return []
[ "def", "initial_blocks", "(", "_indent", ")", ":", "return", "[", "]" ]
Any text that should be inside an initial block
[ "Any", "text", "that", "should", "be", "inside", "an", "initial", "block" ]
[ "\"\"\"\n Any text that should be inside an initial block\n\n Args:\n indent (str): Indentation to add to each line\n\n Returns:\n list[str]: List of strings that go into separate initial blocks\n \"\"\"" ]
[ { "param": "_indent", "type": null } ]
{ "returns": [ { "docstring": "List of strings that go into separate initial blocks", "docstring_tokens": [ "List", "of", "strings", "that", "go", "into", "separate", "initial", "blocks" ], "type": "list[str]" } ...
3ff99e7156481e3c6520089236ad30d435cc64ca
sharm294/sonar
sonar/endpoints.py
[ "MIT" ]
Python
prologue
<not_specific>
def prologue(_indent): """ Any text that should be part of the testbench as a prologue outside any blocks such as variable declarations. Args: prologue (str): The preceding text to append to indent (str): Indentation to add to each line Returns: ...
Any text that should be part of the testbench as a prologue outside any blocks such as variable declarations. Args: prologue (str): The preceding text to append to indent (str): Indentation to add to each line Returns: str: Updated prologue
Any text that should be part of the testbench as a prologue outside any blocks such as variable declarations.
[ "Any", "text", "that", "should", "be", "part", "of", "the", "testbench", "as", "a", "prologue", "outside", "any", "blocks", "such", "as", "variable", "declarations", "." ]
def prologue(_indent): return ""
[ "def", "prologue", "(", "_indent", ")", ":", "return", "\"\"" ]
Any text that should be part of the testbench as a prologue outside any blocks such as variable declarations.
[ "Any", "text", "that", "should", "be", "part", "of", "the", "testbench", "as", "a", "prologue", "outside", "any", "blocks", "such", "as", "variable", "declarations", "." ]
[ "\"\"\"\n Any text that should be part of the testbench as a prologue outside any\n blocks such as variable declarations.\n\n Args:\n prologue (str): The preceding text to append to\n indent (str): Indentation to add to each line\n\n Returns:\n str: Updat...
[ { "param": "_indent", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "_indent", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": nul...
3ff99e7156481e3c6520089236ad30d435cc64ca
sharm294/sonar
sonar/endpoints.py
[ "MIT" ]
Python
source_tcl
<not_specific>
def source_tcl(_interface, _path): """ Any TCL files that should be sourced as part of initializing the interface Args: interface (AXI4LiteSlave): AXI4LiteSlave object path (str): Path where to place the TCL source files """ return None
Any TCL files that should be sourced as part of initializing the interface Args: interface (AXI4LiteSlave): AXI4LiteSlave object path (str): Path where to place the TCL source files
Any TCL files that should be sourced as part of initializing the interface
[ "Any", "TCL", "files", "that", "should", "be", "sourced", "as", "part", "of", "initializing", "the", "interface" ]
def source_tcl(_interface, _path): return None
[ "def", "source_tcl", "(", "_interface", ",", "_path", ")", ":", "return", "None" ]
Any TCL files that should be sourced as part of initializing the interface
[ "Any", "TCL", "files", "that", "should", "be", "sourced", "as", "part", "of", "initializing", "the", "interface" ]
[ "\"\"\"\n Any TCL files that should be sourced as part of initializing the\n interface\n\n Args:\n interface (AXI4LiteSlave): AXI4LiteSlave object\n path (str): Path where to place the TCL source files\n \"\"\"" ]
[ { "param": "_interface", "type": null }, { "param": "_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "_interface", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "_path", "type": null, "docstring": null, "docstring_tok...
3ff99e7156481e3c6520089236ad30d435cc64ca
sharm294/sonar
sonar/endpoints.py
[ "MIT" ]
Python
instantiate
<not_specific>
def instantiate(cls, indent): """ Any modules that this interface instantiates in SV. Args: indent (str): Indentation to add to each line Returns: str: Updated ip_inst """ name = cls.arguments["name"] initial_value = cls.arguments["value"...
Any modules that this interface instantiates in SV. Args: indent (str): Indentation to add to each line Returns: str: Updated ip_inst
Any modules that this interface instantiates in SV.
[ "Any", "modules", "that", "this", "interface", "instantiates", "in", "SV", "." ]
def instantiate(cls, indent): name = cls.arguments["name"] initial_value = cls.arguments["value"] period = cls.arguments["period"] block = textwrap.indent( textwrap.dedent( f"""\ initial begin {name}_endpoint[$$endpointIndex] = {ini...
[ "def", "instantiate", "(", "cls", ",", "indent", ")", ":", "name", "=", "cls", ".", "arguments", "[", "\"name\"", "]", "initial_value", "=", "cls", ".", "arguments", "[", "\"value\"", "]", "period", "=", "cls", ".", "arguments", "[", "\"period\"", "]", ...
Any modules that this interface instantiates in SV.
[ "Any", "modules", "that", "this", "interface", "instantiates", "in", "SV", "." ]
[ "\"\"\"\n Any modules that this interface instantiates in SV.\n\n Args:\n indent (str): Indentation to add to each line\n\n Returns:\n str: Updated ip_inst\n \"\"\"" ]
[ { "param": "cls", "type": null }, { "param": "indent", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "cls", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
c5c4f787738ddb02f44a457c50e7f8f6a726bfe8
sharm294/sonar
sonar/core/generate.py
[ "MIT" ]
Python
filter_langs
<not_specific>
def filter_langs(active_langs, sonar_tb_filepath): """ If any of the generated testbenches are newer than the sonar testbench script, skip generating it. This probably implies the user has manually edited the generated testbench. Args: active_langs (tuple): Original list of languages to use...
If any of the generated testbenches are newer than the sonar testbench script, skip generating it. This probably implies the user has manually edited the generated testbench. Args: active_langs (tuple): Original list of languages to use Returns: tuple: Filtered list of languages t...
If any of the generated testbenches are newer than the sonar testbench script, skip generating it. This probably implies the user has manually edited the generated testbench.
[ "If", "any", "of", "the", "generated", "testbenches", "are", "newer", "than", "the", "sonar", "testbench", "script", "skip", "generating", "it", ".", "This", "probably", "implies", "the", "user", "has", "manually", "edited", "the", "generated", "testbench", "....
def filter_langs(active_langs, sonar_tb_filepath): try: sonar_tb_file_time = os.path.getmtime(sonar_tb_filepath) except FileNotFoundError: logger.warning( "File %s not found, so not filtering languages by creation time", sonar_tb_filepath, ) return active_...
[ "def", "filter_langs", "(", "active_langs", ",", "sonar_tb_filepath", ")", ":", "try", ":", "sonar_tb_file_time", "=", "os", ".", "path", ".", "getmtime", "(", "sonar_tb_filepath", ")", "except", "FileNotFoundError", ":", "logger", ".", "warning", "(", "\"File %...
If any of the generated testbenches are newer than the sonar testbench script, skip generating it.
[ "If", "any", "of", "the", "generated", "testbenches", "are", "newer", "than", "the", "sonar", "testbench", "script", "skip", "generating", "it", "." ]
[ "\"\"\"\n If any of the generated testbenches are newer than the sonar testbench\n script, skip generating it. This probably implies the user has manually\n edited the generated testbench.\n\n Args:\n active_langs (tuple): Original list of languages to use\n\n Returns:\n tuple: Filtered...
[ { "param": "active_langs", "type": null }, { "param": "sonar_tb_filepath", "type": null } ]
{ "returns": [ { "docstring": "Filtered list of languages to generate testbenches for", "docstring_tokens": [ "Filtered", "list", "of", "languages", "to", "generate", "testbenches", "for" ], "type": "tuple" } ], "raise...
c5c4f787738ddb02f44a457c50e7f8f6a726bfe8
sharm294/sonar
sonar/core/generate.py
[ "MIT" ]
Python
parse_sonar_tb
<not_specific>
def parse_sonar_tb(sonar_tb_filepath): """ From the passed in sonar_tb_filepath, extract the name of the file and the directory relative to which the generated files will be created Args: sonar_tb_filepath (str): Path to the file used to create the testbench_config Returns: ...
From the passed in sonar_tb_filepath, extract the name of the file and the directory relative to which the generated files will be created Args: sonar_tb_filepath (str): Path to the file used to create the testbench_config Returns: tuple: The name of the DUT, directory in ...
From the passed in sonar_tb_filepath, extract the name of the file and the directory relative to which the generated files will be created
[ "From", "the", "passed", "in", "sonar_tb_filepath", "extract", "the", "name", "of", "the", "file", "and", "the", "directory", "relative", "to", "which", "the", "generated", "files", "will", "be", "created" ]
def parse_sonar_tb(sonar_tb_filepath): dut_name = os.path.basename(sonar_tb_filepath)[:-3] directory = os.path.join( os.path.dirname(sonar_tb_filepath), "build", dut_name ) return dut_name, directory
[ "def", "parse_sonar_tb", "(", "sonar_tb_filepath", ")", ":", "dut_name", "=", "os", ".", "path", ".", "basename", "(", "sonar_tb_filepath", ")", "[", ":", "-", "3", "]", "directory", "=", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "...
From the passed in sonar_tb_filepath, extract the name of the file and the directory relative to which the generated files will be created
[ "From", "the", "passed", "in", "sonar_tb_filepath", "extract", "the", "name", "of", "the", "file", "and", "the", "directory", "relative", "to", "which", "the", "generated", "files", "will", "be", "created" ]
[ "\"\"\"\n From the passed in sonar_tb_filepath, extract the name of the file and\n the directory relative to which the generated files will be created\n\n Args:\n sonar_tb_filepath (str): Path to the file used to create the\n testbench_config\n\n Returns:\n tuple: The name of th...
[ { "param": "sonar_tb_filepath", "type": null } ]
{ "returns": [ { "docstring": "The name of the DUT, directory in which to place generated files", "docstring_tokens": [ "The", "name", "of", "the", "DUT", "directory", "in", "which", "to", "place", "generated", ...
c5c4f787738ddb02f44a457c50e7f8f6a726bfe8
sharm294/sonar
sonar/core/generate.py
[ "MIT" ]
Python
finalize_waits
<not_specific>
def finalize_waits(testbench_config): """ Using the test vectors in the testbench, this method aggregates all the wait conditions as required for the Sonar backend Args: testbench_config (Testbench): The user-defined testbench configuration Returns: Testbench: Updated testbench con...
Using the test vectors in the testbench, this method aggregates all the wait conditions as required for the Sonar backend Args: testbench_config (Testbench): The user-defined testbench configuration Returns: Testbench: Updated testbench configuration
Using the test vectors in the testbench, this method aggregates all the wait conditions as required for the Sonar backend
[ "Using", "the", "test", "vectors", "in", "the", "testbench", "this", "method", "aggregates", "all", "the", "wait", "conditions", "as", "required", "for", "the", "Sonar", "backend" ]
def finalize_waits(testbench_config): def update_waits(index, temp_key): if temp_key.isdigit(): if int(temp_key) >= index: raise Exception return None, index if temp_key not in conditions: new_key = str(index) waits.append({"condition":...
[ "def", "finalize_waits", "(", "testbench_config", ")", ":", "def", "update_waits", "(", "index", ",", "temp_key", ")", ":", "if", "temp_key", ".", "isdigit", "(", ")", ":", "if", "int", "(", "temp_key", ")", ">=", "index", ":", "raise", "Exception", "ret...
Using the test vectors in the testbench, this method aggregates all the wait conditions as required for the Sonar backend
[ "Using", "the", "test", "vectors", "in", "the", "testbench", "this", "method", "aggregates", "all", "the", "wait", "conditions", "as", "required", "for", "the", "Sonar", "backend" ]
[ "\"\"\"\n Using the test vectors in the testbench, this method aggregates all the\n wait conditions as required for the Sonar backend\n\n Args:\n testbench_config (Testbench): The user-defined testbench configuration\n\n Returns:\n Testbench: Updated testbench configuration\n \"\"\"" ]
[ { "param": "testbench_config", "type": null } ]
{ "returns": [ { "docstring": "Updated testbench configuration", "docstring_tokens": [ "Updated", "testbench", "configuration" ], "type": "Testbench" } ], "raises": [], "params": [ { "identifier": "testbench_config", "type": null, "do...
c5c4f787738ddb02f44a457c50e7f8f6a726bfe8
sharm294/sonar
sonar/core/generate.py
[ "MIT" ]
Python
configure_prologue
<not_specific>
def configure_prologue(testbench_config): """ If a prologue thread is added, add it to all test vectors and delay other threads to wait for it to finish Args: testbench_config (Testbench): The user-defined testbench configuration Returns: Testbench: Updated testbench configuration ...
If a prologue thread is added, add it to all test vectors and delay other threads to wait for it to finish Args: testbench_config (Testbench): The user-defined testbench configuration Returns: Testbench: Updated testbench configuration
If a prologue thread is added, add it to all test vectors and delay other threads to wait for it to finish
[ "If", "a", "prologue", "thread", "is", "added", "add", "it", "to", "all", "test", "vectors", "and", "delay", "other", "threads", "to", "wait", "for", "it", "to", "finish" ]
def configure_prologue(testbench_config): if testbench_config.prologue_thread is None: return testbench_config prologue_thread = testbench_config.prologue_thread prologue_thread.commands.insert( 0, {"signal": {"name": "test_prologue", "value": 1}} ) prologue_thread.set_signal("test_p...
[ "def", "configure_prologue", "(", "testbench_config", ")", ":", "if", "testbench_config", ".", "prologue_thread", "is", "None", ":", "return", "testbench_config", "prologue_thread", "=", "testbench_config", ".", "prologue_thread", "prologue_thread", ".", "commands", "."...
If a prologue thread is added, add it to all test vectors and delay other threads to wait for it to finish
[ "If", "a", "prologue", "thread", "is", "added", "add", "it", "to", "all", "test", "vectors", "and", "delay", "other", "threads", "to", "wait", "for", "it", "to", "finish" ]
[ "\"\"\"\n If a prologue thread is added, add it to all test vectors and delay other\n threads to wait for it to finish\n\n Args:\n testbench_config (Testbench): The user-defined testbench configuration\n\n Returns:\n Testbench: Updated testbench configuration\n \"\"\"" ]
[ { "param": "testbench_config", "type": null } ]
{ "returns": [ { "docstring": "Updated testbench configuration", "docstring_tokens": [ "Updated", "testbench", "configuration" ], "type": "Testbench" } ], "raises": [], "params": [ { "identifier": "testbench_config", "type": null, "do...
c5c4f787738ddb02f44a457c50e7f8f6a726bfe8
sharm294/sonar
sonar/core/generate.py
[ "MIT" ]
Python
add_endpoint_combinations
<not_specific>
def add_endpoint_combinations(testbench_config): """ If there are multiple endpoints added, duplicate test vectors to capture all the combinations Args: testbench_config (Testbench): The testbench Returns: Testbench: Updated testbench """ interfaces = testbench_config.get_f...
If there are multiple endpoints added, duplicate test vectors to capture all the combinations Args: testbench_config (Testbench): The testbench Returns: Testbench: Updated testbench
If there are multiple endpoints added, duplicate test vectors to capture all the combinations
[ "If", "there", "are", "multiple", "endpoints", "added", "duplicate", "test", "vectors", "to", "capture", "all", "the", "combinations" ]
def add_endpoint_combinations(testbench_config): interfaces = testbench_config.get_from_dut("interfaces") for interface_index, interface in enumerate(interfaces): vector_num = len(testbench_config.vectors) if len(interface.endpoints) > 1: vectors_copy = deepcopy(testbench_config.vect...
[ "def", "add_endpoint_combinations", "(", "testbench_config", ")", ":", "interfaces", "=", "testbench_config", ".", "get_from_dut", "(", "\"interfaces\"", ")", "for", "interface_index", ",", "interface", "in", "enumerate", "(", "interfaces", ")", ":", "vector_num", "...
If there are multiple endpoints added, duplicate test vectors to capture all the combinations
[ "If", "there", "are", "multiple", "endpoints", "added", "duplicate", "test", "vectors", "to", "capture", "all", "the", "combinations" ]
[ "\"\"\"\n If there are multiple endpoints added, duplicate test vectors to capture\n all the combinations\n\n Args:\n testbench_config (Testbench): The testbench\n\n Returns:\n Testbench: Updated testbench\n \"\"\"", "# testbench_config.vectors = testbench_config.vectors * len(interfa...
[ { "param": "testbench_config", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "Testbench" } ], "raises": [], "params": [ { "identifier": "testbench_config", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "def...
c5c4f787738ddb02f44a457c50e7f8f6a726bfe8
sharm294/sonar
sonar/core/generate.py
[ "MIT" ]
Python
legalize_config
<not_specific>
def legalize_config(testbench_config): """ There are some additional automatic steps that must be performed on the testbench configuration once the user has finished it Args: testbench_config (Testbench): The user-defined testbench configuration Returns: Testbench: Updated testbenc...
There are some additional automatic steps that must be performed on the testbench configuration once the user has finished it Args: testbench_config (Testbench): The user-defined testbench configuration Returns: Testbench: Updated testbench configuration
There are some additional automatic steps that must be performed on the testbench configuration once the user has finished it
[ "There", "are", "some", "additional", "automatic", "steps", "that", "must", "be", "performed", "on", "the", "testbench", "configuration", "once", "the", "user", "has", "finished", "it" ]
def legalize_config(testbench_config): testbench_config = configure_prologue(testbench_config) testbench_config = finalize_waits(testbench_config) testbench_config = add_endpoint_combinations(testbench_config) return testbench_config
[ "def", "legalize_config", "(", "testbench_config", ")", ":", "testbench_config", "=", "configure_prologue", "(", "testbench_config", ")", "testbench_config", "=", "finalize_waits", "(", "testbench_config", ")", "testbench_config", "=", "add_endpoint_combinations", "(", "t...
There are some additional automatic steps that must be performed on the testbench configuration once the user has finished it
[ "There", "are", "some", "additional", "automatic", "steps", "that", "must", "be", "performed", "on", "the", "testbench", "configuration", "once", "the", "user", "has", "finished", "it" ]
[ "\"\"\"\n There are some additional automatic steps that must be performed on the\n testbench configuration once the user has finished it\n\n Args:\n testbench_config (Testbench): The user-defined testbench configuration\n\n Returns:\n Testbench: Updated testbench configuration\n \"\"\"...
[ { "param": "testbench_config", "type": null } ]
{ "returns": [ { "docstring": "Updated testbench configuration", "docstring_tokens": [ "Updated", "testbench", "configuration" ], "type": "Testbench" } ], "raises": [], "params": [ { "identifier": "testbench_config", "type": null, "do...
c5c4f787738ddb02f44a457c50e7f8f6a726bfe8
sharm294/sonar
sonar/core/generate.py
[ "MIT" ]
Python
sonar
null
def sonar( testbench_config, sonar_tb_filepath, languages="sv", force=False, legalize=True, ): """ Call the appropriate backends to generate testbenches in the chosen languages. Args: testbench_config (Testbench): The user-defined testbench configuration sonar_tb_fil...
Call the appropriate backends to generate testbenches in the chosen languages. Args: testbench_config (Testbench): The user-defined testbench configuration sonar_tb_filepath (str): Path to the Python file used to generate testbench_config languages (str or tuple, option...
Call the appropriate backends to generate testbenches in the chosen languages.
[ "Call", "the", "appropriate", "backends", "to", "generate", "testbenches", "in", "the", "chosen", "languages", "." ]
def sonar( testbench_config, sonar_tb_filepath, languages="sv", force=False, legalize=True, ): if legalize: testbench_config = legalize_config(testbench_config) if isinstance(languages, str): if languages == "all": active_langs = ("sv", "cpp") else: ...
[ "def", "sonar", "(", "testbench_config", ",", "sonar_tb_filepath", ",", "languages", "=", "\"sv\"", ",", "force", "=", "False", ",", "legalize", "=", "True", ",", ")", ":", "if", "legalize", ":", "testbench_config", "=", "legalize_config", "(", "testbench_conf...
Call the appropriate backends to generate testbenches in the chosen languages.
[ "Call", "the", "appropriate", "backends", "to", "generate", "testbenches", "in", "the", "chosen", "languages", "." ]
[ "\"\"\"\n Call the appropriate backends to generate testbenches in the chosen\n languages.\n\n Args:\n testbench_config (Testbench): The user-defined testbench configuration\n sonar_tb_filepath (str): Path to the Python file used to generate\n testbench_config\n languages (s...
[ { "param": "testbench_config", "type": null }, { "param": "sonar_tb_filepath", "type": null }, { "param": "languages", "type": null }, { "param": "force", "type": null }, { "param": "legalize", "type": null } ]
{ "returns": [], "raises": [ { "docstring": "Raised for invalid languages", "docstring_tokens": [ "Raised", "for", "invalid", "languages" ], "type": "SonarInvalidArgError" } ], "params": [ { "identifier": "testbench_config", "type":...
53b62bc575c835d5add8bced6cd79a669b9d7acd
sharm294/sonar
sonar/base_types.py
[ "MIT" ]
Python
asdict
null
def asdict(self): """ Placeholder function that's overridden in the child classes Raises: NotImplementedError: This function should not be called """ raise NotImplementedError
Placeholder function that's overridden in the child classes Raises: NotImplementedError: This function should not be called
Placeholder function that's overridden in the child classes
[ "Placeholder", "function", "that", "'", "s", "overridden", "in", "the", "child", "classes" ]
def asdict(self): raise NotImplementedError
[ "def", "asdict", "(", "self", ")", ":", "raise", "NotImplementedError" ]
Placeholder function that's overridden in the child classes
[ "Placeholder", "function", "that", "'", "s", "overridden", "in", "the", "child", "classes" ]
[ "\"\"\"\n Placeholder function that's overridden in the child classes\n\n Raises:\n NotImplementedError: This function should not be called\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [ { "docstring": "This function should not be called", "docstring_tokens": [ "This", "function", "should", "not", "be", "called" ], "type": "NotImplementedError" } ], "params": [ { "identifier": ...
53b62bc575c835d5add8bced6cd79a669b9d7acd
sharm294/sonar
sonar/base_types.py
[ "MIT" ]
Python
_get_ports
Union[list, dict]
def _get_ports( self, attribute: str, directions: Union[str, tuple, list], collapse: bool, ) -> Union[list, dict]: """ Return some subset of the ports of the module based on the attribute and directions. Args: attribute (str): Type of port...
Return some subset of the ports of the module based on the attribute and directions. Args: attribute (str): Type of port to get directions (Union[str, tuple, list]): Direction(s) of the port type to get collapse (bool): Collapse all ports int...
Return some subset of the ports of the module based on the attribute and directions.
[ "Return", "some", "subset", "of", "the", "ports", "of", "the", "module", "based", "on", "the", "attribute", "and", "directions", "." ]
def _get_ports( self, attribute: str, directions: Union[str, tuple, list], collapse: bool, ) -> Union[list, dict]: if isinstance(directions, str): try: ports = getattr(getattr(self, attribute), directions) except KeyError as ex: ...
[ "def", "_get_ports", "(", "self", ",", "attribute", ":", "str", ",", "directions", ":", "Union", "[", "str", ",", "tuple", ",", "list", "]", ",", "collapse", ":", "bool", ",", ")", "->", "Union", "[", "list", ",", "dict", "]", ":", "if", "isinstanc...
Return some subset of the ports of the module based on the attribute and directions.
[ "Return", "some", "subset", "of", "the", "ports", "of", "the", "module", "based", "on", "the", "attribute", "and", "directions", "." ]
[ "\"\"\"\n Return some subset of the ports of the module based on the attribute and\n directions.\n\n Args:\n attribute (str): Type of port to get\n directions (Union[str, tuple, list]): Direction(s) of the port type\n to get\n collapse (bool): Col...
[ { "param": "self", "type": null }, { "param": "attribute", "type": "str" }, { "param": "directions", "type": "Union[str, tuple, list]" }, { "param": "collapse", "type": "bool" } ]
{ "returns": [ { "docstring": "The retrieved ports of the module", "docstring_tokens": [ "The", "retrieved", "ports", "of", "the", "module" ], "type": "Union[list, dict]" } ], "raises": [ { "docstring": "Raised if a directio...
53b62bc575c835d5add8bced6cd79a669b9d7acd
sharm294/sonar
sonar/base_types.py
[ "MIT" ]
Python
add_signal
null
def add_signal(self, signal): """ Add a signal to the module Args: signal (SignalPort): A SignalPort object """ self._add_ports("signals", signal)
Add a signal to the module Args: signal (SignalPort): A SignalPort object
Add a signal to the module
[ "Add", "a", "signal", "to", "the", "module" ]
def add_signal(self, signal): self._add_ports("signals", signal)
[ "def", "add_signal", "(", "self", ",", "signal", ")", ":", "self", ".", "_add_ports", "(", "\"signals\"", ",", "signal", ")" ]
Add a signal to the module
[ "Add", "a", "signal", "to", "the", "module" ]
[ "\"\"\"\n Add a signal to the module\n\n Args:\n signal (SignalPort): A SignalPort object\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "signal", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "signal", "type": null, "docstring": "A SignalPort object", "d...
53b62bc575c835d5add8bced6cd79a669b9d7acd
sharm294/sonar
sonar/base_types.py
[ "MIT" ]
Python
add_reset
null
def add_reset(self, signal): """ Add a reset to the module Args: signal (SignalPort): A SignalPort object """ self._add_ports("resets", signal)
Add a reset to the module Args: signal (SignalPort): A SignalPort object
Add a reset to the module
[ "Add", "a", "reset", "to", "the", "module" ]
def add_reset(self, signal): self._add_ports("resets", signal)
[ "def", "add_reset", "(", "self", ",", "signal", ")", ":", "self", ".", "_add_ports", "(", "\"resets\"", ",", "signal", ")" ]
Add a reset to the module
[ "Add", "a", "reset", "to", "the", "module" ]
[ "\"\"\"\n Add a reset to the module\n\n Args:\n signal (SignalPort): A SignalPort object\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "signal", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "signal", "type": null, "docstring": "A SignalPort object", "d...
53b62bc575c835d5add8bced6cd79a669b9d7acd
sharm294/sonar
sonar/base_types.py
[ "MIT" ]
Python
add_clock
null
def add_clock(self, signal): """ Add a clock to the module Args: signal (ClockPort): A ClockPort object """ self._add_ports("clocks", signal)
Add a clock to the module Args: signal (ClockPort): A ClockPort object
Add a clock to the module
[ "Add", "a", "clock", "to", "the", "module" ]
def add_clock(self, signal): self._add_ports("clocks", signal)
[ "def", "add_clock", "(", "self", ",", "signal", ")", ":", "self", ".", "_add_ports", "(", "\"clocks\"", ",", "signal", ")" ]
Add a clock to the module
[ "Add", "a", "clock", "to", "the", "module" ]
[ "\"\"\"\n Add a clock to the module\n\n Args:\n signal (ClockPort): A ClockPort object\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "signal", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "signal", "type": null, "docstring": "A ClockPort object", "do...
53b62bc575c835d5add8bced6cd79a669b9d7acd
sharm294/sonar
sonar/base_types.py
[ "MIT" ]
Python
add_interface
null
def add_interface(self, interface): """ Add an interface to the module Args: interface (BaseInterface): An interface """ self._add_ports("interfaces", interface)
Add an interface to the module Args: interface (BaseInterface): An interface
Add an interface to the module
[ "Add", "an", "interface", "to", "the", "module" ]
def add_interface(self, interface): self._add_ports("interfaces", interface)
[ "def", "add_interface", "(", "self", ",", "interface", ")", ":", "self", ".", "_add_ports", "(", "\"interfaces\"", ",", "interface", ")" ]
Add an interface to the module
[ "Add", "an", "interface", "to", "the", "module" ]
[ "\"\"\"\n Add an interface to the module\n\n Args:\n interface (BaseInterface): An interface\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "interface", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "interface", "type": null, "docstring": null, "docstring_token...
53b62bc575c835d5add8bced6cd79a669b9d7acd
sharm294/sonar
sonar/base_types.py
[ "MIT" ]
Python
asdict
<not_specific>
def asdict(self): """ Return the Module ports object as a dict Returns: dict: Module ports """ module_ports = {} module_ports["clocks"] = self.clocks.asdict() module_ports["resets"] = self.resets.asdict() module_ports["interfaces"] = self.inte...
Return the Module ports object as a dict Returns: dict: Module ports
Return the Module ports object as a dict
[ "Return", "the", "Module", "ports", "object", "as", "a", "dict" ]
def asdict(self): module_ports = {} module_ports["clocks"] = self.clocks.asdict() module_ports["resets"] = self.resets.asdict() module_ports["interfaces"] = self.interfaces.asdict() module_ports["signals"] = self.signals.asdict() return module_ports
[ "def", "asdict", "(", "self", ")", ":", "module_ports", "=", "{", "}", "module_ports", "[", "\"clocks\"", "]", "=", "self", ".", "clocks", ".", "asdict", "(", ")", "module_ports", "[", "\"resets\"", "]", "=", "self", ".", "resets", ".", "asdict", "(", ...
Return the Module ports object as a dict
[ "Return", "the", "Module", "ports", "object", "as", "a", "dict" ]
[ "\"\"\"\n Return the Module ports object as a dict\n\n Returns:\n dict: Module ports\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "dict" } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
68764ae6d4bcbeb3b0492da8d1b70ed150453fb7
sharm294/sonar
sonar/core/backends/sv_interfaces.py
[ "MIT" ]
Python
add_prologue
<not_specific>
def add_prologue(testbench, endpoint, interface): """ Declare any variables that may be needed by the interface Args: testbench (str): The testbench component being generated interface (BaseInterface): The interface currently being looked at Returns: str: Updated testbench ...
Declare any variables that may be needed by the interface Args: testbench (str): The testbench component being generated interface (BaseInterface): The interface currently being looked at Returns: str: Updated testbench
Declare any variables that may be needed by the interface
[ "Declare", "any", "variables", "that", "may", "be", "needed", "by", "the", "interface" ]
def add_prologue(testbench, endpoint, interface): prologue = endpoint.prologue("") prologue = include.replace_variables(prologue, interface) testbench += prologue + "\n" return testbench
[ "def", "add_prologue", "(", "testbench", ",", "endpoint", ",", "interface", ")", ":", "prologue", "=", "endpoint", ".", "prologue", "(", "\"\"", ")", "prologue", "=", "include", ".", "replace_variables", "(", "prologue", ",", "interface", ")", "testbench", "...
Declare any variables that may be needed by the interface
[ "Declare", "any", "variables", "that", "may", "be", "needed", "by", "the", "interface" ]
[ "\"\"\"\n Declare any variables that may be needed by the interface\n\n Args:\n testbench (str): The testbench component being generated\n interface (BaseInterface): The interface currently being looked at\n\n Returns:\n str: Updated testbench\n \"\"\"" ]
[ { "param": "testbench", "type": null }, { "param": "endpoint", "type": null }, { "param": "interface", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "testbench", "type": null, "docstring": "The testbench component being generated", "docstring_tokens": [ "T...
68764ae6d4bcbeb3b0492da8d1b70ed150453fb7
sharm294/sonar
sonar/core/backends/sv_interfaces.py
[ "MIT" ]
Python
add_initial_blocks
<not_specific>
def add_initial_blocks(testbench, endpoint, interface): """ Add any statements an interface might require within an initial block Args: testbench (str): The testbench being generated interface (BaseInterface): The interface currently being looked at Returns: str: Updated testbe...
Add any statements an interface might require within an initial block Args: testbench (str): The testbench being generated interface (BaseInterface): The interface currently being looked at Returns: str: Updated testbench
Add any statements an interface might require within an initial block
[ "Add", "any", "statements", "an", "interface", "might", "require", "within", "an", "initial", "block" ]
def add_initial_blocks(testbench, endpoint, interface): initial_blocks = [] initial_blocks_raw = endpoint.initial_blocks(include.TAB_SIZE) for block in initial_blocks_raw: initial_blocks.append(include.replace_variables(block, interface)) for block in initial_blocks: testbench += "initia...
[ "def", "add_initial_blocks", "(", "testbench", ",", "endpoint", ",", "interface", ")", ":", "initial_blocks", "=", "[", "]", "initial_blocks_raw", "=", "endpoint", ".", "initial_blocks", "(", "include", ".", "TAB_SIZE", ")", "for", "block", "in", "initial_blocks...
Add any statements an interface might require within an initial block
[ "Add", "any", "statements", "an", "interface", "might", "require", "within", "an", "initial", "block" ]
[ "\"\"\"\n Add any statements an interface might require within an initial block\n\n Args:\n testbench (str): The testbench being generated\n interface (BaseInterface): The interface currently being looked at\n\n Returns:\n str: Updated testbench\n \"\"\"" ]
[ { "param": "testbench", "type": null }, { "param": "endpoint", "type": null }, { "param": "interface", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "testbench", "type": null, "docstring": "The testbench being generated", "docstring_tokens": [ "The", ...
68764ae6d4bcbeb3b0492da8d1b70ed150453fb7
sharm294/sonar
sonar/core/backends/sv_interfaces.py
[ "MIT" ]
Python
instantiate_endpoint_ips
<not_specific>
def instantiate_endpoint_ips(testbench, endpoint): """ Instantiate any IPs required by the interfaces Args: testbench (str): The testbench being generated endpoint (Endpoint): The endpoint to use for adding IPs Returns: str: Updated testbench """ ip_inst = endpoint.inst...
Instantiate any IPs required by the interfaces Args: testbench (str): The testbench being generated endpoint (Endpoint): The endpoint to use for adding IPs Returns: str: Updated testbench
Instantiate any IPs required by the interfaces
[ "Instantiate", "any", "IPs", "required", "by", "the", "interfaces" ]
def instantiate_endpoint_ips(testbench, endpoint): ip_inst = endpoint.instantiate(include.TAB_SIZE) testbench += ip_inst + "\n" return testbench
[ "def", "instantiate_endpoint_ips", "(", "testbench", ",", "endpoint", ")", ":", "ip_inst", "=", "endpoint", ".", "instantiate", "(", "include", ".", "TAB_SIZE", ")", "testbench", "+=", "ip_inst", "+", "\"\\n\"", "return", "testbench" ]
Instantiate any IPs required by the interfaces
[ "Instantiate", "any", "IPs", "required", "by", "the", "interfaces" ]
[ "\"\"\"\n Instantiate any IPs required by the interfaces\n\n Args:\n testbench (str): The testbench being generated\n endpoint (Endpoint): The endpoint to use for adding IPs\n\n Returns:\n str: Updated testbench\n \"\"\"" ]
[ { "param": "testbench", "type": null }, { "param": "endpoint", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "testbench", "type": null, "docstring": "The testbench being generated", "docstring_tokens": [ "The", ...
68764ae6d4bcbeb3b0492da8d1b70ed150453fb7
sharm294/sonar
sonar/core/backends/sv_interfaces.py
[ "MIT" ]
Python
add_signal_endpoints
<not_specific>
def add_signal_endpoints(testbench_config, testbench): """ Add signals' sources/sinks Args: testbench_config (Testbench): The testbench configuration testbench (str): The testbench being generated Returns: str: The testbench """ endpoints_str = "" leading_spaces = i...
Add signals' sources/sinks Args: testbench_config (Testbench): The testbench configuration testbench (str): The testbench being generated Returns: str: The testbench
Add signals' sources/sinks
[ "Add", "signals", "'", "sources", "/", "sinks" ]
def add_signal_endpoints(testbench_config, testbench): endpoints_str = "" leading_spaces = include.get_indentation( "SONAR_INCLUDE_ENDPOINTS", testbench ) all_endpoints = testbench_config.get_from_dut("endpoints") for signal_index, endpoint_dict in enumerate(all_endpoints.items()): s...
[ "def", "add_signal_endpoints", "(", "testbench_config", ",", "testbench", ")", ":", "endpoints_str", "=", "\"\"", "leading_spaces", "=", "include", ".", "get_indentation", "(", "\"SONAR_INCLUDE_ENDPOINTS\"", ",", "testbench", ")", "all_endpoints", "=", "testbench_config...
Add signals' sources/sinks
[ "Add", "signals", "'", "sources", "/", "sinks" ]
[ "\"\"\"\n Add signals' sources/sinks\n\n Args:\n testbench_config (Testbench): The testbench configuration\n testbench (str): The testbench being generated\n\n Returns:\n str: The testbench\n \"\"\"" ]
[ { "param": "testbench_config", "type": null }, { "param": "testbench", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "testbench_config", "type": null, "docstring": "The testbench configuration", "docstring_tokens": [ "The", ...
68764ae6d4bcbeb3b0492da8d1b70ed150453fb7
sharm294/sonar
sonar/core/backends/sv_interfaces.py
[ "MIT" ]
Python
add_interfaces
<not_specific>
def add_interfaces(testbench_config, testbench, directory): """ Add interfaces and their sources/sinks Args: testbench_config (Testbench): The testbench configuration testbench (str): The testbench being generated directory (str): Path to the directory to place generated files ...
Add interfaces and their sources/sinks Args: testbench_config (Testbench): The testbench configuration testbench (str): The testbench being generated directory (str): Path to the directory to place generated files Returns: str: The testbench
Add interfaces and their sources/sinks
[ "Add", "interfaces", "and", "their", "sources", "/", "sinks" ]
def add_interfaces(testbench_config, testbench, directory): endpoints_str = "" imports_str = "" used_interfaces = {} leading_spaces = include.get_indentation( "SONAR_INCLUDE_INTERFACE_ENDPOINTS", testbench ) interfaces = testbench_config.get_from_dut("interfaces") for interface_index...
[ "def", "add_interfaces", "(", "testbench_config", ",", "testbench", ",", "directory", ")", ":", "endpoints_str", "=", "\"\"", "imports_str", "=", "\"\"", "used_interfaces", "=", "{", "}", "leading_spaces", "=", "include", ".", "get_indentation", "(", "\"SONAR_INCL...
Add interfaces and their sources/sinks
[ "Add", "interfaces", "and", "their", "sources", "/", "sinks" ]
[ "\"\"\"\n Add interfaces and their sources/sinks\n\n Args:\n testbench_config (Testbench): The testbench configuration\n testbench (str): The testbench being generated\n directory (str): Path to the directory to place generated files\n\n Returns:\n str: The testbench\n \"\"\"...
[ { "param": "testbench_config", "type": null }, { "param": "testbench", "type": null }, { "param": "directory", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "testbench_config", "type": null, "docstring": "The testbench configuration", "docstring_tokens": [ "The", ...
5cc863158cbd6f040dfe92fe6fe9b059216425bf
sharm294/sonar
tests/conftest.py
[ "MIT" ]
Python
patch_constants
null
def patch_constants( monkeypatch, test_home_path ): # pylint: disable=redefined-outer-name """ For pytest, override the default constants used in sonar Args: monkeypatch (monkeypatch): Defined in pytest for monkeypatching code test_home_path (str): Path to the new home directory for so...
For pytest, override the default constants used in sonar Args: monkeypatch (monkeypatch): Defined in pytest for monkeypatching code test_home_path (str): Path to the new home directory for sonar
For pytest, override the default constants used in sonar
[ "For", "pytest", "override", "the", "default", "constants", "used", "in", "sonar" ]
def patch_constants( monkeypatch, test_home_path ): @init_constants class MockConstants(Constants): SONAR_BASE_PATH = Path(test_home_path) monkeypatch.setattr("sonar.api.Constants", MockConstants) monkeypatch.setattr("sonar.database.Constants", MockConstants) monkeypatch.setattr("sonar...
[ "def", "patch_constants", "(", "monkeypatch", ",", "test_home_path", ")", ":", "@", "init_constants", "class", "MockConstants", "(", "Constants", ")", ":", "\"\"\"\n New mock Constants class that inherits all the constants from the base\n class but overrides the base pa...
For pytest, override the default constants used in sonar
[ "For", "pytest", "override", "the", "default", "constants", "used", "in", "sonar" ]
[ "# pylint: disable=redefined-outer-name", "\"\"\"\n For pytest, override the default constants used in sonar\n\n Args:\n monkeypatch (monkeypatch): Defined in pytest for monkeypatching code\n test_home_path (str): Path to the new home directory for sonar\n \"\"\"", "\"\"\"\n New mo...
[ { "param": "monkeypatch", "type": null }, { "param": "test_home_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "monkeypatch", "type": null, "docstring": "Defined in pytest for monkeypatching code", "docstring_tokens": [ "Defined", "in", "pytest", "for", "monkeypatching", "code" ], ...
5cc863158cbd6f040dfe92fe6fe9b059216425bf
sharm294/sonar
tests/conftest.py
[ "MIT" ]
Python
cli
<not_specific>
def cli(args=""): """ Calls sonar from Python as though it were called from the command line Args: args (str, optional): Arguments to pass to sonar. Defaults to "". Returns: int: Return value from calling sonar """ testargs = ["sonar"] te...
Calls sonar from Python as though it were called from the command line Args: args (str, optional): Arguments to pass to sonar. Defaults to "". Returns: int: Return value from calling sonar
Calls sonar from Python as though it were called from the command line
[ "Calls", "sonar", "from", "Python", "as", "though", "it", "were", "called", "from", "the", "command", "line" ]
def cli(args=""): testargs = ["sonar"] testargs.extend(args.split(" ")) with pytest.raises(SystemExit) as exc: with patch.object(sys, "argv", testargs): sonar.main.main() return exc.value.code
[ "def", "cli", "(", "args", "=", "\"\"", ")", ":", "testargs", "=", "[", "\"sonar\"", "]", "testargs", ".", "extend", "(", "args", ".", "split", "(", "\" \"", ")", ")", "with", "pytest", ".", "raises", "(", "SystemExit", ")", "as", "exc", ":", "with...
Calls sonar from Python as though it were called from the command line
[ "Calls", "sonar", "from", "Python", "as", "though", "it", "were", "called", "from", "the", "command", "line" ]
[ "\"\"\"\n Calls sonar from Python as though it were called from the command line\n\n Args:\n args (str, optional): Arguments to pass to sonar. Defaults to \"\".\n\n Returns:\n int: Return value from calling sonar\n \"\"\"" ]
[ { "param": "args", "type": null } ]
{ "returns": [ { "docstring": "Return value from calling sonar", "docstring_tokens": [ "Return", "value", "from", "calling", "sonar" ], "type": "int" } ], "raises": [], "params": [ { "identifier": "args", "type": null, ...