From 20a9e6d10276eaafeb357a0b145784523256d9c5 Mon Sep 17 00:00:00 2001 From: Hansung Kim Date: Tue, 14 Nov 2023 23:00:43 -0800 Subject: [PATCH] Force include VX_gpu_pkg as compile order workaround addResource() calls in Chisel BlackBox does not preserve order of the files being included; the actual compile order for these files are re-arranged to be in alphabetical order. Therefore, while VX_gpu_pkg.sv has to be compiled before all the other modules because it holds the top-level package definition, that order cannot be ensured from Chisel. As a hacky workaround, simply `include this file in some of the sv files whose name starts earlier than VX_gpu_pkg in lexicographical order. --- hw/rtl/cache/VX_cache_cluster.sv | 1 + hw/rtl/core/VX_csr_data.sv | 2 ++ 2 files changed, 3 insertions(+) diff --git a/hw/rtl/cache/VX_cache_cluster.sv b/hw/rtl/cache/VX_cache_cluster.sv index 18e26eb2..d54a06d0 100644 --- a/hw/rtl/cache/VX_cache_cluster.sv +++ b/hw/rtl/cache/VX_cache_cluster.sv @@ -12,6 +12,7 @@ // limitations under the License. `include "VX_cache_define.vh" +`include "VX_gpu_pkg.sv" module VX_cache_cluster import VX_gpu_pkg::*; #( parameter `STRING INSTANCE_ID = "", diff --git a/hw/rtl/core/VX_csr_data.sv b/hw/rtl/core/VX_csr_data.sv index 9ba0ffd0..f959d93b 100644 --- a/hw/rtl/core/VX_csr_data.sv +++ b/hw/rtl/core/VX_csr_data.sv @@ -12,6 +12,8 @@ // limitations under the License. `include "VX_define.vh" +`include "VX_fpu_pkg.sv" +`include "VX_gpu_pkg.sv" `ifdef EXT_F_ENABLE `include "VX_fpu_define.vh"