Skip to content

Commit

Permalink
Hotfix v1.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
kristopk committed Jul 13, 2017
1 parent 9db4263 commit 42e5578
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 22 deletions.
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,34 @@
#include <stdint.h>

// 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);
Expand Down
7 changes: 5 additions & 2 deletions hdk/cl/examples/cl_hello_world/verif/scripts/top.questa.f
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,22 @@
# 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}
-y ${HDK_SHELL_DESIGN_DIR}/ip/cl_debug_bridge/bd_0/hdl
-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}
Expand All @@ -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}
1 change: 1 addition & 0 deletions hdk/cl/examples/cl_hello_world/verif/scripts/top.vivado.f
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions hdk/common/verif/include/sh_dpi_tasks.svh
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
22 changes: 16 additions & 6 deletions hdk/common/verif/models/sh_bfm/sh_bfm.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion hdk/common/verif/tb/sv/tb_type_defines_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hdk/hdk_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
HDK_VERSION=1.2.4
HDK_VERSION=1.2.5
9 changes: 9 additions & 0 deletions hdk/tests/dcp_generation_tests/gen_dcp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
32 changes: 29 additions & 3 deletions hdk_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 42e5578

Please sign in to comment.