diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 53f0fb139..c3bc4dc16 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -27,6 +27,10 @@ See [Errata](./ERRATA.md) for additional documentation of unsupported features a * 1 DDR controller implemented in the SH (always available) * 3 DDR controllers implemented in the CL (configurable number of implemented controllers allowed) +# Release 1.2.5 + * Improved tool checks in hdk_setup + * Fixed simulation model and test bench bugs + # Release 1.2.4 * AWS SDK API `aws ec2 describe-fpga-images` released. See [describe-fpga-images](./hdk/docs/describe_fpga_images.md) document for details on how to use this API. Requires Developer AMI 1.2.4 or awscli upgrade: `pip install --upgrade --user awscli` * Fix cl_dram_dam debug probes (.ltx) generation in build scripts diff --git a/hdk/cl/examples/cl_hello_world/software/verif_rtl/src/test_hello_world.c b/hdk/cl/examples/cl_hello_world/software/verif_rtl/src/test_hello_world.c index 3969f969f..ed692336a 100644 --- a/hdk/cl/examples/cl_hello_world/software/verif_rtl/src/test_hello_world.c +++ b/hdk/cl/examples/cl_hello_world/software/verif_rtl/src/test_hello_world.c @@ -18,34 +18,34 @@ #include // Vivado does not support svGetScopeFromName -#ifdef INCLUDE_DPI_CALLS +//#ifdef INCLUDE_DPI_CALLS #ifndef VIVADO_SIM #include "svdpi.h" #endif -#endif +//#endif #include "sh_dpi_tasks.h" -#define HELLO_WORLD_REG_ADDR UINT64_C(0x00) +#define HELLO_WORLD_REG_ADDR UINT64_C(0x500) void test_main(uint32_t *exit_code) { // Vivado does not support svGetScopeFromName -#ifdef INCLUDE_DPI_CALLS +//#ifdef INCLUDE_DPI_CALLS #ifndef VIVADO_SIM svScope scope; #endif -#endif +//#endif uint32_t rdata; // Vivado does not support svGetScopeFromName -#ifdef INCLUDE_DPI_CALLS +//#ifdef INCLUDE_DPI_CALLS #ifndef VIVADO_SIM scope = svGetScopeFromName("tb"); svSetScope(scope); #endif -#endif +//#endif log_printf("Writing 0xDEAD_BEEF to address 0x%x", HELLO_WORLD_REG_ADDR); cl_poke(HELLO_WORLD_REG_ADDR, 0xDEADBEEF); diff --git a/hdk/cl/examples/cl_hello_world/verif/scripts/top.questa.f b/hdk/cl/examples/cl_hello_world/verif/scripts/top.questa.f index a3817c395..276f9f5b1 100644 --- a/hdk/cl/examples/cl_hello_world/verif/scripts/top.questa.f +++ b/hdk/cl/examples/cl_hello_world/verif/scripts/top.questa.f @@ -14,13 +14,14 @@ # limitations under the License. +define+QUESTA_SIM - ++define+CARD_1=card +libext+.v +libext+.sv +libext+.svh -y ${CL_ROOT}/../common/design -y ${CL_ROOT}/design +-y ${CL_ROOT}/verif/sv -y ${SH_LIB_DIR} -y ${SH_INF_DIR} -y ${SH_SH_DIR} @@ -28,6 +29,7 @@ -y ${HDK_SHELL_DESIGN_DIR}/ip/cl_debug_bridge/sim +incdir+${CL_ROOT}/../common/design ++incdir+${CL_ROOT}/design +incdir+${CL_ROOT}/verif/sv +incdir+${SH_LIB_DIR} +incdir+${SH_INF_DIR} @@ -52,10 +54,11 @@ ${HDK_SHELL_DESIGN_DIR}/ip/axi_register_slice_light/sim/axi_register_slice_light.v ${HDK_SHELL_DESIGN_DIR}/ip/axi_register_slice_light/hdl/axi_register_slice_v2_1_vl_rfs.v ${HDK_SHELL_DESIGN_DIR}/ip/axi_register_slice_light/hdl/axi_infrastructure_v1_1_vl_rfs.v -${CL_ROOT}/design/cl_hello_world.sv ${HDK_SHELL_DESIGN_DIR}/ip/axi_register_slice/sim/axi_register_slice.v ${HDK_SHELL_DESIGN_DIR}/ip/axi_clock_converter_0/sim/axi_clock_converter_0.v +${CL_ROOT}/design/cl_hello_world.sv + -f ${HDK_COMMON_DIR}/verif/tb/filelists/tb.${SIMULATOR}.f ${TEST_NAME} diff --git a/hdk/cl/examples/cl_hello_world/verif/scripts/top.vivado.f b/hdk/cl/examples/cl_hello_world/verif/scripts/top.vivado.f index 7416e6c0f..c7553da52 100644 --- a/hdk/cl/examples/cl_hello_world/verif/scripts/top.vivado.f +++ b/hdk/cl/examples/cl_hello_world/verif/scripts/top.vivado.f @@ -21,6 +21,7 @@ -sourcelibdir ${CL_ROOT}/../common/design -sourcelibdir ${CL_ROOT}/design +-sourcelibdir ${CL_ROOT}/verif/sv -sourcelibdir ${SH_LIB_DIR} -sourcelibdir ${SH_INF_DIR} -sourcelibdir ${SH_SH_DIR} diff --git a/hdk/common/verif/include/sh_dpi_tasks.svh b/hdk/common/verif/include/sh_dpi_tasks.svh index fb394cc75..e5e2c8278 100755 --- a/hdk/common/verif/include/sh_dpi_tasks.svh +++ b/hdk/common/verif/include/sh_dpi_tasks.svh @@ -42,11 +42,11 @@ import tb_type_defines_pkg::*; endtask task cl_peek(input longint unsigned addr, output int unsigned data); - tb.card.fpga.sh.peek(addr, data); + tb.card.fpga.sh.peek(.addr(addr), .data(data), .intf(AxiPort::PORT_OCL)); endtask task cl_poke(input longint unsigned addr, int unsigned data); - tb.card.fpga.sh.poke(addr, data); + tb.card.fpga.sh.poke(.addr(addr), .data(data), .intf(AxiPort::PORT_OCL)); endtask task sv_int_ack(input int unsigned int_num); diff --git a/hdk/common/verif/models/sh_bfm/sh_bfm.sv b/hdk/common/verif/models/sh_bfm/sh_bfm.sv index cb42312e0..3c24930e9 100644 --- a/hdk/common/verif/models/sh_bfm/sh_bfm.sv +++ b/hdk/common/verif/models/sh_bfm/sh_bfm.sv @@ -1445,7 +1445,7 @@ module sh_bfm #( ClockRecipe::A2: begin MAIN_A0_DLY = 32ns; CORE_DLY = 32ns; - EXTRA_A1_DLY = 64ns; + EXTRA_A1_DLY = 32ns; EXTRA_A2_DLY = 4ns; EXTRA_A3_DLY = 8ns; end @@ -1894,7 +1894,7 @@ module sh_bfm #( last_beat = 0; start_addr = 0; aligned = 0; - + for (int chan = 0; chan < 4; chan++) begin if ((h2c_dma_started[chan] != 1'b0) && (h2c_dma_list[chan].size() > 0)) begin dop = h2c_dma_list[chan].pop_front(); @@ -1909,7 +1909,8 @@ module sh_bfm #( for(int burst_cnt=0; burst_cnt < num_of_data_beats; ) begin if(burst_cnt == 0) begin // if first data beat axi_cmd.addr = dop.cl_addr; - axi_cmd.len = aligned ? (num_of_data_beats - 1 - last_beat) : 0; + axi_cmd.len = (num_of_data_beats==1) ? 0 : + aligned ? (num_of_data_beats - 1 - last_beat) : 0; // handle the condition if addr is crossing 4k page boundry if(aligned && (dop.cl_addr[11:0] + ((axi_cmd.len + 1) * 64) > 4095)) begin axi_cmd.len = ((4096 - dop.cl_addr[11:0])/64) - 1; @@ -1938,9 +1939,17 @@ module sh_bfm #( axi_data.strb = 64'b0; axi_data.id = chan; last_data_beat = (((num_of_data_beats - 1) - burst_cnt) == 0) ? 1 : 0; - num_bytes = last_beat ? (dop.len + dop.cl_addr[5:0])%64 : 64; + num_bytes = last_beat ? (dop.len + dop.cl_addr[5:0])%64 : 64; axi_data.last = (j == axi_cmd.len) ? 1 : 0; - if(last_data_beat) begin + if(num_of_data_beats == 1) begin + num_bytes = (dop.len)%64; + for(int i=start_addr[5:0]; i < (num_bytes+start_addr[5:0]); i++) begin + axi_data.data = axi_data.data | tb.hm_get_byte(.addr(dop.buffer + byte_cnt)) << 8*i; + axi_data.strb = axi_data.strb | 1 << i; + byte_cnt++; + end + end + else if(last_data_beat) begin for(int i=0; i < num_bytes; i++) begin axi_data.data = axi_data.data | tb.hm_get_byte(.addr(dop.buffer + byte_cnt)) << 8*i; axi_data.strb = axi_data.strb | 1 << i; @@ -2040,7 +2049,8 @@ module sh_bfm #( for(int burst_cnt=0; burst_cnt < num_of_data_beats; ) begin if(burst_cnt == 0) begin // if first data beat axi_cmd.addr = dop.cl_addr; - axi_cmd.len = aligned ? (num_of_data_beats - 1 - last_beat) : 0; + axi_cmd.len = (num_of_data_beats==1) ? 0 : + aligned ? (num_of_data_beats - 1 - last_beat) : 0; // handle the condition if addr is crossing 4k page boundry if(aligned && (dop.cl_addr[11:0] + ((axi_cmd.len + 1) * 64) > 4095)) begin axi_cmd.len = ((4096 - dop.cl_addr[11:0])/64) - 1; diff --git a/hdk/common/verif/tb/sv/tb_type_defines_pkg.sv b/hdk/common/verif/tb/sv/tb_type_defines_pkg.sv index 51d900587..621b49b9a 100644 --- a/hdk/common/verif/tb/sv/tb_type_defines_pkg.sv +++ b/hdk/common/verif/tb/sv/tb_type_defines_pkg.sv @@ -18,7 +18,7 @@ package tb_type_defines_pkg; // clk_main_a0 clk_extra_a1 clk_extra_a2 clk_extra_a3 // Recipe A0 (Default) 125 62.5 187.5 250 // Recipe A1 250 125 375 500 -// Recipe A2 15.625 7.8125 125 62.5 +// Recipe A2 15.625 15.625 125 62.5 // clk_extra_b0 clk_extra_b1 // Recipe B0 (Default) 250 125 diff --git a/hdk/hdk_version.txt b/hdk/hdk_version.txt index 5d6ec6ba7..7604a499c 100644 --- a/hdk/hdk_version.txt +++ b/hdk/hdk_version.txt @@ -1 +1 @@ -HDK_VERSION=1.2.4 +HDK_VERSION=1.2.5 diff --git a/hdk/tests/dcp_generation_tests/gen_dcp.sh b/hdk/tests/dcp_generation_tests/gen_dcp.sh index b5b331be9..7faacbef2 100755 --- a/hdk/tests/dcp_generation_tests/gen_dcp.sh +++ b/hdk/tests/dcp_generation_tests/gen_dcp.sh @@ -61,6 +61,15 @@ if [ ! -d $HDK_DIR/cl/examples/$test/build/checkpoints/to_aws ]; then exit 1 fi +cd $HDK_DIR/cl/examples/$test/build/checkpoints + +echo "INFO: Checking that a non zero size ltx file exists in the folder" +non_zero_ltx=$(find . -name '*.ltx' -type f ! -size 0) +if [ "$non_zero_ltx" = "" ]; then + echo -e >&2 "ERROR: LTX file not found or is of 0 byte size\n" + exit 1 +fi + cd $HDK_DIR/cl/examples/$test/build/checkpoints/to_aws echo "INFO: Checking that a non zero size manifest file exists in the folder" diff --git a/hdk_setup.sh b/hdk_setup.sh index 353b73ad1..81edde13a 100644 --- a/hdk_setup.sh +++ b/hdk_setup.sh @@ -29,6 +29,20 @@ script_dir=$(dirname $full_script) debug=0 +# This function checks if an environment module exists +# Returns 0 if it exists, and returns 1 if it doesn't +function does_module_exist() { + + output=`/usr/bin/ls /usr/local/Modules/$MODULE_VERSION/modulefiles | grep $1` + + if [[ $output == "$1" ]]; then + return 0; + else + return 1; + fi +} + + function info_msg { echo -e "INFO: $1" } @@ -102,9 +116,21 @@ debug_msg "Checking for Vivado install:" if [ -e /usr/local/Modules/$MODULE_VERSION/bin/modulecmd ]; then # Module command is installed. # Load and unload the modules just to make sure have the environment set correctly - module unload vivado - module unload sdx - module load vivado + + # We want to make sure sdx exists before calling the unload function + if does_module_exist sdx; then + module unload sdx + fi + + if does_module_exist vivado; then + # First unload and then load it back. + module unload vivado + module load vivado + else + err_msg "The modulefile to set the environment variables for Vivado does not exist!" + err_msg " Please source the hdk_setup script on the correct AMI from the marketplace" + return 1 + fi fi # before going too far make sure Vivado is available