elasticai.preprocessor.translation.ir2c#

Module Contents#

Functions#

get_embedded_datatype

Determine the C datatype for processing data

replace_variables_with_parameters

Function for search parameter in string list and replace with new defined real values

generate_c_files

Function for generating the C files

API#

elasticai.preprocessor.translation.ir2c.get_embedded_datatype(bitwidth: int, signed: bool) str[source]#

Determine the C datatype for processing data

Parameters:
  • bitwidth – Integer with bitwidth value

  • signed – Boolean if datatype is signed or unsigned

Returns:

String with datatype in C

elasticai.preprocessor.translation.ir2c.replace_variables_with_parameters(string_input: list, parameters: dict) list[source]#

Function for search parameter in string list and replace with new defined real values

Parameters:
  • string_input – List with input strings from file

  • parameters – Dictionary with parameters (key and value)

Returns:

List with corrected string output

elasticai.preprocessor.translation.ir2c.generate_c_files(path2save: pathlib.Path, template_name: str, file_name: str, module_id: str, proto_file: list, impl_file: list, path2template: pathlib.Path = Path('./../c').absolute()) None[source]#

Function for generating the C files

Parameters:
  • path2save – Path to save C files

  • template_name – String with template name

  • file_name – String with file name

  • module_id – String with module ID

  • proto_file – List with content of the prototype implementation

  • impl_file – List with content of the implementation

  • path2template – Path to template file

Returns:

None