Skip to main content

Module parser

Module parser 

Source
Expand description

DSL parsing for instruction definitions.

This module parses .chipi files (or source strings) into an intermediate representation. The parser handles:

  • Decoder configuration (name, width, bit order)
  • Type aliases for custom field types
  • Instruction definitions with fixed bit patterns and variable fields

Bit ranges are converted from DSL notation (where the order depends on bit_order config) to hardware notation (LSB=0) during validation.

Functionsยง

dsl_to_hardware
Convert DSL bit positions to hardware (LSB=0) positions with unit support.
parse
Parse DSL source text into a decoder definition.
parse_file
Parse a .chipi file from a path, resolving include directives relative to its directory.
parse_file_with_deps
Parse a .chipi file and return both the definition and the set of all resolved file paths (input + includes). Useful for cargo:rerun-if-changed.