From 35c88dd939b9276d8edd3939254385a0f485da12 Mon Sep 17 00:00:00 2001 From: Ronald Caesar Date: Mon, 12 Jan 2026 18:56:01 -0400 Subject: [PATCH] ir: add initial ir translation module Signed-off-by: Ronald Caesar --- include/bal_types.h | 1 + src/bal_translator.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/bal_translator.h diff --git a/include/bal_types.h b/include/bal_types.h index 1c2323c..0381b8a 100644 --- a/include/bal_types.h +++ b/include/bal_types.h @@ -10,6 +10,7 @@ typedef uint64_t bal_instruction_t; typedef uint16_t bal_instruction_count_t; +typedef uint16_t bal_ssa_id_t; typedef uint8_t bal_bit_width_t; typedef enum diff --git a/src/bal_translator.h b/src/bal_translator.h new file mode 100644 index 0000000..4d298b5 --- /dev/null +++ b/src/bal_translator.h @@ -0,0 +1,31 @@ +/** @file bal_translator.h + * + * @brief ARM to Ballistic IR Translation Interface. + * + * @details + * + * This module represents the frontend of Ballistic. It performas the following + * in a single pass: + * + * 1. Fetch + * 2. Decode + * 3. SSA Construction + */ + +#ifndef BAL_TRANSLATOR_H +#define BAL_TRANSLATOR_H + +#include "bal_engine.h" +#include "bal_types.h" + +typedef struct +{ + bal_instruction_t *instructions; + bal_bit_width_t *ssa_bit_widths; + bal_source_variable_t *source_variables; + size_t instruction_count; +} bal_translation_context_t; + +#endif /* BAL_TRANSLATOR_H */ + +/*** end of file ***/