bringing the power of eclipse to digital hardware designers (eclipsecon 2012)
DESCRIPTION
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. http://www.eclipsecon.org/2012/sessions/bringing-power-eclipse-digital-hardware-designersTRANSCRIPT
Bringing the power of Eclipse to Digital
Hardware designersHendrik EeckhautMark ChristiaensLieven Lemiengre
2
Eclipse
3
• Navigation
• Autocomplete
• Real-time errors
• Quick-assist/fix
• Refactoring
• Navigation
• Autocomplete
• Real-time errors
• Quick-assist/fix
• Refactoring
• Text based
• Syntax books
• Scroll through logs
• Stare at code
• Live with ugly code
5
hardware development toolkit
Bring power of Eclipse to Digital Hardware Designers
VHDL
• Efficient 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
VHSIC (Very High Speed Integrated Circuit) Hardware Description Language
Verbose
8
Irregular syntax
9
Long feedback loops
10
11
• Efficient and robust way to design HW
• You can build cool stuff
• Custom cpu’s, Mars rovers, ...
• A good IDE can resolve most issues
Not everything is negative!
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 fit for ?
• Xtext looks like perfect fit:• navigation
• type time syntax checking
• linting and quick-fixes
• formatting
• But: Powerful enough for VHDL?
13
Grammar
• navigation
• type time syntax checking
• linting and quick-fixes
• formatting
Demo
Xtext experience
15
Results
Effort
EMFAntlr
Guice
Xtext
Eclipse
• Grammar
• Scoping
• UI
• Autocomplete
• Formatting
• Testing
• Performance
• Validation
Overview
Lessons learnt ?
16
• Grammar
• Scoping
• UI
• Autocomplete
• Formatting
• Testing
• Performance
• Validation
• Grammar
• Scoping
• UI
• Autocomplete
• Formatting
• Testing
• Performance
• Validation
Grammar
• Lexer: No problems(We had ANTLR grammar to start from)
• Parser: No semantic predicates
• Keep track of the number/size of objects that are created
17
Grammar
• Grammar
• Scoping
• UI
• Autocomplete
• Formatting
• Testing
• Performance
• Validation
Scoping
• A lot harder than expected
• Difficult to debug (declarative approach, lazy evaluation)
• Some corner cases continue to pop up
18
Scoping
• Grammar
• Scoping
• UI
• Autocomplete
• Formatting
• Testing
• Performance
• Validation
User Interface
• Works as expected : outline, preferences, templates, folding, (syntax and semantic) highlighting
• Xtext team keeps adding nice improvements
• Some scalability issues: Large files are problematic in UI (n2 problems)
19
UI
• Grammar
• Scoping
• UI
• Autocomplete
• Formatting
• Testing
• Performance
• Validation
Autocomplete
• grammar/scope information is not enough for VHDL autocomplete• too many suggestions because of
generic grammar (no type information, ... )
• strange behavior because of backtracking parser
• Most VHDL autocompletes are manually designed
20
Autocomplete
• Grammar
• Scoping
• UI
• Autocomplete
• Formatting
• Testing
• Performance
• Validation
Formatting
• A lot cleaner to implement than what e.g. Emacs does
• Priority of rules not always clear
• Custom extension for vertical alignment
21
Formatting
• Grammar
• Scoping
• UI
• Autocomplete
• Formatting
• Testing
• Performance
• Validation
Testing
• Xtext itself contains good starting points
• Dependency injection (Guice) makes it easy to test
• Most tests can run as simple unit tests (with Eclipse workbench)
22
Testing
• Grammar
• Scoping
• UI
• Autocomplete
• Formatting
• Testing
• Performance
• Validation
Performance
23
• Xtext continuously improves
• Sigasi patches:• Parallel loading (#358714)
• Model Caching (#359824)
• Memory usage OK
Performance
• Grammar
• Scoping
• UI
• Autocomplete
• Formatting
• Testing
• Performance
• Validation
Validation
• Good framework to add validation checks
• Watch out for resource loading
• Custom configurable severities
24
• Validation
Conclusions
• Xtext is really powerful technology
• Gives great architecture/structure
• Getting started is easy
• But... still a lot of work
• Devil is in the details
25