#!/bin/sh # Measure Lines of Code for the LLRF firmware. # First number is non-blank code lines, second number is comment-only lines. # Does not count testbenches. Does count some simulation-only (initial) lines. # Does count a fair amount of preprocessor manipulation in adctest.v that # supports building with or without feedback, feedforward, and test buffers. # This counts Ming Choy's altsport.v instead of Larry Doolittle's sportx.v for f in adctest.v dds.v cordic.v fdbk_loop.v error3.v kcm.v afterburner.v \ history.v feedforward.v ds2401.v altsport.v rf_timer.v flasher.v; do L=`grep -v "^ *//" $f | grep -c '[a-z]'` C=`grep -c "^ *//" $f` echo $L $C $f done | awk '{l+=$1; c+=$2; printf "%4d %4d %s\n", $1, $2, $3} END{printf "%4d %4d %s\n", l, c, "total"}'