Bringing the power of Eclipse to Digital Hardware designers (EclipseCon 2012)
Digital hardware designers develop state-of-the-art chips that perform extremely complex tasks at high speeds. Sadly they rely on antiquated tools to create those very chip designs. The most popular design entry tool today is still Emacs...
To bring hardware designers up to speed with their software colleagues, Sigasi developed an Eclipse based IDE for VHDL, one of the major hardware design languages. Because very little hardware designers have experience with Eclipse, the VHDL plugin is primarily distributed as an RCP application: a customized Eclipse variant, especially targeted for hardware designers.
Sigasi 2.0 is built on top of Xtext: an Eclipse based framework for the creation of domain specific languages (DSL). While you could consider VHDL to be a DSL, it has all shortcomings of arcane languages and none of the elegance of a modern DSL. Fitting all peculiarities of a 20 year old language (based on ADA) in the Xtext framework is a daunting task.
In this talk we present our experience and lessons learnt while implementing VHDL in Xtext. Especially scoping, autocomplete and formatting turned out to be really challenging.
• Navigation • Text based• Autocomplete • Syntax books• Real-time errors • Scroll through logs• Quick-assist/ﬁx • Stare at code• Refactoring • Live with ugly code 5
hardware development toolkitBring power of Eclipse to Digital Hardware Designers
VHDL VHSIC (Very High Speed Integrated Circuit) Hardware Description Language• Efﬁcient and robust way to design HW• 20 year old language (based on Ada)• But all shortcomings of arcane languages • lots of noise • limited expressiveness • irregular • most designers use small subset • ... 7
Not everything is negative!• Efﬁcient and robust way to design HW• You can build cool stuff • Custom cpu’s, Mars rovers, ...• A good IDE can resolve most issues 11
Sigasi 1.0• ANTLR-based Eclipse plugin• Proved business value• But: • Lots of prototype code • Type time compilation • Memory usage • Better architecture required 12
Perfect ﬁt for ?• Xtext looks like perfect ﬁt: • navigation • navigation • • type time syntax checking type time syntax checking Grammar • • linting and quick-ﬁxes linting and quick-ﬁxes • formatting • formatting• But: Powerful enough for VHDL? 13
Grammar• Grammar• Scoping• UI• Autocomplete • Lexer: No problems• Formatting (We had ANTLR grammar to start from)• Testing • Parser: No semantic predicates• Performance• Validation • Keep track of the number/size of objects that are created 17
Scoping• Grammar• Scoping• UI• Autocomplete • A lot harder than expected• Formatting • Difﬁcult to debug (declarative• Testing approach, lazy evaluation)• Performance• Validation • Some corner cases continue to pop up 18
User Interface• Grammar• Scoping • Works as expected : outline,• UI preferences, templates, folding,• Autocomplete (syntax and semantic)• Formatting highlighting• Testing • Xtext team keeps adding nice• Performance improvements• Validation • Some scalability issues: Large ﬁles are problematic in UI (n 2 problems) 19
Autocomplete• Grammar• Scoping • grammar/scope information is not• UI enough for VHDL autocomplete• Autocomplete • too many suggestions because of• Formatting generic grammar (no type• Testing information, ... )• Performance • strange behavior because of• Validation backtracking parser • Most VHDL autocompletes are manually designed 20
Formatting• Grammar• Scoping• UI • A lot cleaner to implement than• Autocomplete what e.g. Emacs does• Formatting • Priority of rules not always clear• Testing • Custom extension for vertical• Performance alignment• Validation 21
Testing• Grammar• Scoping• UI • Xtext itself contains good• Autocomplete starting points• Formatting• Testing • Dependency injection (Guice)• Performance makes it easy to test• Validation • Most tests can run as simple unit tests (with Eclipse workbench) 22