Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mflowgen: Scripts fail silently (ish) if GARNET_HOME not set #412

Open
steveri opened this issue Jan 28, 2020 · 1 comment
Open

mflowgen: Scripts fail silently (ish) if GARNET_HOME not set #412

steveri opened this issue Jan 28, 2020 · 1 comment
Assignees

Comments

@steveri
Copy link
Contributor

steveri commented Jan 28, 2020

My latest attempt at building a default Tile_PE failed for the following reason: It looks as though there is a requirement to have an env var GARNET_HOME in order for the mflowgen scripts to work.

%cd garnet/mflowgen; grep -r GARNET_HOME *
  common/rtl/gen_rtl.sh:cd $GARNET_HOME
  glb_tile/rtl/gen_rtl.sh:    cat $GARNET_HOME/global_buffer/rtl/$F >> outputs/design.v
  glb_tile/rtl/gen_rtl.sh:done <$GARNET_HOME/global_buffer/rtl/global_buffer.filelist
  glb_top/glb_tile/get_glb_outputs.sh:../../configure --design $GARNET_HOME/mflowgen/glb_tile/
  glb_top/rtl/gen_rtl.sh:cat $GARNET_HOME/global_buffer/rtl/global_buffer_pkg.sv >> outputs/design.v
  glb_top/rtl/gen_rtl.sh:cat $GARNET_HOME/global_buffer/rtl/global_buffer.sv >> outputs/design.v
  Tile_MemCore/rtl/gen_rtl.sh:cd $GARNET_HOME

Seems like this should be documented in the README (which I can do) and there should be an env-var check somewhere in the scripts (which somebody else should probably do) e.g.

if test [ "$GARNET_HOME" == "" ]; then
  echo ERROR oops looks like you forgot to set env var GARNET_HOME
  exit 13
fi

...or am I missing something?

@steveri
Copy link
Contributor Author

steveri commented Jan 28, 2020

Also: looks like gen_rtl scripts assume that python points to python3 although there are apparently no specification or checks to make sure;

% make rtl
  File "garnet.py", line 28
    def __init__(self, width, height, add_pd, interconnect_only: bool = False,
                                                               ^
  SyntaxError: invalid syntax

Scripts should probably use python3 instead of simply python and/or do a check
``
v=python -c 'import sys; print(sys.version_info[0]*1000+sys.version_info[1])'
if [ $v -lt 3000 ] ; then
echo ""; echo "ERROR found python version $v -- should be at least 3000"; exit 13
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants