#!/bin/bash

# Script which writes area and pin info to allinfo.csv

grep area *.vbe | \
  sed 's/\([^:][^:]*\):[^=][^=]*= *\([^;][^;]*\); *$/\1,\2/' | \
  sed 's/\.vbe//' > $$_temp1

cells=$(ls -1 *.vbe)
for cell in $cells
do
  sed -n '/^PORT/,/) *;/ p' $cell | \
    grep -i BIT | \
    egrep -v 'vdd|vss' | \
    grep -c '^' >> $$_temp2
done
paste -d ',' $$_temp1 $$_temp2 > allinfo.csv
rm -f $$_temp1 $$_temp2
