Cross-contamination between RTL and TB
I have noticed that some RTL source code is in the TB directory and that the associated variables in the Makefile at tb/core also mix RTL and TB files.
RTL source files in the TB directory:
- fpnew is cloned into tb/core by the Makefile
- tb/core/cluster_clock_gating.sv should be in rtl/cluster_clock_gating.sv
I would also recommend the TB* and RTL* variables in the Makefile be updated to ensure that TB* points only to files at or below tb/ and RTL* points to files at or below rtl/. For example:
# TB source files
TBSRC_HOME := ../../tb
TBSRC_PKG := $(TBSRC_HOME)/tb_riscv/include/perturbation_defines.sv
TBSRC_TOP := $(TBSRC_HOME)/core/tb_top.sv
TBSRC_CORE := $(TBSRC_HOME)/core
TBSRC := $(TBSRC_CORE)/tb_top.sv \
$(TBSRC_CORE)/riscv_wrapper.sv \
$(TBSRC_CORE)/mm_ram.sv \
$(TBSRC_CORE)/dp_ram.sv \
$(TBSRC_HOME)/tb_riscv/riscv_random_stall.sv \
$(TBSRC_HOME)/tb_riscv/riscv_random_interrupt_generator.sv
TBSRC_VERI := $(TBSRC_CORE)/tb_top_verilator.sv \
$(TBSRC_CORE)/riscv_wrapper.sv \
$(TBSRC_CORE)/mm_ram.sv \
$(TBSRC_CORE)/dp_ram.sv
# RTL source files
RTLSRC_HOME := ../../rtl # will be ../../../rtl for CV32E
RTLSRC_INCDIR := $(RTLSRC_HOME)/include
FPNEW_PKG := $(RTLSRC_HOME)/fpnew
RTLSRC_PKG := $(FPNEW_PKG)/src/fpnew_pkg.sv \
$(addprefix $(RTLSRC_HOME)/include/,\
apu_core_package.sv \
riscv_defines.sv \
riscv_tracer_defines.sv)
RTLSRC := $(filter-out $(RTLSRC_HOME)/riscv_register_file_latch.sv,\
$(wildcard $(RTLSRC_HOME)/*.sv))
I have a local branch with these and other changes, but I can no longer push a branch to this repo.