From 1cd833d2c4e8463a6a8bc54bdb64d1ca2c14a708 Mon Sep 17 00:00:00 2001 From: Blaise Tine Date: Mon, 11 Oct 2021 19:02:13 -0700 Subject: [PATCH] minor fixes --- ci/prebuilt.sh | 10 +++++++--- driver/asesim/Makefile | 6 ++---- driver/common/vx_scope.cpp | 13 +++---------- driver/common/vx_scope.h | 8 ++++++++ driver/fpga/Makefile | 6 ++---- driver/vlsim/Makefile | 6 ++---- hw/rtl/VX_gpu_unit.sv | 8 ++++---- hw/scripts/scope.json | 8 ++++---- hw/scripts/scope.py | 2 ++ hw/syn/opae/README | 16 ++++++++-------- hw/syn/opae/gen_sources.sh | 2 +- 11 files changed, 43 insertions(+), 42 deletions(-) diff --git a/ci/prebuilt.sh b/ci/prebuilt.sh index 4198b2e8..cc9ff3dd 100755 --- a/ci/prebuilt.sh +++ b/ci/prebuilt.sh @@ -3,9 +3,13 @@ # exit when any command fails set -e -OS_DIR=ubuntu/bionic -SRCDIR=/opt -DESTDIR=. +OS_DIR=${OS_DIR:-'ubuntu/bionic'} +SRCDIR=${SRCDIR:-'/opt'} +DESTDIR=${DESTDIR:-'.'} + +echo "OS_DIR=${OS_DIR}" +echo "SRCDIR=${SRCDIR}" +echo "DESTDIR=${DESTDIR}" riscv() { diff --git a/driver/asesim/Makefile b/driver/asesim/Makefile index b9092823..c3077e06 100644 --- a/driver/asesim/Makefile +++ b/driver/asesim/Makefile @@ -9,7 +9,7 @@ OPAE_SYN_DIR=../../hw/syn/opae CXXFLAGS += -std=c++11 -O2 -DNDEBUG -Wall -Wextra -pedantic -Wfatal-errors #CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors -CXXFLAGS += -I../include -I../../hw -I$(OPAE_HOME)/include -I$(OPAE_SYN_DIR) +CXXFLAGS += -I. -I../include -I../../hw -I$(OPAE_HOME)/include -I$(OPAE_SYN_DIR) LDFLAGS += -L$(OPAE_HOME)/lib -luuid -lopae-c-ase @@ -35,8 +35,6 @@ LDFLAGS += -shared PROJECT = libvortex.so -AFU_JSON_INFO = vortex_afu.h - SRCS = ../common/opae.cpp ../common/vx_utils.cpp # Enable scope analyzer @@ -69,7 +67,7 @@ $(PROJECT): $(SRCS) $(OPAE_SYN_DIR)/vortex_afu.h $(SCOPE_H) $(CXX) $(CXXFLAGS) -MM $(SRCS) > .depend; clean: - rm -rf $(PROJECT) *.o .depend + rm -rf $(PROJECT) *.o .depend scope-defs.h ifneq ($(MAKECMDGOALS),clean) -include .depend diff --git a/driver/common/vx_scope.cpp b/driver/common/vx_scope.cpp index eb192250..9e855d5b 100644 --- a/driver/common/vx_scope.cpp +++ b/driver/common/vx_scope.cpp @@ -1,3 +1,4 @@ +#include "vx_scope.h" #include #include #include @@ -7,17 +8,9 @@ #include #include #include - -#ifdef USE_VLSIM -#include "vlsim/fpga.h" -#else -#include -#endif - #include -#include "vx_scope.h" -#include "vortex_afu.h" -#include "scope-defs.h" +#include +#include #define FRAME_FLUSH_SIZE 100 diff --git a/driver/common/vx_scope.h b/driver/common/vx_scope.h index bb8cad19..dfc53520 100644 --- a/driver/common/vx_scope.h +++ b/driver/common/vx_scope.h @@ -1,5 +1,13 @@ #pragma once +#include + +#ifdef USE_VLSIM +#include +#else +#include +#endif + #if defined(USE_FPGA) #define HANG_TIMEOUT 60 #else diff --git a/driver/fpga/Makefile b/driver/fpga/Makefile index 8884430b..a2771ecb 100644 --- a/driver/fpga/Makefile +++ b/driver/fpga/Makefile @@ -9,7 +9,7 @@ OPAE_SYN_DIR=../../hw/syn/opae CXXFLAGS += -std=c++11 -O2 -DNDEBUG -Wall -Wextra -pedantic -Wfatal-errors #CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors -CXXFLAGS += -I../include -I../../hw -I$(OPAE_HOME)/include -I$(OPAE_SYN_DIR) +CXXFLAGS += -I. -I../include -I../../hw -I$(OPAE_HOME)/include -I$(OPAE_SYN_DIR) LDFLAGS += -L$(OPAE_HOME)/lib -luuid -lopae-c @@ -37,8 +37,6 @@ LDFLAGS += -shared PROJECT = libvortex.so -AFU_JSON_INFO = vortex_afu.h - SRCS = ../common/opae.cpp ../common/vx_utils.cpp # Enable scope analyzer @@ -71,7 +69,7 @@ $(PROJECT): $(SRCS) $(OPAE_SYN_DIR)/vortex_afu.h $(SCOPE_H) $(CXX) $(CXXFLAGS) -MM $(SRCS) > .depend; clean: - rm -rf $(PROJECT) *.o .depend + rm -rf $(PROJECT) *.o .depend scope-defs.h ifneq ($(MAKECMDGOALS),clean) -include .depend diff --git a/driver/vlsim/Makefile b/driver/vlsim/Makefile index eb30f318..58e8d566 100644 --- a/driver/vlsim/Makefile +++ b/driver/vlsim/Makefile @@ -7,7 +7,7 @@ SCRIPT_DIR=../../hw/scripts CXXFLAGS += -std=c++11 -O2 -DNDEBUG -Wall -Wextra -pedantic -Wfatal-errors #CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors -CXXFLAGS += -I../include -I../../hw -I$(VLSIM_DIR) +CXXFLAGS += -I. -I../include -I../../hw -I$(VLSIM_DIR) LDFLAGS += $(VLSIM_DIR)/libopae-c-vlsim.a @@ -22,8 +22,6 @@ CXXFLAGS += -DDUMP_PERF_STATS LDFLAGS += -shared -pthread -AFU_JSON_INFO = vortex_afu.h - SRCS = ../common/opae.cpp ../common/vx_utils.cpp # Enable scope analyzer @@ -57,7 +55,7 @@ $(PROJECT): $(SRCS) $(SCOPE_H) clean: $(MAKE) -C $(VLSIM_DIR) clean-static - rm -rf $(PROJECT) *.o .depend + rm -rf $(PROJECT) *.o .depend scope-defs.h ifneq ($(MAKECMDGOALS),clean) -include .depend diff --git a/hw/rtl/VX_gpu_unit.sv b/hw/rtl/VX_gpu_unit.sv index fb7b4802..66f76cda 100644 --- a/hw/rtl/VX_gpu_unit.sv +++ b/hw/rtl/VX_gpu_unit.sv @@ -100,9 +100,9 @@ module VX_gpu_unit #( `SCOPE_ASSIGN (gpu_rsp_valid, warp_ctl_if.valid); `SCOPE_ASSIGN (gpu_rsp_wid, warp_ctl_if.wid); - `SCOPE_ASSIGN (gpu_rsp_tmc, warp_ctl_if.tmc); - `SCOPE_ASSIGN (gpu_rsp_wspawn, warp_ctl_if.wspawn); - `SCOPE_ASSIGN (gpu_rsp_split, warp_ctl_if.split); - `SCOPE_ASSIGN (gpu_rsp_barrier, warp_ctl_if.barrier); + `SCOPE_ASSIGN (gpu_rsp_tmc, warp_ctl_if.tmc.valid); + `SCOPE_ASSIGN (gpu_rsp_wspawn, warp_ctl_if.wspawn.valid); + `SCOPE_ASSIGN (gpu_rsp_split, warp_ctl_if.split.valid); + `SCOPE_ASSIGN (gpu_rsp_barrier, warp_ctl_if.barrier.valid); endmodule \ No newline at end of file diff --git a/hw/scripts/scope.json b/hw/scripts/scope.json index 3dbf7a41..50348b7f 100644 --- a/hw/scripts/scope.json +++ b/hw/scripts/scope.json @@ -160,10 +160,10 @@ "afu/vortex/cluster/core/pipeline/execute/gpu_unit": { "?gpu_rsp_valid": 1, "gpu_rsp_wid": "`NW_BITS", - "gpu_rsp_tmc": "`GPU_TMC_BITS", - "gpu_rsp_wspawn": "`GPU_WSPAWN_BITS", - "gpu_rsp_split": "`GPU_SPLIT_BITS", - "gpu_rsp_barrier": "`GPU_BARRIER_BITS" + "gpu_rsp_tmc": 1, + "gpu_rsp_wspawn": 1, + "gpu_rsp_split": 1, + "gpu_rsp_barrier": 1 }, "afu/vortex/cluster/core/pipeline/execute/lsu_unit": { "?dcache_req_fire":"`NUM_THREADS", diff --git a/hw/scripts/scope.py b/hw/scripts/scope.py index 73728a26..9dda8ffe 100755 --- a/hw/scripts/scope.py +++ b/hw/scripts/scope.py @@ -398,6 +398,8 @@ def eval_node(text, params): try: __text = text.replace('$clog2', '__clog2') __text = translate_ternary(__text) + __text = __text.replace('||', 'or') + __text = __text.replace('&&', 'and') e = eval(__text, {'__clog2': clog2}) return e except (NameError, SyntaxError): diff --git a/hw/syn/opae/README b/hw/syn/opae/README index ae8bca51..1c23b88f 100644 --- a/hw/syn/opae/README +++ b/hw/syn/opae/README @@ -63,13 +63,13 @@ qsub-sim make ase # tests -./run_ase.sh build_ase_arria10_1c ../../../driver/tests/basic/basic -n1 -t0 -./run_ase.sh build_ase_arria10_1c ../../../driver/tests/basic/basic -n1 -t1 -./run_ase.sh build_ase_arria10_1c ../../../driver/tests/basic/basic -n16 -./run_ase.sh build_ase_arria10_1c ../../../driver/tests/demo/demo -n16 -./run_ase.sh build_ase_arria10_1c ../../../driver/tests/dogfood/dogfood -n16 -./run_ase.sh build_ase_arria10_1c ../../../benchmarks/opencl/vecadd/vecadd -./run_ase.sh build_ase_arria10_1c ../../../benchmarks/opencl/sgemm/sgemm -n4 +./run_ase.sh build_arria10_ase_1c ../../../tests/regression/basic/basic -n1 -t0 +./run_ase.sh build_arria10_ase_1c ../../../tests/regression/basic/basic -n1 -t1 +./run_ase.sh build_arria10_ase_1c ../../../tests/regression/basic/basic -n16 +./run_ase.sh build_arria10_ase_1c ../../../tests/regression/demo/demo -n16 +./run_ase.sh build_arria10_ase_1c ../../../tests/regression/dogfood/dogfood -n16 +./run_ase.sh build_arria10_ase_1c ../../../tests/opencl/vecadd/vecadd +./run_ase.sh build_arria10_ase_1c ../../../tests/opencl/sgemm/sgemm -n4 # modify "vsim_run.tcl" to dump VCD trace vcd file trace.vcd @@ -82,7 +82,7 @@ tar -zcvf output_files_1c.tar.gz `find ./build_fpga_1c -type f \( -iname \*.rpt # compress log trace tar -zcvf run.log.tar.gz run.log tar -cvjf trace.vcd.tar.bz2 trace.vcd run.log -tar -cvjf trace.vcd.tar.bz2 build_ase_arria10_1c/work/run.log build_ase_arria10_1c/work/trace.vcd +tar -cvjf trace.vcd.tar.bz2 build_arria10_ase_1c/work/run.log build_arria10_ase_1c/work/trace.vcd # decompress log trace tar -zxvf vortex.vcd.tar.gz diff --git a/hw/syn/opae/gen_sources.sh b/hw/syn/opae/gen_sources.sh index b330efc1..a320f53a 100755 --- a/hw/syn/opae/gen_sources.sh +++ b/hw/syn/opae/gen_sources.sh @@ -1,6 +1,6 @@ #!/bin/bash -exclude_list="VX_fpu_fpnew.v" +exclude_list="VX_fpu_fpnew.sv" macros=() includes=()