Skip to content
Snippets Groups Projects
Commit 341995f2 authored by David Mapstone's avatar David Mapstone
Browse files

SOC1-124: Updated set_env script

parent f3387635
No related branches found
No related tags found
No related merge requests found
......@@ -15,4 +15,4 @@ DEFAULT_SIMULATOR="ivlog"
if [[ -z "${SIMULATOR}" ]]; then
SIMULATOR=$DEFAULT_SIMULATOR
fi
$SOC_TOP"/flow/simulators/"$SIMULATOR"_sim.sh" $@
$SOC_TOP_DIR"/flow/simulators/"$SIMULATOR"_sim.sh" $@
......@@ -188,15 +188,15 @@ def stimulus_generation(stim_file, ref_file, input_start_address, input_size, ou
# Generate ADP Command File with Write Transactions
adp_file = os.environ["WRAP_ACC_DIR"] + "/simulate/stimulus/" + "adp_hash_stim.cmd"
adp_file = os.environ["ACC_WRAPPER_DIR"] + "/simulate/stimulus/" + "adp_hash_stim.cmd"
adp_output(adp_file, output_word_list)
# Generate FRI File with Write Transactions
fri_file = os.environ["WRAP_ACC_DIR"] + "/simulate/stimulus/" + "ahb_input_hash_stim.fri"
fri_file = os.environ["ACC_WRAPPER_DIR"] + "/simulate/stimulus/" + "ahb_input_hash_stim.fri"
fri_output(fri_file, output_word_list)
# Call fm2conv.pl script
m2d_file = os.environ["WRAP_ACC_DIR"] + "/simulate/stimulus/" + "ahb_input_hash_stim.m2d"
m2d_file = os.environ["ACC_WRAPPER_DIR"] + "/simulate/stimulus/" + "ahb_input_hash_stim.m2d"
os.system(f"fm2conv.pl -busWidth=32 -infile={fri_file} -outfile={m2d_file}")
......
......@@ -10,34 +10,41 @@
#-----------------------------------------------------------------------------
#!/bin/bash
# Get Root Location of Repository
# Get Root Location of Design Structure
if [ -z $DESIGN_ROOT ]; then
# If $DESIGN_ROOT hasn't been set yet
DESIGN_ROOT=`git rev-parse --show-superproject-working-tree`
if [ -z $DESIGN_ROOT ]; then
# If not in a submodule
# If not in a submodule - at root
DESIGN_ROOT=`git rev-parse --show-toplevel`
fi
fi
# Set Environment Variable for this Repository
export WRAP_ACC_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
# Source Top-Level Sourceme
source $DESIGN_ROOT/set_env.sh
else
# Set Environment Variable for this Repository
export ACC_WRAPPER_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
# If this Repo is root of workspace
if [ $WRAP_ACC_DIR = $DESIGN_ROOT ]; then
echo "Design Workspace: $WRAP_ACC_DIR"
export $DESIGN_ROOT
fi
# If this Repo is root of workspace
if [ $ACC_WRAPPER_DIR = $DESIGN_ROOT ]; then
echo "Design Workspace: $DESIGN_ROOT"
export DESIGN_ROOT
# Set Default Simulator
export SIMULATOR="ivlog"
fi
# Source environment variables for all submodules
for d in $WRAP_ACC_DIR/* ; do
if [ -f "$d/.git" ]; then
if [ -f "$d/set_env.sh" ]; then
# If .git file exists - submodule
source $d/set_env.sh
# Source environment variables for all submodules
for d in $ACC_WRAPPER_DIR/* ; do
if [ -f "$d/.git" ]; then
if [ -f "$d/set_env.sh" ]; then
# If .git file exists - submodule
source $d/set_env.sh
fi
fi
fi
done
done
# Add Scripts to Path
export PATH="$PATH:/$ACC_WRAPPER_DIR/flow"
fi
# Add Flow directory to Path
export PATH="$PATH:/$WRAP_ACC_DIR/flow"
\ No newline at end of file
......@@ -11,25 +11,25 @@
#!/usr/bin/env bash
if [ -z "$WRAP_ACC_DIR" ]; then
if [ -z "$ACC_WRAPPER_DIR" ]; then
# Set environment Variables for Repository
export WRAP_ACC_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
export ACC_WRAPPER_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
if [ -z "$SOC_ENV_SET" ]; then
# Add flow directory to Path
export PATH=$PATH:$WRAP_ACC_DIR/flow
export PATH=$PATH:$ACC_WRAPPER_DIR/flow
# Set Default Simulator
export SIMULATOR="ivlog"
# Set Top-level Directory
export SOC_TOP=$WRAP_ACC_DIR
export SOC_TOP=$ACC_WRAPPER_DIR
# Set flag to say this is top level repo
export SOC_ENV_SET="True"
# Source Top-level sourceme
for d in $WRAP_ACC_DIR/../* ; do
for d in $ACC_WRAPPER_DIR/../* ; do
if [ -d "$d" ]; then
if test -f "$d/sourceme"; then
source $d/sourceme
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment