StanfordAHA/garnet

RTL step failed silently

Closed this issue · 1 comments

Problem: In full_chip RTL step, mflowgen-run executes a command bash gen_rtl.sh , and then gen_rtl.sh does this

#!/bin/bash
..
      docker exec $container_name /bin/bash -c \
         ...
         aha garnet $flags; # Here is where we build the verilog for the main chip
         ...

If/when the "aha garnet" command fails with non-zero exit status, this does not cause the script as a whole to fail, so the build continues until something else fails later in the pipeline, at which point the original error is lost.


Solution: Judicious use of the bash set -e mechanism will let the script to fail immediately, instead of ignoring the error and continuing on:

#!/bin/bash
set -e; # DIE if any of the below commands exits with error status
..
      docker exec $container_name /bin/bash -c \
         set -e; # DIE if any of the below commands exits with error status
         ...
         aha garnet $flags; # Here is where we build the verilog for the main chip
         ...

I plan to file a git pull to address this problem and will ref. this issue when that happens.

However! This is not the only gen_rtl.sh script in the build, and gen_rtl.sh is probably not the only called script with this problem. Fixing all the scripts is a larger issue...

Fixed, see pull #788