Genesis2 Mode for Emacs/Xemacs at Stanford

4 views
Skip to first unread message

Stephen Richardson

unread,
Oct 9, 2012, 6:03:52 PM10/9/12
to genesis...@googlegroups.com
Instructions for using Genesis2 mode for emacs at Stanford.  If you're not at Stanford, see the Wiki instructions at 
http://genesis2.stanford.edu/mediawiki/index.php/Genesis2#Setting_Genesis2_Mode_for_Emacs.2FXemacs

Some of you were inquiring about Genesis2 mode for emacs.  It's far from perfect, but if you want to try it out, here's the 4-1-1:

Setting Genesis2 Mode for Emacs/Xemacs at Stanford

If you use emacs or xemacs and would like to use genesis2-mode, run the "mmm-install.csh" command, which will install new code in your .emacs and/or .xemacs/init.el file(s):

  % $CHIPGEN/elisp/mmm-install.csh

To activate Genesis2 mode you'll need to restart emacs or at least re-read the updated init file. Now, when you open a file with a Genesis2 extension (e.g. "myfile.vp"), this will automatically put you in Genesis2 mode.  Perl regions should parse as Perl and Verilog as Verilog.  The TAB character (^I) should indent the current line or region according to its mode (Perl or Verilog).

If you don't like genesis2 mode, you can just as easily make .vp files open in verilog mode, in which case perl lines will simply appear as comments.

==== In case of failure ====

Check your emacs init file(s) "~/.emacs" and/or "~/.xemacs/init.el" file to see if the following code got added correctly at the end.  Particularly check to see that the correct directory was added in place of "/home/mydir/myPerforcePath/ChipGen/elisp" and that e.g. "/home/mydir/myPerforcePath/ChipGen/elisp/mmm-genesis2-mode-init.el" exists is readable.

<pre>
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;; BEGIN genesis2-mode setup

  ;; mmm-dir tells emacs where to find the mmm directory and startup file
  (setq mmm-dir "/home/mydir/myPerforcePath/ChipGen/elisp")

  ;; Add mmm-dir and "mmm-dir/mmm-mode-0.4.8" to the load path
  (setq mmm-dir (expand-file-name mmm-dir)) ;; Turns e.g. "~/mmm" into "/home/myname/mmm"
  (setq load-path (cons  mmm-dir                           load-path))
  (setq load-path (cons (concat mmm-dir "/mmm-mode-0.4.8") load-path))

  ;; Load it up
  (load-library "mmm-genesis2-mode-init.el")

  ;; (Optional): Leaving submode-decoration at the default "1" value gives Perl a
  ;; lovely aquamarine bg maybe better suited to black-text-on-white-page displays
  ;; I set it to zero because I use white-text-on-black-page.
  (setq mmm-submode-decoration-level 1)
  (setq mmm-submode-decoration-level 0)

  ;; If you have trouble with quotes and indents in Perl regions,
  ;; try turning the following features on or off:
  ;; (fixquote-off-srmmm) ;; (Default is ON).
  ;; (fixindent-on-srmmm) ;; (Default is OFF).

  ;; END genesis2-mode setup
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</pre>

Stephen Richardson

unread,
Oct 18, 2012, 1:08:09 PM10/18/12
to genesis...@googlegroups.com
I think I fixed some of the more annoying problems with mmm genesis2 mode for emacs, in particular the problem where the screen jumped around every time you hit a TAB in a perl region.

To get the new version (Stanford) simply do a "p4 sync" and restart emacs (to reload the relevant $CHIPGEN/elisp/mmm-genesis* file).

Those of you who are off campus can get the latest version here:


Fontification still doesn't work in emacs single-window mode (-nw), don't really know why.  Zain (and/or others who care): how badly would you like this to be fixed?

Enjoy!
Steve


Reply all
Reply to author
Forward
0 new messages