This paper presents a transpiler framework for converting RTL pseudo code of the POWER Instruction Set Architecture (ISA) to C code, enabling its execution on the Cavatools simulator. The transpiler consists of a lexer and parser, which parse the RTL pseudo code and generate corresponding C code representations. The lexer tokenizes the input code, while the parser applies grammar rules to build an abstract syntax tree (AST). The transpiler ensures compatibility with the Cavatools simulator by generating C code that adheres to its requirements. The resulting C code can be executed on the Cavatools simulator, allowing developers to analyze the instruction-level performance of the Power ISA in real time. The proposed framework facilitates the seamless integration of RTL pseudo code into the Cavatools ecosystem, enabling comprehensive performance analysis and optimization of Power ISA-based code.
翻译:本文提出了一种转译器框架,用于将POWER指令集架构(ISA)的RTL伪代码转换为C代码,使其能够在Cavatools模拟器上执行。该转译器由词法分析器和语法分析器组成,负责解析RTL伪代码并生成对应的C代码表示。词法分析器对输入代码进行词法标记化,而语法分析器则应用语法规则构建抽象语法树(AST)。转译器通过生成符合Cavatools模拟器要求的C代码,确保与其兼容性。生成的C代码可在Cavatools模拟器上执行,从而使开发者能够实时分析POWER ISA的指令级性能。所提出的框架促进了RTL伪代码与Cavatools生态系统的无缝集成,为基于POWER ISA的代码提供了全面的性能分析与优化能力。