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
a80ea0e7fffd9d28a84425769522d9a2dccb48f5
Blebowski/Reg_Map_Gen
ip_xact/h_addr_generator.py
[ "MIT" ]
Python
write_reg_field_enums
null
def write_reg_field_enums(self, reg): """ Write enumerated values of all register fields within IP-XACT register object as C enums. Name of the C enum is: <prefix>_<register_name>_<field_name> """ for (i,field) in enumerate(sorted(reg.field, key=lambda a: a.bitOffset)): # Skip field if there are no en...
Write enumerated values of all register fields within IP-XACT register object as C enums. Name of the C enum is: <prefix>_<register_name>_<field_name>
Write enumerated values of all register fields within IP-XACT register object as C enums. Name of the C enum is: __
[ "Write", "enumerated", "values", "of", "all", "register", "fields", "within", "IP", "-", "XACT", "register", "object", "as", "C", "enums", ".", "Name", "of", "the", "C", "enum", "is", ":", "__" ]
def write_reg_field_enums(self, reg): for (i,field) in enumerate(sorted(reg.field, key=lambda a: a.bitOffset)): if (field.enumeratedValues == []): continue enum_elements = self.create_field_enum_decls(field) enum_name = (self.prefix + "_" + reg.name + "_" + field.name).lower() self.headerGen.create_en...
[ "def", "write_reg_field_enums", "(", "self", ",", "reg", ")", ":", "for", "(", "i", ",", "field", ")", "in", "enumerate", "(", "sorted", "(", "reg", ".", "field", ",", "key", "=", "lambda", "a", ":", "a", ".", "bitOffset", ")", ")", ":", "if", "(...
Write enumerated values of all register fields within IP-XACT register object as C enums.
[ "Write", "enumerated", "values", "of", "all", "register", "fields", "within", "IP", "-", "XACT", "register", "object", "as", "C", "enums", "." ]
[ "\"\"\"\n\t\tWrite enumerated values of all register fields within IP-XACT register\n\t\tobject as C enums. Name of the C enum is:\n\t\t\t<prefix>_<register_name>_<field_name>\n\t\t\"\"\"", "# Skip field if there are no enums", "# Create declaration objects for each enumerated value of field", "# Write enum ...
[ { "param": "self", "type": null }, { "param": "reg", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "reg", "type": null, "docstring": null, "docstring_tokens": []...
a80ea0e7fffd9d28a84425769522d9a2dccb48f5
Blebowski/Reg_Map_Gen
ip_xact/h_addr_generator.py
[ "MIT" ]
Python
sort_regs_to_wrd_groups
<not_specific>
def sort_regs_to_wrd_groups(self, regs): """ Sort list of IP-XACT register objects into groups. Each group is represented by a list. Each list contains registers located within a single memory word. """ regGroups = [[]] lowInd = 0 # Sort the registers from field map into sub-lists for reg in sorted(...
Sort list of IP-XACT register objects into groups. Each group is represented by a list. Each list contains registers located within a single memory word.
Sort list of IP-XACT register objects into groups. Each group is represented by a list. Each list contains registers located within a single memory word.
[ "Sort", "list", "of", "IP", "-", "XACT", "register", "objects", "into", "groups", ".", "Each", "group", "is", "represented", "by", "a", "list", ".", "Each", "list", "contains", "registers", "located", "within", "a", "single", "memory", "word", "." ]
def sort_regs_to_wrd_groups(self, regs): regGroups = [[]] lowInd = 0 for reg in sorted(regs, key=lambda a: a.addressOffset): if (reg.addressOffset >= lowInd + self.wrdWidthByte): lowInd = reg.addressOffset - reg.addressOffset % 4 regGroups.append([]) regGroups[-1].append(reg) return regGroups
[ "def", "sort_regs_to_wrd_groups", "(", "self", ",", "regs", ")", ":", "regGroups", "=", "[", "[", "]", "]", "lowInd", "=", "0", "for", "reg", "in", "sorted", "(", "regs", ",", "key", "=", "lambda", "a", ":", "a", ".", "addressOffset", ")", ":", "if...
Sort list of IP-XACT register objects into groups.
[ "Sort", "list", "of", "IP", "-", "XACT", "register", "objects", "into", "groups", "." ]
[ "\"\"\"\n\t\tSort list of IP-XACT register objects into groups. Each group is\n\t\trepresented by a list. Each list contains registers located within\n\t\ta single memory word.\n\t\t\"\"\"", "# Sort the registers from field map into sub-lists\t", "# We hit the register aligned create new group" ]
[ { "param": "self", "type": null }, { "param": "regs", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "regs", "type": null, "docstring": null, "docstring_tokens": [...
a80ea0e7fffd9d28a84425769522d9a2dccb48f5
Blebowski/Reg_Map_Gen
ip_xact/h_addr_generator.py
[ "MIT" ]
Python
write_reg_unions_and_enums
null
def write_reg_unions_and_enums(self, regs): """ Write registers from IP-XACT registers object into generator output. Following artifacts are written: - union for each memory word with registers - enums for each enumerated values of register fields """ # First sort the registerinto word-aligned groups. ...
Write registers from IP-XACT registers object into generator output. Following artifacts are written: - union for each memory word with registers - enums for each enumerated values of register fields
Write registers from IP-XACT registers object into generator output. Following artifacts are written: union for each memory word with registers enums for each enumerated values of register fields
[ "Write", "registers", "from", "IP", "-", "XACT", "registers", "object", "into", "generator", "output", ".", "Following", "artifacts", "are", "written", ":", "union", "for", "each", "memory", "word", "with", "registers", "enums", "for", "each", "enumerated", "v...
def write_reg_unions_and_enums(self, regs): regGroups = self.sort_regs_to_wrd_groups(regs) for regGroup in regGroups: self.write_reg_group_union(regGroup) for reg in regGroup: self.write_reg_field_enums(reg)
[ "def", "write_reg_unions_and_enums", "(", "self", ",", "regs", ")", ":", "regGroups", "=", "self", ".", "sort_regs_to_wrd_groups", "(", "regs", ")", "for", "regGroup", "in", "regGroups", ":", "self", ".", "write_reg_group_union", "(", "regGroup", ")", "for", "...
Write registers from IP-XACT registers object into generator output.
[ "Write", "registers", "from", "IP", "-", "XACT", "registers", "object", "into", "generator", "output", "." ]
[ "\"\"\"\n\t\tWrite registers from IP-XACT registers object into generator output.\n\t\tFollowing artifacts are written:\n\t\t\t- union for each memory word with registers\n\t\t\t- enums for each enumerated values of register fields\n\t\t\"\"\"", "# First sort the registerinto word-aligned groups.", "# Write eac...
[ { "param": "self", "type": null }, { "param": "regs", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "regs", "type": null, "docstring": null, "docstring_tokens": [...
a80ea0e7fffd9d28a84425769522d9a2dccb48f5
Blebowski/Reg_Map_Gen
ip_xact/h_addr_generator.py
[ "MIT" ]
Python
write_mem_map_fields
null
def write_mem_map_fields(self): """ Process registers within "memBlock" IP-XACT memory block and write to register output. """ for block in self.memMap.addressBlock: # Skip memory blocks. if (block.usage == "memory"): continue # Write unions and enums of registers within memory block ...
Process registers within "memBlock" IP-XACT memory block and write to register output.
Process registers within "memBlock" IP-XACT memory block and write to register output.
[ "Process", "registers", "within", "\"", "memBlock", "\"", "IP", "-", "XACT", "memory", "block", "and", "write", "to", "register", "output", "." ]
def write_mem_map_fields(self): for block in self.memMap.addressBlock: if (block.usage == "memory"): continue self.write_reg_unions_and_enums(block.register)
[ "def", "write_mem_map_fields", "(", "self", ")", ":", "for", "block", "in", "self", ".", "memMap", ".", "addressBlock", ":", "if", "(", "block", ".", "usage", "==", "\"memory\"", ")", ":", "continue", "self", ".", "write_reg_unions_and_enums", "(", "block", ...
Process registers within "memBlock" IP-XACT memory block and write to register output.
[ "Process", "registers", "within", "\"", "memBlock", "\"", "IP", "-", "XACT", "memory", "block", "and", "write", "to", "register", "output", "." ]
[ "\"\"\"\n\t\tProcess registers within \"memBlock\" IP-XACT memory block and write to\n\t\tregister output.\n\t\t\"\"\"", "# Skip memory blocks. ", "# Write unions and enums of registers within memory block" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
a80ea0e7fffd9d28a84425769522d9a2dccb48f5
Blebowski/Reg_Map_Gen
ip_xact/h_addr_generator.py
[ "MIT" ]
Python
write_mem_map_addr_enum
null
def write_mem_map_addr_enum(self): """ Write addresses of registers within "memBlock" IP-XACT memory block as enum to generator output. """ cmnt = "{} memory map".format(self.memMap.name) self.headerGen.write_comment(cmnt, 0, small=True) decls = [] for block in self.memMap.addressBlock: for reg in...
Write addresses of registers within "memBlock" IP-XACT memory block as enum to generator output.
Write addresses of registers within "memBlock" IP-XACT memory block as enum to generator output.
[ "Write", "addresses", "of", "registers", "within", "\"", "memBlock", "\"", "IP", "-", "XACT", "memory", "block", "as", "enum", "to", "generator", "output", "." ]
def write_mem_map_addr_enum(self): cmnt = "{} memory map".format(self.memMap.name) self.headerGen.write_comment(cmnt, 0, small=True) decls = [] for block in self.memMap.addressBlock: for reg in sorted(block.register, key=lambda a: a.addressOffset): decls.append(LanDeclaration((self.prefix + "_" + reg.nam...
[ "def", "write_mem_map_addr_enum", "(", "self", ")", ":", "cmnt", "=", "\"{} memory map\"", ".", "format", "(", "self", ".", "memMap", ".", "name", ")", "self", ".", "headerGen", ".", "write_comment", "(", "cmnt", ",", "0", ",", "small", "=", "True", ")",...
Write addresses of registers within "memBlock" IP-XACT memory block as enum to generator output.
[ "Write", "addresses", "of", "registers", "within", "\"", "memBlock", "\"", "IP", "-", "XACT", "memory", "block", "as", "enum", "to", "generator", "output", "." ]
[ "\"\"\"\n\t\tWrite addresses of registers within \"memBlock\" IP-XACT memory block as\n\t\tenum to generator output.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
a80ea0e7fffd9d28a84425769522d9a2dccb48f5
Blebowski/Reg_Map_Gen
ip_xact/h_addr_generator.py
[ "MIT" ]
Python
create_addrMap_package
null
def create_addrMap_package(self, name): """ Create C header file package for "memMap" IP-XACT memory block. Package contains: 1. Enum with addresses of each register 2. Unions for each memory word with registers. 3. Enums for each enumerated values of Register fields. """ self.headerGen.wr_nl() sel...
Create C header file package for "memMap" IP-XACT memory block. Package contains: 1. Enum with addresses of each register 2. Unions for each memory word with registers. 3. Enums for each enumerated values of Register fields.
Create C header file package for "memMap" IP-XACT memory block. Package contains: 1. Enum with addresses of each register 2. Unions for each memory word with registers. 3. Enums for each enumerated values of Register fields.
[ "Create", "C", "header", "file", "package", "for", "\"", "memMap", "\"", "IP", "-", "XACT", "memory", "block", ".", "Package", "contains", ":", "1", ".", "Enum", "with", "addresses", "of", "each", "register", "2", ".", "Unions", "for", "each", "memory", ...
def create_addrMap_package(self, name): self.headerGen.wr_nl() self.headerGen.write_comment("This file is autogenerated, DO NOT EDIT!", 0, small=True) self.headerGen.wr_nl() self.headerGen.create_package((self.prefix + "_" + name).upper()) self.headerGen.wr_nl() if (self.memMap): print ("Writin...
[ "def", "create_addrMap_package", "(", "self", ",", "name", ")", ":", "self", ".", "headerGen", ".", "wr_nl", "(", ")", "self", ".", "headerGen", ".", "write_comment", "(", "\"This file is autogenerated, DO NOT EDIT!\"", ",", "0", ",", "small", "=", "True", ")"...
Create C header file package for "memMap" IP-XACT memory block.
[ "Create", "C", "header", "file", "package", "for", "\"", "memMap", "\"", "IP", "-", "XACT", "memory", "block", "." ]
[ "\"\"\"\n\t\tCreate C header file package for \"memMap\" IP-XACT memory block.\n\t\tPackage contains:\n\t\t\t1. Enum with addresses of each register\n\t\t\t2. Unions for each memory word with registers.\n\t\t\t3. Enums for each enumerated values of Register fields.\n\t\t\"\"\"", "# Write memory map address enum",...
[ { "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": null, "docstring_tokens": [...
e6f45d794ee4ac7292c7336604536894efbd7955
Blebowski/Reg_Map_Gen
languages/gen_lyx.py
[ "MIT" ]
Python
is_supported_layout
<not_specific>
def is_supported_layout(self, layout): """ Finds out whether the layout is supported by the basic lyx packages. Arguments: layout Name of the lyx layout Returns: True id supported, False otherwise """ for styleGroup in LyxGenerator.supStyles: for styleIter in styleGroup: if (styleIter == layou...
Finds out whether the layout is supported by the basic lyx packages. Arguments: layout Name of the lyx layout Returns: True id supported, False otherwise
Finds out whether the layout is supported by the basic lyx packages. Arguments: layout Name of the lyx layout Returns: True id supported, False otherwise
[ "Finds", "out", "whether", "the", "layout", "is", "supported", "by", "the", "basic", "lyx", "packages", ".", "Arguments", ":", "layout", "Name", "of", "the", "lyx", "layout", "Returns", ":", "True", "id", "supported", "False", "otherwise" ]
def is_supported_layout(self, layout): for styleGroup in LyxGenerator.supStyles: for styleIter in styleGroup: if (styleIter == layout): return True return False
[ "def", "is_supported_layout", "(", "self", ",", "layout", ")", ":", "for", "styleGroup", "in", "LyxGenerator", ".", "supStyles", ":", "for", "styleIter", "in", "styleGroup", ":", "if", "(", "styleIter", "==", "layout", ")", ":", "return", "True", "return", ...
Finds out whether the layout is supported by the basic lyx packages.
[ "Finds", "out", "whether", "the", "layout", "is", "supported", "by", "the", "basic", "lyx", "packages", "." ]
[ "\"\"\"\n\t\tFinds out whether the layout is supported by the basic lyx packages.\n\t\tArguments:\n\t\t\tlayout\t\tName of the lyx layout\n\t\tReturns:\n\t\t\tTrue id supported, False otherwise\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "layout", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "layout", "type": null, "docstring": null, "docstring_tokens":...
e6f45d794ee4ac7292c7336604536894efbd7955
Blebowski/Reg_Map_Gen
languages/gen_lyx.py
[ "MIT" ]
Python
insert_layout
<not_specific>
def insert_layout(self, layout): """ Insert lyx layout into the generator output (Chapter, Section etc...) Arguments: layout Name of the lyx layout """ if (not self.is_supported_layout(layout)): return False self.wr_line("\\begin_layout {}\n".format(layout)) self.append_line("\\end_layout\n")
Insert lyx layout into the generator output (Chapter, Section etc...) Arguments: layout Name of the lyx layout
Insert lyx layout into the generator output (Chapter, Section etc...) Arguments: layout Name of the lyx layout
[ "Insert", "lyx", "layout", "into", "the", "generator", "output", "(", "Chapter", "Section", "etc", "...", ")", "Arguments", ":", "layout", "Name", "of", "the", "lyx", "layout" ]
def insert_layout(self, layout): if (not self.is_supported_layout(layout)): return False self.wr_line("\\begin_layout {}\n".format(layout)) self.append_line("\\end_layout\n")
[ "def", "insert_layout", "(", "self", ",", "layout", ")", ":", "if", "(", "not", "self", ".", "is_supported_layout", "(", "layout", ")", ")", ":", "return", "False", "self", ".", "wr_line", "(", "\"\\\\begin_layout {}\\n\"", ".", "format", "(", "layout", ")...
Insert lyx layout into the generator output (Chapter, Section etc...) Arguments: layout Name of the lyx layout
[ "Insert", "lyx", "layout", "into", "the", "generator", "output", "(", "Chapter", "Section", "etc", "...", ")", "Arguments", ":", "layout", "Name", "of", "the", "lyx", "layout" ]
[ "\"\"\"\n\t\tInsert lyx layout into the generator output (Chapter, Section etc...)\n\t\tArguments:\n\t\t\tlayout\t\tName of the lyx layout\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "layout", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "layout", "type": null, "docstring": null, "docstring_tokens":...
e6f45d794ee4ac7292c7336604536894efbd7955
Blebowski/Reg_Map_Gen
languages/gen_lyx.py
[ "MIT" ]
Python
insert_inset
null
def insert_inset(self, inset, options=[]): """ Insert lyx inset into the generator output (Text, Tabular, ERT) Arguments: layout Name of the lyx inset. """ self.wr_line("\\begin_inset {}\n".format(inset)) for option in options: self.wr_line("{} {}\n".format(option[0], option[1])) self.append_line("...
Insert lyx inset into the generator output (Text, Tabular, ERT) Arguments: layout Name of the lyx inset.
Insert lyx inset into the generator output (Text, Tabular, ERT) Arguments: layout Name of the lyx inset.
[ "Insert", "lyx", "inset", "into", "the", "generator", "output", "(", "Text", "Tabular", "ERT", ")", "Arguments", ":", "layout", "Name", "of", "the", "lyx", "inset", "." ]
def insert_inset(self, inset, options=[]): self.wr_line("\\begin_inset {}\n".format(inset)) for option in options: self.wr_line("{} {}\n".format(option[0], option[1])) self.append_line("\\end_inset\n")
[ "def", "insert_inset", "(", "self", ",", "inset", ",", "options", "=", "[", "]", ")", ":", "self", ".", "wr_line", "(", "\"\\\\begin_inset {}\\n\"", ".", "format", "(", "inset", ")", ")", "for", "option", "in", "options", ":", "self", ".", "wr_line", "...
Insert lyx inset into the generator output (Text, Tabular, ERT) Arguments: layout Name of the lyx inset.
[ "Insert", "lyx", "inset", "into", "the", "generator", "output", "(", "Text", "Tabular", "ERT", ")", "Arguments", ":", "layout", "Name", "of", "the", "lyx", "inset", "." ]
[ "\"\"\"\n\t\tInsert lyx inset into the generator output (Text, Tabular, ERT)\n\t\tArguments:\n\t\t\tlayout\t\tName of the lyx inset.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "inset", "type": null }, { "param": "options", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "inset", "type": null, "docstring": null, "docstring_tokens": ...
e6f45d794ee4ac7292c7336604536894efbd7955
Blebowski/Reg_Map_Gen
languages/gen_lyx.py
[ "MIT" ]
Python
insert_table_cell
null
def insert_table_cell(self, cell): """ Insert Table cell into the into the generator output. Arguments: cell Cell to insert in format: [cellOptions, cellTextOptions, cellText, cellLabel, cellColor] where: cellOptions - Dictionary with cell options such as: {"alignment":"center", "bottom...
Insert Table cell into the into the generator output. Arguments: cell Cell to insert in format: [cellOptions, cellTextOptions, cellText, cellLabel, cellColor] where: cellOptions - Dictionary with cell options such as: {"alignment":"center", "bottomline":"true"} cellTextOptions - Tex...
Insert Table cell into the into the generator output.
[ "Insert", "Table", "cell", "into", "the", "into", "the", "generator", "output", "." ]
def insert_table_cell(self, cell): self.insert_html_table_tag("cell", cell[0], endTag=True) self.insert_inset("Text") self.wr_line("\n") self.write_layout_text("Plain Layout", cell[2], textOptions=cell[1], label=cell[3], color=cell[4]) self.wr_line("\n") self.commit_append_line(2)
[ "def", "insert_table_cell", "(", "self", ",", "cell", ")", ":", "self", ".", "insert_html_table_tag", "(", "\"cell\"", ",", "cell", "[", "0", "]", ",", "endTag", "=", "True", ")", "self", ".", "insert_inset", "(", "\"Text\"", ")", "self", ".", "wr_line",...
Insert Table cell into the into the generator output.
[ "Insert", "Table", "cell", "into", "the", "into", "the", "generator", "output", "." ]
[ "\"\"\"\n\t\tInsert Table cell into the into the generator output.\n\t\tArguments:\n\t\t\tcell\tCell to insert in format:\n\t\t\t\t\t[cellOptions, cellTextOptions, cellText, cellLabel, cellColor]\n\t\t\t\t\twhere:\n\t\t\t\t\tcellOptions - Dictionary with cell options such as:\n\t\t\t\t\t\t\t\t\t{\"alignment\":\"cen...
[ { "param": "self", "type": null }, { "param": "cell", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "cell", "type": null, "docstring": null, "docstring_tokens": [...
e6f45d794ee4ac7292c7336604536894efbd7955
Blebowski/Reg_Map_Gen
languages/gen_lyx.py
[ "MIT" ]
Python
insert_table
null
def insert_table(self, table): """ Insert lyx table into the generator output. Arguments: table Lyx table in the following format: [tableOptions, tableCells] where: tableOptions has following format: [tagName, tagOptions] where: tagName - name of HTML options tag t...
Insert lyx table into the generator output. Arguments: table Lyx table in the following format: [tableOptions, tableCells] where: tableOptions has following format: [tagName, tagOptions] where: tagName - name of HTML options tag tagOptions - dictionary with HTML tag...
Insert lyx table into the generator output.
[ "Insert", "lyx", "table", "into", "the", "generator", "output", "." ]
def insert_table(self, table): tableOptions = table[0] cells = table[1] self.insert_layout("Standard") self.wr_line("\\noindent\n") self.wr_line("\\align center\n") self.insert_inset("Tabular") tableDimension = {"version" : "3", "rows" : '{}'.format(len(cells)), "columns" : '{}'.format(len(cells[0]...
[ "def", "insert_table", "(", "self", ",", "table", ")", ":", "tableOptions", "=", "table", "[", "0", "]", "cells", "=", "table", "[", "1", "]", "self", ".", "insert_layout", "(", "\"Standard\"", ")", "self", ".", "wr_line", "(", "\"\\\\noindent\\n\"", ")"...
Insert lyx table into the generator output.
[ "Insert", "lyx", "table", "into", "the", "generator", "output", "." ]
[ "\"\"\"\n\t\tInsert lyx table into the generator output.\n\t\tArguments:\n\t\t\ttable \t\tLyx table in the following format:\n\t\t\t\t\t\t\t[tableOptions, tableCells] where:\n\t\t\t\t\t\t\t\ttableOptions has following format:\n\t\t\t\t\t\t\t\t\t[tagName, tagOptions] where:\n\t\t\t\t\t\t\t\t\t\ttagName - name of HTM...
[ { "param": "self", "type": null }, { "param": "table", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "table", "type": null, "docstring": null, "docstring_tokens": ...
e6f45d794ee4ac7292c7336604536894efbd7955
Blebowski/Reg_Map_Gen
languages/gen_lyx.py
[ "MIT" ]
Python
replace_reserved_sign
<not_specific>
def replace_reserved_sign(self, text): """ Replace reserved character of "_" in the lyx hypertext function. Arguments: text Text to replace the option in Returns: Text with reserved characters replaced with according backslash option. """ retVal = "" for char in text: if (char == "_"): re...
Replace reserved character of "_" in the lyx hypertext function. Arguments: text Text to replace the option in Returns: Text with reserved characters replaced with according backslash option.
Replace reserved character of "_" in the lyx hypertext function. Arguments: text Text to replace the option in Returns: Text with reserved characters replaced with according backslash option.
[ "Replace", "reserved", "character", "of", "\"", "_", "\"", "in", "the", "lyx", "hypertext", "function", ".", "Arguments", ":", "text", "Text", "to", "replace", "the", "option", "in", "Returns", ":", "Text", "with", "reserved", "characters", "replaced", "with...
def replace_reserved_sign(self, text): retVal = "" for char in text: if (char == "_"): retVal += "\\backslash textunderscore " elif (char == """\ """): retVal += "\\" else: retVal += char return retVal
[ "def", "replace_reserved_sign", "(", "self", ",", "text", ")", ":", "retVal", "=", "\"\"", "for", "char", "in", "text", ":", "if", "(", "char", "==", "\"_\"", ")", ":", "retVal", "+=", "\"\\\\backslash textunderscore \"", "elif", "(", "char", "==", "\"\"\"...
Replace reserved character of "_" in the lyx hypertext function.
[ "Replace", "reserved", "character", "of", "\"", "_", "\"", "in", "the", "lyx", "hypertext", "function", "." ]
[ "\"\"\"\n\t\tReplace reserved character of \"_\" in the lyx hypertext function.\n\t\tArguments:\n\t\t\ttext\t\tText to replace the option in\n\t\tReturns:\n\t\t\tText with reserved characters replaced with according backslash\n\t\t\toption.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "text", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "text", "type": null, "docstring": null, "docstring_tokens": [...
e6f45d794ee4ac7292c7336604536894efbd7955
Blebowski/Reg_Map_Gen
languages/gen_lyx.py
[ "MIT" ]
Python
insert_ref
null
def insert_ref(self, labelText, ref): """ Insert label or reference into the generator output. Arguments: labelText Text to write into the label ref Label type. At the moment can be: "label" - LabelText is written and label object is created directly behind. "hyperref" - Hyperref ...
Insert label or reference into the generator output. Arguments: labelText Text to write into the label ref Label type. At the moment can be: "label" - LabelText is written and label object is created directly behind. "hyperref" - Hyperref object is created with "labelTe...
Insert label or reference into the generator output. Arguments: labelText Text to write into the label ref Label type. At the moment can be: "label" - LabelText is written and label object is created directly behind. "hyperref" - Hyperref object is created with "labelText" placed in the hyperr...
[ "Insert", "label", "or", "reference", "into", "the", "generator", "output", ".", "Arguments", ":", "labelText", "Text", "to", "write", "into", "the", "label", "ref", "Label", "type", ".", "At", "the", "moment", "can", "be", ":", "\"", "label", "\"", "-",...
def insert_ref(self, labelText, ref): self.insert_inset("ERT") self.wr_line("status open\n") self.insert_layout("Plain Layout") self.wr_line("\\backslash\n") if (ref == "label"): labelStr = "{"+"{}".format(labelText)+"}" self.wr_line("{}{}".format(ref, labelStr)) if (ref == "hyperref"): refString =...
[ "def", "insert_ref", "(", "self", ",", "labelText", ",", "ref", ")", ":", "self", ".", "insert_inset", "(", "\"ERT\"", ")", "self", ".", "wr_line", "(", "\"status open\\n\"", ")", "self", ".", "insert_layout", "(", "\"Plain Layout\"", ")", "self", ".", "wr...
Insert label or reference into the generator output.
[ "Insert", "label", "or", "reference", "into", "the", "generator", "output", "." ]
[ "\"\"\"\n\t\tInsert label or reference into the generator output.\n\t\tArguments:\n\t\t\tlabelText\tText to write into the label\n\t\t\tref\t\t\tLabel type. At the moment can be:\n\t\t\t\t\t\t\t\"label\" - LabelText is written and label object is\n\t\t\t\t\t\t\t\t\t created directly behind.\n\t\t\t\t\t\t\t\"hyperr...
[ { "param": "self", "type": null }, { "param": "labelText", "type": null }, { "param": "ref", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "labelText", "type": null, "docstring": null, "docstring_token...
e6f45d794ee4ac7292c7336604536894efbd7955
Blebowski/Reg_Map_Gen
languages/gen_lyx.py
[ "MIT" ]
Python
insert_color
null
def insert_color(self, color): """ Insert color inset to a table cell Arguments: color """ self.insert_inset("ERT") self.wr_line("status open\n") self.insert_layout("Plain Layout") self.wr_line("\\backslash\n") colorStr = "cellcolor{" + color+"}\n" self.wr_line(colorStr) self.commit_append...
Insert color inset to a table cell Arguments: color
Insert color inset to a table cell Arguments: color
[ "Insert", "color", "inset", "to", "a", "table", "cell", "Arguments", ":", "color" ]
def insert_color(self, color): self.insert_inset("ERT") self.wr_line("status open\n") self.insert_layout("Plain Layout") self.wr_line("\\backslash\n") colorStr = "cellcolor{" + color+"}\n" self.wr_line(colorStr) self.commit_append_line(2)
[ "def", "insert_color", "(", "self", ",", "color", ")", ":", "self", ".", "insert_inset", "(", "\"ERT\"", ")", "self", ".", "wr_line", "(", "\"status open\\n\"", ")", "self", ".", "insert_layout", "(", "\"Plain Layout\"", ")", "self", ".", "wr_line", "(", "...
Insert color inset to a table cell Arguments: color
[ "Insert", "color", "inset", "to", "a", "table", "cell", "Arguments", ":", "color" ]
[ "\"\"\"\n\t\tInsert color inset to a table cell\n\t\tArguments:\n\t\t\tcolor\t\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "color", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "color", "type": null, "docstring": null, "docstring_tokens": ...
e6f45d794ee4ac7292c7336604536894efbd7955
Blebowski/Reg_Map_Gen
languages/gen_lyx.py
[ "MIT" ]
Python
write_layout_text
null
def write_layout_text(self, layoutType, text, textOptions=None, label=None, color=None): """ Insert layout type into the generator output and append a simple text. If text options are specified then the text in the layout is printed with these options. Arguments: layoutType Name of the layout as in...
Insert layout type into the generator output and append a simple text. If text options are specified then the text in the layout is printed with these options. Arguments: layoutType Name of the layout as in "insert_layout" text Text to be written in the layout. textOptions Text options as specifie...
Insert layout type into the generator output and append a simple text. If text options are specified then the text in the layout is printed with these options. Arguments: layoutType Name of the layout as in "insert_layout" text Text to be written in the layout. textOptions Te...
[ "Insert", "layout", "type", "into", "the", "generator", "output", "and", "append", "a", "simple", "text", ".", "If", "text", "options", "are", "specified", "then", "the", "text", "in", "the", "layout", "is", "printed", "with", "these", "options", ".", "Arg...
def write_layout_text(self, layoutType, text, textOptions=None, label=None, color=None): self.insert_layout(layoutType) if (textOptions != None): self.insert_text_options(textOptions) if (label == "hyperref"): self.insert_ref(text, label) elif (label != None): self.wr_line(text) self.insert_r...
[ "def", "write_layout_text", "(", "self", ",", "layoutType", ",", "text", ",", "textOptions", "=", "None", ",", "label", "=", "None", ",", "color", "=", "None", ")", ":", "self", ".", "insert_layout", "(", "layoutType", ")", "if", "(", "textOptions", "!="...
Insert layout type into the generator output and append a simple text.
[ "Insert", "layout", "type", "into", "the", "generator", "output", "and", "append", "a", "simple", "text", "." ]
[ "\"\"\"\n\t\tInsert layout type into the generator output and append a simple text.\n\t\tIf text options are specified then the text in the layout is printed\n\t\twith these options.\n\t\tArguments:\n\t\t\tlayoutType\t\tName of the layout as in \"insert_layout\"\n\t\t\ttext\t\t\tText to be written in the layout.\n\...
[ { "param": "self", "type": null }, { "param": "layoutType", "type": null }, { "param": "text", "type": null }, { "param": "textOptions", "type": null }, { "param": "label", "type": null }, { "param": "color", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "layoutType", "type": null, "docstring": null, "docstring_toke...
e6f45d794ee4ac7292c7336604536894efbd7955
Blebowski/Reg_Map_Gen
languages/gen_lyx.py
[ "MIT" ]
Python
build_table_options
<not_specific>
def build_table_options(self, columnCount, rowCount, longTable=False): """ Creates default table options object with default column alignment set to center of the cell. Arguments: columnCount Number of table columns rowCount Number of table rows Returns: New table options object which can be used i...
Creates default table options object with default column alignment set to center of the cell. Arguments: columnCount Number of table columns rowCount Number of table rows Returns: New table options object which can be used in "insert_html_table_tag" function.
Creates default table options object with default column alignment set to center of the cell. Arguments: columnCount Number of table columns rowCount Number of table rows Returns: New table options object which can be used in "insert_html_table_tag" function.
[ "Creates", "default", "table", "options", "object", "with", "default", "column", "alignment", "set", "to", "center", "of", "the", "cell", ".", "Arguments", ":", "columnCount", "Number", "of", "table", "columns", "rowCount", "Number", "of", "table", "rows", "Re...
def build_table_options(self, columnCount, rowCount, longTable=False): tableOptions = [] optionsDict = {} if (longTable): optionsDict["islongtable"] = "true" optionsDict["longtabularalignment"] = "center" tableOptions.append(["features", optionsDict]) for i in range(0, columnCount): tableOptions.appe...
[ "def", "build_table_options", "(", "self", ",", "columnCount", ",", "rowCount", ",", "longTable", "=", "False", ")", ":", "tableOptions", "=", "[", "]", "optionsDict", "=", "{", "}", "if", "(", "longTable", ")", ":", "optionsDict", "[", "\"islongtable\"", ...
Creates default table options object with default column alignment set to center of the cell.
[ "Creates", "default", "table", "options", "object", "with", "default", "column", "alignment", "set", "to", "center", "of", "the", "cell", "." ]
[ "\"\"\"\n\t\tCreates default table options object with default column alignment\n\t\tset to center of the cell.\n\t\tArguments:\n\t\t\tcolumnCount\t\tNumber of table columns\n\t\t\trowCount\t\tNumber of table rows\n\t\tReturns:\n\t\t\tNew table options object which can be used in \"insert_html_table_tag\"\n\t\t\tfu...
[ { "param": "self", "type": null }, { "param": "columnCount", "type": null }, { "param": "rowCount", "type": null }, { "param": "longTable", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "columnCount", "type": null, "docstring": null, "docstring_tok...
e6f45d794ee4ac7292c7336604536894efbd7955
Blebowski/Reg_Map_Gen
languages/gen_lyx.py
[ "MIT" ]
Python
build_table_cells
<not_specific>
def build_table_cells(self, columnCount, rowCount, defCellText): """ Creates default table cell objects with standard cell attributes. Arguments: columnCount Number of table columns rowCount Number of table rows defCellText Text which should be put to the cell by default. Returns: New table cells...
Creates default table cell objects with standard cell attributes. Arguments: columnCount Number of table columns rowCount Number of table rows defCellText Text which should be put to the cell by default. Returns: New table cells object which has the structure as tableCells in the table argument...
Creates default table cell objects with standard cell attributes. Arguments: columnCount Number of table columns rowCount Number of table rows defCellText Text which should be put to the cell by default. Returns: New table cells object which has the structure as tableCells in the ...
[ "Creates", "default", "table", "cell", "objects", "with", "standard", "cell", "attributes", ".", "Arguments", ":", "columnCount", "Number", "of", "table", "columns", "rowCount", "Number", "of", "table", "rows", "defCellText", "Text", "which", "should", "be", "pu...
def build_table_cells(self, columnCount, rowCount, defCellText): tableCells = [] stdCellAttributes = {"alignment" : "center", "valignment" : "top", "topline" : "true", "leftline" : "true", "usebox" : "none"} for row in range(0, rowCount): tableCells.append([]) for column in range(0, columnCount)...
[ "def", "build_table_cells", "(", "self", ",", "columnCount", ",", "rowCount", ",", "defCellText", ")", ":", "tableCells", "=", "[", "]", "stdCellAttributes", "=", "{", "\"alignment\"", ":", "\"center\"", ",", "\"valignment\"", ":", "\"top\"", ",", "\"topline\"",...
Creates default table cell objects with standard cell attributes.
[ "Creates", "default", "table", "cell", "objects", "with", "standard", "cell", "attributes", "." ]
[ "\"\"\"\n\t\tCreates default table cell objects with standard cell attributes.\n\t\tArguments:\n\t\t\tcolumnCount\t\tNumber of table columns\n\t\t\trowCount\t\tNumber of table rows\n\t\t\tdefCellText\t\tText which should be put to the cell by default.\n\t\tReturns:\n\t\t\tNew table cells object which has the struct...
[ { "param": "self", "type": null }, { "param": "columnCount", "type": null }, { "param": "rowCount", "type": null }, { "param": "defCellText", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "columnCount", "type": null, "docstring": null, "docstring_tok...
e6f45d794ee4ac7292c7336604536894efbd7955
Blebowski/Reg_Map_Gen
languages/gen_lyx.py
[ "MIT" ]
Python
build_table
<not_specific>
def build_table(self, columnCount, rowCount, defCellText="Reserved", longTable=False): """ Builds the table Arguments: columnCount Number of table columns rowCount Number of table rows defCellText Text which should be put to the cell by default. Returns: New table object with structure as "table...
Builds the table Arguments: columnCount Number of table columns rowCount Number of table rows defCellText Text which should be put to the cell by default. Returns: New table object with structure as "table" argument in "insert_table" function.
Builds the table Arguments: columnCount Number of table columns rowCount Number of table rows defCellText Text which should be put to the cell by default. Returns: New table object with structure as "table" argument in "insert_table" function.
[ "Builds", "the", "table", "Arguments", ":", "columnCount", "Number", "of", "table", "columns", "rowCount", "Number", "of", "table", "rows", "defCellText", "Text", "which", "should", "be", "put", "to", "the", "cell", "by", "default", ".", "Returns", ":", "New...
def build_table(self, columnCount, rowCount, defCellText="Reserved", longTable=False): table = [] tableOptions = self.build_table_options(columnCount, rowCount, longTable) tableCells = self.build_table_cells(columnCount, rowCount, defCellText) table.append(tableOptions) table.append(tableCells) return tabl...
[ "def", "build_table", "(", "self", ",", "columnCount", ",", "rowCount", ",", "defCellText", "=", "\"Reserved\"", ",", "longTable", "=", "False", ")", ":", "table", "=", "[", "]", "tableOptions", "=", "self", ".", "build_table_options", "(", "columnCount", ",...
Builds the table Arguments: columnCount Number of table columns rowCount Number of table rows defCellText Text which should be put to the cell by default.
[ "Builds", "the", "table", "Arguments", ":", "columnCount", "Number", "of", "table", "columns", "rowCount", "Number", "of", "table", "rows", "defCellText", "Text", "which", "should", "be", "put", "to", "the", "cell", "by", "default", "." ]
[ "\"\"\"\n\t\tBuilds the table \n\t\tArguments:\n\t\t\tcolumnCount\t\tNumber of table columns\n\t\t\trowCount\t\tNumber of table rows\n\t\t\tdefCellText\t\tText which should be put to the cell by default.\n\t\tReturns:\n\t\t\tNew table object with structure as \"table\" argument in \"insert_table\"\n\t\t\tfunction.\...
[ { "param": "self", "type": null }, { "param": "columnCount", "type": null }, { "param": "rowCount", "type": null }, { "param": "defCellText", "type": null }, { "param": "longTable", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "columnCount", "type": null, "docstring": null, "docstring_tok...
e6f45d794ee4ac7292c7336604536894efbd7955
Blebowski/Reg_Map_Gen
languages/gen_lyx.py
[ "MIT" ]
Python
insert_new_page
null
def insert_new_page(self): """ Write new page into the generator output. """ self.insert_layout("Standard") self.insert_inset("Newpage newpage") self.commit_append_line(2)
Write new page into the generator output.
Write new page into the generator output.
[ "Write", "new", "page", "into", "the", "generator", "output", "." ]
def insert_new_page(self): self.insert_layout("Standard") self.insert_inset("Newpage newpage") self.commit_append_line(2)
[ "def", "insert_new_page", "(", "self", ")", ":", "self", ".", "insert_layout", "(", "\"Standard\"", ")", "self", ".", "insert_inset", "(", "\"Newpage newpage\"", ")", "self", ".", "commit_append_line", "(", "2", ")" ]
Write new page into the generator output.
[ "Write", "new", "page", "into", "the", "generator", "output", "." ]
[ "\"\"\"\n\t\tWrite new page into the generator output.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e6f45d794ee4ac7292c7336604536894efbd7955
Blebowski/Reg_Map_Gen
languages/gen_lyx.py
[ "MIT" ]
Python
write_comm_line
null
def write_comm_line(self, gap=2): """ Write comment line to the lyx document """ self.__wr_line('{:{fill}<78}\n'.format(" " * gap, fill=self.commentSign))
Write comment line to the lyx document
Write comment line to the lyx document
[ "Write", "comment", "line", "to", "the", "lyx", "document" ]
def write_comm_line(self, gap=2): self.__wr_line('{:{fill}<78}\n'.format(" " * gap, fill=self.commentSign))
[ "def", "write_comm_line", "(", "self", ",", "gap", "=", "2", ")", ":", "self", ".", "__wr_line", "(", "'{:{fill}<78}\\n'", ".", "format", "(", "\" \"", "*", "gap", ",", "fill", "=", "self", ".", "commentSign", ")", ")" ]
Write comment line to the lyx document
[ "Write", "comment", "line", "to", "the", "lyx", "document" ]
[ "\"\"\"\n\t\tWrite comment line to the lyx document\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "gap", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "gap", "type": null, "docstring": null, "docstring_tokens": []...
e6f45d794ee4ac7292c7336604536894efbd7955
Blebowski/Reg_Map_Gen
languages/gen_lyx.py
[ "MIT" ]
Python
write_comment
null
def write_comment(self, input, gap, caption=None, small=False): """ Write comment to the lyx document """ self.__wr_line('{}# {}'.format(" " * gap, input))
Write comment to the lyx document
Write comment to the lyx document
[ "Write", "comment", "to", "the", "lyx", "document" ]
def write_comment(self, input, gap, caption=None, small=False): self.__wr_line('{}# {}'.format(" " * gap, input))
[ "def", "write_comment", "(", "self", ",", "input", ",", "gap", ",", "caption", "=", "None", ",", "small", "=", "False", ")", ":", "self", ".", "__wr_line", "(", "'{}# {}'", ".", "format", "(", "\"\t\"", "*", "gap", ",", "input", ")", ")" ]
Write comment to the lyx document
[ "Write", "comment", "to", "the", "lyx", "document" ]
[ "\"\"\"\n\t\tWrite comment to the lyx document\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "input", "type": null }, { "param": "gap", "type": null }, { "param": "caption", "type": null }, { "param": "small", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "input", "type": null, "docstring": null, "docstring_tokens": ...
fd96c1834c07117b5394fc973aeb9523c10e9489
Blebowski/Reg_Map_Gen
languages/gen_h.py
[ "MIT" ]
Python
write_comm_line
null
def write_comm_line(self, gap=2): """ Write C comment line in format: (gap)/******/ aligned to 80 characters Arguments: gap Number of tabs before the comment line """ self.__wr_line('/*{:{fill}<78}\n'.format(" " * gap, fill=self.commentSign))
Write C comment line in format: (gap)/******/ aligned to 80 characters Arguments: gap Number of tabs before the comment line
Write C comment line in format: (gap)// aligned to 80 characters Arguments: gap Number of tabs before the comment line
[ "Write", "C", "comment", "line", "in", "format", ":", "(", "gap", ")", "//", "aligned", "to", "80", "characters", "Arguments", ":", "gap", "Number", "of", "tabs", "before", "the", "comment", "line" ]
def write_comm_line(self, gap=2): self.__wr_line('/*{:{fill}<78}\n'.format(" " * gap, fill=self.commentSign))
[ "def", "write_comm_line", "(", "self", ",", "gap", "=", "2", ")", ":", "self", ".", "__wr_line", "(", "'/*{:{fill}<78}\\n'", ".", "format", "(", "\" \"", "*", "gap", ",", "fill", "=", "self", ".", "commentSign", ")", ")" ]
Write C comment line in format: (gap)/******/ aligned to 80 characters Arguments: gap Number of tabs before the comment line
[ "Write", "C", "comment", "line", "in", "format", ":", "(", "gap", ")", "/", "******", "/", "aligned", "to", "80", "characters", "Arguments", ":", "gap", "Number", "of", "tabs", "before", "the", "comment", "line" ]
[ "\"\"\" \n\t\tWrite C comment line in format: (gap)/******/ aligned to 80 characters\n\t\tArguments:\n\t\t\tgap\t\t Number of tabs before the comment line\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "gap", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "gap", "type": null, "docstring": null, "docstring_tokens": []...
fd96c1834c07117b5394fc973aeb9523c10e9489
Blebowski/Reg_Map_Gen
languages/gen_h.py
[ "MIT" ]
Python
write_comment
<not_specific>
def write_comment(self, input, gap, caption=None, small=False): """ Write C comment line aligned to 80 characters in format: /* COMMENT */ or: /* * COMMENT LONGER THAN 80 CHARACTERS SPLIT BETWEEN LINES */ Arguments: gap Number of tabs before the comment caption Caption to append to the ...
Write C comment line aligned to 80 characters in format: /* COMMENT */ or: /* * COMMENT LONGER THAN 80 CHARACTERS SPLIT BETWEEN LINES */ Arguments: gap Number of tabs before the comment caption Caption to append to the comment in the first line small So far no meaning for C implement...
Write C comment line aligned to 80 characters in format: COMMENT or. COMMENT LONGER THAN 80 CHARACTERS SPLIT BETWEEN LINES gap Number of tabs before the comment caption Caption to append to the comment in the first line small So far no meaning for C implementation
[ "Write", "C", "comment", "line", "aligned", "to", "80", "characters", "in", "format", ":", "COMMENT", "or", ".", "COMMENT", "LONGER", "THAN", "80", "CHARACTERS", "SPLIT", "BETWEEN", "LINES", "gap", "Number", "of", "tabs", "before", "the", "comment", "caption...
def write_comment(self, input, gap, caption=None, small=False): spltStr = split_string(input, 75 - gap) if (caption != None): spltStr.append("") spltStr.append(caption) elif (len(spltStr) == 1): self.__wr_line("{}/* {} */\n".format(" " * gap, input)) return None self.__wr_line("{}/*\n".format(" " * ...
[ "def", "write_comment", "(", "self", ",", "input", ",", "gap", ",", "caption", "=", "None", ",", "small", "=", "False", ")", ":", "spltStr", "=", "split_string", "(", "input", ",", "75", "-", "gap", ")", "if", "(", "caption", "!=", "None", ")", ":"...
Write C comment line aligned to 80 characters in format: COMMENT or:
[ "Write", "C", "comment", "line", "aligned", "to", "80", "characters", "in", "format", ":", "COMMENT", "or", ":" ]
[ "\"\"\" \n\t\tWrite C comment line aligned to 80 characters in format:\n\t\t\t/* COMMENT */\n\t\tor:\n\t\t\t/* \n\t\t\t * COMMENT LONGER THAN 80 CHARACTERS SPLIT BETWEEN LINES\n\t\t\t */\n\t\tArguments:\n\t\t\tgap\t\t Number of tabs before the comment\n\t\t\tcaption Caption to append to the comment in the first li...
[ { "param": "self", "type": null }, { "param": "input", "type": null }, { "param": "gap", "type": null }, { "param": "caption", "type": null }, { "param": "small", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "input", "type": null, "docstring": null, "docstring_tokens": ...
fd96c1834c07117b5394fc973aeb9523c10e9489
Blebowski/Reg_Map_Gen
languages/gen_h.py
[ "MIT" ]
Python
create_enum
null
def create_enum(self, name, decls): """ Create a C enum. Align to the maximum declaration name within the elements declaration list. Arguments: name Enum name decls List of enum elements as declarations """ self.__wr_line("enum {} {}\n".format(name, "{")) # Check the maximum string length in t...
Create a C enum. Align to the maximum declaration name within the elements declaration list. Arguments: name Enum name decls List of enum elements as declarations
Create a C enum. Align to the maximum declaration name within the elements declaration list. Arguments: name Enum name decls List of enum elements as declarations
[ "Create", "a", "C", "enum", ".", "Align", "to", "the", "maximum", "declaration", "name", "within", "the", "elements", "declaration", "list", ".", "Arguments", ":", "name", "Enum", "name", "decls", "List", "of", "enum", "elements", "as", "declarations" ]
def create_enum(self, name, decls): self.__wr_line("enum {} {}\n".format(name, "{")) maxLen = 0 for item in decls: if (len(item.name) > maxLen): maxLen = len(item.name) for item in decls: pref = " {}".format(item.name) if (item.value != None): post = " = {},\n".format(hex(item.value)) post ...
[ "def", "create_enum", "(", "self", ",", "name", ",", "decls", ")", ":", "self", ".", "__wr_line", "(", "\"enum {} {}\\n\"", ".", "format", "(", "name", ",", "\"{\"", ")", ")", "maxLen", "=", "0", "for", "item", "in", "decls", ":", "if", "(", "len", ...
Create a C enum.
[ "Create", "a", "C", "enum", "." ]
[ "\"\"\" \n\t\tCreate a C enum. Align to the maximum declaration name within the\n\t\telements declaration list.\n\t\tArguments:\n\t\t\tname\t\tEnum name\n\t\t\tdecls\t\tList of enum elements as declarations\n\t\t\"\"\"", "# Check the maximum string length in the enum", "# Write the enum" ]
[ { "param": "self", "type": null }, { "param": "name", "type": null }, { "param": "decls", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "name", "type": null, "docstring": null, "docstring_tokens": [...
fd96c1834c07117b5394fc973aeb9523c10e9489
Blebowski/Reg_Map_Gen
languages/gen_h.py
[ "MIT" ]
Python
write_decl
<not_specific>
def write_decl(self, decl): """ Create simple C declaration. This function supports: - simple variable declaration (initialized, non-initialized) - enum element declaration (value must be specified on declarations) - bitfield element declaration (bitWidth must be specified) Arguments: decl Declarati...
Create simple C declaration. This function supports: - simple variable declaration (initialized, non-initialized) - enum element declaration (value must be specified on declarations) - bitfield element declaration (bitWidth must be specified) Arguments: decl Declaration to create
Create simple C declaration. This function supports: simple variable declaration (initialized, non-initialized) enum element declaration (value must be specified on declarations) bitfield element declaration (bitWidth must be specified) Arguments: decl Declaration to create
[ "Create", "simple", "C", "declaration", ".", "This", "function", "supports", ":", "simple", "variable", "declaration", "(", "initialized", "non", "-", "initialized", ")", "enum", "element", "declaration", "(", "value", "must", "be", "specified", "on", "declarati...
def write_decl(self, decl): if(self.is_supported_type(decl.type) == False): return False if (decl.specifier == None): intSpec = "" else: intSpec = decl.specifier + " " if (decl.comment != None): self.write_comment(decl.comment, decl.gap, small=True) pref = "{}{}{}{}".format(" " * decl.gap, intSpec...
[ "def", "write_decl", "(", "self", ",", "decl", ")", ":", "if", "(", "self", ".", "is_supported_type", "(", "decl", ".", "type", ")", "==", "False", ")", ":", "return", "False", "if", "(", "decl", ".", "specifier", "==", "None", ")", ":", "intSpec", ...
Create simple C declaration.
[ "Create", "simple", "C", "declaration", "." ]
[ "\"\"\" \n\t\tCreate simple C declaration. This function supports:\n\t\t\t- simple variable declaration (initialized, non-initialized)\n\t\t\t- enum element declaration (value must be specified on declarations)\n\t\t\t- bitfield element declaration (bitWidth must be specified)\n\t\tArguments:\n\t\t\tdecl\t\tDeclara...
[ { "param": "self", "type": null }, { "param": "decl", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "decl", "type": null, "docstring": null, "docstring_tokens": [...
fd96c1834c07117b5394fc973aeb9523c10e9489
Blebowski/Reg_Map_Gen
languages/gen_h.py
[ "MIT" ]
Python
__write_structure_norm
null
def __write_structure_norm(self, decls): """ Write structure declaration without bitfields Arguments: decls Structure elements """ for decl in decls: self.write_decl(decl)
Write structure declaration without bitfields Arguments: decls Structure elements
Write structure declaration without bitfields Arguments: decls Structure elements
[ "Write", "structure", "declaration", "without", "bitfields", "Arguments", ":", "decls", "Structure", "elements" ]
def __write_structure_norm(self, decls): for decl in decls: self.write_decl(decl)
[ "def", "__write_structure_norm", "(", "self", ",", "decls", ")", ":", "for", "decl", "in", "decls", ":", "self", ".", "write_decl", "(", "decl", ")" ]
Write structure declaration without bitfields Arguments: decls Structure elements
[ "Write", "structure", "declaration", "without", "bitfields", "Arguments", ":", "decls", "Structure", "elements" ]
[ "\"\"\" \n\t\tWrite structure declaration without bitfields\n\t\tArguments:\n\t\t\tdecls\t\tStructure elements\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "decls", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "decls", "type": null, "docstring": null, "docstring_tokens": ...
fd96c1834c07117b5394fc973aeb9523c10e9489
Blebowski/Reg_Map_Gen
languages/gen_h.py
[ "MIT" ]
Python
__insert_rsvd_bitfield
<not_specific>
def __insert_rsvd_bitfield(self, decls, neighbour, index): """ Fill the declarations list with reserved bitfields on missing indices. Arguments: decls List of declarations to extend neighbour Neighbour to copy the element declaration into the reserved field declaration index Last filled bit by...
Fill the declarations list with reserved bitfields on missing indices. Arguments: decls List of declarations to extend neighbour Neighbour to copy the element declaration into the reserved field declaration index Last filled bit by previous declaration Returns: Index of last filled bit wit...
Fill the declarations list with reserved bitfields on missing indices. Arguments: decls List of declarations to extend neighbour Neighbour to copy the element declaration into the reserved field declaration index Last filled bit by previous declaration Returns: Index of last filled bit with the ne...
[ "Fill", "the", "declarations", "list", "with", "reserved", "bitfields", "on", "missing", "indices", ".", "Arguments", ":", "decls", "List", "of", "declarations", "to", "extend", "neighbour", "Neighbour", "to", "copy", "the", "element", "declaration", "into", "th...
def __insert_rsvd_bitfield(self, decls, neighbour, index): decl = copy.copy(neighbour) high = "" if (neighbour.bitIndex - index > 1): high = "_{}".format(neighbour.bitIndex - 1) decl.name = "reserved{}_{}".format(high, index) decl.bitIndex = index decl.comment = None decl.bitWidth = neighbour.bitIndex ...
[ "def", "__insert_rsvd_bitfield", "(", "self", ",", "decls", ",", "neighbour", ",", "index", ")", ":", "decl", "=", "copy", ".", "copy", "(", "neighbour", ")", "high", "=", "\"\"", "if", "(", "neighbour", ".", "bitIndex", "-", "index", ">", "1", ")", ...
Fill the declarations list with reserved bitfields on missing indices.
[ "Fill", "the", "declarations", "list", "with", "reserved", "bitfields", "on", "missing", "indices", "." ]
[ "\"\"\" \n\t\tFill the declarations list with reserved bitfields on missing indices.\n\t\tArguments:\n\t\t\tdecls\t\tList of declarations to extend\n\t\t\tneighbour Neighbour to copy the element declaration into the\n\t\t\t\t\t\treserved field declaration\n\t\t\tindex\t\tLast filled bit by previous declaration\n\...
[ { "param": "self", "type": null }, { "param": "decls", "type": null }, { "param": "neighbour", "type": null }, { "param": "index", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "decls", "type": null, "docstring": null, "docstring_tokens": ...
fd96c1834c07117b5394fc973aeb9523c10e9489
Blebowski/Reg_Map_Gen
languages/gen_h.py
[ "MIT" ]
Python
__write_structure_bitfields
null
def __write_structure_bitfields(self, decls, bitFieldWidth): """ Create structure declaration with bitfields. Arguments: decls List of declarations describing the structure elements bitFieldWidth Width of the bitfield to create """ # Copy the list of declarations and insert the reserved valu...
Create structure declaration with bitfields. Arguments: decls List of declarations describing the structure elements bitFieldWidth Width of the bitfield to create
Create structure declaration with bitfields. Arguments: decls List of declarations describing the structure elements bitFieldWidth Width of the bitfield to create
[ "Create", "structure", "declaration", "with", "bitfields", ".", "Arguments", ":", "decls", "List", "of", "declarations", "describing", "the", "structure", "elements", "bitFieldWidth", "Width", "of", "the", "bitfield", "to", "create" ]
def __write_structure_bitfields(self, decls, bitFieldWidth): tmp = copy.copy(decls) index = 0 tmp.append(copy.copy(tmp[-1])) tmp[-1].bitIndex = bitFieldWidth for item in tmp: if (item.bitIndex > index): index = self.__insert_rsvd_bitfield(tmp, item, index) else: index = index + item.bitWidth t...
[ "def", "__write_structure_bitfields", "(", "self", ",", "decls", ",", "bitFieldWidth", ")", ":", "tmp", "=", "copy", ".", "copy", "(", "decls", ")", "index", "=", "0", "tmp", ".", "append", "(", "copy", ".", "copy", "(", "tmp", "[", "-", "1", "]", ...
Create structure declaration with bitfields.
[ "Create", "structure", "declaration", "with", "bitfields", "." ]
[ "\"\"\" \n\t\tCreate structure declaration with bitfields.\n\t\tArguments:\n\t\t\tdecls\t\t\tList of declarations describing the structure \n\t\t\t\t\t\t\telements\n\t\t\tbitFieldWidth \tWidth of the bitfield to create\n\t\t\"\"\"", "# Copy the list of declarations and insert the reserved values", "# check if w...
[ { "param": "self", "type": null }, { "param": "decls", "type": null }, { "param": "bitFieldWidth", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "decls", "type": null, "docstring": null, "docstring_tokens": ...
fd96c1834c07117b5394fc973aeb9523c10e9489
Blebowski/Reg_Map_Gen
languages/gen_h.py
[ "MIT" ]
Python
__get_type_size
<not_specific>
def __get_type_size(self, type): """ Get bit size of given type Arguments: type Declaration type to get the size Returns: Bit size of the given type """ if (not self.is_supported_type(type)): return 0 for i,iter in enumerate(self.supportedTypes): if (iter == type): return self.typeSize...
Get bit size of given type Arguments: type Declaration type to get the size Returns: Bit size of the given type
Get bit size of given type Arguments: type Declaration type to get the size Returns: Bit size of the given type
[ "Get", "bit", "size", "of", "given", "type", "Arguments", ":", "type", "Declaration", "type", "to", "get", "the", "size", "Returns", ":", "Bit", "size", "of", "the", "given", "type" ]
def __get_type_size(self, type): if (not self.is_supported_type(type)): return 0 for i,iter in enumerate(self.supportedTypes): if (iter == type): return self.typeSizes[i]
[ "def", "__get_type_size", "(", "self", ",", "type", ")", ":", "if", "(", "not", "self", ".", "is_supported_type", "(", "type", ")", ")", ":", "return", "0", "for", "i", ",", "iter", "in", "enumerate", "(", "self", ".", "supportedTypes", ")", ":", "if...
Get bit size of given type Arguments: type Declaration type to get the size Returns: Bit size of the given type
[ "Get", "bit", "size", "of", "given", "type", "Arguments", ":", "type", "Declaration", "type", "to", "get", "the", "size", "Returns", ":", "Bit", "size", "of", "the", "given", "type" ]
[ "\"\"\" \n\t\tGet bit size of given type\n\t\tArguments:\n\t\t\ttype\tDeclaration type to get the size\n\t\tReturns:\n\t\t\tBit size of the given type\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "type", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "type", "type": null, "docstring": null, "docstring_tokens": [...
fd96c1834c07117b5394fc973aeb9523c10e9489
Blebowski/Reg_Map_Gen
languages/gen_h.py
[ "MIT" ]
Python
create_union
null
def create_union(self, name, decls): """ Create union with declarations. Arguments: name Union name decls List with declarations contained within the union. """ self.__wr_line("{}union {} {}\n".format(" " * (decls[0].gap - 1), name, "{")) for decl in decls: # Recursive if (type(decl...
Create union with declarations. Arguments: name Union name decls List with declarations contained within the union.
Create union with declarations. Arguments: name Union name decls List with declarations contained within the union.
[ "Create", "union", "with", "declarations", ".", "Arguments", ":", "name", "Union", "name", "decls", "List", "with", "declarations", "contained", "within", "the", "union", "." ]
def create_union(self, name, decls): self.__wr_line("{}union {} {}\n".format(" " * (decls[0].gap - 1), name, "{")) for decl in decls: if (type(decl) == list): self.create_structure(name + "_s", decl) else: self.write_decl(decl) self.__wr_line("{}{};\n".format(" " * (decls[0].gap - 1), "}"))
[ "def", "create_union", "(", "self", ",", "name", ",", "decls", ")", ":", "self", ".", "__wr_line", "(", "\"{}union {} {}\\n\"", ".", "format", "(", "\"\t\"", "*", "(", "decls", "[", "0", "]", ".", "gap", "-", "1", ")", ",", "name", ",", "\"{\"", ")...
Create union with declarations.
[ "Create", "union", "with", "declarations", "." ]
[ "\"\"\" \n\t\tCreate union with declarations.\n\t\tArguments:\n\t\t\tname\tUnion name\n\t\t\tdecls\tList with declarations contained within the union.\n\t\t\"\"\"", "# Recursive", "# So far hardcoded that union contains structure for register", "# map... For future this will be changed with some kind of", "...
[ { "param": "self", "type": null }, { "param": "name", "type": null }, { "param": "decls", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "name", "type": null, "docstring": null, "docstring_tokens": [...
fd96c1834c07117b5394fc973aeb9523c10e9489
Blebowski/Reg_Map_Gen
languages/gen_h.py
[ "MIT" ]
Python
create_structure
null
def create_structure(self, name, decls): """ Create structure, either with or without bitfields. Arguments: name structure name decls List with declarations contained within the structure. """ self.__wr_line("{}struct {} {}\n".format(" " * (decls[0].gap - 1), name, "{")) if (decls[0].intType =...
Create structure, either with or without bitfields. Arguments: name structure name decls List with declarations contained within the structure.
Create structure, either with or without bitfields. Arguments: name structure name decls List with declarations contained within the structure.
[ "Create", "structure", "either", "with", "or", "without", "bitfields", ".", "Arguments", ":", "name", "structure", "name", "decls", "List", "with", "declarations", "contained", "within", "the", "structure", "." ]
def create_structure(self, name, decls): self.__wr_line("{}struct {} {}\n".format(" " * (decls[0].gap - 1), name, "{")) if (decls[0].intType == "bitfield"): tmp = self.__get_type_size(decls[0].type) self.__write_structure_bitfields(decls, tmp) s = " s" else: s = "" self.__write_structure_nor...
[ "def", "create_structure", "(", "self", ",", "name", ",", "decls", ")", ":", "self", ".", "__wr_line", "(", "\"{}struct {} {}\\n\"", ".", "format", "(", "\"\t\"", "*", "(", "decls", "[", "0", "]", ".", "gap", "-", "1", ")", ",", "name", ",", "\"{\"",...
Create structure, either with or without bitfields.
[ "Create", "structure", "either", "with", "or", "without", "bitfields", "." ]
[ "\"\"\" \n\t\tCreate structure, either with or without bitfields.\n\t\tArguments:\n\t\t\tname\tstructure name\n\t\t\tdecls\tList with declarations contained within the structure.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "name", "type": null }, { "param": "decls", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "name", "type": null, "docstring": null, "docstring_tokens": [...
fd96c1834c07117b5394fc973aeb9523c10e9489
Blebowski/Reg_Map_Gen
languages/gen_h.py
[ "MIT" ]
Python
create_includes
null
def create_includes(self, includeList): """ Create C header includes. Arguments: includeList List of C includes """ for include in includeList: self.__wr_line("#include {}\n")
Create C header includes. Arguments: includeList List of C includes
Create C header includes. Arguments: includeList List of C includes
[ "Create", "C", "header", "includes", ".", "Arguments", ":", "includeList", "List", "of", "C", "includes" ]
def create_includes(self, includeList): for include in includeList: self.__wr_line("#include {}\n")
[ "def", "create_includes", "(", "self", ",", "includeList", ")", ":", "for", "include", "in", "includeList", ":", "self", ".", "__wr_line", "(", "\"#include {}\\n\"", ")" ]
Create C header includes.
[ "Create", "C", "header", "includes", "." ]
[ "\"\"\" \n\t\tCreate C header includes.\n\t\tArguments:\n\t\t\tincludeList\t\tList of C includes\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "includeList", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "includeList", "type": null, "docstring": null, "docstring_tok...
2acb01c0bfd19c438ad0fafacb6cdc89fedf9d45
Blebowski/Reg_Map_Gen
ip_xact/kern_h_addr_generator.py
[ "MIT" ]
Python
write_mem_map_addr_enum
null
def write_mem_map_addr_enum(self): """ Write addresses of registers within "memBlock" IP-XACT memory block as enum to generator output. """ cmnt = "{} memory map".format(self.memMap.name) self.headerGen.write_comment(cmnt, 0, small=True) decls = [] for block in self.memMap.addressBlock: for reg in s...
Write addresses of registers within "memBlock" IP-XACT memory block as enum to generator output.
Write addresses of registers within "memBlock" IP-XACT memory block as enum to generator output.
[ "Write", "addresses", "of", "registers", "within", "\"", "memBlock", "\"", "IP", "-", "XACT", "memory", "block", "as", "enum", "to", "generator", "output", "." ]
def write_mem_map_addr_enum(self): cmnt = "{} memory map".format(self.memMap.name) self.headerGen.write_comment(cmnt, 0, small=True) decls = [] for block in self.memMap.addressBlock: for reg in sorted(block.register, key=lambda a: a.addressOffset): decls.append(LanDeclaration(("CTUCANFD_" + reg.name).upp...
[ "def", "write_mem_map_addr_enum", "(", "self", ")", ":", "cmnt", "=", "\"{} memory map\"", ".", "format", "(", "self", ".", "memMap", ".", "name", ")", "self", ".", "headerGen", ".", "write_comment", "(", "cmnt", ",", "0", ",", "small", "=", "True", ")",...
Write addresses of registers within "memBlock" IP-XACT memory block as enum to generator output.
[ "Write", "addresses", "of", "registers", "within", "\"", "memBlock", "\"", "IP", "-", "XACT", "memory", "block", "as", "enum", "to", "generator", "output", "." ]
[ "\"\"\"\n\t\tWrite addresses of registers within \"memBlock\" IP-XACT memory block as\n\t\tenum to generator output.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
2acb01c0bfd19c438ad0fafacb6cdc89fedf9d45
Blebowski/Reg_Map_Gen
ip_xact/kern_h_addr_generator.py
[ "MIT" ]
Python
create_addrMap_package
null
def create_addrMap_package(self, name): """ Create C header file package for "memMap" IP-XACT memory block. Package contains for each register within memory block: 1. Define with register address offset. 2. Defines for each register field. """ self.headerGen.wr_nl() self.headerGen.write_comment("This ...
Create C header file package for "memMap" IP-XACT memory block. Package contains for each register within memory block: 1. Define with register address offset. 2. Defines for each register field.
Create C header file package for "memMap" IP-XACT memory block. Package contains for each register within memory block: 1. Define with register address offset. 2. Defines for each register field.
[ "Create", "C", "header", "file", "package", "for", "\"", "memMap", "\"", "IP", "-", "XACT", "memory", "block", ".", "Package", "contains", "for", "each", "register", "within", "memory", "block", ":", "1", ".", "Define", "with", "register", "address", "offs...
def create_addrMap_package(self, name): self.headerGen.wr_nl() self.headerGen.write_comment("This file is autogenerated, DO NOT EDIT!", 0, small=True) self.headerGen.wr_nl() self.headerGen.create_package((self.prefix + "_" + name).upper()) self.headerGen.wr_nl() self.headerGen.write_include("linux/bits.h") ...
[ "def", "create_addrMap_package", "(", "self", ",", "name", ")", ":", "self", ".", "headerGen", ".", "wr_nl", "(", ")", "self", ".", "headerGen", ".", "write_comment", "(", "\"This file is autogenerated, DO NOT EDIT!\"", ",", "0", ",", "small", "=", "True", ")"...
Create C header file package for "memMap" IP-XACT memory block.
[ "Create", "C", "header", "file", "package", "for", "\"", "memMap", "\"", "IP", "-", "XACT", "memory", "block", "." ]
[ "\"\"\"\n\t\tCreate C header file package for \"memMap\" IP-XACT memory block.\n\t\tPackage contains for each register within memory block:\n\t\t\t1. Define with register address offset.\n\t\t\t2. Defines for each register field.\n\t\t\"\"\"", "# Write memory map address enum", "# Write memory map fields" ]
[ { "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": null, "docstring_tokens": [...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
commit_to_file
null
def commit_to_file(self): """ Commit the generator output into the output file. """ for line in self.hdlGen.out : self.of.write(line) self.hdlGen.out = []
Commit the generator output into the output file.
Commit the generator output into the output file.
[ "Commit", "the", "generator", "output", "into", "the", "output", "file", "." ]
def commit_to_file(self): for line in self.hdlGen.out : self.of.write(line) self.hdlGen.out = []
[ "def", "commit_to_file", "(", "self", ")", ":", "for", "line", "in", "self", ".", "hdlGen", ".", "out", ":", "self", ".", "of", ".", "write", "(", "line", ")", "self", ".", "hdlGen", ".", "out", "=", "[", "]" ]
Commit the generator output into the output file.
[ "Commit", "the", "generator", "output", "into", "the", "output", "file", "." ]
[ "\"\"\" \n\t\tCommit the generator output into the output file.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_reg_ports
<not_specific>
def create_reg_ports(self, block, signDict): """ Creates declarations for Output/Input ports of an entity which correspond to values Written / Read to / from registers. Declarations have following format: signal <block_name>_in : in <block_name>_in_t signal <block_name>_out : in <block_name>_out_t ...
Creates declarations for Output/Input ports of an entity which correspond to values Written / Read to / from registers. Declarations have following format: signal <block_name>_in : in <block_name>_in_t signal <block_name>_out : in <block_name>_out_t Declarations are appended to signDict dictionary. ...
Creates declarations for Output/Input ports of an entity which correspond to values Written / Read to / from registers. Declarations have following format: signal _in : in _in_t signal _out : in _out_t Declarations are appended to signDict dictionary.
[ "Creates", "declarations", "for", "Output", "/", "Input", "ports", "of", "an", "entity", "which", "correspond", "to", "values", "Written", "/", "Read", "to", "/", "from", "registers", ".", "Declarations", "have", "following", "format", ":", "signal", "_in", ...
def create_reg_ports(self, block, signDict): if (not checkIsDict(signDict)): return reg_ports = ["out", "in"] for reg_port in reg_ports: port = LanDeclaration(block.name + "_" + reg_port, value=None) port.direction = reg_port port.type = block.name + "_" + reg_port + "_t" port.bitWidth = 0 port....
[ "def", "create_reg_ports", "(", "self", ",", "block", ",", "signDict", ")", ":", "if", "(", "not", "checkIsDict", "(", "signDict", ")", ")", ":", "return", "reg_ports", "=", "[", "\"out\"", ",", "\"in\"", "]", "for", "reg_port", "in", "reg_ports", ":", ...
Creates declarations for Output/Input ports of an entity which correspond to values Written / Read to / from registers.
[ "Creates", "declarations", "for", "Output", "/", "Input", "ports", "of", "an", "entity", "which", "correspond", "to", "values", "Written", "/", "Read", "to", "/", "from", "registers", "." ]
[ "\"\"\"\n\t\tCreates declarations for Output/Input ports of an entity which\n\t\tcorrespond to values Written / Read to / from registers. \n\t\tDeclarations have following format:\n\t\t\tsignal <block_name>_in : in <block_name>_in_t\n\t\t\tsignal <block_name>_out : in <block_name>_out_t\n\t\tDeclarations are ap...
[ { "param": "self", "type": null }, { "param": "block", "type": null }, { "param": "signDict", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_wr_reg_sel_decl
null
def create_wr_reg_sel_decl(self, block, signDict): """ Create declaration of register selector signal for writable registers within a memory block. Width of register selector is number of words within a block which contain at least one writable register. """ signDict["reg_sel"] = LanDeclaration("reg_sel", v...
Create declaration of register selector signal for writable registers within a memory block. Width of register selector is number of words within a block which contain at least one writable register.
Create declaration of register selector signal for writable registers within a memory block. Width of register selector is number of words within a block which contain at least one writable register.
[ "Create", "declaration", "of", "register", "selector", "signal", "for", "writable", "registers", "within", "a", "memory", "block", ".", "Width", "of", "register", "selector", "is", "number", "of", "words", "within", "a", "block", "which", "contain", "at", "lea...
def create_wr_reg_sel_decl(self, block, signDict): signDict["reg_sel"] = LanDeclaration("reg_sel", value = None) signDict["reg_sel"].type = "std_logic" signDict["reg_sel"].specifier = "signal" signDict["reg_sel"].bitWidth = self.calc_blk_wrd_count(block)
[ "def", "create_wr_reg_sel_decl", "(", "self", ",", "block", ",", "signDict", ")", ":", "signDict", "[", "\"reg_sel\"", "]", "=", "LanDeclaration", "(", "\"reg_sel\"", ",", "value", "=", "None", ")", "signDict", "[", "\"reg_sel\"", "]", ".", "type", "=", "\...
Create declaration of register selector signal for writable registers within a memory block.
[ "Create", "declaration", "of", "register", "selector", "signal", "for", "writable", "registers", "within", "a", "memory", "block", "." ]
[ "\"\"\"\n\t\tCreate declaration of register selector signal for writable\n\t\tregisters within a memory block. Width of register selector is number of\n\t\twords within a block which contain at least one writable register.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "block", "type": null }, { "param": "signDict", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
calc_addr_vect_value
<not_specific>
def calc_addr_vect_value(self, block): """ Calculate address vector value for address decoder for reach register word. """ vect_val = "" addr_entry_width = self.calc_wrd_address_width(block) # Check if register is present on a given word, if yes, append it to the # vector. [low_addr, high_addr] = sel...
Calculate address vector value for address decoder for reach register word.
Calculate address vector value for address decoder for reach register word.
[ "Calculate", "address", "vector", "value", "for", "address", "decoder", "for", "reach", "register", "word", "." ]
def calc_addr_vect_value(self, block): vect_val = "" addr_entry_width = self.calc_wrd_address_width(block) [low_addr, high_addr] = self.calc_blk_wrd_span(block) high_addr += self.wrdWidthByte for wrd_addr in range(low_addr, high_addr, self.wrdWidthByte): regs_in_wrd = self.get_regs_from_word(wrd_addr, bloc...
[ "def", "calc_addr_vect_value", "(", "self", ",", "block", ")", ":", "vect_val", "=", "\"\"", "addr_entry_width", "=", "self", ".", "calc_wrd_address_width", "(", "block", ")", "[", "low_addr", ",", "high_addr", "]", "=", "self", ".", "calc_blk_wrd_span", "(", ...
Calculate address vector value for address decoder for reach register word.
[ "Calculate", "address", "vector", "value", "for", "address", "decoder", "for", "reach", "register", "word", "." ]
[ "\"\"\"\n\t\tCalculate address vector value for address decoder for reach register\n\t\tword.\n\t\t\"\"\"", "# Check if register is present on a given word, if yes, append it to the", "# vector.", "# Word with no registers can be skipped, nothing is appended to", "# address vector", "# Append address vect...
[ { "param": "self", "type": null }, { "param": "block", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_addr_vect_decl
null
def create_addr_vect_decl(self, block, signDict): """ Create declaration of Address vector constant which is an input to Address decoder. """ signDict["addr_vect"] = LanDeclaration("addr_vect", value = None) signDict["addr_vect"].type = "std_logic" signDict["addr_vect"].specifier = "constant" signDict["...
Create declaration of Address vector constant which is an input to Address decoder.
Create declaration of Address vector constant which is an input to Address decoder.
[ "Create", "declaration", "of", "Address", "vector", "constant", "which", "is", "an", "input", "to", "Address", "decoder", "." ]
def create_addr_vect_decl(self, block, signDict): signDict["addr_vect"] = LanDeclaration("addr_vect", value = None) signDict["addr_vect"].type = "std_logic" signDict["addr_vect"].specifier = "constant" signDict["addr_vect"].value = self.calc_addr_vect_value(block) addr_vect_size = self.calc_blk_wrd_count(bloc...
[ "def", "create_addr_vect_decl", "(", "self", ",", "block", ",", "signDict", ")", ":", "signDict", "[", "\"addr_vect\"", "]", "=", "LanDeclaration", "(", "\"addr_vect\"", ",", "value", "=", "None", ")", "signDict", "[", "\"addr_vect\"", "]", ".", "type", "=",...
Create declaration of Address vector constant which is an input to Address decoder.
[ "Create", "declaration", "of", "Address", "vector", "constant", "which", "is", "an", "input", "to", "Address", "decoder", "." ]
[ "\"\"\"\n\t\tCreate declaration of Address vector constant which is an input to\n\t\tAddress decoder.\n\t\t\"\"\"", "# LSBs are cut" ]
[ { "param": "self", "type": null }, { "param": "block", "type": null }, { "param": "signDict", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_read_data_mux_in_decl
null
def create_read_data_mux_in_decl(self, block, signDict): """ Create declaration of read data multiplexor input signal. Length of read data mux input covers the minimum necessary length to cover all words with readable registers. """ signDict["read_data_mux_in"] = LanDeclaration("read_data_mux_in", value = N...
Create declaration of read data multiplexor input signal. Length of read data mux input covers the minimum necessary length to cover all words with readable registers.
Create declaration of read data multiplexor input signal. Length of read data mux input covers the minimum necessary length to cover all words with readable registers.
[ "Create", "declaration", "of", "read", "data", "multiplexor", "input", "signal", ".", "Length", "of", "read", "data", "mux", "input", "covers", "the", "minimum", "necessary", "length", "to", "cover", "all", "words", "with", "readable", "registers", "." ]
def create_read_data_mux_in_decl(self, block, signDict): signDict["read_data_mux_in"] = LanDeclaration("read_data_mux_in", value = None) signDict["read_data_mux_in"].type = "std_logic" [low_addr, high_addr] = self.calc_blk_wrd_span(block, ["read"]) high_addr += self.wrdWidthByte signDict["read_data_mux_in"].b...
[ "def", "create_read_data_mux_in_decl", "(", "self", ",", "block", ",", "signDict", ")", ":", "signDict", "[", "\"read_data_mux_in\"", "]", "=", "LanDeclaration", "(", "\"read_data_mux_in\"", ",", "value", "=", "None", ")", "signDict", "[", "\"read_data_mux_in\"", ...
Create declaration of read data multiplexor input signal.
[ "Create", "declaration", "of", "read", "data", "multiplexor", "input", "signal", "." ]
[ "\"\"\"\n\t\tCreate declaration of read data multiplexor input signal. Length of\n\t\tread data mux input covers the minimum necessary length to cover\n\t\tall words with readable registers.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "block", "type": null }, { "param": "signDict", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_read_data_mask_n_decl
null
def create_read_data_mask_n_decl(self, block, signDict): """ Create declaration of Read data mask signal for Read data multiplexor. """ signDict["read_data_mask_n"] = LanDeclaration("read_data_mask_n", value = None) signDict["read_data_mask_n"].type = "std_logic" signDict["read_data_mask_n"].bitWidth = self...
Create declaration of Read data mask signal for Read data multiplexor.
Create declaration of Read data mask signal for Read data multiplexor.
[ "Create", "declaration", "of", "Read", "data", "mask", "signal", "for", "Read", "data", "multiplexor", "." ]
def create_read_data_mask_n_decl(self, block, signDict): signDict["read_data_mask_n"] = LanDeclaration("read_data_mask_n", value = None) signDict["read_data_mask_n"].type = "std_logic" signDict["read_data_mask_n"].bitWidth = self.wrdWidthBit signDict["read_data_mask_n"].specifier = "signal"
[ "def", "create_read_data_mask_n_decl", "(", "self", ",", "block", ",", "signDict", ")", ":", "signDict", "[", "\"read_data_mask_n\"", "]", "=", "LanDeclaration", "(", "\"read_data_mask_n\"", ",", "value", "=", "None", ")", "signDict", "[", "\"read_data_mask_n\"", ...
Create declaration of Read data mask signal for Read data multiplexor.
[ "Create", "declaration", "of", "Read", "data", "mask", "signal", "for", "Read", "data", "multiplexor", "." ]
[ "\"\"\"\n\t\tCreate declaration of Read data mask signal for Read data multiplexor.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "block", "type": null }, { "param": "signDict", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_write_data_int_decl
null
def create_write_data_int_decl(self, block, signDict): """ Create declaration for internal record with data written to writable registers. """ name = block.name + "_out" signDict[name + "_i"] = LanDeclaration(name + "_i", value = None) signDict[name + "_i"].type = name + "_t" signDict[name + "_i"].speci...
Create declaration for internal record with data written to writable registers.
Create declaration for internal record with data written to writable registers.
[ "Create", "declaration", "for", "internal", "record", "with", "data", "written", "to", "writable", "registers", "." ]
def create_write_data_int_decl(self, block, signDict): name = block.name + "_out" signDict[name + "_i"] = LanDeclaration(name + "_i", value = None) signDict[name + "_i"].type = name + "_t" signDict[name + "_i"].specifier = "signal"
[ "def", "create_write_data_int_decl", "(", "self", ",", "block", ",", "signDict", ")", ":", "name", "=", "block", ".", "name", "+", "\"_out\"", "signDict", "[", "name", "+", "\"_i\"", "]", "=", "LanDeclaration", "(", "name", "+", "\"_i\"", ",", "value", "...
Create declaration for internal record with data written to writable registers.
[ "Create", "declaration", "for", "internal", "record", "with", "data", "written", "to", "writable", "registers", "." ]
[ "\"\"\"\n\t\tCreate declaration for internal record with data written to writable\n\t\tregisters.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "block", "type": null }, { "param": "signDict", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_read_mux_ena_int_decl
null
def create_read_mux_ena_int_decl(self, signDict): """ Create declaration for read data multiplexor enable. This allows keeping or clearing read data signal after data were read. """ signDict["read_mux_ena"] = LanDeclaration("read_mux_ena", value = None) signDict["read_mux_ena"].type = "std_logic" signDict...
Create declaration for read data multiplexor enable. This allows keeping or clearing read data signal after data were read.
Create declaration for read data multiplexor enable. This allows keeping or clearing read data signal after data were read.
[ "Create", "declaration", "for", "read", "data", "multiplexor", "enable", ".", "This", "allows", "keeping", "or", "clearing", "read", "data", "signal", "after", "data", "were", "read", "." ]
def create_read_mux_ena_int_decl(self, signDict): signDict["read_mux_ena"] = LanDeclaration("read_mux_ena", value = None) signDict["read_mux_ena"].type = "std_logic" signDict["read_mux_ena"].bitWidth = 1 signDict["read_mux_ena"].specifier = "signal"
[ "def", "create_read_mux_ena_int_decl", "(", "self", ",", "signDict", ")", ":", "signDict", "[", "\"read_mux_ena\"", "]", "=", "LanDeclaration", "(", "\"read_mux_ena\"", ",", "value", "=", "None", ")", "signDict", "[", "\"read_mux_ena\"", "]", ".", "type", "=", ...
Create declaration for read data multiplexor enable.
[ "Create", "declaration", "for", "read", "data", "multiplexor", "enable", "." ]
[ "\"\"\"\n\t\tCreate declaration for read data multiplexor enable. This allows keeping\n\t\tor clearing read data signal after data were read.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "signDict", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "signDict", "type": null, "docstring": null, "docstring_tokens...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_internal_decls
<not_specific>
def create_internal_decls(self, block, signDict): """ Create declarations of internal signals of architecture of register memory block. Following declarations are created: - Write selector signal for all writable registers - Address vector input to address decoder - Read data multiplexor input vector. ...
Create declarations of internal signals of architecture of register memory block. Following declarations are created: - Write selector signal for all writable registers - Address vector input to address decoder - Read data multiplexor input vector. - Read data mask signal from byte enable signals ...
Create declarations of internal signals of architecture of register memory block. Following declarations are created: Write selector signal for all writable registers Address vector input to address decoder Read data multiplexor input vector. Read data mask signal from byte enable signals Internal signal for output reg...
[ "Create", "declarations", "of", "internal", "signals", "of", "architecture", "of", "register", "memory", "block", ".", "Following", "declarations", "are", "created", ":", "Write", "selector", "signal", "for", "all", "writable", "registers", "Address", "vector", "i...
def create_internal_decls(self, block, signDict): if (not checkIsDict(signDict)): return; self.create_wr_reg_sel_decl(block, signDict) self.create_addr_vect_decl(block, signDict) self.create_read_data_mux_in_decl(block, signDict) self.create_read_data_mask_n_decl(block, signDict) self.create_write_data_...
[ "def", "create_internal_decls", "(", "self", ",", "block", ",", "signDict", ")", ":", "if", "(", "not", "checkIsDict", "(", "signDict", ")", ")", ":", "return", ";", "self", ".", "create_wr_reg_sel_decl", "(", "block", ",", "signDict", ")", "self", ".", ...
Create declarations of internal signals of architecture of register memory block.
[ "Create", "declarations", "of", "internal", "signals", "of", "architecture", "of", "register", "memory", "block", "." ]
[ "\"\"\"\n\t\tCreate declarations of internal signals of architecture of register\n\t\tmemory block. Following declarations are created:\n\t\t\t- Write selector signal for all writable registers\n\t\t\t- Address vector input to address decoder\n\t\t\t- Read data multiplexor input vector.\n\t\t\t- Read data mask sign...
[ { "param": "self", "type": null }, { "param": "block", "type": null }, { "param": "signDict", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
append_reg_byte_val
<not_specific>
def append_reg_byte_val(self, block, reg, byte_ind, read_wrd): """ Append name of a register if it is located on a given byte within a memory word. Returns: [pad_zeroes, read_wrd] pad_zeroes - If zeores should be padded instead of this register read_wrd - Appended value of word value """ reg_offs...
Append name of a register if it is located on a given byte within a memory word. Returns: [pad_zeroes, read_wrd] pad_zeroes - If zeores should be padded instead of this register read_wrd - Appended value of word value
Append name of a register if it is located on a given byte within a memory word.
[ "Append", "name", "of", "a", "register", "if", "it", "is", "located", "on", "a", "given", "byte", "within", "a", "memory", "word", "." ]
def append_reg_byte_val(self, block, reg, byte_ind, read_wrd): reg_offset = reg.addressOffset % self.wrdWidthByte reg_bytes = reg.size / 8 if (reg_offset == byte_ind): if (self.reg_is_access_type(reg, ["read-write"])): appendix = "_out_i." else: appendix = "_in." read_wrd += (block.name + appendi...
[ "def", "append_reg_byte_val", "(", "self", ",", "block", ",", "reg", ",", "byte_ind", ",", "read_wrd", ")", ":", "reg_offset", "=", "reg", ".", "addressOffset", "%", "self", ".", "wrdWidthByte", "reg_bytes", "=", "reg", ".", "size", "/", "8", "if", "(", ...
Append name of a register if it is located on a given byte within a memory word.
[ "Append", "name", "of", "a", "register", "if", "it", "is", "located", "on", "a", "given", "byte", "within", "a", "memory", "word", "." ]
[ "\"\"\"\n\t\tAppend name of a register if it is located on a given byte within a\n\t\tmemory word.\n\t\tReturns:\n\t\t\t[pad_zeroes, read_wrd]\n\t\t\tpad_zeroes - If zeores should be padded instead of this register\n\t\t\tread_wrd - Appended value of word value\n\t\t\"\"\"", "# Register starts on given byte -> ...
[ { "param": "self", "type": null }, { "param": "block", "type": null }, { "param": "reg", "type": null }, { "param": "byte_ind", "type": null }, { "param": "read_wrd", "type": null } ]
{ "returns": [ { "docstring": "[pad_zeroes, read_wrd]\npad_zeroes - If zeores should be padded instead of this register\nread_wrd - Appended value of word value", "docstring_tokens": [ "[", "pad_zeroes", "read_wrd", "]", "pad_zeroes", "-", "If"...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_read_wrd_from_regs
<not_specific>
def create_read_wrd_from_regs(self, regs_in_wrd, block): """ Create single read word input to read data multiplexor input. Readable registers are implemented. """ read_wrd = " " for byte_ind in range(self.wrdWidthByte - 1, -1, -1): pad_zeroes = True for reg in regs_in_wrd: # Skip registers w...
Create single read word input to read data multiplexor input. Readable registers are implemented.
Create single read word input to read data multiplexor input. Readable registers are implemented.
[ "Create", "single", "read", "word", "input", "to", "read", "data", "multiplexor", "input", ".", "Readable", "registers", "are", "implemented", "." ]
def create_read_wrd_from_regs(self, regs_in_wrd, block): read_wrd = " " for byte_ind in range(self.wrdWidthByte - 1, -1, -1): pad_zeroes = True for reg in regs_in_wrd: if (not (self.reg_has_access_type(reg, ["read"]))): continue; [pad_zeroes, read_wrd] = self.append_reg_byte_val(block, reg, ...
[ "def", "create_read_wrd_from_regs", "(", "self", ",", "regs_in_wrd", ",", "block", ")", ":", "read_wrd", "=", "\" \"", "for", "byte_ind", "in", "range", "(", "self", ".", "wrdWidthByte", "-", "1", ",", "-", "1", ",", "-", "1", ")", ":", "pad_zeroes", ...
Create single read word input to read data multiplexor input.
[ "Create", "single", "read", "word", "input", "to", "read", "data", "multiplexor", "input", "." ]
[ "\"\"\"\n\t\tCreate single read word input to read data multiplexor input. Readable\n\t\tregisters are implemented. \n\t\t\"\"\"", "# Skip registers which are not readable", "# If there is no register on this byte append zeroes as read data" ]
[ { "param": "self", "type": null }, { "param": "regs_in_wrd", "type": null }, { "param": "block", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "regs_in_wrd", "type": null, "docstring": null, "docstring_tok...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_read_data_mux_in
null
def create_read_data_mux_in(self, block): """ Create driver for read data multiplexor input signal. Read data multiplexor is a long vector with read data concatenated to long std_logic vector. """ self.hdlGen.write_comment("Read data driver", gap = 2) self.hdlGen.push_parallel_assignment("read_data_mux_in...
Create driver for read data multiplexor input signal. Read data multiplexor is a long vector with read data concatenated to long std_logic vector.
Create driver for read data multiplexor input signal. Read data multiplexor is a long vector with read data concatenated to long std_logic vector.
[ "Create", "driver", "for", "read", "data", "multiplexor", "input", "signal", ".", "Read", "data", "multiplexor", "is", "a", "long", "vector", "with", "read", "data", "concatenated", "to", "long", "std_logic", "vector", "." ]
def create_read_data_mux_in(self, block): self.hdlGen.write_comment("Read data driver", gap = 2) self.hdlGen.push_parallel_assignment("read_data_mux_in") self.hdlGen.wr_line("\n") [low_addr, high_addr] = self.calc_blk_wrd_span(block, ["read"]) high_addr += self.wrdWidthByte for addr in reversed(range(low_ad...
[ "def", "create_read_data_mux_in", "(", "self", ",", "block", ")", ":", "self", ".", "hdlGen", ".", "write_comment", "(", "\"Read data driver\"", ",", "gap", "=", "2", ")", "self", ".", "hdlGen", ".", "push_parallel_assignment", "(", "\"read_data_mux_in\"", ")", ...
Create driver for read data multiplexor input signal.
[ "Create", "driver", "for", "read", "data", "multiplexor", "input", "signal", "." ]
[ "\"\"\"\n\t\tCreate driver for read data multiplexor input signal. Read data\n\t\tmultiplexor is a long vector with read data concatenated to\n\t\tlong std_logic vector.\n\t\t\"\"\"", "# Check each word in the memory block, Start from highest address", "# since highest bits in std_logic_vector correspond to hig...
[ { "param": "self", "type": null }, { "param": "block", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
calc_addr_indices
<not_specific>
def calc_addr_indices(self, block): """ Calculates low and high index of address vector necessary for addressing given memory block. Each word is addressed and LSBs of address to address within a word is truncated. """ addr_lind = self.calc_addr_width_from_size(self.wrdWidthByte) addr_hi...
Calculates low and high index of address vector necessary for addressing given memory block. Each word is addressed and LSBs of address to address within a word is truncated.
Calculates low and high index of address vector necessary for addressing given memory block. Each word is addressed and LSBs of address to address within a word is truncated.
[ "Calculates", "low", "and", "high", "index", "of", "address", "vector", "necessary", "for", "addressing", "given", "memory", "block", ".", "Each", "word", "is", "addressed", "and", "LSBs", "of", "address", "to", "address", "within", "a", "word", "is", "trunc...
def calc_addr_indices(self, block): addr_lind = self.calc_addr_width_from_size(self.wrdWidthByte) addr_hind = self.calc_addr_width_from_size(block.range) - 1 return [addr_hind, addr_lind]
[ "def", "calc_addr_indices", "(", "self", ",", "block", ")", ":", "addr_lind", "=", "self", ".", "calc_addr_width_from_size", "(", "self", ".", "wrdWidthByte", ")", "addr_hind", "=", "self", ".", "calc_addr_width_from_size", "(", "block", ".", "range", ")", "-"...
Calculates low and high index of address vector necessary for addressing given memory block.
[ "Calculates", "low", "and", "high", "index", "of", "address", "vector", "necessary", "for", "addressing", "given", "memory", "block", "." ]
[ "\"\"\"\n Calculates low and high index of address vector necessary for addressing\n given memory block. Each word is addressed and LSBs of address to address\n within a word is truncated.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "block", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_addr_decoder
null
def create_addr_decoder(self, block): """ Create instance of address decoder for writable registers. """ path = os.path.join(ROOT_PATH, self.template_sources["addr_dec_template_path"]) addr_dec = self.hdlGen.load_entity_template(path) addr_dec.isInstance = True addr_dec.value = addr_dec.name.lower(...
Create instance of address decoder for writable registers.
Create instance of address decoder for writable registers.
[ "Create", "instance", "of", "address", "decoder", "for", "writable", "registers", "." ]
def create_addr_decoder(self, block): path = os.path.join(ROOT_PATH, self.template_sources["addr_dec_template_path"]) addr_dec = self.hdlGen.load_entity_template(path) addr_dec.isInstance = True addr_dec.value = addr_dec.name.lower() + "_" + block.name.lower() + "_comp" addr_dec.gap = 2 addr_dec.generics["a...
[ "def", "create_addr_decoder", "(", "self", ",", "block", ")", ":", "path", "=", "os", ".", "path", ".", "join", "(", "ROOT_PATH", ",", "self", ".", "template_sources", "[", "\"addr_dec_template_path\"", "]", ")", "addr_dec", "=", "self", ".", "hdlGen", "."...
Create instance of address decoder for writable registers.
[ "Create", "instance", "of", "address", "decoder", "for", "writable", "registers", "." ]
[ "\"\"\"\n Create instance of address decoder for writable registers.\n\t\t\"\"\"", "# Connect generics", "# Connect ports", "# Create instance of a component" ]
[ { "param": "self", "type": null }, { "param": "block", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
calc_reg_data_mask
<not_specific>
def calc_reg_data_mask(self, reg): """ Calculates data mask of given register. Data mask contains "1" for each bit which is implemented in the register, "0" for each bit which is not implemented in a register. """ # Suppose there is no implemented register data_mask = ["0" for x in range(reg.size)]...
Calculates data mask of given register. Data mask contains "1" for each bit which is implemented in the register, "0" for each bit which is not implemented in a register.
Calculates data mask of given register. Data mask contains "1" for each bit which is implemented in the register, "0" for each bit which is not implemented in a register.
[ "Calculates", "data", "mask", "of", "given", "register", ".", "Data", "mask", "contains", "\"", "1", "\"", "for", "each", "bit", "which", "is", "implemented", "in", "the", "register", "\"", "0", "\"", "for", "each", "bit", "which", "is", "not", "implemen...
def calc_reg_data_mask(self, reg): data_mask = ["0" for x in range(reg.size)] for field in sorted(reg.field, key=lambda a: a.bitOffset): if (field.bitWidth > 1): for j in range(field.bitOffset, field.bitOffset + field.bitWidth): data_mask[j] = "1" else: data_mask[field.bitOffset] = "1" return '...
[ "def", "calc_reg_data_mask", "(", "self", ",", "reg", ")", ":", "data_mask", "=", "[", "\"0\"", "for", "x", "in", "range", "(", "reg", ".", "size", ")", "]", "for", "field", "in", "sorted", "(", "reg", ".", "field", ",", "key", "=", "lambda", "a", ...
Calculates data mask of given register.
[ "Calculates", "data", "mask", "of", "given", "register", "." ]
[ "\"\"\"\n\t\tCalculates data mask of given register. Data mask contains \"1\" for each bit\n\t\twhich is implemented in the register, \"0\" for each bit which is not\n\t\timplemented in a register.\n\t\t\"\"\"", "# Suppose there is no implemented register", "# Go through fields and mark each field which is pres...
[ { "param": "self", "type": null }, { "param": "reg", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "reg", "type": null, "docstring": null, "docstring_tokens": []...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
calc_autoclear_mask
<not_specific>
def calc_autoclear_mask(self, reg): """ Calculate mask for autoclear feature of memory register. Bits of memory register marked as "clear" in "write action" will be automatically cleared after write (One-shot like). """ # Suppose no bit is autoclear autoclearMask = ["0" for x in range(reg.size)] # Go t...
Calculate mask for autoclear feature of memory register. Bits of memory register marked as "clear" in "write action" will be automatically cleared after write (One-shot like).
Calculate mask for autoclear feature of memory register. Bits of memory register marked as "clear" in "write action" will be automatically cleared after write (One-shot like).
[ "Calculate", "mask", "for", "autoclear", "feature", "of", "memory", "register", ".", "Bits", "of", "memory", "register", "marked", "as", "\"", "clear", "\"", "in", "\"", "write", "action", "\"", "will", "be", "automatically", "cleared", "after", "write", "("...
def calc_autoclear_mask(self, reg): autoclearMask = ["0" for x in range(reg.size)] for field in sorted(reg.field, key=lambda a: a.bitOffset): if (field.modifiedWriteValue == "clear"): if (field.bitWidth > 1): for j in range(field.bitOffset, field.bitOffset + field.bitWidth): autoclearMask[j] = "1"...
[ "def", "calc_autoclear_mask", "(", "self", ",", "reg", ")", ":", "autoclearMask", "=", "[", "\"0\"", "for", "x", "in", "range", "(", "reg", ".", "size", ")", "]", "for", "field", "in", "sorted", "(", "reg", ".", "field", ",", "key", "=", "lambda", ...
Calculate mask for autoclear feature of memory register.
[ "Calculate", "mask", "for", "autoclear", "feature", "of", "memory", "register", "." ]
[ "\"\"\"\n\t\tCalculate mask for autoclear feature of memory register. Bits of memory\n\t\tregister marked as \"clear\" in \"write action\" will be automatically cleared\n\t\tafter write (One-shot like).\n\t\t\"\"\"", "# Suppose no bit is autoclear", "# Go through register fields and mark each bit whose field ha...
[ { "param": "self", "type": null }, { "param": "reg", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "reg", "type": null, "docstring": null, "docstring_tokens": []...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
calc_reg_byte_enable_vector
<not_specific>
def calc_reg_byte_enable_vector(self, reg): """ Create byte enable vector for a register. Position of register within a memory word is considered. """ l_be_ind = reg.addressOffset % 4 h_be_ind = l_be_ind + int(reg.size / 8) - 1 return self.hdlGen.format_vector_range("be", h_be_ind, l_be_ind)
Create byte enable vector for a register. Position of register within a memory word is considered.
Create byte enable vector for a register. Position of register within a memory word is considered.
[ "Create", "byte", "enable", "vector", "for", "a", "register", ".", "Position", "of", "register", "within", "a", "memory", "word", "is", "considered", "." ]
def calc_reg_byte_enable_vector(self, reg): l_be_ind = reg.addressOffset % 4 h_be_ind = l_be_ind + int(reg.size / 8) - 1 return self.hdlGen.format_vector_range("be", h_be_ind, l_be_ind)
[ "def", "calc_reg_byte_enable_vector", "(", "self", ",", "reg", ")", ":", "l_be_ind", "=", "reg", ".", "addressOffset", "%", "4", "h_be_ind", "=", "l_be_ind", "+", "int", "(", "reg", ".", "size", "/", "8", ")", "-", "1", "return", "self", ".", "hdlGen",...
Create byte enable vector for a register.
[ "Create", "byte", "enable", "vector", "for", "a", "register", "." ]
[ "\"\"\"\n\t\tCreate byte enable vector for a register. Position of register within\n\t\ta memory word is considered.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "reg", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "reg", "type": null, "docstring": null, "docstring_tokens": []...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
fill_reg_inst_generics
null
def fill_reg_inst_generics(self, reg, reg_inst): """ Fill Generic values of VHDL register instance from IP-XACT register object. """ reg_inst.generics["data_width"].value = reg.size reg_inst.generics["data_mask"].value = self.calc_reg_data_mask(reg) reg_inst.generics["reset_polarity"].value = "reset_polar...
Fill Generic values of VHDL register instance from IP-XACT register object.
Fill Generic values of VHDL register instance from IP-XACT register object.
[ "Fill", "Generic", "values", "of", "VHDL", "register", "instance", "from", "IP", "-", "XACT", "register", "object", "." ]
def fill_reg_inst_generics(self, reg, reg_inst): reg_inst.generics["data_width"].value = reg.size reg_inst.generics["data_mask"].value = self.calc_reg_data_mask(reg) reg_inst.generics["reset_polarity"].value = "reset_polarity".upper() reg_inst.generics["reset_value"].value = self.calc_reg_rstval_mask(reg) reg...
[ "def", "fill_reg_inst_generics", "(", "self", ",", "reg", ",", "reg_inst", ")", ":", "reg_inst", ".", "generics", "[", "\"data_width\"", "]", ".", "value", "=", "reg", ".", "size", "reg_inst", ".", "generics", "[", "\"data_mask\"", "]", ".", "value", "=", ...
Fill Generic values of VHDL register instance from IP-XACT register object.
[ "Fill", "Generic", "values", "of", "VHDL", "register", "instance", "from", "IP", "-", "XACT", "register", "object", "." ]
[ "\"\"\"\n\t\tFill Generic values of VHDL register instance from IP-XACT register\n\t\tobject.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "reg", "type": null }, { "param": "reg_inst", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "reg", "type": null, "docstring": null, "docstring_tokens": []...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
fill_reg_ports
null
def fill_reg_ports(self, block, reg, reg_inst): """ Fill ports for register instance from IP-XACT register object """ reg_inst.ports["clk_sys"].value = "clk_sys" reg_inst.ports["res_n"].value = "res_n" reg_value = (block.name + "_out_i." + reg.name).lower() reg_inst.ports["reg_value"].value = reg_value ...
Fill ports for register instance from IP-XACT register object
Fill ports for register instance from IP-XACT register object
[ "Fill", "ports", "for", "register", "instance", "from", "IP", "-", "XACT", "register", "object" ]
def fill_reg_ports(self, block, reg, reg_inst): reg_inst.ports["clk_sys"].value = "clk_sys" reg_inst.ports["res_n"].value = "res_n" reg_value = (block.name + "_out_i." + reg.name).lower() reg_inst.ports["reg_value"].value = reg_value l_ind = (reg.addressOffset * 8) % self.wrdWidthBit h_ind = l_ind + reg.siz...
[ "def", "fill_reg_ports", "(", "self", ",", "block", ",", "reg", ",", "reg_inst", ")", ":", "reg_inst", ".", "ports", "[", "\"clk_sys\"", "]", ".", "value", "=", "\"clk_sys\"", "reg_inst", ".", "ports", "[", "\"res_n\"", "]", ".", "value", "=", "\"res_n\"...
Fill ports for register instance from IP-XACT register object
[ "Fill", "ports", "for", "register", "instance", "from", "IP", "-", "XACT", "register", "object" ]
[ "\"\"\"\n\t\tFill ports for register instance from IP-XACT register object\n\t\t\"\"\"", "# Calculate data input indices within a memory word", "# Calculate byte enable index / indices from position of register within a", "# memory word.", "# Connect lock signal" ]
[ { "param": "self", "type": null }, { "param": "block", "type": null }, { "param": "reg", "type": null }, { "param": "reg_inst", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_reg_instance
null
def create_reg_instance(self, block, reg): """ Create register instance from IP-XACT register object. If "isPresent" property is set, parameter name is searched in IP-XACT input and it's name is used as generic condition for register presence. """ # Load register template path and create basic i...
Create register instance from IP-XACT register object. If "isPresent" property is set, parameter name is searched in IP-XACT input and it's name is used as generic condition for register presence.
Create register instance from IP-XACT register object. If "isPresent" property is set, parameter name is searched in IP-XACT input and it's name is used as generic condition for register presence.
[ "Create", "register", "instance", "from", "IP", "-", "XACT", "register", "object", ".", "If", "\"", "isPresent", "\"", "property", "is", "set", "parameter", "name", "is", "searched", "in", "IP", "-", "XACT", "input", "and", "it", "'", "s", "name", "is", ...
def create_reg_instance(self, block, reg): path = os.path.join(ROOT_PATH, self.template_sources["reg_template_path"]) reg_inst = self.hdlGen.load_entity_template(path) reg_inst.isInstance = True reg_inst.intType = "entity" reg_inst.value = reg.name.lower() + "_reg_comp" self.hdlGen.write_comment(reg.name.up...
[ "def", "create_reg_instance", "(", "self", ",", "block", ",", "reg", ")", ":", "path", "=", "os", ".", "path", ".", "join", "(", "ROOT_PATH", ",", "self", ".", "template_sources", "[", "\"reg_template_path\"", "]", ")", "reg_inst", "=", "self", ".", "hdl...
Create register instance from IP-XACT register object.
[ "Create", "register", "instance", "from", "IP", "-", "XACT", "register", "object", "." ]
[ "\"\"\"\n\t\tCreate register instance from IP-XACT register object. If \"isPresent\" property\n is set, parameter name is searched in IP-XACT input and it's name is used\n as generic condition for register presence.\n\t\t\"\"\"", "# Load register template path and create basic instance", "# Fill g...
[ { "param": "self", "type": null }, { "param": "block", "type": null }, { "param": "reg", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
fill_access_signaller_generics
null
def fill_access_signaller_generics(self, reg, signaller_inst): """ Fill generics for VHDL access signaller instance from IP-XACT register object. """ signaller_inst.generics["reset_polarity"].value = "reset_polarity".upper() signaller_inst.generics["data_width"].value = reg.size # Read signalling capabil...
Fill generics for VHDL access signaller instance from IP-XACT register object.
Fill generics for VHDL access signaller instance from IP-XACT register object.
[ "Fill", "generics", "for", "VHDL", "access", "signaller", "instance", "from", "IP", "-", "XACT", "register", "object", "." ]
def fill_access_signaller_generics(self, reg, signaller_inst): signaller_inst.generics["reset_polarity"].value = "reset_polarity".upper() signaller_inst.generics["data_width"].value = reg.size if (self.is_reg_read_indicate(reg)): signaller_inst.generics["read_signalling"].value = True else: signaller_inst...
[ "def", "fill_access_signaller_generics", "(", "self", ",", "reg", ",", "signaller_inst", ")", ":", "signaller_inst", ".", "generics", "[", "\"reset_polarity\"", "]", ".", "value", "=", "\"reset_polarity\"", ".", "upper", "(", ")", "signaller_inst", ".", "generics"...
Fill generics for VHDL access signaller instance from IP-XACT register object.
[ "Fill", "generics", "for", "VHDL", "access", "signaller", "instance", "from", "IP", "-", "XACT", "register", "object", "." ]
[ "\"\"\"\n\t\tFill generics for VHDL access signaller instance from IP-XACT register\n\t\tobject.\n\t\t\"\"\"", "# Read signalling capability", "# Mark read signalling as combinational value!", "# Write signalling capability, set signalling as registered to have", "# the signal in the same clock cycle as new...
[ { "param": "self", "type": null }, { "param": "reg", "type": null }, { "param": "signaller_inst", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "reg", "type": null, "docstring": null, "docstring_tokens": []...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
fill_access_signaller_ports
null
def fill_access_signaller_ports(self, block, reg, signaller_inst): """ Fill ports for VHDL access signaller instance from IP-XACT register object. """ signaller_inst.ports["clk_sys"].value = "clk_sys" signaller_inst.ports["res_n"].value = "res_n" # Get word index from address decoder reg_sel_index = se...
Fill ports for VHDL access signaller instance from IP-XACT register object.
Fill ports for VHDL access signaller instance from IP-XACT register object.
[ "Fill", "ports", "for", "VHDL", "access", "signaller", "instance", "from", "IP", "-", "XACT", "register", "object", "." ]
def fill_access_signaller_ports(self, block, reg, signaller_inst): signaller_inst.ports["clk_sys"].value = "clk_sys" signaller_inst.ports["res_n"].value = "res_n" reg_sel_index = self.get_wrd_index(block, reg) - 1 signaller_inst.ports["cs"].value = \ self.hdlGen.format_vector_index("reg_sel", reg_sel_index) ...
[ "def", "fill_access_signaller_ports", "(", "self", ",", "block", ",", "reg", ",", "signaller_inst", ")", ":", "signaller_inst", ".", "ports", "[", "\"clk_sys\"", "]", ".", "value", "=", "\"clk_sys\"", "signaller_inst", ".", "ports", "[", "\"res_n\"", "]", ".",...
Fill ports for VHDL access signaller instance from IP-XACT register object.
[ "Fill", "ports", "for", "VHDL", "access", "signaller", "instance", "from", "IP", "-", "XACT", "register", "object", "." ]
[ "\"\"\"\n\t\tFill ports for VHDL access signaller instance from IP-XACT register\n\t\tobject.\n\t\t\"\"\"", "# Get word index from address decoder", "# Connect memory bus signals", "# Connect write access signalling", "# Connect read access signalling" ]
[ { "param": "self", "type": null }, { "param": "block", "type": null }, { "param": "reg", "type": null }, { "param": "signaller_inst", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_access_signaller
null
def create_access_signaller(self, block, reg): """ Create access signaller components for registers which have this feature enabled. """ path = os.path.join(ROOT_PATH, self.template_sources["access_signaller_template_path"]) signaller_inst = self.hdlGen.load_entity_template(path) signaller_inst.isInstance...
Create access signaller components for registers which have this feature enabled.
Create access signaller components for registers which have this feature enabled.
[ "Create", "access", "signaller", "components", "for", "registers", "which", "have", "this", "feature", "enabled", "." ]
def create_access_signaller(self, block, reg): path = os.path.join(ROOT_PATH, self.template_sources["access_signaller_template_path"]) signaller_inst = self.hdlGen.load_entity_template(path) signaller_inst.isInstance = True signaller_inst.intType = "entity" signaller_inst.value = reg.name.lower() + "_access_s...
[ "def", "create_access_signaller", "(", "self", ",", "block", ",", "reg", ")", ":", "path", "=", "os", ".", "path", ".", "join", "(", "ROOT_PATH", ",", "self", ".", "template_sources", "[", "\"access_signaller_template_path\"", "]", ")", "signaller_inst", "=", ...
Create access signaller components for registers which have this feature enabled.
[ "Create", "access", "signaller", "components", "for", "registers", "which", "have", "this", "feature", "enabled", "." ]
[ "\"\"\"\n\t\tCreate access signaller components for registers which have this feature\n\t\tenabled.\n\t\t\"\"\"", "# Fill generic values of access signaller", "# Fill ports of access signaller", "# Create component of signaller" ]
[ { "param": "self", "type": null }, { "param": "block", "type": null }, { "param": "reg", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_write_reg_instances
null
def create_write_reg_instances(self, block): """ Create VHDL instance for each writable register in a memory block. """ for i,reg in enumerate(sorted(block.register, key=lambda a: a.addressOffset)): # Create register instances for writable registers if (self.reg_has_access_type(reg, ["write"])): self...
Create VHDL instance for each writable register in a memory block.
Create VHDL instance for each writable register in a memory block.
[ "Create", "VHDL", "instance", "for", "each", "writable", "register", "in", "a", "memory", "block", "." ]
def create_write_reg_instances(self, block): for i,reg in enumerate(sorted(block.register, key=lambda a: a.addressOffset)): if (self.reg_has_access_type(reg, ["write"])): self.create_reg_instance(block, reg) if (self.is_reg_write_indicate(reg) or self.is_reg_read_indicate(reg)): self.create_access_signa...
[ "def", "create_write_reg_instances", "(", "self", ",", "block", ")", ":", "for", "i", ",", "reg", "in", "enumerate", "(", "sorted", "(", "block", ".", "register", ",", "key", "=", "lambda", "a", ":", "a", ".", "addressOffset", ")", ")", ":", "if", "(...
Create VHDL instance for each writable register in a memory block.
[ "Create", "VHDL", "instance", "for", "each", "writable", "register", "in", "a", "memory", "block", "." ]
[ "\"\"\"\n\t\tCreate VHDL instance for each writable register in a memory block.\n\t\t\"\"\"", "# Create register instances for writable registers", "# Create access signalling for registers which have signalling enabled" ]
[ { "param": "self", "type": null }, { "param": "block", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_read_data_mux_instance
null
def create_read_data_mux_instance(self, block): """ Create instance of Read data multiplexor. """ path = os.path.join(ROOT_PATH, self.template_sources["data_mux_template_path"]) # Load data mux template data_mux = self.hdlGen.load_entity_template(path) data_mux.isInstance = True data_mux.value = ...
Create instance of Read data multiplexor.
Create instance of Read data multiplexor.
[ "Create", "instance", "of", "Read", "data", "multiplexor", "." ]
def create_read_data_mux_instance(self, block): path = os.path.join(ROOT_PATH, self.template_sources["data_mux_template_path"]) data_mux = self.hdlGen.load_entity_template(path) data_mux.isInstance = True data_mux.value = (data_mux.name + "_"+ block.name + "_comp").lower() data_mux.generics["data_out_width"]....
[ "def", "create_read_data_mux_instance", "(", "self", ",", "block", ")", ":", "path", "=", "os", ".", "path", ".", "join", "(", "ROOT_PATH", ",", "self", ".", "template_sources", "[", "\"data_mux_template_path\"", "]", ")", "data_mux", "=", "self", ".", "hdlG...
Create instance of Read data multiplexor.
[ "Create", "instance", "of", "Read", "data", "multiplexor", "." ]
[ "\"\"\"\n Create instance of Read data multiplexor.\n\t\t\"\"\"", "# Load data mux template", "# FIll generic values", "# Connect ports", "# Enable data loading" ]
[ { "param": "self", "type": null }, { "param": "block", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_read_data_mask_driver
null
def create_read_data_mask_driver(self): """ Create driver for read data mask signal from byte enable inputs of memory bus. """ self.hdlGen.write_comment("Read data mask - Byte enables", gap = 4) self.hdlGen.push_parallel_assignment(signalName = "read_data_mask_n", gap = 4) wrd_line = "" byte_lst = [] ...
Create driver for read data mask signal from byte enable inputs of memory bus.
Create driver for read data mask signal from byte enable inputs of memory bus.
[ "Create", "driver", "for", "read", "data", "mask", "signal", "from", "byte", "enable", "inputs", "of", "memory", "bus", "." ]
def create_read_data_mask_driver(self): self.hdlGen.write_comment("Read data mask - Byte enables", gap = 4) self.hdlGen.push_parallel_assignment(signalName = "read_data_mask_n", gap = 4) wrd_line = "" byte_lst = [] for byte in range(self.wrdWidthByte - 1, -1, -1): be_ind = self.hdlGen.format_vector_index("...
[ "def", "create_read_data_mask_driver", "(", "self", ")", ":", "self", ".", "hdlGen", ".", "write_comment", "(", "\"Read data mask - Byte enables\"", ",", "gap", "=", "4", ")", "self", ".", "hdlGen", ".", "push_parallel_assignment", "(", "signalName", "=", "\"read_...
Create driver for read data mask signal from byte enable inputs of memory bus.
[ "Create", "driver", "for", "read", "data", "mask", "signal", "from", "byte", "enable", "inputs", "of", "memory", "bus", "." ]
[ "\"\"\"\n\t\tCreate driver for read data mask signal from byte enable inputs of memory\n\t\tbus.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_reg_cond_generics
null
def create_reg_cond_generics(self, block, entity): """ Add conditional generic definitions into entity declaration. Parameter "isPresent" of each IP-XACT register is added as generic boolean input. Parameter look-up is performed for each found parameter. """ for reg in block.register: if (reg.isPresent !...
Add conditional generic definitions into entity declaration. Parameter "isPresent" of each IP-XACT register is added as generic boolean input. Parameter look-up is performed for each found parameter.
Add conditional generic definitions into entity declaration. Parameter "isPresent" of each IP-XACT register is added as generic boolean input. Parameter look-up is performed for each found parameter.
[ "Add", "conditional", "generic", "definitions", "into", "entity", "declaration", ".", "Parameter", "\"", "isPresent", "\"", "of", "each", "IP", "-", "XACT", "register", "is", "added", "as", "generic", "boolean", "input", ".", "Parameter", "look", "-", "up", ...
def create_reg_cond_generics(self, block, entity): for reg in block.register: if (reg.isPresent != ""): paramName = self.parameter_lookup(reg.isPresent) entity.generics[paramName] = LanDeclaration(paramName, value = 0) entity.generics[paramName].value = "true" entity.generics[paramName].type = "boo...
[ "def", "create_reg_cond_generics", "(", "self", ",", "block", ",", "entity", ")", ":", "for", "reg", "in", "block", ".", "register", ":", "if", "(", "reg", ".", "isPresent", "!=", "\"\"", ")", ":", "paramName", "=", "self", ".", "parameter_lookup", "(", ...
Add conditional generic definitions into entity declaration.
[ "Add", "conditional", "generic", "definitions", "into", "entity", "declaration", "." ]
[ "\"\"\"\n\t\tAdd conditional generic definitions into entity declaration. Parameter\n\t\t\"isPresent\" of each IP-XACT register is added as generic boolean input.\n\t\tParameter look-up is performed for each found parameter.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "block", "type": null }, { "param": "entity", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_reg_block_template
<not_specific>
def create_reg_block_template(self, block): """ Load memory bus entity template, add ports for register inputs, outputs. Create declaration of register block entity. """ # Load memory bus template and create entity definition path = os.path.join(ROOT_PATH, self.template_sources["mem_bus_template_path"]) e...
Load memory bus entity template, add ports for register inputs, outputs. Create declaration of register block entity.
Load memory bus entity template, add ports for register inputs, outputs. Create declaration of register block entity.
[ "Load", "memory", "bus", "entity", "template", "add", "ports", "for", "register", "inputs", "outputs", ".", "Create", "declaration", "of", "register", "block", "entity", "." ]
def create_reg_block_template(self, block): path = os.path.join(ROOT_PATH, self.template_sources["mem_bus_template_path"]) entity = self.hdlGen.load_entity_template(path) entity.intType = "entity" entity.isInstance = False entity.name = block.name.lower() + "_reg_map" self.create_reg_ports(block, entity.p...
[ "def", "create_reg_block_template", "(", "self", ",", "block", ")", ":", "path", "=", "os", ".", "path", ".", "join", "(", "ROOT_PATH", ",", "self", ".", "template_sources", "[", "\"mem_bus_template_path\"", "]", ")", "entity", "=", "self", ".", "hdlGen", ...
Load memory bus entity template, add ports for register inputs, outputs.
[ "Load", "memory", "bus", "entity", "template", "add", "ports", "for", "register", "inputs", "outputs", "." ]
[ "\"\"\"\n\t\tLoad memory bus entity template, add ports for register inputs, outputs.\n\t\tCreate declaration of register block entity.\n\t\t\"\"\"", "# Load memory bus template and create entity definition", "# Add ports for register values", "# Add generics for conditionally defined components", "# Format...
[ { "param": "self", "type": null }, { "param": "block", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_write_reg_record_driver
null
def create_write_reg_record_driver(self, block): """ Create driver for write registe record. Internal signal is connected to output port. """ dest = block.name + "_out" src = dest + "_i" self.hdlGen.create_signal_connection(dest, src, gap = 4)
Create driver for write registe record. Internal signal is connected to output port.
Create driver for write registe record. Internal signal is connected to output port.
[ "Create", "driver", "for", "write", "registe", "record", ".", "Internal", "signal", "is", "connected", "to", "output", "port", "." ]
def create_write_reg_record_driver(self, block): dest = block.name + "_out" src = dest + "_i" self.hdlGen.create_signal_connection(dest, src, gap = 4)
[ "def", "create_write_reg_record_driver", "(", "self", ",", "block", ")", ":", "dest", "=", "block", ".", "name", "+", "\"_out\"", "src", "=", "dest", "+", "\"_i\"", "self", ".", "hdlGen", ".", "create_signal_connection", "(", "dest", ",", "src", ",", "gap"...
Create driver for write registe record.
[ "Create", "driver", "for", "write", "registe", "record", "." ]
[ "\"\"\"\n\t\tCreate driver for write registe record. Internal signal is connected\n\t\tto output port.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "block", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_reg_access_cover_point
null
def create_reg_access_cover_point(self, block, reg, acc_type): """ Create cover point for write/read to/from a register. """ # Get index of memory word for the register reg_sel_index = self.get_wrd_index(block, reg) - 1 # Calcuate byte enable indices l_be_ind = reg.addressOffset % 4 h_be_ind = l_be_ind...
Create cover point for write/read to/from a register.
Create cover point for write/read to/from a register.
[ "Create", "cover", "point", "for", "write", "/", "read", "to", "/", "from", "a", "register", "." ]
def create_reg_access_cover_point(self, block, reg, acc_type): reg_sel_index = self.get_wrd_index(block, reg) - 1 l_be_ind = reg.addressOffset % 4 h_be_ind = l_be_ind + int(reg.size / 8) - 1 be_lst = [] for i in range(l_be_ind, h_be_ind + 1): be_lst.append(self.hdlGen.format_logic_op( [self.hdlGe...
[ "def", "create_reg_access_cover_point", "(", "self", ",", "block", ",", "reg", ",", "acc_type", ")", ":", "reg_sel_index", "=", "self", ".", "get_wrd_index", "(", "block", ",", "reg", ")", "-", "1", "l_be_ind", "=", "reg", ".", "addressOffset", "%", "4", ...
Create cover point for write/read to/from a register.
[ "Create", "cover", "point", "for", "write", "/", "read", "to", "/", "from", "a", "register", "." ]
[ "\"\"\"\n\t\tCreate cover point for write/read to/from a register.\n\t\t\"\"\"", "# Get index of memory word for the register", "# Calcuate byte enable indices" ]
[ { "param": "self", "type": null }, { "param": "block", "type": null }, { "param": "reg", "type": null }, { "param": "acc_type", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_reg_access_cover_points
null
def create_reg_access_cover_points(self, block): """ Create cover points to monitor functional coverage within the generated block. Following points are created: 1. Write cover point for each writable register. 2. Read cover point for each readable register. """ # Add comments for readabiliy self.hdlG...
Create cover points to monitor functional coverage within the generated block. Following points are created: 1. Write cover point for each writable register. 2. Read cover point for each readable register.
Create cover points to monitor functional coverage within the generated block. Following points are created: 1. Write cover point for each writable register. 2. Read cover point for each readable register.
[ "Create", "cover", "points", "to", "monitor", "functional", "coverage", "within", "the", "generated", "block", ".", "Following", "points", "are", "created", ":", "1", ".", "Write", "cover", "point", "for", "each", "writable", "register", ".", "2", ".", "Read...
def create_reg_access_cover_points(self, block): self.hdlGen.write_comment("<RELEASE_OFF>", gap = 4, small=True) self.hdlGen.write_comment("Functional coverage", gap = 4) if (type(self.hdlGen) == VhdlGenerator): self.hdlGen.write_comment(" psl default clock is " \ "rising_edge(clk_sys);", gap = 4, small=Tr...
[ "def", "create_reg_access_cover_points", "(", "self", ",", "block", ")", ":", "self", ".", "hdlGen", ".", "write_comment", "(", "\"<RELEASE_OFF>\"", ",", "gap", "=", "4", ",", "small", "=", "True", ")", "self", ".", "hdlGen", ".", "write_comment", "(", "\"...
Create cover points to monitor functional coverage within the generated block.
[ "Create", "cover", "points", "to", "monitor", "functional", "coverage", "within", "the", "generated", "block", "." ]
[ "\"\"\"\n\t\tCreate cover points to monitor functional coverage within the\n\t\tgenerated block. Following points are created:\n\t\t\t1. Write cover point for each writable register.\n\t\t\t2. Read cover point for each readable register.\n\t\t\"\"\"", "# Add comments for readabiliy", "# Specify clock for PSL", ...
[ { "param": "self", "type": null }, { "param": "block", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_read_data_mux_ena
null
def create_read_data_mux_ena(self): """ Create driver for read data multiplexor enable signal. If read data should be cleared after transaction, enable is constantly at logic 1, thus next cycle will data will be cleared, read mux output flop is permanently enabled. If read data should not be cleared, flop is...
Create driver for read data multiplexor enable signal. If read data should be cleared after transaction, enable is constantly at logic 1, thus next cycle will data will be cleared, read mux output flop is permanently enabled. If read data should not be cleared, flop is enabled only by new transaction.
Create driver for read data multiplexor enable signal. If read data should be cleared after transaction, enable is constantly at logic 1, thus next cycle will data will be cleared, read mux output flop is permanently enabled. If read data should not be cleared, flop is enabled only by new transaction.
[ "Create", "driver", "for", "read", "data", "multiplexor", "enable", "signal", ".", "If", "read", "data", "should", "be", "cleared", "after", "transaction", "enable", "is", "constantly", "at", "logic", "1", "thus", "next", "cycle", "will", "data", "will", "be...
def create_read_data_mux_ena(self): self.hdlGen.write_comment("Read data multiplexor enable ", gap = 4) self.hdlGen.create_if_generate(name="read_data_keep_gen", condition="clear_read_data".upper(), value="false", gap = 4) self.hdlGen.create_signal_connection(result="read_mux_ena", driver="read a...
[ "def", "create_read_data_mux_ena", "(", "self", ")", ":", "self", ".", "hdlGen", ".", "write_comment", "(", "\"Read data multiplexor enable \"", ",", "gap", "=", "4", ")", "self", ".", "hdlGen", ".", "create_if_generate", "(", "name", "=", "\"read_data_keep_gen\""...
Create driver for read data multiplexor enable signal.
[ "Create", "driver", "for", "read", "data", "multiplexor", "enable", "signal", "." ]
[ "\"\"\"\n\t\tCreate driver for read data multiplexor enable signal. If read data\n\t\tshould be cleared after transaction, enable is constantly at logic 1,\n\t\tthus next cycle will data will be cleared, read mux output flop is\n\t\tpermanently enabled. If read data should not be cleared, flop is\n\t\tenabled only...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
write_reg_block
null
def write_reg_block(self, block): """ Create register block in VHDL from IP-XACT memory block object. """ # Write file introduction self.hdlGen.wr_nl() self.hdlGen.write_comment("Register map implementation of: " + block.name, gap = 0) self.hdlGen.write_gen_note() self.hdlGen.wr_nl() if (...
Create register block in VHDL from IP-XACT memory block object.
Create register block in VHDL from IP-XACT memory block object.
[ "Create", "register", "block", "in", "VHDL", "from", "IP", "-", "XACT", "memory", "block", "object", "." ]
def write_reg_block(self, block): self.hdlGen.wr_nl() self.hdlGen.write_comment("Register map implementation of: " + block.name, gap = 0) self.hdlGen.write_gen_note() self.hdlGen.wr_nl() if (type(self.hdlGen) == VhdlGenerator): self.hdlGen.create_includes("ieee", ["std_logic_1164.all"]) self.hdlGen....
[ "def", "write_reg_block", "(", "self", ",", "block", ")", ":", "self", ".", "hdlGen", ".", "wr_nl", "(", ")", "self", ".", "hdlGen", ".", "write_comment", "(", "\"Register map implementation of: \"", "+", "block", ".", "name", ",", "gap", "=", "0", ")", ...
Create register block in VHDL from IP-XACT memory block object.
[ "Create", "register", "block", "in", "VHDL", "from", "IP", "-", "XACT", "memory", "block", "object", "." ]
[ "\"\"\"\n Create register block in VHDL from IP-XACT memory block object.\n\t\t\"\"\"", "# Write file introduction", "# Create entity definition", "# Create architecture of Register Block", "# Write declaration of internal architecture signals", "# Start architecture", "# Create instance of write...
[ { "param": "self", "type": null }, { "param": "block", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_output_reg_record
null
def create_output_reg_record(self, block): """ Create record for writable registers from IP-XACT memory block object. If register write should be indicated, additional <reg_name>_write signal is added. If register read should be indicated, additional <reg_name>_read signal is added. """ outDecls = [] ...
Create record for writable registers from IP-XACT memory block object. If register write should be indicated, additional <reg_name>_write signal is added. If register read should be indicated, additional <reg_name>_read signal is added.
Create record for writable registers from IP-XACT memory block object. If register write should be indicated, additional _write signal is added. If register read should be indicated, additional _read signal is added.
[ "Create", "record", "for", "writable", "registers", "from", "IP", "-", "XACT", "memory", "block", "object", ".", "If", "register", "write", "should", "be", "indicated", "additional", "_write", "signal", "is", "added", ".", "If", "register", "read", "should", ...
def create_output_reg_record(self, block): outDecls = [] outName = block.name + "_out_t" for i,reg in enumerate(sorted(block.register, key=lambda a: a.addressOffset)): if ("write" in reg.access): outDecls.append(LanDeclaration(reg.name, value="")) outDecls[-1].type = "std_logic_vector" outDecls[-1]...
[ "def", "create_output_reg_record", "(", "self", ",", "block", ")", ":", "outDecls", "=", "[", "]", "outName", "=", "block", ".", "name", "+", "\"_out_t\"", "for", "i", ",", "reg", "in", "enumerate", "(", "sorted", "(", "block", ".", "register", ",", "k...
Create record for writable registers from IP-XACT memory block object.
[ "Create", "record", "for", "writable", "registers", "from", "IP", "-", "XACT", "memory", "block", "object", "." ]
[ "\"\"\"\n\t\tCreate record for writable registers from IP-XACT memory block object.\n\t\tIf register write should be indicated, additional <reg_name>_write signal\n\t\tis added.\n\t\tIf register read should be indicated, additional <reg_name>_read signal is\n\t\tadded.\n\t\t\"\"\"", "# Create the declarations", ...
[ { "param": "self", "type": null }, { "param": "block", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_input_reg_record
null
def create_input_reg_record(self, block): """ Create record for readable registers from IP-XACT memory block object. """ # Input Declarations record inDecls = [] inName = block.name + "_in_t" for i,reg in enumerate(sorted(block.register, key=lambda a: a.addressOffset)): # All registers with read, but...
Create record for readable registers from IP-XACT memory block object.
Create record for readable registers from IP-XACT memory block object.
[ "Create", "record", "for", "readable", "registers", "from", "IP", "-", "XACT", "memory", "block", "object", "." ]
def create_input_reg_record(self, block): inDecls = [] inName = block.name + "_in_t" for i,reg in enumerate(sorted(block.register, key=lambda a: a.addressOffset)): if (("read" in reg.access) and (reg.access != "read-write")): inDecls.append(LanDeclaration(reg.name, value="")) inDecls[-1].type = "std_lo...
[ "def", "create_input_reg_record", "(", "self", ",", "block", ")", ":", "inDecls", "=", "[", "]", "inName", "=", "block", ".", "name", "+", "\"_in_t\"", "for", "i", ",", "reg", "in", "enumerate", "(", "sorted", "(", "block", ".", "register", ",", "key",...
Create record for readable registers from IP-XACT memory block object.
[ "Create", "record", "for", "readable", "registers", "from", "IP", "-", "XACT", "memory", "block", "object", "." ]
[ "\"\"\"\n\t\tCreate record for readable registers from IP-XACT memory block object.\n\t\t\"\"\"", "# Input Declarations record", "# All registers with read, but not read-write, since read-write is register", "# whose value is written and the same value is read back", "# Format the declaration" ]
[ { "param": "self", "type": null }, { "param": "block", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
create_mem_block_records
null
def create_mem_block_records(self, block): """ Create records for register module input/outputs. Each writable register is present in "write record". Each readable register is present in a read record. """ self.hdlGen.wr_nl() self.create_output_reg_record(block) self.hdlGen.wr_nl() self.hdlGen.wr_n...
Create records for register module input/outputs. Each writable register is present in "write record". Each readable register is present in a read record.
Create records for register module input/outputs. Each writable register is present in "write record". Each readable register is present in a read record.
[ "Create", "records", "for", "register", "module", "input", "/", "outputs", ".", "Each", "writable", "register", "is", "present", "in", "\"", "write", "record", "\"", ".", "Each", "readable", "register", "is", "present", "in", "a", "read", "record", "." ]
def create_mem_block_records(self, block): self.hdlGen.wr_nl() self.create_output_reg_record(block) self.hdlGen.wr_nl() self.hdlGen.wr_nl() self.create_input_reg_record(block) self.hdlGen.wr_nl()
[ "def", "create_mem_block_records", "(", "self", ",", "block", ")", ":", "self", ".", "hdlGen", ".", "wr_nl", "(", ")", "self", ".", "create_output_reg_record", "(", "block", ")", "self", ".", "hdlGen", ".", "wr_nl", "(", ")", "self", ".", "hdlGen", ".", ...
Create records for register module input/outputs.
[ "Create", "records", "for", "register", "module", "input", "/", "outputs", "." ]
[ "\"\"\"\n\t\tCreate records for register module input/outputs. Each writable\n\t\tregister is present in \"write record\". Each readable register is \n\t\tpresent in a read record.\n\t\t\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "block", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "block", "type": null, "docstring": null, "docstring_tokens": ...
99b963c1043d0eb1fdaec12ddf6477d8aa78233b
Blebowski/Reg_Map_Gen
ip_xact/vhdl_reg_map_generator.py
[ "MIT" ]
Python
write_reg_map_pkg
null
def write_reg_map_pkg(self): """ Create package with declarations of register map input / output records. """ self.hdlGen.wr_nl() self.hdlGen.write_comment("Register map package for: " + self.memMap.name, gap = 0) self.hdlGen.write_gen_note() self.hdlGen.wr_nl() if (type(self.hdlGen) == VhdlGene...
Create package with declarations of register map input / output records.
Create package with declarations of register map input / output records.
[ "Create", "package", "with", "declarations", "of", "register", "map", "input", "/", "output", "records", "." ]
def write_reg_map_pkg(self): self.hdlGen.wr_nl() self.hdlGen.write_comment("Register map package for: " + self.memMap.name, gap = 0) self.hdlGen.write_gen_note() self.hdlGen.wr_nl() if (type(self.hdlGen) == VhdlGenerator): self.hdlGen.create_includes("ieee", ["std_logic_1164.all"]) self.hdlGen.wr_nl...
[ "def", "write_reg_map_pkg", "(", "self", ")", ":", "self", ".", "hdlGen", ".", "wr_nl", "(", ")", "self", ".", "hdlGen", ".", "write_comment", "(", "\"Register map package for: \"", "+", "self", ".", "memMap", ".", "name", ",", "gap", "=", "0", ")", "sel...
Create package with declarations of register map input / output records.
[ "Create", "package", "with", "declarations", "of", "register", "map", "input", "/", "output", "records", "." ]
[ "\"\"\"\n\t\tCreate package with declarations of register map input / output\n\t\trecords.\n\t\t\"\"\"", "# Skip blocks marked as memory" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e0fb5cab25f1409645052b24ff78664e54349c65
LUMC/fastq-filter
src/fastq_filter/__init__.py
[ "MIT" ]
Python
file_to_fastq_records
Generator[dnaio.Sequence, None, None]
def file_to_fastq_records(filepath: str) -> Generator[dnaio.Sequence, None, None]: """Parse a FASTQ file into a generator of Sequence objects""" opener = functools.partial(xopen.xopen, threads=0) with dnaio.open(filepath, opener=opener) as record_h: # t...
Parse a FASTQ file into a generator of Sequence objects
Parse a FASTQ file into a generator of Sequence objects
[ "Parse", "a", "FASTQ", "file", "into", "a", "generator", "of", "Sequence", "objects" ]
def file_to_fastq_records(filepath: str) -> Generator[dnaio.Sequence, None, None]: opener = functools.partial(xopen.xopen, threads=0) with dnaio.open(filepath, opener=opener) as record_h: yield from record_h
[ "def", "file_to_fastq_records", "(", "filepath", ":", "str", ")", "->", "Generator", "[", "dnaio", ".", "Sequence", ",", "None", ",", "None", "]", ":", "opener", "=", "functools", ".", "partial", "(", "xopen", ".", "xopen", ",", "threads", "=", "0", ")...
Parse a FASTQ file into a generator of Sequence objects
[ "Parse", "a", "FASTQ", "file", "into", "a", "generator", "of", "Sequence", "objects" ]
[ "\"\"\"Parse a FASTQ file into a generator of Sequence objects\"\"\"", "# type: ignore" ]
[ { "param": "filepath", "type": "str" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "filepath", "type": "str", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e0fb5cab25f1409645052b24ff78664e54349c65
LUMC/fastq-filter
src/fastq_filter/__init__.py
[ "MIT" ]
Python
filter_string_to_filters
List[Callable[[dnaio.Sequence], bool]]
def filter_string_to_filters(filter_string: str ) -> List[Callable[[dnaio.Sequence], bool]]: """Convert a filter string such as 'min_length:50|mean_quality:20 into a list of filter functions that can be used by Python's builtin filter function.""" filters: List[Callable[[dna...
Convert a filter string such as 'min_length:50|mean_quality:20 into a list of filter functions that can be used by Python's builtin filter function.
Convert a filter string such as 'min_length:50|mean_quality:20 into a list of filter functions that can be used by Python's builtin filter function.
[ "Convert", "a", "filter", "string", "such", "as", "'", "min_length", ":", "50|mean_quality", ":", "20", "into", "a", "list", "of", "filter", "functions", "that", "can", "be", "used", "by", "Python", "'", "s", "builtin", "filter", "function", "." ]
def filter_string_to_filters(filter_string: str ) -> List[Callable[[dnaio.Sequence], bool]]: filters: List[Callable[[dnaio.Sequence], bool]] = [] for single_filter_string in filter_string.split('|'): filter_name, filter_argstring = single_filter_string.split(':') try...
[ "def", "filter_string_to_filters", "(", "filter_string", ":", "str", ")", "->", "List", "[", "Callable", "[", "[", "dnaio", ".", "Sequence", "]", ",", "bool", "]", "]", ":", "filters", ":", "List", "[", "Callable", "[", "[", "dnaio", ".", "Sequence", "...
Convert a filter string such as 'min_length:50|mean_quality:20 into a list of filter functions that can be used by Python's builtin filter function.
[ "Convert", "a", "filter", "string", "such", "as", "'", "min_length", ":", "50|mean_quality", ":", "20", "into", "a", "list", "of", "filter", "functions", "that", "can", "be", "used", "by", "Python", "'", "s", "builtin", "filter", "function", "." ]
[ "\"\"\"Convert a filter string such as 'min_length:50|mean_quality:20 into\n a list of filter functions that can be used by Python's builtin filter\n function.\"\"\"", "# Convert the strings from the command line in the appropriate types" ]
[ { "param": "filter_string", "type": "str" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "filter_string", "type": "str", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e0fb5cab25f1409645052b24ff78664e54349c65
LUMC/fastq-filter
src/fastq_filter/__init__.py
[ "MIT" ]
Python
filter_fastq
null
def filter_fastq(filter_string: str, input_file: str, output_file: str, compression_level: int = DEFAULT_COMPRESSION_LEVEL): """ Filter a FASTQ input file with the filters in filter_string and write the results to the output file. :param filter_string:...
Filter a FASTQ input file with the filters in filter_string and write the results to the output file. :param filter_string: A string representing one or multiple filters. For more information see the documentation. :param input_file: A FASTQ input filename. Compressed files are handled automat...
Filter a FASTQ input file with the filters in filter_string and write the results to the output file.
[ "Filter", "a", "FASTQ", "input", "file", "with", "the", "filters", "in", "filter_string", "and", "write", "the", "results", "to", "the", "output", "file", "." ]
def filter_fastq(filter_string: str, input_file: str, output_file: str, compression_level: int = DEFAULT_COMPRESSION_LEVEL): fastq_records = file_to_fastq_records(input_file) filtered_fastq_records: Iterable[dnaio.Sequence] = fastq_records for filter_func i...
[ "def", "filter_fastq", "(", "filter_string", ":", "str", ",", "input_file", ":", "str", ",", "output_file", ":", "str", ",", "compression_level", ":", "int", "=", "DEFAULT_COMPRESSION_LEVEL", ")", ":", "fastq_records", "=", "file_to_fastq_records", "(", "input_fil...
Filter a FASTQ input file with the filters in filter_string and write the results to the output file.
[ "Filter", "a", "FASTQ", "input", "file", "with", "the", "filters", "in", "filter_string", "and", "write", "the", "results", "to", "the", "output", "file", "." ]
[ "\"\"\"\n Filter a FASTQ input file with the filters in filter_string and write\n the results to the output file.\n\n :param filter_string: A string representing one or multiple filters. For\n more information see the documentation.\n :param input_file: A FASTQ input filename. Compressed files are ha...
[ { "param": "filter_string", "type": "str" }, { "param": "input_file", "type": "str" }, { "param": "output_file", "type": "str" }, { "param": "compression_level", "type": "int" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "filter_string", "type": "str", "docstring": "A string representing one or multiple filters. For\nmore information see the documentation.", "docstring_tokens": [ "A", "string", "representing", "o...
a7b14669424c8786864aad05590228f45fb793c7
csmoore/solutions-geoprocessing-toolbox
operational_graphics/toolboxes/scripts/CanvasAreaGRG.py
[ "Apache-2.0" ]
Python
RotateXY
<not_specific>
def RotateXY(x, y, xc=0, yc=0, angle=0, units="DEGREES"): """Rotate an xy cooordinate about a specified origin x,y xy coordinates xc,yc center of rotation angle angle units "DEGREES" (default) or "RADIANS" """ import math x = x - xc y ...
Rotate an xy cooordinate about a specified origin x,y xy coordinates xc,yc center of rotation angle angle units "DEGREES" (default) or "RADIANS"
Rotate an xy cooordinate about a specified origin x,y xy coordinates xc,yc center of rotation angle angle units "DEGREES" (default) or "RADIANS"
[ "Rotate", "an", "xy", "cooordinate", "about", "a", "specified", "origin", "x", "y", "xy", "coordinates", "xc", "yc", "center", "of", "rotation", "angle", "angle", "units", "\"", "DEGREES", "\"", "(", "default", ")", "or", "\"", "RADIANS", "\"" ]
def RotateXY(x, y, xc=0, yc=0, angle=0, units="DEGREES"): import math x = x - xc y = y - yc angle = angle * -1 if units == "DEGREES": angle = math.radians(angle) xr = (x * math.cos(angle)) - (y * math.sin(angle)) + xc yr = (x * math.sin(angle)) + (y * ...
[ "def", "RotateXY", "(", "x", ",", "y", ",", "xc", "=", "0", ",", "yc", "=", "0", ",", "angle", "=", "0", ",", "units", "=", "\"DEGREES\"", ")", ":", "import", "math", "x", "=", "x", "-", "xc", "y", "=", "y", "-", "yc", "angle", "=", "angle"...
Rotate an xy cooordinate about a specified origin x,y xy coordinates xc,yc center of rotation angle angle units "DEGREES" (default) or "RADIANS"
[ "Rotate", "an", "xy", "cooordinate", "about", "a", "specified", "origin", "x", "y", "xy", "coordinates", "xc", "yc", "center", "of", "rotation", "angle", "angle", "units", "\"", "DEGREES", "\"", "(", "default", ")", "or", "\"", "RADIANS", "\"" ]
[ "\"\"\"Rotate an xy cooordinate about a specified origin\n\n x,y xy coordinates\n xc,yc center of rotation\n angle angle\n units \"DEGREES\" (default) or \"RADIANS\"\n \"\"\"", "# make angle clockwise (like Rotate_management)" ]
[ { "param": "x", "type": null }, { "param": "y", "type": null }, { "param": "xc", "type": null }, { "param": "yc", "type": null }, { "param": "angle", "type": null }, { "param": "units", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "y", "type": null, "docstring": null, "docstring_tokens": [], ...
735ae7be40ab0ec8b6c7c697322a935bb9c315af
RMeli/gninascripts
show_xyz_arrows.py
[ "BSD-3-Clause" ]
Python
draw_arrow
null
def draw_arrow(xyz1,xyz2, radius=0.5, gap=0.0, hlength=-1, hradius=-1, color='blue red', name=''): ''' Draw an arrow; borrows heavily from cgi arrows. ''' radius, gap = float(radius), float(gap) hlength, hradius = float(hlength), float(hradius) xyz1 = list(xyz1) xyz2 = list(xyz2) ...
Draw an arrow; borrows heavily from cgi arrows.
Draw an arrow; borrows heavily from cgi arrows.
[ "Draw", "an", "arrow", ";", "borrows", "heavily", "from", "cgi", "arrows", "." ]
def draw_arrow(xyz1,xyz2, radius=0.5, gap=0.0, hlength=-1, hradius=-1, color='blue red', name=''): radius, gap = float(radius), float(gap) hlength, hradius = float(hlength), float(hradius) xyz1 = list(xyz1) xyz2 = list(xyz2) try: color1, color2 = color.split() except: ...
[ "def", "draw_arrow", "(", "xyz1", ",", "xyz2", ",", "radius", "=", "0.5", ",", "gap", "=", "0.0", ",", "hlength", "=", "-", "1", ",", "hradius", "=", "-", "1", ",", "color", "=", "'blue red'", ",", "name", "=", "''", ")", ":", "radius", ",", "g...
Draw an arrow; borrows heavily from cgi arrows.
[ "Draw", "an", "arrow", ";", "borrows", "heavily", "from", "cgi", "arrows", "." ]
[ "'''\nDraw an arrow; borrows heavily from cgi arrows.\n '''" ]
[ { "param": "xyz1", "type": null }, { "param": "xyz2", "type": null }, { "param": "radius", "type": null }, { "param": "gap", "type": null }, { "param": "hlength", "type": null }, { "param": "hradius", "type": null }, { "param": "color", ...
{ "returns": [], "raises": [], "params": [ { "identifier": "xyz1", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "xyz2", "type": null, "docstring": null, "docstring_tokens": [...
e317b24329436de9132aaca92776980a4560caf1
RMeli/gninascripts
affinity_search/outputjson.py
[ "BSD-3-Clause" ]
Python
makejson
<not_specific>
def makejson(): '''return dictionary of config options from makemodel''' opts = makemodel.getoptions() d=OrderedDict() for (name,vals) in sorted(opts.items()): paramsize=1 if type(vals) == tuple: options=list(map(str,vals)) paramtype="enum" data=OrderedDict([("name",name), ("type", paramtype), ("size"...
return dictionary of config options from makemodel
return dictionary of config options from makemodel
[ "return", "dictionary", "of", "config", "options", "from", "makemodel" ]
def makejson(): opts = makemodel.getoptions() d=OrderedDict() for (name,vals) in sorted(opts.items()): paramsize=1 if type(vals) == tuple: options=list(map(str,vals)) paramtype="enum" data=OrderedDict([("name",name), ("type", paramtype), ("size", paramsize),("options",options)]) elif isinstance(vals, ...
[ "def", "makejson", "(", ")", ":", "opts", "=", "makemodel", ".", "getoptions", "(", ")", "d", "=", "OrderedDict", "(", ")", "for", "(", "name", ",", "vals", ")", "in", "sorted", "(", "opts", ".", "items", "(", ")", ")", ":", "paramsize", "=", "1"...
return dictionary of config options from makemodel
[ "return", "dictionary", "of", "config", "options", "from", "makemodel" ]
[ "'''return dictionary of config options from makemodel'''" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
5abe899c45da243e05c4cd40b01eeef70ec5d66c
RMeli/gninascripts
simple_grid_visualization.py
[ "BSD-3-Clause" ]
Python
make_points
null
def make_points(atom,val_range,root,mapping):#TODO -- make sure this works ''' Function that makes the points needed for the types file. ''' if not os.path.isdir(root+atom): os.mkdir(root+atom) counter=0 for x in val_range: pos=[x,0.0,0.0] pos=struct.pack('f'*len(pos),*pos) identity=[mapping] identity...
Function that makes the points needed for the types file.
Function that makes the points needed for the types file.
[ "Function", "that", "makes", "the", "points", "needed", "for", "the", "types", "file", "." ]
def make_points(atom,val_range,root,mapping): if not os.path.isdir(root+atom): os.mkdir(root+atom) counter=0 for x in val_range: pos=[x,0.0,0.0] pos=struct.pack('f'*len(pos),*pos) identity=[mapping] identity=struct.pack('i'*len(identity),*identity) with open(root+atom+'/'+atom+'_'+str(counter)+'.gninatyp...
[ "def", "make_points", "(", "atom", ",", "val_range", ",", "root", ",", "mapping", ")", ":", "if", "not", "os", ".", "path", ".", "isdir", "(", "root", "+", "atom", ")", ":", "os", ".", "mkdir", "(", "root", "+", "atom", ")", "counter", "=", "0", ...
Function that makes the points needed for the types file.
[ "Function", "that", "makes", "the", "points", "needed", "for", "the", "types", "file", "." ]
[ "#TODO -- make sure this works", "'''\n\tFunction that makes the points needed for the types file.\n\t'''" ]
[ { "param": "atom", "type": null }, { "param": "val_range", "type": null }, { "param": "root", "type": null }, { "param": "mapping", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "atom", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "val_range", "type": null, "docstring": null, "docstring_token...
5abe899c45da243e05c4cd40b01eeef70ec5d66c
RMeli/gninascripts
simple_grid_visualization.py
[ "BSD-3-Clause" ]
Python
make_types
<not_specific>
def make_types(atom, root, receptor): ''' Function that writes a types file for all the points created from make_points in root Returns the name of the file ''' def atoi(text): return int(text) if text.isdigit() else text def natural_keys(text): return [ atoi(c) for c in re.split(r'(\d+)', text) ] gninat...
Function that writes a types file for all the points created from make_points in root Returns the name of the file
Function that writes a types file for all the points created from make_points in root Returns the name of the file
[ "Function", "that", "writes", "a", "types", "file", "for", "all", "the", "points", "created", "from", "make_points", "in", "root", "Returns", "the", "name", "of", "the", "file" ]
def make_types(atom, root, receptor): def atoi(text): return int(text) if text.isdigit() else text def natural_keys(text): return [ atoi(c) for c in re.split(r'(\d+)', text) ] gninatypes=glob.glob(root+atom+'/'+atom+'*.gninatypes') gninatypes.sort(key=natural_keys) filename=root+receptor.split('/')[-1].split('...
[ "def", "make_types", "(", "atom", ",", "root", ",", "receptor", ")", ":", "def", "atoi", "(", "text", ")", ":", "return", "int", "(", "text", ")", "if", "text", ".", "isdigit", "(", ")", "else", "text", "def", "natural_keys", "(", "text", ")", ":",...
Function that writes a types file for all the points created from make_points in root Returns the name of the file
[ "Function", "that", "writes", "a", "types", "file", "for", "all", "the", "points", "created", "from", "make_points", "in", "root", "Returns", "the", "name", "of", "the", "file" ]
[ "'''\n\tFunction that writes a types file for all the points created from make_points in root\n\n\tReturns the name of the file\n\t'''" ]
[ { "param": "atom", "type": null }, { "param": "root", "type": null }, { "param": "receptor", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "atom", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "root", "type": null, "docstring": null, "docstring_tokens": [...
f3b814a3c4213df11522a987d48af8c2302c64f9
RMeli/gninascripts
generate_counterexample_typeslines.py
[ "BSD-3-Clause" ]
Python
calc_ligand_dic
<not_specific>
def calc_ligand_dic(lines,ligand_suffix): ''' This function will parse the input list of lines and construct 2 dictionaries 1) ligand name -> [docked files with that ligand] 2) docked_filename -> crystal_file for that pose ''' data={} docked_lookup={} for line in lines: #1) Getting the crystal ligand file...
This function will parse the input list of lines and construct 2 dictionaries 1) ligand name -> [docked files with that ligand] 2) docked_filename -> crystal_file for that pose
This function will parse the input list of lines and construct 2 dictionaries 1) ligand name -> [docked files with that ligand] 2) docked_filename -> crystal_file for that pose
[ "This", "function", "will", "parse", "the", "input", "list", "of", "lines", "and", "construct", "2", "dictionaries", "1", ")", "ligand", "name", "-", ">", "[", "docked", "files", "with", "that", "ligand", "]", "2", ")", "docked_filename", "-", ">", "crys...
def calc_ligand_dic(lines,ligand_suffix): data={} docked_lookup={} for line in lines: ligfile=re.split('--autobox_ligand ',line)[1].split()[0] ligname=ligfile.split('/')[-1].split(ligand_suffix)[0].split('_')[1] if ligname not in data: data[ligname]=[] outfile=re.split('-o ',line)[1].split()[0] data[lig...
[ "def", "calc_ligand_dic", "(", "lines", ",", "ligand_suffix", ")", ":", "data", "=", "{", "}", "docked_lookup", "=", "{", "}", "for", "line", "in", "lines", ":", "ligfile", "=", "re", ".", "split", "(", "'--autobox_ligand '", ",", "line", ")", "[", "1"...
This function will parse the input list of lines and construct 2 dictionaries 1) ligand name -> [docked files with that ligand] 2) docked_filename -> crystal_file for that pose
[ "This", "function", "will", "parse", "the", "input", "list", "of", "lines", "and", "construct", "2", "dictionaries", "1", ")", "ligand", "name", "-", ">", "[", "docked", "files", "with", "that", "ligand", "]", "2", ")", "docked_filename", "-", ">", "crys...
[ "'''\n\tThis function will parse the input list of lines and construct 2 dictionaries\n\t\t 1) ligand name -> [docked files with that ligand]\n\t\t 2) docked_filename -> crystal_file for that pose\n\t'''", "#1) Getting the crystal ligand file", "#2) Getting the name of the ligand ** here we assume the ligfile i...
[ { "param": "lines", "type": null }, { "param": "ligand_suffix", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "lines", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ligand_suffix", "type": null, "docstring": null, "docstring_...
f3b814a3c4213df11522a987d48af8c2302c64f9
RMeli/gninascripts
generate_counterexample_typeslines.py
[ "BSD-3-Clause" ]
Python
run_obrms
<not_specific>
def run_obrms(ligand_file,crystal_file): ''' This function returns a list of rmsds of the docked ligand file to the crystal file. The list is in the order of the poses. ''' rmsds=subprocess.check_output(f'obrms {ligand_file} {crystal_file}',shell=True) rmsds=str(rmsds,'utf-8').rstrip().split('\n') rmsds=[float(x...
This function returns a list of rmsds of the docked ligand file to the crystal file. The list is in the order of the poses.
This function returns a list of rmsds of the docked ligand file to the crystal file. The list is in the order of the poses.
[ "This", "function", "returns", "a", "list", "of", "rmsds", "of", "the", "docked", "ligand", "file", "to", "the", "crystal", "file", ".", "The", "list", "is", "in", "the", "order", "of", "the", "poses", "." ]
def run_obrms(ligand_file,crystal_file): rmsds=subprocess.check_output(f'obrms {ligand_file} {crystal_file}',shell=True) rmsds=str(rmsds,'utf-8').rstrip().split('\n') rmsds=[float(x.split()[-1]) for x in rmsds] return rmsds
[ "def", "run_obrms", "(", "ligand_file", ",", "crystal_file", ")", ":", "rmsds", "=", "subprocess", ".", "check_output", "(", "f'obrms {ligand_file} {crystal_file}'", ",", "shell", "=", "True", ")", "rmsds", "=", "str", "(", "rmsds", ",", "'utf-8'", ")", ".", ...
This function returns a list of rmsds of the docked ligand file to the crystal file.
[ "This", "function", "returns", "a", "list", "of", "rmsds", "of", "the", "docked", "ligand", "file", "to", "the", "crystal", "file", "." ]
[ "'''\n\tThis function returns a list of rmsds of the docked ligand file to the crystal file. The list is in the order of the poses.\n\t'''" ]
[ { "param": "ligand_file", "type": null }, { "param": "crystal_file", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ligand_file", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "crystal_file", "type": null, "docstring": null, "docst...
f3b814a3c4213df11522a987d48af8c2302c64f9
RMeli/gninascripts
generate_counterexample_typeslines.py
[ "BSD-3-Clause" ]
Python
run_obrms_cross
<not_specific>
def run_obrms_cross(filename): ''' This function returns a pandas dataframe of the RMSD between every pose and every other pose, which is generated using obrms -x ''' csv=subprocess.check_output('obrms -x '+filename,shell=True) csv=str(csv,'utf-8').rstrip().split('\n') data=pd.DataFrame([x.split(',')[1:] for x i...
This function returns a pandas dataframe of the RMSD between every pose and every other pose, which is generated using obrms -x
This function returns a pandas dataframe of the RMSD between every pose and every other pose, which is generated using obrms -x
[ "This", "function", "returns", "a", "pandas", "dataframe", "of", "the", "RMSD", "between", "every", "pose", "and", "every", "other", "pose", "which", "is", "generated", "using", "obrms", "-", "x" ]
def run_obrms_cross(filename): csv=subprocess.check_output('obrms -x '+filename,shell=True) csv=str(csv,'utf-8').rstrip().split('\n') data=pd.DataFrame([x.split(',')[1:] for x in csv],dtype=float) return data
[ "def", "run_obrms_cross", "(", "filename", ")", ":", "csv", "=", "subprocess", ".", "check_output", "(", "'obrms -x '", "+", "filename", ",", "shell", "=", "True", ")", "csv", "=", "str", "(", "csv", ",", "'utf-8'", ")", ".", "rstrip", "(", ")", ".", ...
This function returns a pandas dataframe of the RMSD between every pose and every other pose, which is generated using obrms -x
[ "This", "function", "returns", "a", "pandas", "dataframe", "of", "the", "RMSD", "between", "every", "pose", "and", "every", "other", "pose", "which", "is", "generated", "using", "obrms", "-", "x" ]
[ "'''\n\tThis function returns a pandas dataframe of the RMSD between every pose and every other pose, which is generated using obrms -x\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": [] }
e7859b5a2fcb7417309d15662e9b2b9d5669e42e
RMeli/gninascripts
compute_row.py
[ "BSD-3-Clause" ]
Python
compute_ligand_similarity
<not_specific>
def compute_ligand_similarity(smiles, pair): ''' Input a list of smiles, and a pair to compute the similarity. Returns the indices of the pair and the similarity ''' (a,b) = pair smi_a = smiles[a] mol_a = AllChem.MolFromSmiles(smi_a) if mol_a == None: mol_a = AllChem.MolFromSmil...
Input a list of smiles, and a pair to compute the similarity. Returns the indices of the pair and the similarity
Input a list of smiles, and a pair to compute the similarity. Returns the indices of the pair and the similarity
[ "Input", "a", "list", "of", "smiles", "and", "a", "pair", "to", "compute", "the", "similarity", ".", "Returns", "the", "indices", "of", "the", "pair", "and", "the", "similarity" ]
def compute_ligand_similarity(smiles, pair): (a,b) = pair smi_a = smiles[a] mol_a = AllChem.MolFromSmiles(smi_a) if mol_a == None: mol_a = AllChem.MolFromSmiles(smi_a, sanitize=False) fp_a = FingerprintMols.FingerprintMol(mol_a) smi_b = smiles[b] mol_b = AllChem.MolFromSmiles(smi_b) ...
[ "def", "compute_ligand_similarity", "(", "smiles", ",", "pair", ")", ":", "(", "a", ",", "b", ")", "=", "pair", "smi_a", "=", "smiles", "[", "a", "]", "mol_a", "=", "AllChem", ".", "MolFromSmiles", "(", "smi_a", ")", "if", "mol_a", "==", "None", ":",...
Input a list of smiles, and a pair to compute the similarity.
[ "Input", "a", "list", "of", "smiles", "and", "a", "pair", "to", "compute", "the", "similarity", "." ]
[ "'''\n Input a list of smiles, and a pair to compute the similarity.\n Returns the indices of the pair and the similarity\n '''" ]
[ { "param": "smiles", "type": null }, { "param": "pair", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "smiles", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "pair", "type": null, "docstring": null, "docstring_tokens":...
2a19339a2c728b71605ae82767f3e6f75c337ba9
RMeli/gninascripts
train.py
[ "BSD-3-Clause" ]
Python
write_model_file
null
def write_model_file(model_file, template_file, train_file, test_file, root_folder, avg_rotations=False, percent_reduc=False,train_file2=None, ratio=None, root_folder2=None, test_root_folder=None): '''Writes a model prototxt file based on a provided template file with certain placeholders r...
Writes a model prototxt file based on a provided template file with certain placeholders replaced in each MolGridDataLayer. For the source parameter, "TRAINFILE" is replaced with train_file and "TESTFILE" is replaced with test_file. For the root_folder parameter, "DATA_ROOT" is replaced with root_folder...
Writes a model prototxt file based on a provided template file with certain placeholders replaced in each MolGridDataLayer. For the source parameter, "TRAINFILE" is replaced with train_file and "TESTFILE" is replaced with test_file. For the root_folder parameter, "DATA_ROOT" is replaced with root_folder, unless the lay...
[ "Writes", "a", "model", "prototxt", "file", "based", "on", "a", "provided", "template", "file", "with", "certain", "placeholders", "replaced", "in", "each", "MolGridDataLayer", ".", "For", "the", "source", "parameter", "\"", "TRAINFILE", "\"", "is", "replaced", ...
def write_model_file(model_file, template_file, train_file, test_file, root_folder, avg_rotations=False, percent_reduc=False,train_file2=None, ratio=None, root_folder2=None, test_root_folder=None): netparam = NetParameter() with open(template_file, 'r') as f: prototxt.Merge(f.read()...
[ "def", "write_model_file", "(", "model_file", ",", "template_file", ",", "train_file", ",", "test_file", ",", "root_folder", ",", "avg_rotations", "=", "False", ",", "percent_reduc", "=", "False", ",", "train_file2", "=", "None", ",", "ratio", "=", "None", ","...
Writes a model prototxt file based on a provided template file with certain placeholders replaced in each MolGridDataLayer.
[ "Writes", "a", "model", "prototxt", "file", "based", "on", "a", "provided", "template", "file", "with", "certain", "placeholders", "replaced", "in", "each", "MolGridDataLayer", "." ]
[ "'''Writes a model prototxt file based on a provided template file\n with certain placeholders replaced in each MolGridDataLayer.\n For the source parameter, \"TRAINFILE\" is replaced with train_file\n and \"TESTFILE\" is replaced with test_file.\n For the root_folder parameter, \"DATA_ROOT\" is replace...
[ { "param": "model_file", "type": null }, { "param": "template_file", "type": null }, { "param": "train_file", "type": null }, { "param": "test_file", "type": null }, { "param": "root_folder", "type": null }, { "param": "avg_rotations", "type": null...
{ "returns": [], "raises": [], "params": [ { "identifier": "model_file", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "template_file", "type": null, "docstring": null, "docst...
2a19339a2c728b71605ae82767f3e6f75c337ba9
RMeli/gninascripts
train.py
[ "BSD-3-Clause" ]
Python
write_solver_file
null
def write_solver_file(solver_file, train_model, test_models, type, base_lr, momentum, weight_decay, lr_policy, gamma, power, random_seed, max_iter, clip_gradients, snapshot_prefix,display=0): '''Writes a solver prototxt file with parameters set to the corresponding argument values. In part...
Writes a solver prototxt file with parameters set to the corresponding argument values. In particular, the train_net parameter is set to train_model, and a test_net parameter is added for each of test_models, which should be a list.
Writes a solver prototxt file with parameters set to the corresponding argument values. In particular, the train_net parameter is set to train_model, and a test_net parameter is added for each of test_models, which should be a list.
[ "Writes", "a", "solver", "prototxt", "file", "with", "parameters", "set", "to", "the", "corresponding", "argument", "values", ".", "In", "particular", "the", "train_net", "parameter", "is", "set", "to", "train_model", "and", "a", "test_net", "parameter", "is", ...
def write_solver_file(solver_file, train_model, test_models, type, base_lr, momentum, weight_decay, lr_policy, gamma, power, random_seed, max_iter, clip_gradients, snapshot_prefix,display=0): param = SolverParameter() param.train_net = train_model for test_model in test_models: ...
[ "def", "write_solver_file", "(", "solver_file", ",", "train_model", ",", "test_models", ",", "type", ",", "base_lr", ",", "momentum", ",", "weight_decay", ",", "lr_policy", ",", "gamma", ",", "power", ",", "random_seed", ",", "max_iter", ",", "clip_gradients", ...
Writes a solver prototxt file with parameters set to the corresponding argument values.
[ "Writes", "a", "solver", "prototxt", "file", "with", "parameters", "set", "to", "the", "corresponding", "argument", "values", "." ]
[ "'''Writes a solver prototxt file with parameters set to the\n corresponding argument values. In particular, the train_net\n parameter is set to train_model, and a test_net parameter is\n added for each of test_models, which should be a list.'''", "#don't test automatically", "#don't print solver itera...
[ { "param": "solver_file", "type": null }, { "param": "train_model", "type": null }, { "param": "test_models", "type": null }, { "param": "type", "type": null }, { "param": "base_lr", "type": null }, { "param": "momentum", "type": null }, { ...
{ "returns": [], "raises": [], "params": [ { "identifier": "solver_file", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "train_model", "type": null, "docstring": null, "docstr...
2a19339a2c728b71605ae82767f3e6f75c337ba9
RMeli/gninascripts
train.py
[ "BSD-3-Clause" ]
Python
check_improvement
<not_specific>
def check_improvement(testval, ratio, gold, gold_i, current_i, want_bigger): '''Function that computes if training has improved. Returns a tuple: (best_val, i, to_snap)''' #indicators that we are at the first testing iteration and just need to return. if gold==np.inf or gold==0: return (testva...
Function that computes if training has improved. Returns a tuple: (best_val, i, to_snap)
Function that computes if training has improved.
[ "Function", "that", "computes", "if", "training", "has", "improved", "." ]
def check_improvement(testval, ratio, gold, gold_i, current_i, want_bigger): if gold==np.inf or gold==0: return (testval, current_i, True) best_val=gold i=gold_i to_snap=False if want_bigger: if (testval-gold) / gold > ratio: best_val=testval i=current_i ...
[ "def", "check_improvement", "(", "testval", ",", "ratio", ",", "gold", ",", "gold_i", ",", "current_i", ",", "want_bigger", ")", ":", "if", "gold", "==", "np", ".", "inf", "or", "gold", "==", "0", ":", "return", "(", "testval", ",", "current_i", ",", ...
Function that computes if training has improved.
[ "Function", "that", "computes", "if", "training", "has", "improved", "." ]
[ "'''Function that computes if training has improved.\n\n Returns a tuple: (best_val, i, to_snap)'''", "#indicators that we are at the first testing iteration and just need to return." ]
[ { "param": "testval", "type": null }, { "param": "ratio", "type": null }, { "param": "gold", "type": null }, { "param": "gold_i", "type": null }, { "param": "current_i", "type": null }, { "param": "want_bigger", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "testval", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ratio", "type": null, "docstring": null, "docstring_tokens...
2a19339a2c728b71605ae82767f3e6f75c337ba9
RMeli/gninascripts
train.py
[ "BSD-3-Clause" ]
Python
freemem
null
def freemem(): '''Free intermediate blobs from all networks. These will be reallocated as needed.''' net = solver.net if net.clearblobs: #solver will need values in output blobs for (bname, blob) in net.blobs.items(): if bname not in net.outputs: ...
Free intermediate blobs from all networks. These will be reallocated as needed.
Free intermediate blobs from all networks. These will be reallocated as needed.
[ "Free", "intermediate", "blobs", "from", "all", "networks", ".", "These", "will", "be", "reallocated", "as", "needed", "." ]
def freemem(): net = solver.net if net.clearblobs: for (bname, blob) in net.blobs.items(): if bname not in net.outputs: blob.clear() for k in test_nets.keys(): test_nets[k][0].clearblobs()
[ "def", "freemem", "(", ")", ":", "net", "=", "solver", ".", "net", "if", "net", ".", "clearblobs", ":", "for", "(", "bname", ",", "blob", ")", "in", "net", ".", "blobs", ".", "items", "(", ")", ":", "if", "bname", "not", "in", "net", ".", "outp...
Free intermediate blobs from all networks.
[ "Free", "intermediate", "blobs", "from", "all", "networks", "." ]
[ "'''Free intermediate blobs from all networks. These will be reallocated as needed.'''", "#solver will need values in output blobs" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
2a19339a2c728b71605ae82767f3e6f75c337ba9
RMeli/gninascripts
train.py
[ "BSD-3-Clause" ]
Python
update_from_result
null
def update_from_result(name, test, result): '''Put results into test/train structure''' test.y_true = result.y_true test.y_score = result.y_score test.y_aff = result.y_aff test.y_predaff = result.y_predaff test.rmsd_true = result.rmsd_true test.rmsd_pred = result....
Put results into test/train structure
Put results into test/train structure
[ "Put", "results", "into", "test", "/", "train", "structure" ]
def update_from_result(name, test, result): test.y_true = result.y_true test.y_score = result.y_score test.y_aff = result.y_aff test.y_predaff = result.y_predaff test.rmsd_true = result.rmsd_true test.rmsd_pred = result.rmsd_pred if result.auc is not None: ...
[ "def", "update_from_result", "(", "name", ",", "test", ",", "result", ")", ":", "test", ".", "y_true", "=", "result", ".", "y_true", "test", ".", "y_score", "=", "result", ".", "y_score", "test", ".", "y_aff", "=", "result", ".", "y_aff", "test", ".", ...
Put results into test/train structure
[ "Put", "results", "into", "test", "/", "train", "structure" ]
[ "'''Put results into test/train structure'''" ]
[ { "param": "name", "type": null }, { "param": "test", "type": null }, { "param": "result", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "name", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "test", "type": null, "docstring": null, "docstring_tokens": [...
a50abf1ed0d8ebda7a3cb3363ddbd93e89be7ecb
RMeli/gninascripts
affinity_search/ga_addrequests.py
[ "BSD-3-Clause" ]
Python
cleanparams
<not_specific>
def cleanparams(p): '''standardize params that do not matter''' modeldefaults = makemodel.getdefaults() for i in range(1,6): if p['conv%d_width'%i] == 0: for suffix in ['func', 'init', 'norm', 'size', 'stride', 'width']: name = 'conv%d_%s'%(i,suffix) p[nam...
standardize params that do not matter
standardize params that do not matter
[ "standardize", "params", "that", "do", "not", "matter" ]
def cleanparams(p): modeldefaults = makemodel.getdefaults() for i in range(1,6): if p['conv%d_width'%i] == 0: for suffix in ['func', 'init', 'norm', 'size', 'stride', 'width']: name = 'conv%d_%s'%(i,suffix) p[name] = modeldefaults[name] if p['pool%d_si...
[ "def", "cleanparams", "(", "p", ")", ":", "modeldefaults", "=", "makemodel", ".", "getdefaults", "(", ")", "for", "i", "in", "range", "(", "1", ",", "6", ")", ":", "if", "p", "[", "'conv%d_width'", "%", "i", "]", "==", "0", ":", "for", "suffix", ...
standardize params that do not matter
[ "standardize", "params", "that", "do", "not", "matter" ]
[ "'''standardize params that do not matter'''" ]
[ { "param": "p", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "p", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
a50abf1ed0d8ebda7a3cb3363ddbd93e89be7ecb
RMeli/gninascripts
affinity_search/ga_addrequests.py
[ "BSD-3-Clause" ]
Python
randParam
<not_specific>
def randParam(param, choices): '''randomly select a choice for param''' if isinstance(choices, makemodel.Range): #discretize choices = np.linspace(choices.min,choices.max, 9) return np.asscalar(np.random.choice(choices))
randomly select a choice for param
randomly select a choice for param
[ "randomly", "select", "a", "choice", "for", "param" ]
def randParam(param, choices): if isinstance(choices, makemodel.Range): choices = np.linspace(choices.min,choices.max, 9) return np.asscalar(np.random.choice(choices))
[ "def", "randParam", "(", "param", ",", "choices", ")", ":", "if", "isinstance", "(", "choices", ",", "makemodel", ".", "Range", ")", ":", "choices", "=", "np", ".", "linspace", "(", "choices", ".", "min", ",", "choices", ".", "max", ",", "9", ")", ...
randomly select a choice for param
[ "randomly", "select", "a", "choice", "for", "param" ]
[ "'''randomly select a choice for param'''", "#discretize" ]
[ { "param": "param", "type": null }, { "param": "choices", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "param", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "choices", "type": null, "docstring": null, "docstring_tokens...
a50abf1ed0d8ebda7a3cb3363ddbd93e89be7ecb
RMeli/gninascripts
affinity_search/ga_addrequests.py
[ "BSD-3-Clause" ]
Python
mutateIndividual
<not_specific>
def mutateIndividual(ind, indpb=0.05): '''for each param, with prob indpb randomly sample another choice''' options = makemodel.getoptions() for (param,choices) in options.items(): if np.random.rand() < indpb: ind[param] = randParam(param, choices) return (ind,)
for each param, with prob indpb randomly sample another choice
for each param, with prob indpb randomly sample another choice
[ "for", "each", "param", "with", "prob", "indpb", "randomly", "sample", "another", "choice" ]
def mutateIndividual(ind, indpb=0.05): options = makemodel.getoptions() for (param,choices) in options.items(): if np.random.rand() < indpb: ind[param] = randParam(param, choices) return (ind,)
[ "def", "mutateIndividual", "(", "ind", ",", "indpb", "=", "0.05", ")", ":", "options", "=", "makemodel", ".", "getoptions", "(", ")", "for", "(", "param", ",", "choices", ")", "in", "options", ".", "items", "(", ")", ":", "if", "np", ".", "random", ...
for each param, with prob indpb randomly sample another choice
[ "for", "each", "param", "with", "prob", "indpb", "randomly", "sample", "another", "choice" ]
[ "'''for each param, with prob indpb randomly sample another choice'''" ]
[ { "param": "ind", "type": null }, { "param": "indpb", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ind", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "indpb", "type": null, "docstring": null, "docstring_tokens": [...
a50abf1ed0d8ebda7a3cb3363ddbd93e89be7ecb
RMeli/gninascripts
affinity_search/ga_addrequests.py
[ "BSD-3-Clause" ]
Python
runGA
<not_specific>
def runGA(pop): '''run GA with early stopping if not improving''' hof = tools.HallOfFame(10) stats = tools.Statistics(lambda ind: ind.fitness.values) stats.register("avg", np.mean) stats.register("std", np.std) stats.register("min", np.min) stats.register("max", np.max) best = 0 ...
run GA with early stopping if not improving
run GA with early stopping if not improving
[ "run", "GA", "with", "early", "stopping", "if", "not", "improving" ]
def runGA(pop): hof = tools.HallOfFame(10) stats = tools.Statistics(lambda ind: ind.fitness.values) stats.register("avg", np.mean) stats.register("std", np.std) stats.register("min", np.min) stats.register("max", np.max) best = 0 pop = toolbox.clone(pop) for i in range(40): p...
[ "def", "runGA", "(", "pop", ")", ":", "hof", "=", "tools", ".", "HallOfFame", "(", "10", ")", "stats", "=", "tools", ".", "Statistics", "(", "lambda", "ind", ":", "ind", ".", "fitness", ".", "values", ")", "stats", ".", "register", "(", "\"avg\"", ...
run GA with early stopping if not improving
[ "run", "GA", "with", "early", "stopping", "if", "not", "improving" ]
[ "'''run GA with early stopping if not improving'''" ]
[ { "param": "pop", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "pop", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
a50abf1ed0d8ebda7a3cb3363ddbd93e89be7ecb
RMeli/gninascripts
affinity_search/ga_addrequests.py
[ "BSD-3-Clause" ]
Python
addrows
null
def addrows(config,host,db,password): '''add rows from fname into database, starting at row start''' conn = MySQLdb.connect (host = host,user = "opter",passwd=password,db=db) cursor = conn.cursor() items = list(config.items()) names = ','.join([str(n) for (n,v) in items]) values = ','.join...
add rows from fname into database, starting at row start
add rows from fname into database, starting at row start
[ "add", "rows", "from", "fname", "into", "database", "starting", "at", "row", "start" ]
def addrows(config,host,db,password): conn = MySQLdb.connect (host = host,user = "opter",passwd=password,db=db) cursor = conn.cursor() items = list(config.items()) names = ','.join([str(n) for (n,v) in items]) values = ','.join(['%s' for (n,v) in items]) names += ',id' values += ',"REQUESTED...
[ "def", "addrows", "(", "config", ",", "host", ",", "db", ",", "password", ")", ":", "conn", "=", "MySQLdb", ".", "connect", "(", "host", "=", "host", ",", "user", "=", "\"opter\"", ",", "passwd", "=", "password", ",", "db", "=", "db", ")", "cursor"...
add rows from fname into database, starting at row start
[ "add", "rows", "from", "fname", "into", "database", "starting", "at", "row", "start" ]
[ "'''add rows from fname into database, starting at row start'''", "#do five variations" ]
[ { "param": "config", "type": null }, { "param": "host", "type": null }, { "param": "db", "type": null }, { "param": "password", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "config", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "host", "type": null, "docstring": null, "docstring_tokens":...
b9bccff5ac8d1e7947db64b57d5b562c061fb325
RMeli/gninascripts
create_caches.py
[ "BSD-3-Clause" ]
Python
writemol
<not_specific>
def writemol(root, mol, out): '''mol is gninatypes file, write it in the appropriate binary format to out''' fname = root+'/'+mol try: with open(fname,'rb') as gninatype: if len(fname) > 255: print("Skipping",mol,"since filename is too long") return ...
mol is gninatypes file, write it in the appropriate binary format to out
mol is gninatypes file, write it in the appropriate binary format to out
[ "mol", "is", "gninatypes", "file", "write", "it", "in", "the", "appropriate", "binary", "format", "to", "out" ]
def writemol(root, mol, out): fname = root+'/'+mol try: with open(fname,'rb') as gninatype: if len(fname) > 255: print("Skipping",mol,"since filename is too long") return s = bytes(mol) out.write(struct.pack('b',len(s))) out...
[ "def", "writemol", "(", "root", ",", "mol", ",", "out", ")", ":", "fname", "=", "root", "+", "'/'", "+", "mol", "try", ":", "with", "open", "(", "fname", ",", "'rb'", ")", "as", "gninatype", ":", "if", "len", "(", "fname", ")", ">", "255", ":",...
mol is gninatypes file, write it in the appropriate binary format to out
[ "mol", "is", "gninatypes", "file", "write", "it", "in", "the", "appropriate", "binary", "format", "to", "out" ]
[ "'''mol is gninatypes file, write it in the appropriate binary format to out'''" ]
[ { "param": "root", "type": null }, { "param": "mol", "type": null }, { "param": "out", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "root", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "mol", "type": null, "docstring": null, "docstring_tokens": []...
18fea99a1349e09cd4ede82e4bdb889ff11565f0
RMeli/gninascripts
affinity_search/cleanparams.py
[ "BSD-3-Clause" ]
Python
cleanparams
<not_specific>
def cleanparams(p): '''standardize params that do not matter''' for i in range(1,6): if p['conv%d_width'%i] == 0: for suffix in ['func', 'init', 'norm', 'size', 'stride', 'width']: name = 'conv%d_%s'%(i,suffix) p[name] = modeldefaults[name] if p['pool%...
standardize params that do not matter
standardize params that do not matter
[ "standardize", "params", "that", "do", "not", "matter" ]
def cleanparams(p): for i in range(1,6): if p['conv%d_width'%i] == 0: for suffix in ['func', 'init', 'norm', 'size', 'stride', 'width']: name = 'conv%d_%s'%(i,suffix) p[name] = modeldefaults[name] if p['pool%d_size'%i] == 0: name = 'pool%d_type...
[ "def", "cleanparams", "(", "p", ")", ":", "for", "i", "in", "range", "(", "1", ",", "6", ")", ":", "if", "p", "[", "'conv%d_width'", "%", "i", "]", "==", "0", ":", "for", "suffix", "in", "[", "'func'", ",", "'init'", ",", "'norm'", ",", "'size'...
standardize params that do not matter
[ "standardize", "params", "that", "do", "not", "matter" ]
[ "'''standardize params that do not matter'''" ]
[ { "param": "p", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "p", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
3cfa26ec8644609c845746a68d8a6cc9c1268e7b
RMeli/gninascripts
affinity_search/populaterequests.py
[ "BSD-3-Clause" ]
Python
addrows
null
def addrows(fname,host,db,password,start=0): '''add rows from fname into database, starting at row start''' data = pd.read_csv(fname,delim_whitespace=True,header=None) colnames = ['P1','P2'] for (name,val) in sorted(opts.items()): colnames.append(name) data.columns = colnames da...
add rows from fname into database, starting at row start
add rows from fname into database, starting at row start
[ "add", "rows", "from", "fname", "into", "database", "starting", "at", "row", "start" ]
def addrows(fname,host,db,password,start=0): data = pd.read_csv(fname,delim_whitespace=True,header=None) colnames = ['P1','P2'] for (name,val) in sorted(opts.items()): colnames.append(name) data.columns = colnames data = data.drop(['P1','P2'],axis=1) conn = MySQLdb.connect (host = host,u...
[ "def", "addrows", "(", "fname", ",", "host", ",", "db", ",", "password", ",", "start", "=", "0", ")", ":", "data", "=", "pd", ".", "read_csv", "(", "fname", ",", "delim_whitespace", "=", "True", ",", "header", "=", "None", ")", "colnames", "=", "["...
add rows from fname into database, starting at row start
[ "add", "rows", "from", "fname", "into", "database", "starting", "at", "row", "start" ]
[ "'''add rows from fname into database, starting at row start'''", "#do five variations" ]
[ { "param": "fname", "type": null }, { "param": "host", "type": null }, { "param": "db", "type": null }, { "param": "password", "type": null }, { "param": "start", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "fname", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "host", "type": null, "docstring": null, "docstring_tokens": ...
592babced10618460d376fed85830dcc304c7a62
RMeli/gninascripts
affinity_search/makemodel.py
[ "BSD-3-Clause" ]
Python
add_conv_args
null
def add_conv_args(n,defaultwidth): '''add arguments for layer n, in the form conv<n>_<arg> A conv unit consists of a pool layer, a convolutional layer, a normalization layer, and a non-linear layer The pool layer is defined by kernel size The conv layer is defined by kernel size, stride, initializa...
add arguments for layer n, in the form conv<n>_<arg> A conv unit consists of a pool layer, a convolutional layer, a normalization layer, and a non-linear layer The pool layer is defined by kernel size The conv layer is defined by kernel size, stride, initialization, and output width Note that a wid...
add arguments for layer n, in the form conv_ A conv unit consists of a pool layer, a convolutional layer, a normalization layer, and a non-linear layer The pool layer is defined by kernel size The conv layer is defined by kernel size, stride, initialization, and output width Note that a width of zero indicates the lack...
[ "add", "arguments", "for", "layer", "n", "in", "the", "form", "conv_", "A", "conv", "unit", "consists", "of", "a", "pool", "layer", "a", "convolutional", "layer", "a", "normalization", "layer", "and", "a", "non", "-", "linear", "layer", "The", "pool", "l...
def add_conv_args(n,defaultwidth): parser.add_argument('--pool%d_size'%n,type=int,help="Pooling size for layer %d"%n,default=2 if defaultwidth > 0 else 0,choices=(0,2,4,8)) parser.add_argument('--pool%d_type'%n,type=str,help="Pooling type for layer %d"%n,default='MAX',choices=('MAX','AVE')) parser.add_argum...
[ "def", "add_conv_args", "(", "n", ",", "defaultwidth", ")", ":", "parser", ".", "add_argument", "(", "'--pool%d_size'", "%", "n", ",", "type", "=", "int", ",", "help", "=", "\"Pooling size for layer %d\"", "%", "n", ",", "default", "=", "2", "if", "default...
add arguments for layer n, in the form conv<n>_<arg> A conv unit consists of a pool layer, a convolutional layer, a normalization layer, and a non-linear layer The pool layer is defined by kernel size The conv layer is defined by kernel size, stride, initialization, and output width Note that a width of zero indicates ...
[ "add", "arguments", "for", "layer", "n", "in", "the", "form", "conv<n", ">", "_<arg", ">", "A", "conv", "unit", "consists", "of", "a", "pool", "layer", "a", "convolutional", "layer", "a", "normalization", "layer", "and", "a", "non", "-", "linear", "layer...
[ "'''add arguments for layer n, in the form conv<n>_<arg>\n A conv unit consists of a pool layer, a convolutional layer, \n a normalization layer, and a non-linear layer\n The pool layer is defined by kernel size\n The conv layer is defined by kernel size, stride, initialization, and output width\n No...
[ { "param": "n", "type": null }, { "param": "defaultwidth", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "n", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "defaultwidth", "type": null, "docstring": null, "docstring_token...
592babced10618460d376fed85830dcc304c7a62
RMeli/gninascripts
affinity_search/makemodel.py
[ "BSD-3-Clause" ]
Python
create_model
<not_specific>
def create_model(args): '''Generate the model defined by args; first line (comment) contains solver/train.py arguments''' m = '# --base_lr %f --momentum %f --weight_decay %f -- solver %s\n' % (10**args.base_lr_exp,args.momentum,10**args.weight_decay_exp,args.solver) #test input m += ''' layer { name: ...
Generate the model defined by args; first line (comment) contains solver/train.py arguments
Generate the model defined by args; first line (comment) contains solver/train.py arguments
[ "Generate", "the", "model", "defined", "by", "args", ";", "first", "line", "(", "comment", ")", "contains", "solver", "/", "train", ".", "py", "arguments" ]
def create_model(args): m = '# --base_lr %f --momentum %f --weight_decay %f -- solver %s\n' % (10**args.base_lr_exp,args.momentum,10**args.weight_decay_exp,args.solver) m += ''' layer { name: "data" type: "MolGridData" top: "data" top: "label" top: "affinity" include { phase: TEST } molgrid_...
[ "def", "create_model", "(", "args", ")", ":", "m", "=", "'# --base_lr %f --momentum %f --weight_decay %f -- solver %s\\n'", "%", "(", "10", "**", "args", ".", "base_lr_exp", ",", "args", ".", "momentum", ",", "10", "**", "args", ".", "weight_decay_exp", ",", "ar...
Generate the model defined by args; first line (comment) contains solver/train.py arguments
[ "Generate", "the", "model", "defined", "by", "args", ";", "first", "line", "(", "comment", ")", "contains", "solver", "/", "train", ".", "py", "arguments" ]
[ "'''Generate the model defined by args; first line (comment) contains solver/train.py arguments'''", "#test input", "#train input,", "#now pool/conv layers", "#fully connected", "# pose", "#tuples of name,numoutput", "# affinity", "#tuples of name,numoutput", "#loss", "#pose", "#affinity loss"...
[ { "param": "args", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "args", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cfd23fb632d49990e523d69c81900e687c7c431a
RMeli/gninascripts
affinity_search/evaluate_cross.py
[ "BSD-3-Clause" ]
Python
reduce_results
<not_specific>
def reduce_results(results, index, which): '''Return results with only one tuple for every pocket-ligand value, taking the one with the max value at index in the tuple (predicted affinity or pose score) ''' res = dict() #indexed by pocketligand for r in results: lname = r[3] m = re.s...
Return results with only one tuple for every pocket-ligand value, taking the one with the max value at index in the tuple (predicted affinity or pose score)
Return results with only one tuple for every pocket-ligand value, taking the one with the max value at index in the tuple (predicted affinity or pose score)
[ "Return", "results", "with", "only", "one", "tuple", "for", "every", "pocket", "-", "ligand", "value", "taking", "the", "one", "with", "the", "max", "value", "at", "index", "in", "the", "tuple", "(", "predicted", "affinity", "or", "pose", "score", ")" ]
def reduce_results(results, index, which): res = dict() for r in results: lname = r[3] m = re.search(r'(\S+)/...._._rec_...._(\S+)_(lig|uff_min)',lname) pocket = m.group(1) lig = m.group(2) key = pocket+':'+lig if key not in res: res[key] = r ...
[ "def", "reduce_results", "(", "results", ",", "index", ",", "which", ")", ":", "res", "=", "dict", "(", ")", "for", "r", "in", "results", ":", "lname", "=", "r", "[", "3", "]", "m", "=", "re", ".", "search", "(", "r'(\\S+)/...._._rec_...._(\\S+)_(lig|u...
Return results with only one tuple for every pocket-ligand value, taking the one with the max value at index in the tuple (predicted affinity or pose score)
[ "Return", "results", "with", "only", "one", "tuple", "for", "every", "pocket", "-", "ligand", "value", "taking", "the", "one", "with", "the", "max", "value", "at", "index", "in", "the", "tuple", "(", "predicted", "affinity", "or", "pose", "score", ")" ]
[ "'''Return results with only one tuple for every pocket-ligand value,\n taking the one with the max value at index in the tuple (predicted affinity or pose score)\n '''", "#indexed by pocketligand", "#select smallest by index" ]
[ { "param": "results", "type": null }, { "param": "index", "type": null }, { "param": "which", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "results", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "index", "type": null, "docstring": null, "docstring_tokens...