Friday, 27 April 2012

Two Modelsim Tips You Should Know

Analogue Waveforms

Modelsim can display a signal in your VHDL/Verilog design as an analogue signal. One use for this is when you want to visualise the output of a digital to analogue converter to see if you have synthesised the waveform as you intended. To do this you can right-click on the signal name in the Wave window and select it's properties. Switch to the Format tab and select 'Analogue'. You can optionally set a maximum value for the signal so that Modelsim can stretch your waveform to fit the height of the row. For example, set it to 255 for an 8-bit DAC value.

Vi/Emacs Editor

You can tell Modelsim to use the key-bindings from your favourite editor (by which I mean Vi or Emacs). Do this by drilling down the Tools > Preferences > Text editor menus until you get to the option for switching from normal to Vi or Emacs key-bindings. The good news is it is slightly better than using normal mode. The bad news is, for Vi at least, many of the features are missing, probably because I'm used to using Vim. Search, file operations and the basic editing commands are all there, but it feels like an emulation rather than the real thing. My recommendation is to carry on using your favourite external editor by default and only use the Modelsim editor for minor changes.



No comments: