Skip to main content

Crate chipi_core

Crate chipi_core 

Source
Expand description

§chipi-core

Core library for the chipi instruction decoder generator.

§Crate structure

  • parser: parses .chipi instruction-spec files into a raw AST. See types::DecoderDef.
  • validate: validates and lowers the AST into a language-agnostic IR. See types::ValidatedDef.
  • tree: builds an optimal decision tree for instruction dispatch.
  • backend: language-specific code generation backends.
  • config: internal generation and dispatch config types.
  • codegen: Rust decoder/disassembler code generation.
  • lut_gen: Rust emulator dispatch LUT generation.
  • instr_gen: Rust instruction newtype generation.
  • bindings: parser and lowerer for *.bindings.chipi configs.

Re-exports§

pub use config::Dispatch;

Modules§

backend
Code generation backends.
bindings
*.bindings.chipi configuration format.
codegen
Rust code generation from validated definitions and decision trees.
codegen_binja
Binary Ninja Architecture plugin code generation.
codegen_cpp
C++ code generation from validated definitions and decision trees.
codegen_ida
IDA Pro processor module code generation.
codegen_python
Shared Python code generation helpers.
config
Internal configuration types consumed by the code generation pipeline.
error
Error types and reporting for parsing and validation.
format_parser
Character-level parser for format string internals.
instr_gen
Instruction type generation - produces a newtype with field accessor methods.
lut_gen
Function-pointer LUT generation. Consumes a validated definition and a dispatch tree.
parser
DSL parsing for instruction definitions.
tree
Decision tree construction for optimal instruction dispatch.
types
Core type definitions for the intermediate representation.
validate
Semantic validation for instruction definitions.

Functions§

generate_from_str
Parse source text and generate Rust decoder code. Returns the generated Rust code as a String.
parse
Parse a .chipi file from a file path and return the decoder definition.
parse_str
Parse source text directly without reading from a file.