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-designers
5. • Navigation • Text based
• Autocomplete • Syntax books
• Real-time errors • Scroll through logs
• Quick-assist/fix • Stare at code
• Refactoring • Live with ugly code
5
7. VHDL
VHSIC (Very High Speed Integrated Circuit) Hardware Description Language
• 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
11. Not everything is negative!
• Efficient and robust way to design HW
• You can build cool stuff
• Custom cpu’s, Mars rovers, ...
• A good IDE can resolve most issues
11
12. Sigasi 1.0
• ANTLR-based Eclipse plugin
• Proved business value
• But:
• Lots of prototype code
• Type time compilation
• Memory usage
• Better architecture required
12
13. Perfect fit for ?
• Xtext looks like perfect fit:
• navigation • navigation
• • type time syntax checking
type time syntax checking
Grammar
• • linting and quick-fixes
linting and quick-fixes
• formatting • formatting
• But: Powerful enough for VHDL?
13
17. 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
18. Scoping
• Grammar
• Scoping
• UI
• Autocomplete • A lot harder than expected
• Formatting
• Difficult to debug (declarative
• Testing
approach, lazy evaluation)
• Performance
• Validation
• Some corner cases continue to
pop up
18
19. 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
files are problematic in UI (n 2
problems)
19
20. 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
21. 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
22. 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
24. Validation
• Grammar
• Scoping
• UI
• Good framework to add
• Autocomplete
validation checks
• Formatting • Watch out for resource loading
• Testing
• Custom configurable severities
• Performance
• Validation
24
25. 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