The source code and dockerfile for the GSW2024 AI Lab.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

81 lines
2.6 KiB

4 weeks ago
  1. #! /bin/sh
  2. # A script to test nanotrav.
  3. # Each item in argslist corresponds to one run.
  4. EXE=@EXEEXT@
  5. srcdir=@srcdir@
  6. # The separator IFS is set to a colon so that we can have spaces between
  7. # arguments. Each entry consists of a model name and a list of arguments.
  8. OIFS=$IFS
  9. IFS=:
  10. argslist="\
  11. C17,-cover:\
  12. C880,-ordering dfs -autodyn -automethod sifting -reordering sifting -drop:\
  13. s27,-ordering hw -reordering annealing -trav:\
  14. s27b,-ordering dfs -reordering win4 -verify ${srcdir}/nanotrav/s27.blif:\
  15. s27c,-trav -image depend -depend:\
  16. mult32a,-autodyn -reordering sifting -trav:\
  17. s382,-trav -image part -autodyn -automethod sifting -drop -scc -shortpaths bellman:\
  18. s641,-trav -autodyn -automethod group -drop -clauses -density -decomp -zdd:\
  19. closest,-reordering genetic -drop -closest:\
  20. adj49,-ordering dfs -reordering cogroup -drop -char2vect -cofest:\
  21. ham01,-reordering linear:\
  22. miniFirst,-second ${srcdir}/nanotrav/miniSecond.blif:\
  23. rcn25,-envelope"
  24. verbosity=1
  25. # Discard statistics and remove CPU times.
  26. sed_command='-r:-e:2d:-e:/modifiable/,$d:-e:s/[0-9][0-9]*\.?[0-9]* sec//:-e:s/[0-9][0-9]* recursive//'
  27. echo TAP version 13
  28. echo 1..13
  29. exitstatus=0
  30. count=0
  31. # Create FIFOs for communication between sed processes and diff.
  32. mkfifo nanotrav/tst_fifo nanotrav/out_fifo
  33. # Create empty file.
  34. : > ./nanotrav/differences
  35. for argres in $argslist
  36. do
  37. IFS=, # split model name from arguments
  38. set -- $argres
  39. IFS=:
  40. echo "# executing" "nanotrav/nanotrav$EXE -p $verbosity" \
  41. "$2 ${srcdir}/nanotrav/${1}.blif > ./nanotrav/${1}.tst"
  42. `eval "nanotrav/nanotrav -p $verbosity $2 ${srcdir}/nanotrav/${1}.blif > ./nanotrav/${1}.tst"`
  43. failed=`expr $? != 0`
  44. # If nanotrav completed successfully, compare this run's fitered output
  45. # to the reference filtered output.
  46. if test x$failed = x0; then
  47. echo "# comparing" "./nanotrav/${1}.tst to ${srcdir}/nanotrav/${1}.out"
  48. `sed ${sed_command} ./nanotrav/${1}.tst > nanotrav/tst_fifo &\
  49. sed ${sed_command} ${srcdir}/nanotrav/${1}.out > nanotrav/out_fifo &\
  50. diff -b nanotrav/tst_fifo nanotrav/out_fifo >> ./nanotrav/differences`
  51. failed=`expr $? != 0`
  52. fi
  53. exitstatus=`expr $exitstatus + $failed`
  54. count=`expr $count + 1`
  55. if test x$failed = x0 ; then
  56. echo "ok $count $1"
  57. else
  58. echo "not ok $count $1"
  59. fi
  60. done
  61. # Clean up and report.
  62. rm nanotrav/tst_fifo nanotrav/out_fifo
  63. echo "# $exitstatus failed sub-tests out of $count"
  64. if test x$exitstatus = x0; then
  65. rm ./nanotrav/differences
  66. else
  67. echo '# Check file "./nanotrav/differences"'
  68. fi
  69. # Restore internal field separator.
  70. IFS=$OIFS
  71. exit 0