Verilog Editors

You don't need to use the default ISE editor. You can use any editor you want: gedit, emacs, vim... anything. To change the ISE's default editor, go to "Edit" --> "Preferences" and click the "Editors" tab under "ISE General."

Click the radio button labeled "Editor:" that currently says "ISE Text Editor" and change it to "Custom."

Now in the "Command line syntax" window add the command you would use from the command line to launch your favorite editor, i.e. "gedit $1", "emacs $1" or similar. You have to include the "$1" as an argument since it will point to the path of the file.

You can easily auto-format your code to make it less ugly - especially for uploading and printing. Ugly/messy code makes everything harder and more confusing. It's pretty easy to avoid.

If you use Gedit, run this line in Athena to get an autoformatting plugin:

add 6.111 && mkdir -p ~/.config/gedit/tools/ && cp 
/mit/6.111/verilog-autoformat ~/.config/gedit/tools/ 

Ctrl-Shift-F now auto-formats your code.

If you use emacs, you're all set: C-x h TAB

Alternatively, you can use emacs from the command line to autoformat files. If you use bash, add the following line to the bottom of your ~/.bashrc_mine:

function vf {
 emacs --batch $1 -l /usr/share/emacs/23.2/lisp/progmodes/verilog-mode.elc --eval 
 "(progn (verilog-auto) (verilog-indent-buffer) (delete-trailing-whitespace) 
 (save-buffer))" > /dev/null 2&>1
}

If you use cshell, add the following line to the bottom of your ~/.cshrc_mine:

alias vf 'emacs --batch \!:1 -l 
/usr/share/emacs/23.2/lisp/progmodes/verilog-mode.elc --eval 
"(progn ( verilog-auto ) ( verilog-indent-buffer ) ( delete-trailing-whitespace )
( save-buffer ) ) " >& /dev/null'

If you're not sure which shell you're using, run echo $SHELL

If you're not sure which shell you're using, run echo $SHELL

An example of usage in each case: vf path/to/verilog_code.v Here's the raw command used in both cases:

emacs --batch /path/to/test_file.v -l 
/usr/share/emacs/23.2/lisp/progmodes/verilog-mode.elc 
--eval "(progn (verilog-auto) (verilog-indent-buffer) (delete-trailing-whitespace) 
(save-buffer))"

Credit to Dylan Sherry MIT '12