VHDL and Emacs (My experience)

M

mans

Hello,

I am new in VHDL and Emacs and I tried to use Emacs for editing VHDL
and attaching it to ISE. My experience is as follow:



Overall:



Emacs has a very good editor for VHDL editing. It has several good features
such as auto indentation and syntax highlighting. Over all it is very good
if you can use it (I could not!)



What I did:

I download my copy of Emacs from
http://www.ourcomments.org/Emacs/EmacsW32.html . I installed it in my
windows XP professional system and setup ISE to use it. It works well with
ISE.



Problems that I had:



1- Its keyboard shortcuts are not windows based. I tried to configure
wmacsw32 without any success.

2- It is very slow to start ( I didn't use emacs clinets)

3- I read that you can see a hierarchy of your VHDL code, but I can not
turn it on (I don't know how to turn it on!).

4- I can not find any documentation on facilities which are available
in VHDL mode.

5- Some times when I try to click on VHDL menu, this menu item
disappears!



Best regards



Ps: Does Eclipse support VHDL?
 
M

Mike Treseler

mans wrote:

1- Its keyboard shortcuts are not windows based.

True, but the the arrow keys, and mouse, and menus
work without knowing any shortcuts.
2- It is very slow to start ( I didn't use emacs clinets)

True. I just leave it running all day.
3- I read that you can see a hierarchy of your VHDL code, but I can not
turn it on (I don't know how to turn it on!).

That requires vhdl-mode and speedbar.
vhdl-mode.el is not included in most windows distributions,
get it here:
http://www.iis.ee.ethz.ch/~zimmi/emacs/vhdl-mode.html
Ps: Does Eclipse support VHDL?

Not like it support Java.


-- Mike Treseler
 
G

Gerhard Hoffmann

I am new in VHDL and Emacs and I tried to use Emacs for editing VHDL
and attaching it to ISE. My experience is as follow:

I did the same with gvim. Works nicely. (please not another vi/emacs war!)

But one this is annoying: If I ask ISE for a syntax check etc, the first thing it does
is to kill all editor processes it has started. That's bad because some editors may
contain a changed file that is not yet written back or even may be editing something
completely unrelated in the meantime.

I usually have a lot of files open: the file with the entity, instantiation,
global constants, test bed...

Is there a switch I may have missed?

regards, Gerhard
 
M

mans

Thanks for telling us about the problems so we may try to get them fixed.

Thank you for helping me to solve the problem.
Can you please tell me what you did and how it failed? There is a quick
setup for those things if you use the menus:

Options - Customize EmacsW32 ...

I did use this option and it didn't work for me. I set the CUA in option and
it is working. One point that probably confuse people is that even in this
case, the short cuts in edit menu is not C-x and C-c and so on.

You should use EmacsClient and only start Emacs once.

Making it easy to get started using EmacsClient is one of the main things
the installer for Emacs+EmacsW32 is trying to help you with. Several
shortcuts gets installed that lets you start Emacs through EmacsClient.
There is one in the start menu and you get one in the SendTo menu. If you
prefer working from the command line there is a command line script called
e.cmd for this.

If you use the patched version then Emacs server gets started
automatically through those shortcuts and or the command line scripts.
(For the unpatched version you have to start Emacs server yourself, please
read the Emacs manual.)



I think I don't have the patched version. I will try to see what I can do
with this but as long as I am not closing emacs after each edit, I don't
need to restart it. I am happy!

Can you please describe this more? Exactly when does this happen?



It happens before to me but it is working well now. I will post the details
if it happens again to me.





More on new and old problems that I have:



1- I can set speedbar and used it. It is a very useful facility. The problem
is that I can not dock it into emacs. Is there any way to dock it into emacs
so it doesn't start as a new window?

2- If I have a file that I modified with ISE, when I open it with Emacs, I
can see a ^M at the end of each line. This generates error during
indentation. I could not find any way to fix it. I only can remove them
manually which is time consuming. Any way to do this in emacs or ISE or by
any other tools?



One suggestion:

As during editing, it is possible to edit several files, is there any way
to save all files just by pressing a button on toolbar or a menu item?



My view of emacs for editing VHDL is no changed and I am very happy to use
it with VHDL.



Best regards and thanks for helping to use emacs.
 
J

JK

Thank you for helping me to solve the problem.






I did use this option and it didn't work for me. I set the CUA in option and
it is working. One point that probably confuse people is that even in this
case, the short cuts in edit menu is not C-x and C-c and so on.











I think I don't have the patched version. I will try to see what I can do
with this but as long as I am not closing emacs after each edit, I don't
need to restart it. I am happy!



It happens before to me but it is working well now. I will post the details
if it happens again to me.

More on new and old problems that I have:

1- I can set speedbar and used it. It is a very useful facility. The problem
is that I can not dock it into emacs. Is there any way to dock it into emacs
so it doesn't start as a new window?

2- If I have a file that I modified with ISE, when I open it with Emacs, I
can see a ^M at the end of each line. This generates error during
indentation. I could not find any way to fix it. I only can remove them
manually which is time consuming. Any way to do this in emacs or ISE or by
any other tools?

One suggestion:

As during editing, it is possible to edit several files, is there any way
to save all files just by pressing a button on toolbar or a menu item?

My view of emacs for editing VHDL is no changed and I am very happy to use
it with VHDL.

Best regards and thanks for helping to use emacs.- Hide quoted text -

- Show quoted text -

I downloaded emacs - windows version from http://www.ourcomments.org/cgi-bin/emacsw32-dl-latest.pl
(Download Latest EmacsW32 + Emacs patched).
It supports vhdl mode. Its really good. You can give a try.

JK
I
 
M

mans

JK said:
I downloaded emacs - windows version from
http://www.ourcomments.org/cgi-bin/emacsw32-dl-latest.pl
(Download Latest EmacsW32 + Emacs patched).
It supports vhdl mode. Its really good. You can give a try.

JK
I

If you use it with ISE, would you please tell me how did you setup ISE to
use it?
In my setup, emacs is runs every time and also when I click on an error in
ISE, it can not bring me to the specific line in the source code.

Best regards
 
J

JK

If you use it with ISE, would you please tell me how did you setup ISE to
use it?
In my setup, emacs is runs every time and also when I click on an error in
ISE, it can not bring me to the specific line in the source code.

Best regards- Hide quoted text -

- Show quoted text -

No, I am not using Emacs with ISE. For Design Entry I am using
Emacs32 only and in this, I set Compiler as Modelsim.
So, once I complete my coding, I do compilation in Emacs32 itself to
check syntax errors if any.

Regards,
JK
 
J

JussiJ

mans said:
Over all it is very good if you can use it (I could not!)

You could try the Zeus for Windows IDE:

http://www.zeusedit.com
NOTE: Zeus is shareware.

It should be easy enough to configure Zeus for VHDL.

FWIW the next Zeus release will come with better configuration
for VHDL and will also add code folding for the VHDL language.
Problems that I had:

1- Its keyboard shortcuts are not windows based. I tried
to configure wmacsw32 without any success.

The Zeus keyboard is Windows aware and is also fully configurable.
2- It is very slow to start ( I didn't use emacs clinets)

Generally Zeus will load in less than a second.
3- I read that you can see a hierarchy of your VHDL code, but I
can not turn it on (I don't know how to turn it on!).

Zeus provides code hierarchy via the information provided by
the ctags utility.

I am not sure if ctags supports VHDL, but if it does this information
should apear in the class panel of the navigator.

Cheers Jussi Jumppanen
Author: Zeus for Windows IDE
 
M

Marcus Harnisch

mans said:
Emacs has a very good editor for VHDL editing. It has several good features
such as auto indentation and syntax highlighting. Over all it is very good
if you can use it (I could not!)

This sounds like a good start. Don't let yourself get discouraged.
1- Its keyboard shortcuts are not windows based. I tried to configure
wmacsw32 without any success.

Personally, I use XEmacs (Linux, Win32 native) which might be a little
different. Here, the old-school windows shortcuts for copy/paste do work
(C-Insert, S-Insert, etc.). The others, C-c in particular won't and I
would not recommend changing the mappings. pc-select mode gives you
the selection behavior using S-right/left/up/down (cursor keys).
2- It is very slow to start ( I didn't use emacs clinets)

Depends on what your config file looks like. I'd consider using the
clients.
3- I read that you can see a hierarchy of your VHDL code, but I can not
turn it on (I don't know how to turn it on!).

You will have to load a package called "speedbar". If that has not
been installed already you can get it from
http://cedet.sourceforge.net/
4- I can not find any documentation on facilities which are available
in VHDL mode.

In VHDL mode type: C-c C-h
5- Some times when I try to click on VHDL menu, this menu item
disappears!

Dunno.

Regards
-- Marcus

note that "property" can also be used as syntaxtic sugar to reference
a property, breaking the clean design of verilog; [...]

(seen on http://www.veripool.com/verilog-mode_news.html)
 
R

Robert Thorpe

2- If I have a file that I modified with ISE, when I open it with Emacs, I
can see a ^M at the end of each line. This generates error during
indentation. I could not find any way to fix it. I only can remove them
manually which is time consuming. Any way to do this in emacs or ISE or by
any other tools?

That indicates that your file is stored with odd line endings.

Generally there are two styles of line ending, "Carriage Return" +
"Line Feed" CRLF which is used in MSDOS. And simple Line-Feed (LF)
endings, used in Unix and now in Windows.

What Emacs does is to read the file and find out which sort of endings
are in use and automatically default to the right ones. The problem
here is likely that you are saving the file with LF endings and
opening it again with ISE which uses CRLF endings. Emacs doesn't
expect the endings to change as you edit the file.

The solution is probably to open and save the files initially using
CRLF endings. So, to fix this open up your file using Emacs and type
C-x RET f "dos" RET. Or select the menu Options->Mule->Set coding
systems->For Saving this Buffer.

Post again if doing the above doesn't work.
 
A

Andy

mans said:
Emacs has a very good editor for VHDL editing. It has several good features
such as auto indentation and syntax highlighting. Over all it is very good
if you can use it (I could not!)

This sounds like a good start. Don't let yourself get discouraged.
1- Its keyboard shortcuts are not windows based. I tried to configure
wmacsw32 without any success.

Personally, I use XEmacs (Linux, Win32 native) which might be a little
different. Here, the old-school windows shortcuts for copy/paste do work
(C-Insert, S-Insert, etc.). The others, C-c in particular won't and I
would not recommend changing the mappings. pc-select mode gives you
the selection behavior using S-right/left/up/down (cursor keys).
2- It is very slow to start ( I didn't use emacs clinets)

Depends on what your config file looks like. I'd consider using the
clients.
3- I read that you can see a hierarchy of your VHDL code, but I can not
turn it on (I don't know how to turn it on!).

You will have to load a package called "speedbar". If that has not
been installed already you can get it from
http://cedet.sourceforge.net/
4- I can not find any documentation on facilities which are available
in VHDL mode.

In VHDL mode type: C-c C-h
5- Some times when I try to click on VHDL menu, this menu item
disappears!

Dunno.

Regards
-- Marcus

note that "property" can also be used as syntaxtic sugar to reference
a property, breaking the clean design of verilog; [...]

(seen onhttp://www.veripool.com/verilog-mode_news.html)

I use xemacs with cua mode and it handles most of the windows
shortcuts (including C-c, C-x and C-v). I had to set another couple of
options to get it to treat the selected text as "pending delete" too.
I just wish there was a handy way to select a word or phrase in the
code and then search for other occurrences of it, with minimal
additional typing. There probably is, but I just don't know it yet!

If you really cannot stomach the rest of the emacs wizardy, try jGrasp
(free) from University of Auburn. It has very good highlighting and
indentation (it does not autocapitalize). It also can insert Control
Structure Diagram (CSD) graphics in the left margin/whitespace
including buttons for collapsing/expanding code segments, etc. Mousing
over the appropriate CSD graphic then shows you the top of that
control structure (process/loop/if-then/case, etc), and if it was off
screen, it temporarily shows it on the top row. It uses java and is
portable between unix/linux and windows, but it is not slow like some
other java based editors.

Andy
 
M

Martin Thompson

Andy said:
I use xemacs with cua mode and it handles most of the windows
shortcuts (including C-c, C-x and C-v). I had to set another couple of
options to get it to treat the selected text as "pending delete" too.
I just wish there was a handy way to select a word or phrase in the
code and then search for other occurrences of it, with minimal
additional typing. There probably is, but I just don't know it yet!

Hi Andy,

Does C-s, M-y do what you want?

This calls up a search and pastes your previous copy into it. I have
C-s bound to isearch-forward, which may be non-default. C-s might be
a normal (non-incremental) search, in which case, C-s, C-y might do
the trick?

Alternatively, "M-x occur" is useful, it opens another window listing
which lines a particular phrase (well, regexp) occurs in. If you
like it, bind a key for that too :)

I also have a key bound to mark and copy the word/signalname/etc that
is under the cursor, all in one go. which is quite handy for these
sorts of things...

Cheers,
Martin
 
A

Andy

Hi Andy,

Does C-s, M-y do what you want?

This calls up a search and pastes your previous copy into it. I have
C-s bound to isearch-forward, which may be non-default. C-s might be
a normal (non-incremental) search, in which case, C-s, C-y might do
the trick?

Alternatively, "M-x occur" is useful, it opens another window listing
which lines a particular phrase (well, regexp) occurs in. If you
like it, bind a key for that too :)

I also have a key bound to mark and copy the word/signalname/etc that
is under the cursor, all in one go. which is quite handy for these
sorts of things...

Cheers,
Martin

None of the above worked. Highlighted text when you're typing in the i-
search pattern is a different color than text selected with the mouse
or shift-arrow keys.

Pasting does not seem to work in i-search (C-s).

I am pretty much a neophyte with emacs yet, so thanks for the hints!

Andy
 
B

Ben Jones

Andy said:
None of the above worked. Highlighted text when you're typing in the i-
search pattern is a different color than text selected with the mouse
or shift-arrow keys.
Pasting does not seem to work in i-search (C-s).

Tsk. It's been said before and it'll be said again: "Emacs has just about
every feature you could possibly want from an operating system. Now all it
needs is a decent editor..." :)

-Ben-
 
M

Mike Treseler

Andy said:
I had to set another couple of
options to get it to treat the selected text as "pending delete" too.

I do that with query-replace.
I just wish there was a handy way to select a word or phrase in the
code and then search for other occurrences of it, with minimal
additional typing. There probably is, but I just don't know it yet!

Like most tasks, it's easy once you know how to do it :)

C-s

Then type enough letters to see the instances light up.

C-s again to jump to the next instance, etc.

-- Mike Treseler
 
A

Andy

I do that with query-replace.


Like most tasks, it's easy once you know how to do it :)

C-s

Then type enough letters to see the instances light up.

C-s again to jump to the next instance, etc.

-- Mike Treseler

Mike,

Thanks, but I already know how to use C-s (that's what I end up
using). Unfortunately, it still requires me to type the word (or
enough of it to be sufficiently unique) to start the search. I was
looking for something that allows me to select an existing word,
usually a port or signal/variable name (with mouse or keyboard), and
search for other occurrences of that word. Typing the entire word gets
tedious when using long names with specific suffixes, which require
that virtually the entire name be re-typed. When in I-search (C-s), a
C-v (paste) does not act like I typed it, but actually inserts the
copy buffer at the cursor location. It's like the C-v operation
overrides the fact that one is already in I-search mode.

Andy
 
M

Mike Treseler

Andy said:
I was
looking for something that allows me to select an existing word,
usually a port or signal/variable name (with mouse or keyboard), and
search for other occurrences of that word. Typing the entire word gets
tedious when using long names with specific suffixes, which require
that virtually the entire name be re-typed.

I would just mark with the mouse then, C-s
and paste into the mini-buffer with
the center mouse key. Then C-s, C-s, ...


-- Mike Treseler
 
P

pontus.stenstrom

I would just mark with the mouse then, C-s
and paste into the mini-buffer with
the center mouse key. Then C-s, C-s, ...

-- Mike Treseler

Try C-w (after doing C-s), it will increase the selection, word by
word,
following the point where you stand. I find it very useful.

Be careful, C-w is mapped to kill-region when you are not searching!
Undo (C-_) is your friend.

/Pontus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top