From 391d87ad6bf6bbe84104b28ad9a97a4f01f23066 Mon Sep 17 00:00:00 2001 From: Pagadarai Date: Fri, 31 Mar 2023 16:47:08 -0400 Subject: [PATCH] Updated fsbl build script for Zynq7000 Signed-off-by: Pagadarai --- CI/scripts/fsbl_build_zynq.tcl | 20 ++---- CI/scripts/read_ports_json.py | 109 ++++++++++++++------------------- test/build_design.m | 1 + 3 files changed, 53 insertions(+), 77 deletions(-) diff --git a/CI/scripts/fsbl_build_zynq.tcl b/CI/scripts/fsbl_build_zynq.tcl index c46ad628..674c7d68 100644 --- a/CI/scripts/fsbl_build_zynq.tcl +++ b/CI/scripts/fsbl_build_zynq.tcl @@ -1,21 +1,12 @@ -### Calling script must have system_top.hdf u-boot.elf +### Calling script must generated have system_top.bit set cdir [pwd] set sdk_loc $cdir/vivado_prj.sdk -### Create fsbl -hsi open_hw_design $sdk_loc/system_top.hdf -set cpu_name [lindex [hsi get_cells -filter {IP_TYPE==PROCESSOR}] 0] -sdk setws $sdk_loc -sdk createhw -name hw_0 -hwspec $sdk_loc/system_top.hdf -sdk createapp -name fsbl -hwproject hw_0 -proc $cpu_name -os standalone -lang C -app {Zynq FSBL} -configapp -app fsbl build-config release -sdk projects -build -type all - -### Copy common zynq.bif file +### Copy common dependent files for ZCU102 file mkdir $cdir/boot file copy -force $cdir/projects/common/boot/zynq.bif $cdir/boot/zynq.bif if {$argc == 1} { @@ -24,12 +15,11 @@ if {$argc == 1} { file copy -force $cdir/projects/common/boot/u-boot.elf $cdir/boot/u-boot.elf } -### Copy fsbl and system_top.bit into the output folder -file copy -force $sdk_loc/fsbl/Release/fsbl.elf $cdir/boot/fsbl.elf -file copy -force $sdk_loc/hw_0/system_top.bit $cdir/boot/system_top.bit +### Copy system_top.bit into the output folder +file copy -force $cdir/projects/common/boot/fsbl.elf $cdir/boot/fsbl.elf +file copy -force $cdir/vivado_prj.runs/impl_1/system_top.bit $cdir/boot/system_top.bit ### Build BOOT.BIN cd $cdir/boot exec bootgen -arch zynq -image zynq.bif -o BOOT.BIN -w exit - diff --git a/CI/scripts/read_ports_json.py b/CI/scripts/read_ports_json.py index 5308fc40..b11e47c9 100644 --- a/CI/scripts/read_ports_json.py +++ b/CI/scripts/read_ports_json.py @@ -4,80 +4,65 @@ ports_json_file = 'ports.json' with open(ports_json_file) as json_file: ports = json.load(json_file) + tmp_key = "m_name" for key0 in ports.keys(): - m_names = dict() for key1 in ports[key0]['ports'][0].keys(): if (key1 == "rx"): for ii in range(0, len(ports[key0]['ports'][0][key1])): tmp_dict = ports[key0]['ports'][0][key1][ii] - if tmp_key not in tmp_dict: - if (tmp_dict['type'].lower() == "data"): - if (tmp_dict['input'] == "true") : + if (tmp_dict['type'].lower() == "data"): + if (tmp_dict['input'] == "true"): + if tmp_key not in tmp_dict: tmp_list = tmp_dict['name'].split("_") - last_ele = tmp_list[-1] - ip = "" - if (len(last_ele) == 2) : - ip = f"{ports[key0]['chip']} ADC Data {last_ele.upper()}" - else : - ip = f"{ports[key0]['chip']} ADC Data 0 IN" - if ip in m_names : - m_names[ip] += 1 - ip = f"{ports[key0]['chip']} ADC Data {m_names[ip]} IN" - else : - m_names[ip] = 0 - tmp_dict[tmp_key] = ip - elif (tmp_dict['input'] == "false"): - if tmp_key not in tmp_dict: - ip = f"IP Data 0 OUT" - if ip in m_names : - m_names[ip] += 1 - tmp_dict[tmp_key] = f"IP Data {m_names[ip]} OUT" - else : - m_names[ip] = 0 - tmp_dict[tmp_key] = ip - - elif (tmp_dict['type'].lower() == "valid"): - if (tmp_dict['input'] == "true"): - tmp_dict[tmp_key] = f"IP Valid Rx Data IN" - elif (tmp_dict['input'] == "false"): - tmp_dict[tmp_key] = f"IP Data Valid OUT" + last_ele = tmp_list[-1] + if (len(last_ele) == 1): + res = divmod(int(last_ele), 2) + if res[1]: + i_or_q = "Q" + else: + i_or_q = "I" + tmp_dict[tmp_key] = f"{ports[key0]['chip']} ADC Data {i_or_q}{res[0]}" + elif (len(last_ele) == 2): + tmp_dict[tmp_key] = f"{ports[key0]['chip']} ADC Data {last_ele.upper()}" + elif (tmp_dict['input'] == "false"): + if tmp_key not in tmp_dict: + tmp_list = tmp_dict['name'].split("_") + last_ele = tmp_list[-1] + tmp_dict[tmp_key] = f"IP Data {last_ele.upper()} OUT" + elif (tmp_dict['type'].lower() == "valid"): + if (tmp_dict['input'] == "true"): + tmp_dict[tmp_key] = f"IP Valid Rx Data IN" + elif (tmp_dict['input'] == "false"): + tmp_dict[tmp_key] = f"IP Data Valid OUT" ports[key0]['ports'][0][key1][ii] = tmp_dict - elif (key1 == "tx"): for ii in range(0, len(ports[key0]['ports'][0][key1])): tmp_dict = ports[key0]['ports'][0][key1][ii] - if tmp_key not in tmp_dict : - if (tmp_dict['type'].lower() == "data") : - if (tmp_dict['input'] == "false"): + if (tmp_dict['type'].lower() == "data"): + if (tmp_dict['input'] == "false"): + if tmp_key not in tmp_dict: tmp_list = tmp_dict['name'].split("_") - last_ele = tmp_list[-1] - ip = "" - if (len(last_ele) == 2): - ip = f"{ports[key0]['chip']} DAC Data {last_ele.upper()}" - else: - ip = f"{ports[key0]['chip']} DAC Data 0 OUT" - if ip in m_names : - m_names[ip] += 1 - ip = f"{ports[key0]['chip']} DAC Data {m_names[ip]} OUT" - else : - m_names[ip] = 0 - tmp_dict[tmp_key] = ip - elif (tmp_dict['input'] == "true"): - if tmp_key not in tmp_dict: - ip = f"IP Data 0 IN" - if ip in m_names : - m_names[ip] += 1 - tmp_dict[tmp_key] = f"IP Data {m_names[ip]} IN" - else : - m_names[ip] = 0 - tmp_dict[tmp_key] = ip - - elif (tmp_dict['type'].lower() == "valid"): - if (tmp_dict['input'] == "true"): - tmp_dict[tmp_key] = f"IP Valid Tx Data IN" - elif (tmp_dict['input'] == "false"): - tmp_dict[tmp_key] = f"IP Load Tx Data OUT" + last_ele = tmp_list[-1] + if (len(last_ele) == 1): + res = divmod(int(last_ele), 2) + if res[1]: + i_or_q = "Q" + else: + i_or_q = "I" + tmp_dict[tmp_key] = f"{ports[key0]['chip']} DAC Data {i_or_q}{res[0]}" + elif (len(last_ele) == 2): + tmp_dict[tmp_key] = f"{ports[key0]['chip']} DAC Data {last_ele.upper()}" + elif (tmp_dict['input'] == "true"): + if tmp_key not in tmp_dict: + tmp_list = tmp_dict['name'].split("_") + last_ele = tmp_list[-1] + tmp_dict[tmp_key] = f"IP Data {last_ele.upper()} IN" + elif (tmp_dict['type'].lower() == "valid"): + if (tmp_dict['input'] == "true"): + tmp_dict[tmp_key] = f"IP Valid Tx Data IN" + elif (tmp_dict['input'] == "false"): + tmp_dict[tmp_key] = f"IP Load Tx Data OUT" ports[key0]['ports'][0][key1][ii] = tmp_dict with open(ports_json_file, 'w') as json_file: diff --git a/test/build_design.m b/test/build_design.m index e52eb9c8..38bc839f 100644 --- a/test/build_design.m +++ b/test/build_design.m @@ -31,6 +31,7 @@ hWC.ProjectFolder = folder; hWC.ReferenceDesignToolVersion = vivado_version; hWC.IgnoreToolVersionMismatch = true; +hWC.AllowUnsupportedToolVersion = true; % Set Workflow tasks to run hWC.RunTaskGenerateRTLCodeAndIPCore = true;