diff --git a/CHIPKIT b/CHIPKIT index 89226d95cde43401ac3773c73049f4e623baeac6..672416929813708f48e5376c8de00a4f7a69aa9a 160000 --- a/CHIPKIT +++ b/CHIPKIT @@ -1 +1 @@ -Subproject commit 89226d95cde43401ac3773c73049f4e623baeac6 +Subproject commit 672416929813708f48e5376c8de00a4f7a69aa9a diff --git a/accelerator-wrapper b/accelerator-wrapper index 8cdaed6e4eb5b9a56d6a44bdec1ef1348138efe8..7a5fe7024c3d2be951242c81f15aa743fca5faa8 160000 --- a/accelerator-wrapper +++ b/accelerator-wrapper @@ -1 +1 @@ -Subproject commit 8cdaed6e4eb5b9a56d6a44bdec1ef1348138efe8 +Subproject commit 7a5fe7024c3d2be951242c81f15aa743fca5faa8 diff --git a/env/dependency_env.sh b/env/dependency_env.sh new file mode 100755 index 0000000000000000000000000000000000000000..39edeb95950738ff4b1ed9be6592d465f396927a --- /dev/null +++ b/env/dependency_env.sh @@ -0,0 +1,34 @@ +#----------------------------------------------------------------------------- +# SoC Labs Dependency Repository 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 + +#----------------------------------------------------------------------------- +# Technologies +#----------------------------------------------------------------------------- + +# Accelerator Engine +export SECWORKS_SHA2_TECH_DIR="$PROJECT_DIR/secworks-sha256" + +# Accelerator Wrapper +export WRAPPER_TECH_DIR="$PROJECT_DIR/accelerator-wrapper" + +# NanoSoC +export NANOSOC_TECH_DIR="$PROJECT_DIR/nanosoc" + +#----------------------------------------------------------------------------- +# Flows +#----------------------------------------------------------------------------- + +# CHIPKIT - Register Generation +export CHIPKIT_FLOW_DIR="$PROJECT_DIR/CHIPKIT" + +# SoCSim - Basic Simulation Flow Wrapper +export SOCSIM_FLOW_DIR="$PROJECT_DIR/socsim" \ No newline at end of file diff --git a/flist/ahb_ip.flist b/flist/ahb_ip.flist index 65441c5162674a26982b198c46369a00fa2b41f1..926e156acf127fdd96e2a0dadb9297301c9d6659 100644 --- a/flist/ahb_ip.flist +++ b/flist/ahb_ip.flist @@ -16,9 +16,9 @@ +libext+.v+.vlib // ============= Accelerator Module search path ============= --y $(SOC_TOP_DIR)/cmsdk/ip/ -+incdir+$(SOC_TOP_DIR)/hdl/ip/ +-y $(PROJECT_DIR)/cmsdk/ip/ ++incdir+$(PROJECT_DIR)/hdl/ip/ -$(SOC_TOP_DIR)/cmsdk/ip/cmsdk_ahb_default_slave.v -$(SOC_TOP_DIR)/cmsdk/ip/cmsdk_ahb_slave_mux.v -// $(SOC_TOP_DIR)/cmsdk/ip/cmsdk_ahb_ram_beh.v \ No newline at end of file +$(PROJECT_DIR)/cmsdk/ip/cmsdk_ahb_default_slave.v +$(PROJECT_DIR)/cmsdk/ip/cmsdk_ahb_slave_mux.v +// $(PROJECT_DIR)/cmsdk/ip/cmsdk_ahb_ram_beh.v \ No newline at end of file diff --git a/flist/ahb_vip.flist b/flist/ahb_vip.flist index 1550de1e79f94d99c3eaf599574ef826100c7f6d..ead72ed9af1f3edd0a9eea60f3707120c5abca83 100644 --- a/flist/ahb_vip.flist +++ b/flist/ahb_vip.flist @@ -16,9 +16,9 @@ +libext+.v+.vlib // ============= Accelerator Module search path ============= --y $(SOC_TOP_DIR)/cmsdk/vip/ -+incdir+$(SOC_TOP_DIR)/cmsdk/vip/ +-y $(PROJECT_DIR)/cmsdk/vip/ ++incdir+$(PROJECT_DIR)/cmsdk/vip/ -$(SOC_TOP_DIR)/cmsdk/vip/cmsdk_ahb_fileread_master32.v -$(SOC_TOP_DIR)/cmsdk/vip/cmsdk_ahb_fileread_funnel.v -$(SOC_TOP_DIR)/cmsdk/vip/cmsdk_ahb_filereadcore.v \ No newline at end of file +$(PROJECT_DIR)/cmsdk/vip/cmsdk_ahb_fileread_master32.v +$(PROJECT_DIR)/cmsdk/vip/cmsdk_ahb_fileread_funnel.v +$(PROJECT_DIR)/cmsdk/vip/cmsdk_ahb_filereadcore.v \ No newline at end of file diff --git a/flist/primatives.flist b/flist/primatives.flist index f97049bf864eb5b3210a05f3e846eac621a9b59d..987baf885f8e52ee5b18e90835f335b62a342e8b 100644 --- a/flist/primatives.flist +++ b/flist/primatives.flist @@ -16,7 +16,7 @@ +libext+.v+.vlib // ============= Accelerator Module search path ============= --y $(SOC_TOP_DIR)/primatives/src/ -+incdir+$(SOC_TOP_DIR)/primatives/src/ +-y $(PROJECT_DIR)/primatives/src/ ++incdir+$(PROJECT_DIR)/primatives/src/ -$(SOC_TOP_DIR)/primatives/src/fifo_vr.sv +$(PROJECT_DIR)/primatives/src/fifo_vr.sv diff --git a/flist/secwork_sha25_stream.flist b/flist/secwork_sha25_stream.flist new file mode 100644 index 0000000000000000000000000000000000000000..2d1df0729e7f8b8a06849452588941cce5c4ea41 --- /dev/null +++ b/flist/secwork_sha25_stream.flist @@ -0,0 +1,26 @@ +//----------------------------------------------------------------------------- +// Secworks SHA2 Accelerator AXI-Stream 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 AXI Stream IP +//----------------------------------------------------------------------------- + +// ============= Verilog library extensions =========== ++libext+.v+.vlib + +// ============= Accelerator Module search path ============= +-y $(SECWORKS_SHA2_TECH_DIR)/src/rtl/ ++incdir+$(SECWORKS_SHA2_TECH_DIR)/src/rtl/ + +$(SECWORKS_SHA2_TECH_DIR)/src/interfaces/stream/rtl/sha256_stream.v + +$(SECWORKS_SHA2_TECH_DIR)/src/rtl/sha256_core.v +$(SECWORKS_SHA2_TECH_DIR)/src/rtl/sha256_k_constants.v +$(SECWORKS_SHA2_TECH_DIR)/src/rtl/sha256_w_mem.v diff --git a/flist/system.flist b/flist/system.flist index 968aee3c957bdd2acf3394f73a04ee9ae760824b..10d985b744fc216b23a298ef3afb8faf9ec1c11c 100644 --- a/flist/system.flist +++ b/flist/system.flist @@ -16,7 +16,7 @@ +libext+.v+.vlib // ============= Accelerator Module search path ============= --y $(SOC_TOP_DIR)/system/src/ -+incdir+$(SOC_TOP_DIR)/system/src/ +-y $(PROJECT_DIR)/system/src/ ++incdir+$(PROJECT_DIR)/system/src/ -$(SOC_TOP_DIR)/system/src/nanosoc_exp.v \ No newline at end of file +$(PROJECT_DIR)/system/src/nanosoc_exp.v \ No newline at end of file diff --git a/flist/wrapper.flist b/flist/wrapper.flist index 7a73878aa7060236c102f3299fc7962ad0380034..7aa139a8d0645eef1750635b97a6eec0b1631762 100644 --- a/flist/wrapper.flist +++ b/flist/wrapper.flist @@ -16,8 +16,8 @@ +libext+.v+.vlib // ============= Accelerator Module search path ============= --y $(SOC_TOP_DIR)/wrapper/src/ -+incdir+$(SOC_TOP_DIR)/wrapper/src/ +-y $(PROJECT_DIR)/wrapper/src/ ++incdir+$(PROJECT_DIR)/wrapper/src/ -$(SOC_TOP_DIR)/wrapper/src/wrapper_secworks_sha256.sv -$(SOC_TOP_DIR)/wrapper/src/wrapper_digest_filter.sv +$(PROJECT_DIR)/wrapper/src/wrapper_secworks_sha256.sv +$(PROJECT_DIR)/wrapper/src/wrapper_digest_filter.sv diff --git a/flist/wrapper_ip.flist b/flist/wrapper_ip.flist new file mode 100644 index 0000000000000000000000000000000000000000..046c08f31d1b112a3f7ba57e5c33248d04031360 --- /dev/null +++ b/flist/wrapper_ip.flist @@ -0,0 +1,30 @@ +//----------------------------------------------------------------------------- +// 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 $(WRAPPER_TECH_DIR)/hdl/src/ ++incdir+$(WRAPPER_TECH_DIR)/hdl/src/ + +$(WRAPPER_TECH_DIR)/hdl/src/wrapper_ahb_packet_constructor.sv +$(WRAPPER_TECH_DIR)/hdl/src/wrapper_ahb_packet_deconstructor.sv + +$(WRAPPER_TECH_DIR)/hdl/src/wrapper_addr_calc.sv +$(WRAPPER_TECH_DIR)/hdl/src/wrapper_data_req.sv +$(WRAPPER_TECH_DIR)/hdl/src/wrapper_ahb_reg_interface.sv +// $(WRAPPER_TECH_DIR)/hdl/src/wrapper_ahb_vr_interface.sv +$(WRAPPER_TECH_DIR)/hdl/src/wrapper_packet_construct.sv +$(WRAPPER_TECH_DIR)/hdl/src/wrapper_packet_deconstruct.sv diff --git a/flow/simulators/ivlog_sim.sh b/flow/simulators/ivlog_sim.sh index 149b9ceb0d244481a36a5bfc58923965081b2955..839dd425d08e42f84778c8b48f40671161827198 100755 --- a/flow/simulators/ivlog_sim.sh +++ b/flow/simulators/ivlog_sim.sh @@ -11,6 +11,6 @@ #!/usr/bin/env bash -mkdir -p $SOC_TOP_DIR/simulate/sim/ -iverilog -g2012 -o $SOC_TOP_DIR/simulate/sim/$1.vvp $ACC_WRAPPER_DIR/hdl/verif/tb_$1.sv -cd $SOC_TOP_DIR/simulate/sim/ && vvp $1.vvp $2 \ No newline at end of file +mkdir -p $PROJECT_DIR/simulate/sim/ +iverilog -g2012 -o $PROJECT_DIR/simulate/sim/$1.vvp $WRAPPER_TECH_DIR/hdl/verif/tb_$1.sv +cd $PROJECT_DIR/simulate/sim/ && vvp $1.vvp $2 \ No newline at end of file diff --git a/flow/soc-init b/flow/soc-init index 51df7f3e78bca032e2fd8301a28dfebde37b8b3f..3f3e045a183037a7d6876c36d9d092f23287e077 100755 --- a/flow/soc-init +++ b/flow/soc-init @@ -14,7 +14,7 @@ # Source environment variables for all submodules cd $DESIGN_ROOT -for d in $SOC_TOP_DIR/* ; do +for d in $PROJECT_DIR/* ; do if [ -e "$d/.git" ]; then echo $d if [ -f "$d/set_env.sh" ]; then diff --git a/flow/socsim b/flow/socsim index 5b56393c8a9c6dfb0e9c5e2ea4aa09c7a779adca..4475e853e14786a05a3a6a390671e877a9d2a4d3 100755 --- a/flow/socsim +++ b/flow/socsim @@ -15,9 +15,9 @@ DEFAULT_SIMULATOR="ivlog" if [[ -z "${SIMULATOR}" ]]; then SIMULATOR=$DEFAULT_SIMULATOR fi -# $SOC_TOP_DIR"/flow/simulators/"$SIMULATOR"_sim.sh" $@ +# $PROJECT_DIR"/flow/simulators/"$SIMULATOR"_sim.sh" $@ -for d in $SOC_TOP_DIR/* ; do +for d in $PROJECT_DIR/* ; do if [ -f "$d/.git" ]; then if [ -f "$d/simulate/socsim/$1.sh" ]; then # If .git file exists - submodule diff --git a/nanosoc b/nanosoc index 65925f9cf28b2e2d328fcff94b3296b89cca3ffd..3b65f6f388136905c590e9e067222e5f3679e90e 160000 --- a/nanosoc +++ b/nanosoc @@ -1 +1 @@ -Subproject commit 65925f9cf28b2e2d328fcff94b3296b89cca3ffd +Subproject commit 3b65f6f388136905c590e9e067222e5f3679e90e diff --git a/secworks-sha256 b/secworks-sha256 index edec92f3167b358d58f65a2fad4b7f929d78aeb0..0ca2ab834833789eb49f8f61d929a80734b3f990 160000 --- a/secworks-sha256 +++ b/secworks-sha256 @@ -1 +1 @@ -Subproject commit edec92f3167b358d58f65a2fad4b7f929d78aeb0 +Subproject commit 0ca2ab834833789eb49f8f61d929a80734b3f990 diff --git a/set_env.sh b/set_env.sh index dc61db882173f6d9e6f0ffd3f142b97a7992ec68..fea648bcd9ddd069c9e4a6ce02137abbd9e34488 100755 --- a/set_env.sh +++ b/set_env.sh @@ -24,26 +24,34 @@ if [ -z $DESIGN_ROOT ]; then source $DESIGN_ROOT/set_env.sh else # Set Environment Variable for this Repository - export SOC_TOP_DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + export PROJECT_DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # If this Repo is root of workspace - if [ $SOC_TOP_DIR = $DESIGN_ROOT ]; then + if [ $PROJECT_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 $SOC_TOP_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 + # Source dependency environment variable script + source $PROJECT_DIR/env/dependency_env.sh # Add Scripts to Path - export PATH="$PATH:/$SOC_TOP_DIR/flow" + # "TECH_DIR" + while read line; do + eval PATH="$PATH:\$${line}/flow" + done <<< "$(awk 'BEGIN{for(v in ENVIRON) print v}' | grep TECH_DIR)" + + # "FLOW_DIR" + while read line; do + eval PATH="$PATH:\$${line}/flow" + done <<< "$(awk 'BEGIN{for(v in ENVIRON) print v}' | grep FLOW_DIR)" + + # "PROJECT_DIR" + while read line; do + eval PATH="$PATH:\$${line}/flow" + done <<< "$(awk 'BEGIN{for(v in ENVIRON) print v}' | grep PROJECT_DIR)" + + export PATH fi \ No newline at end of file diff --git a/simulate/socsim/nanosoc_sha256_hashing_stream.sh b/simulate/socsim/nanosoc_sha256_hashing_stream.sh deleted file mode 100755 index c3ce45fef5fd542ff13c83ddeca293bae2836f13..0000000000000000000000000000000000000000 --- a/simulate/socsim/nanosoc_sha256_hashing_stream.sh +++ /dev/null @@ -1,19 +0,0 @@ -#----------------------------------------------------------------------------- -# SoC Labs Cadence Xcelium simulation script for engine testbench -# 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 - -mkdir -p $SOC_TOP_DIR/simulate/sim/ -make run_xm \ - TESTNAME=hello \ - ACCELERATOR_VC="-sv -f $ACC_ENGINE_DIR/flist/sha-2-accelerator_src.flist -f $ACC_WRAPPER_DIR/flist/wrapper_ip.flist" \ - ADP_FILE="$SOC_TOP_DIR/system/stimulus/adp_hash_stim.cmd" \ - -C $NANOSOC_DIR/Cortex-M0/nanosoc/systems/mcu/rtl_sim \ No newline at end of file diff --git a/simulate/socsim/wrapper_secworks_sha256.sh b/simulate/socsim/wrapper_secworks_sha256.sh index 64ecee63d03023d1ef558c5a3e5ddc7dddc59219..a36666d1f3c93cb5b1c6276b2d737835b605951e 100755 --- a/simulate/socsim/wrapper_secworks_sha256.sh +++ b/simulate/socsim/wrapper_secworks_sha256.sh @@ -12,28 +12,25 @@ #!/usr/bin/env bash # Generate Stimulus from stimulus generation Script -# python3 $ACC_SEC_SHA2_DIR/flow/stimgen.py +# python3 $SECWORKS_SHA2_TECH_DIR/flow/stimgen.py # Create Simulatiom Directory to Run in -mkdir -p $SOC_TOP_DIR/simulate/sim/ -mkdir -p $SOC_TOP_DIR/simulate/sim/wrapper_secworks_sha256 +mkdir -p $PROJECT_DIR/simulate/sim/ +mkdir -p $PROJECT_DIR/simulate/sim/wrapper_secworks_sha256 -cd $SOC_TOP_DIR/simulate/sim/wrapper_secworks_sha256 +cd $PROJECT_DIR/simulate/sim/wrapper_secworks_sha256 # Compile Simulation xrun \ -64bit \ -sv \ -timescale 1ps/1ps \ +access+r \ - -f $SOC_TOP_DIR/flist/wrapper.flist \ - -f $SOC_TOP_DIR/flist/primatives.flist \ - -f $SOC_TOP_DIR/flist/ahb_ip.flist \ - -f $SOC_TOP_DIR/flist/ahb_vip.flist \ - -f $ACC_SEC_SHA2_DIR/flist/*.flist \ - -f $ACC_WRAPPER_DIR/flist/wrapper_ip.flist \ - -xmlibdirname $SOC_TOP_DIR/simulate/sim/wrapper_secworks_sha256 \ - $SOC_TOP_DIR/wrapper/verif/tb_wrapper_secworks_sha256.sv \ + -f $PROJECT_DIR/flist/primatives.flist \ + -f $PROJECT_DIR/flist/wrapper_ip.flist \ + -f $PROJECT_DIR/flist/ahb_ip.flist \ + -f $PROJECT_DIR/flist/wrapper.flist \ + -f $PROJECT_DIR/flist/ahb_vip.flist \ + -f $PROJECT_DIR/flist/secworks_sha25_stream.flist \ + -xmlibdirname $PROJECT_DIR/simulate/sim/wrapper_secworks_sha256 \ + $PROJECT_DIR/wrapper/verif/tb_wrapper_secworks_sha256.sv \ -gui \ - -top tb_wrapper_secworks_sha256 - -# Run Simulation -# cd $SOC_TOP_DIR/simulate/sim/ && vvp wrapper_sha256_hashing_stream.vvp \ No newline at end of file + -top tb_wrapper_secworks_sha256 \ No newline at end of file diff --git a/simulate/socsim/wrapper_sha256_hashing_stream.sh b/simulate/socsim/wrapper_sha256_hashing_stream.sh deleted file mode 100755 index d6795fe9d653f27b202c1a068ab159660b6f8282..0000000000000000000000000000000000000000 --- a/simulate/socsim/wrapper_sha256_hashing_stream.sh +++ /dev/null @@ -1,29 +0,0 @@ -#----------------------------------------------------------------------------- -# SoC Labs icarus verilog simulation script for engine testbench -# 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 - -# Generate Stimulus from stimulus generation Script -python3 $ACC_WRAPPER_DIR/flow/stimgen.py -# Create Simulatiom Directory to Run in -mkdir -p $SOC_TOP_DIR/simulate/sim/ -# Compile Simulation -iverilog \ - -c $SOC_TOP_DIR/flist/wrapper.flist \ - -c $SOC_TOP_DIR/flist/ahb_ip.flist \ - -c $SOC_TOP_DIR/flist/ahb_vip.flist \ - -c $ACC_WRAPPER_DIR/flist/wrapper_ip.flist \ - -c $ACC_ENGINE_DIR/flist/*.flist \ - -g2012 \ - -o $SOC_TOP_DIR/simulate/sim/wrapper_sha256_hashing_stream.vvp \ - $SOC_TOP_DIR/wrapper/verif/tb_wrapper_sha256_hashing_stream.sv -# Run Simulation -cd $SOC_TOP_DIR/simulate/sim/ && vvp wrapper_sha256_hashing_stream.vvp \ No newline at end of file diff --git a/simulate/socsim/wrapper_vr_loopback.sh b/simulate/socsim/wrapper_vr_loopback.sh deleted file mode 100755 index f9c92e461a77782d7f02e61114600c378f87263b..0000000000000000000000000000000000000000 --- a/simulate/socsim/wrapper_vr_loopback.sh +++ /dev/null @@ -1,16 +0,0 @@ -#----------------------------------------------------------------------------- -# SoC Labs icarus verilog simulation script for engine testbench -# 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 - -mkdir -p $SOC_TOP_DIR/simulate/sim/ -iverilog -c $ACC_WRAPPER_DIR/flist/accelerator_wrapper.flist -c $ACC_WRAPPER_DIR/flist/ahb_ip.flist -c -I $ACC_WRAPPER_DIR/hdl/verif/ -I $ACC_WRAPPER_DIR/hdl/verif/submodules -I $ACC_WRAPPER_DIR/hdl/src/ -g2012 -o $SOC_TOP_DIR/simulate/sim/wrapper_vr_loopback.vvp $ACC_WRAPPER_DIR/hdl/verif/tb_wrapper_vr_loopback.sv -cd $SOC_TOP_DIR/simulate/sim/ && vvp wrapper_vr_loopback.vvp +STIMFILE=$ACC_WRAPPER_DIR/simulate/stimulus/ahb_input_hash_stim.m2d \ No newline at end of file diff --git a/socsim b/socsim index 449dff8e21ada114a797a5a90085de1dfe41feb4..550534f90e957c4ecc652e9cdd6372869c9a21a2 160000 --- a/socsim +++ b/socsim @@ -1 +1 @@ -Subproject commit 449dff8e21ada114a797a5a90085de1dfe41feb4 +Subproject commit 550534f90e957c4ecc652e9cdd6372869c9a21a2