PER Firmware
Loading...
Searching...
No Matches
utils Namespace Reference

Classes

class  bcolors
 

Functions

 print_as_error (message)
 
 print_as_warning (message)
 
 print_as_ok (message)
 
 print_as_success (message)
 
 load_json (filepath)
 
str to_macro_name (str name)
 
 get_git_hash ()
 
 get_layout_hash (message)
 
 get_jinja_env ()
 
 render_template (env, template_name, output_path, **context)
 

Variables

 BASE_DIR = Path(__file__).parent.parent
 
str SCHEMA_DIR = BASE_DIR / 'schema'
 
str CONFIG_DIR = BASE_DIR / 'configs'
 
str NODE_CONFIG_DIR = CONFIG_DIR / 'nodes'
 
str EXTERNAL_NODE_CONFIG_DIR = CONFIG_DIR / 'external_nodes'
 
str GENERATED_DIR = BASE_DIR / 'generated'
 
str DBC_DIR = BASE_DIR / 'dbc'
 
str BUS_CONFIG_PATH = CONFIG_DIR / 'system' / 'bus_configs.json'
 
str COMMON_TYPES_CONFIG_PATH = CONFIG_DIR / 'system' / 'common_types.json'
 
dict CTYPE_SIZES
 

Detailed Description

utils.py

Author: Irving Wang (irvingw@purdue.edu)

Function Documentation

◆ get_git_hash()

utils.get_git_hash ( )
Returns the short git hash of the current commit

◆ get_jinja_env()

utils.get_jinja_env ( )

◆ get_layout_hash()

utils.get_layout_hash ( message)
Calculates a fingerprint hash for a message layout

◆ load_json()

utils.load_json ( filepath)
Load JSON file

◆ print_as_error()

utils.print_as_error ( message)

◆ print_as_ok()

utils.print_as_ok ( message)

◆ print_as_success()

utils.print_as_success ( message)

◆ print_as_warning()

utils.print_as_warning ( message)

◆ render_template()

utils.render_template ( env,
template_name,
output_path,
** context )

◆ to_macro_name()

str utils.to_macro_name ( str name)

Variable Documentation

◆ BASE_DIR

utils.BASE_DIR = Path(__file__).parent.parent

◆ BUS_CONFIG_PATH

str utils.BUS_CONFIG_PATH = CONFIG_DIR / 'system' / 'bus_configs.json'

◆ COMMON_TYPES_CONFIG_PATH

str utils.COMMON_TYPES_CONFIG_PATH = CONFIG_DIR / 'system' / 'common_types.json'

◆ CONFIG_DIR

str utils.CONFIG_DIR = BASE_DIR / 'configs'

◆ CTYPE_SIZES

dict utils.CTYPE_SIZES
Initial value:
1= {
2 "uint8_t": 8, "int8_t": 8,
3 "uint16_t": 16, "int16_t": 16,
4 "uint32_t": 32, "int32_t": 32,
5 "uint64_t": 64, "int64_t": 64,
6 "float": 32,
7 "bool": 1
8}

◆ DBC_DIR

str utils.DBC_DIR = BASE_DIR / 'dbc'

◆ EXTERNAL_NODE_CONFIG_DIR

str utils.EXTERNAL_NODE_CONFIG_DIR = CONFIG_DIR / 'external_nodes'

◆ GENERATED_DIR

str utils.GENERATED_DIR = BASE_DIR / 'generated'

◆ NODE_CONFIG_DIR

str utils.NODE_CONFIG_DIR = CONFIG_DIR / 'nodes'

◆ SCHEMA_DIR

str utils.SCHEMA_DIR = BASE_DIR / 'schema'