VHDL Code Metrics

A

Andrew

Does anyone know of any tools that generate VHDL code metrics? I need
things like number of lines of code, number of comments, amount of
whitespace, etc.

Thanks,

Andrew
 
T

Tom Verbeure

Assuming you're using a unix line environment:

find . -name "*.vhd" -exec ./Metrix.sh {} \;

--------------------------- Metrix.sh ---------------------
#! /usr/bin/sh
echo "Filename $1"
echo "Lines in file:"
wc -l $1
echo "Lines with comment:"
grep "\-\-" $1 | wc -l
echo "Empty lines:"
egrep "^[ \t]*$" $1 | wc -l
 
S

Stephane

Tom said:
Assuming you're using a unix line environment:

find . -name "*.vhd" -exec ./Metrix.sh {} \;

--------------------------- Metrix.sh ---------------------
#! /usr/bin/sh
echo "Filename $1"
echo "Lines in file:"
wc -l $1
echo "Lines with comment:"
grep "\-\-" $1 | wc -l
echo "Empty lines:"
egrep "^[ \t]*$" $1 | wc -l

are you guys grading your students? ;-)

first make sure they don't ask for traffic light controllers on this
newsgroup!
 
T

Tom Verbeure

Long time ago, I had a pointy haired boss who really used such a script
to evaluate the 'performance' of different designers. :)

Tom
 
A

Andrew

Yeah, I'm hoping that is not what my PHB wants such a script for. And
no, I am not the PHB. :)

Does anyone know of any tools that have this as a feature? A simulator
or something? Unfortunately we're a Windows shop so to run a script
like Stephane's I would need to install cygwin on the PHB's computer.
 
S

Stephane

Andrew said:
Yeah, I'm hoping that is not what my PHB wants such a script for. And
no, I am not the PHB. :)

Does anyone know of any tools that have this as a feature? A simulator
or something? Unfortunately we're a Windows shop so to run a script
like Stephane's I would need to install cygwin on the PHB's computer.
Not mine, Tom's one.

Maybe your boss needs the "bullbuster", or something like that, a
semantic speech analyser, created by Andersen, and that scored high some
presidnt!
 
N

Nicolas Matringe

Hello
Does anyone know of any tools that have this as a feature? A simulator
or something? Unfortunately we're a Windows shop so to run a script
like Stephane's I would need to install cygwin on the PHB's computer.

I think Emacs' VHDL mode has such a feature. And yes, though it's
originally a Un*x program it has been ported to Windows.

Nicolas
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top