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

Classes

class  Bus
 
class  BusView
 
class  Fault
 
class  FaultModule
 
class  Message
 
class  Node
 
class  RxMessage
 
class  Signal
 
class  SystemContext
 

Functions

SystemContext create_system_context (nodes, mappings, bus_configs, custom_types)
 
Dict load_custom_types ()
 
str baud_rate_label (str bus_name, int baud_rate)
 
Dict load_bus_configs ()
 
List[Nodeparse_all ()
 
 validate_node (Node node, Dict custom_types)
 
Optional[str] _priority_period_convention_warning_reason (Message msg)
 
None warn_priority_period_convention (Node node, Bus bus, Message msg)
 
Signal parse_signal (Dict data)
 
Message parse_message (Dict data, Dict bus_config)
 
RxMessage parse_rx_message (Dict data)
 
'Faultparse_fault (Dict data)
 
Dict _require_bus_in_system (str bus_name, Dict bus_configs, str where)
 
None _rx_msg_names_unique (str bus_name, List[Dict] rx_items)
 
Bus parse_bus (str name, Dict data, Dict bus_configs, str where)
 
Node parse_internal_node (Path filepath, Dict bus_configs)
 
Node parse_external_node (Path filepath, Dict bus_configs)
 

Variables

dict BAUD_RATE_LABELS
 

Detailed Description

parser.py

Author: Irving Wang (irvingw@purdue.edu)

Function Documentation

◆ _priority_period_convention_warning_reason()

Optional[str] parser._priority_period_convention_warning_reason ( Message msg)
protected
Return the priority-period convention warning reason, if one applies.
Here is the caller graph for this function:

◆ _require_bus_in_system()

Dict parser._require_bus_in_system ( str bus_name,
Dict bus_configs,
str where )
protected
Ensure bus_name exists in bus_configs.json so ID mode / baud / schema stay consistent.
Here is the caller graph for this function:

◆ _rx_msg_names_unique()

None parser._rx_msg_names_unique ( str bus_name,
List[Dict] rx_items )
protected
Reject duplicate msg_name in rx on the same bus (would break generated switch/cases).
Here is the caller graph for this function:

◆ baud_rate_label()

str parser.baud_rate_label ( str bus_name,
int baud_rate )
Here is the caller graph for this function:

◆ create_system_context()

SystemContext parser.create_system_context ( nodes,
mappings,
bus_configs,
custom_types )
Aggregates all system data into a single context object and performs final validation.

◆ load_bus_configs()

Dict parser.load_bus_configs ( )
Load bus configurations from bus_configs.json and attach each bus's baud rate enum label.
Here is the call graph for this function:

◆ load_custom_types()

Dict parser.load_custom_types ( )
Load custom types from common_types.json

◆ parse_all()

List[Node] parser.parse_all ( )
Parse all configuration files into Node objects.
Performs semantic validation during parsing.
Here is the call graph for this function:

◆ parse_bus()

Bus parser.parse_bus ( str name,
Dict data,
Dict bus_configs,
str where )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_external_node()

Node parser.parse_external_node ( Path filepath,
Dict bus_configs )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_fault()

'Fault' parser.parse_fault ( Dict data)
Here is the caller graph for this function:

◆ parse_internal_node()

Node parser.parse_internal_node ( Path filepath,
Dict bus_configs )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_message()

Message parser.parse_message ( Dict data,
Dict bus_config )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_rx_message()

RxMessage parser.parse_rx_message ( Dict data)
Here is the caller graph for this function:

◆ parse_signal()

Signal parser.parse_signal ( Dict data)
Here is the caller graph for this function:

◆ validate_node()

parser.validate_node ( Node node,
Dict custom_types )
Run semantic validation and resolve bit layouts for a node
Here is the call graph for this function:
Here is the caller graph for this function:

◆ warn_priority_period_convention()

None parser.warn_priority_period_convention ( Node node,
Bus bus,
Message msg )
Warn when a message's period conflicts with the README priority convention.
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ BAUD_RATE_LABELS

dict parser.BAUD_RATE_LABELS
Initial value:
1= {
2 250000: "FDCAN_BAUD_250K",
3 500000: "FDCAN_BAUD_500K",
4 1000000: "FDCAN_BAUD_1M",
5}