170 likes | 279 Views
Hardware Extension to ECL Language EE249 Project Presentation. Yinghua Li (yinghua@ic.eecs) Huifang Qin (huifangq@eecs) Mentors: Ellen Sentovich Luciano Lavagno Roberto Passerrone. Outline. • Project description • Goal achieved • Implementation strategies • Conclusion.
E N D
Hardware Extension to ECL Language EE249 Project Presentation Yinghua Li (yinghua@ic.eecs) Huifang Qin (huifangq@eecs) Mentors: Ellen Sentovich Luciano Lavagno Roberto Passerrone
Outline • Project description • Goal achieved • Implementation strategies • Conclusion
reactive Esterel code data-dominated C code System Implementation What is ECL ? ECL: language for embedded system Specification, which conveniently supports specification of mixed control/data modules Compiler: splitting the source code can be robustly optimized and synthesized to either hardware or software must be implemented in software
Project Description Esterel HW extension is developed by Gerard Berry on 2000
Project Description To keep in pace with the Hardware Esterel, ECL language also need to be hardware extended – adding capabilities for RTL hardware modeling including bit vectors, matrices and equational notations to it.
Project Description Our Goal: Extend the ECL compiler to handle the hardware extensions proposed for the ECL enhancement.
Project Goal achieved • ECL Compiler HW Enhancement features implementation: • Always statement • Equations • Ports • Templates • Generate loops • Encodings • Arrays • Argument initialization • Registered types • Found a bug in the original ECL language Definition not clear yet at current stage. Decided to be left for later by the mentors
Why we need the new HW constructs? Contructs for signal grouping (for Bus interface in HW design) • Ports —— Grouping signals together • Array assignment—— Signal array value assignment • Generate loops—— Construct for grouped signal array operation Contructs implementing HW logic behavior in software • Always statement —— Achieving clock controlled synchronous operation (similar to process definition in VHDL programming) • Encodings—— Implementing encoding/decoding logic in HW design. • Registered types —— Implementing register behavior Contructs for more concise and convenient coding • Equations —— Adding short-cut expressions to emit statement • Argument initialization —— Initializing signals / variables in declaration • Templates —— Providing sub-models where the type and size of parameters can be modified in different calls
Approach for Compiler Enhancement Possible ways of adding new HW – ECL statements: • Make them equivalent to current ECL statements. During the parsing, parser detects these new statements and create corresponding objects from the original classes. • Create new types of statement or expression in ECL to handle the new constructs.
Approach for Compiler Enhancement Possible ways of adding new HW – ECL statements: • Make them equivalent to current ECL statements. During the parsing, parser detects these new statements and create corresponding objects from the original classes. e.g. new construct: Always { stmt; } translated to original stmtFor() in ECL output: for ( ; ; ) { stmt; } • Create new types of statement or expression in ECL to handle the new constructs.
Approach for Compiler Enhancement Possible ways of adding new HW – ECL statements: • Make them equivalent to current ECL statements. During the parsing, parser detects these new statements and create corresponding objects from the original classes. e.g. new construct: Always { stmt; } translated to original stmtFor() in ECL output: for ( ; ; ) { stmt; } • Create new types of statement or expression in ECL to handle the new constructs. e.g. Always { stmt; } New statement stmtAlways() is created still print out: for ( ; ; ) { stmt; }
Implementation Strategies of the New Constructs Direct translation – the new construct is directly expressed by the original statements in ECL • Always statement • Equations • Arrays assignment Translation with Tracing through module – the new construct information is stored in the parser tree throughout the parsing, then the translation is set as the output of the whole module. • Argument initialization • Registered types Unroll into separate elements • Signal arrays • Interfaces and records Pre-processing step – Use preprocessor to make the new constructs easier to handle • Generate loops • Templates
… … … … for ( ; ; ) { await();} … … … … Direct translation ECL Compiler ECL Code Esterel/C Code … … … … always { await();} … … … … Create stmtFor() Set for (null;null;null) {await() }; The new construct is directly expressed by the original statements in ECL • Always statement • Equations • Arrays assignment
Translation with Tracing through module Esterel/C Code ECL Compiler ECL Code Module A { Weak abort [ … … … … present a then emit next_b (12) end present; … … … … emit end_of_bar; || always b<=pre(next_b); ] when (end_of_bar) } Module A { … … … … present (a) {next (b,12);} … … … … } next_stmt_module * Module A { Translating … … … … Create stmtPre(emit next_b(12)) Translating … … … … } The new construct information is stored in the parser tree throughout parsing of the whole module, then the translation is set as the output of the module. • Argument initialization • Registered types
Unroll into Separate Elements ECL Code ECL Compiler Port Intf { input int x; output y; input value int foo; }; Module A (port Intf p, …){ port Intf t; … … … … emit(t.x, p.x +1 ); … … … … } Esterel/C Code Module A (input int p_x, output p_y,…){ signal int t_x;…. … … … … emit(t_x, p_x +1 ); … … … … } Unroll p, t input int p_x; output p_y; input value int p_foo; signal int t_x; signal p_y; signal value int p_foo; • Signal arrays • Interfaces and records
Pre-processing • Generate loops • Templates ECL Compiler Esterel/C Code ECL Code Module A (input int f_0, input int f_1,…){ … … … … await(); present(f_0) emit(f_1, 0); ……. await(); present(f_8) emit(f_9, 8); … … … … } Module A (input int f[10], …){ … … … … generate i < 9 await(); present(f[i]) emit(f[i+1], i); endgenerate … … … … } C preprocessor await(); present(f[0]) emit(f[0+1], 0); ……. await(); present(f[8]) emit(f[8+1], 8);
Conclusion • 8 HW–ECL enhancement features implemented successfully. Thus the body of HW-ECL is constructed. • Future work need to be done on extending the functionality of the features, improving the error tolerant ability, and implementing more new features. • We learned the language parser / compiler construction and Java coding skill from this project. • Big thanks for the generous help from our mentors.