From 7a5fe7024c3d2be951242c81f15aa743fca5faa8 Mon Sep 17 00:00:00 2001 From: dam1n19 <dam1n19@soton.ac.uk> Date: Tue, 11 Apr 2023 13:02:32 +0100 Subject: [PATCH] SOC1-124: Restructured environment setup and environment variable names --- flist/wrapper_ip.flist | 30 ------------------------- flow/stimgen.py | 10 ++++----- set_env.sh | 50 ------------------------------------------ sourceme | 44 ------------------------------------- 4 files changed, 5 insertions(+), 129 deletions(-) delete mode 100644 flist/wrapper_ip.flist delete mode 100644 set_env.sh delete mode 100755 sourceme diff --git a/flist/wrapper_ip.flist b/flist/wrapper_ip.flist deleted file mode 100644 index 5b84e97..0000000 --- a/flist/wrapper_ip.flist +++ /dev/null @@ -1,30 +0,0 @@ -//----------------------------------------------------------------------------- -// Accelerator Wrapper Filelist -// A joint work commissioned on behalf of SoC Labs, under Arm Academic Access license. -// -// Contributors -// -// David Mapstone (d.a.mapstone@soton.ac.uk) -// -// Copyright � 2021-3, SoC Labs (www.soclabs.org) -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -// Abstract : Verilog Command File for Accelerator Wrapper IP -//----------------------------------------------------------------------------- - -// ============= Verilog library extensions =========== -+libext+.v+.vlib - -// ============= Accelerator Module search path ============= --y $(ACC_WRAPPER_DIR)/hdl/src/ -+incdir+$(ACC_WRAPPER_DIR)/hdl/src/ - -$(ACC_WRAPPER_DIR)/hdl/src/wrapper_ahb_packet_constructor.sv -$(ACC_WRAPPER_DIR)/hdl/src/wrapper_ahb_packet_deconstructor.sv - -$(ACC_WRAPPER_DIR)/hdl/src/wrapper_addr_calc.sv -$(ACC_WRAPPER_DIR)/hdl/src/wrapper_data_req.sv -$(ACC_WRAPPER_DIR)/hdl/src/wrapper_ahb_reg_interface.sv -// $(ACC_WRAPPER_DIR)/hdl/src/wrapper_ahb_vr_interface.sv -$(ACC_WRAPPER_DIR)/hdl/src/wrapper_packet_construct.sv -$(ACC_WRAPPER_DIR)/hdl/src/wrapper_packet_deconstruct.sv diff --git a/flow/stimgen.py b/flow/stimgen.py index 561b02f..578df0b 100644 --- a/flow/stimgen.py +++ b/flow/stimgen.py @@ -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["SOC_TOP_DIR"] + "/system/stimulus/" + "adp_hash_stim.cmd" + adp_file = os.environ["PROJECT_DIR"] + "/system/stimulus/" + "adp_hash_stim.cmd" adp_output(adp_file, output_word_list) # Generate FRI File with Write Transactions - fri_file = os.environ["SOC_TOP_DIR"] + "/wrapper/stimulus/" + "ahb_input_hash_stim.fri" + fri_file = os.environ["PROJECT_DIR"] + "/wrapper/stimulus/" + "ahb_input_hash_stim.fri" fri_output(fri_file, output_word_list) # Call fm2conv.pl script - m2d_file = os.environ["SOC_TOP_DIR"] + "/wrapper/stimulus/" + "ahb_input_hash_stim.m2d" + m2d_file = os.environ["PROJECT_DIR"] + "/wrapper/stimulus/" + "ahb_input_hash_stim.m2d" os.system(f"fm2conv.pl -busWidth=32 -infile={fri_file} -outfile={m2d_file}") @@ -205,6 +205,6 @@ if __name__ == "__main__": accelerator_input_size = 0x0000_0800 accelerator_output_address = 0x6001_0800 accelerator_output_size = 0x0000_0800 - stim_file = os.environ["SOC_TOP_DIR"] + "/wrapper/stimulus/" + "input_block_32bit_stim.csv" - ref_file = os.environ["SOC_TOP_DIR"] + "/wrapper/stimulus/" + "output_hash_32bit_ref.csv" + stim_file = os.environ["PROJECT_DIR"] + "/wrapper/stimulus/" + "input_block_32bit_stim.csv" + ref_file = os.environ["PROJECT_DIR"] + "/wrapper/stimulus/" + "output_hash_32bit_ref.csv" stimulus_generation(stim_file, ref_file, accelerator_input_address, accelerator_input_size, accelerator_output_address, accelerator_output_size) \ No newline at end of file diff --git a/set_env.sh b/set_env.sh deleted file mode 100644 index 1ee25dd..0000000 --- a/set_env.sh +++ /dev/null @@ -1,50 +0,0 @@ -#----------------------------------------------------------------------------- -# SoC Labs Environment Setup Script -# A joint work commissioned on behalf of SoC Labs, under Arm Academic Access license. -# -# Contributors -# -# David Mapstone (d.a.mapstone@soton.ac.uk) -# -# Copyright 2023, SoC Labs (www.soclabs.org) -#----------------------------------------------------------------------------- -#!/bin/bash - -# 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 - at root - DESIGN_ROOT=`git rev-parse --show-toplevel` - fi - - # Source Top-Level Sourceme - source $DESIGN_ROOT/set_env.sh -else - # Set Environment Variable for this Repository - export ACC_WRAPPER_DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]:-${(%):-%x}}")" && pwd)" - - # 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 $ACC_WRAPPER_DIR/* ; do - if [ -e "$d/.git" ]; then - if [ -f "$d/set_env.sh" ]; then - # If .git file exists - submodule - source $d/set_env.sh - fi - fi - done - - # Add Scripts to Path - export PATH="$PATH:/$ACC_WRAPPER_DIR/flow" -fi - diff --git a/sourceme b/sourceme deleted file mode 100755 index cbd7285..0000000 --- a/sourceme +++ /dev/null @@ -1,44 +0,0 @@ -#----------------------------------------------------------------------------- -# SoC Labs Environment Setup Script -# A joint work commissioned on behalf of SoC Labs, under Arm Academic Access license. -# -# Contributors -# -# David Mapstone (d.a.mapstone@soton.ac.uk) -# -# Copyright 2022, SoC Labs (www.soclabs.org) -#----------------------------------------------------------------------------- - -#!/usr/bin/env bash - -if [ -z "$ACC_WRAPPER_DIR" ]; then - # Set environment Variables for Repository - export ACC_WRAPPER_DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]:-${(%):-%x}}")" && pwd)" - - if [ -z "$SOC_ENV_SET" ]; then - # Add flow directory to Path - export PATH=$PATH:$ACC_WRAPPER_DIR/flow - - # Set Default Simulator - export SIMULATOR="ivlog" - - # Set Top-level Directory - 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 $ACC_WRAPPER_DIR/../* ; do - if [ -d "$d" ]; then - if test -f "$d/sourceme"; then - source $d/sourceme - fi - fi - done - - # Clear SOC_ENV_SET Variable - unset SOC_ENV_SET - - fi -fi \ No newline at end of file -- GitLab