VHDL Code Metrics

Discussion in 'VHDL' started by Andrew, Jun 7, 2005.

  1. Andrew

    Andrew Guest

    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
     
    Andrew, Jun 7, 2005
    #1
    1. Advertising

  2. Andrew

    Tom Verbeure Guest

    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
     
    Tom Verbeure, Jun 7, 2005
    #2
    1. Advertising

  3. Andrew

    Stephane Guest

    Tom Verbeure wrote:
    > 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!
     
    Stephane, Jun 8, 2005
    #3
  4. Andrew

    Tom Verbeure Guest

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

    Tom
     
    Tom Verbeure, Jun 8, 2005
    #4
  5. Andrew

    Andrew Guest

    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.
     
    Andrew, Jun 9, 2005
    #5
  6. Andrew

    Stephane Guest

    Andrew wrote:
    > 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!
     
    Stephane, Jun 9, 2005
    #6
  7. 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
     
    Nicolas Matringe, Jun 9, 2005
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lucy
    Replies:
    5
    Views:
    2,199
    Keith Wansbrough
    Aug 4, 2004
  2. Edward Berard

    Java Source Code Metrics Tools

    Edward Berard, Mar 9, 2005, in forum: Java
    Replies:
    4
    Views:
    9,335
    satwindercse
    Aug 2, 2010
  3. als
    Replies:
    14
    Views:
    734
    James Kanze
    Nov 2, 2010
  4. RLC
    Replies:
    11
    Views:
    418
    Henrik Faber
    Feb 9, 2012
  5. RLC
    Replies:
    6
    Views:
    429
Loading...

Share This Page