Added vivado IP generatioon
Signed-off-by: Joppe Blondel <joppe@blondel.nl>
This commit is contained in:
2
examples/zynq7000/.gitignore
vendored
Normal file
2
examples/zynq7000/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
OUT
|
||||
BUILD
|
16
examples/zynq7000/IP/zynqps.tcl
Normal file
16
examples/zynq7000/IP/zynqps.tcl
Normal file
@ -0,0 +1,16 @@
|
||||
create_ip -vlnv xilinx.com:ip:processing_system7 -module_name zynqps
|
||||
set_property -dict [ list \
|
||||
CONFIG.PCW_UIPARAM_DDR_BUS_WIDTH {16 Bit} \
|
||||
CONFIG.PCW_UIPARAM_DDR_PARTNO {MT41K256M16 RE-125} \
|
||||
CONFIG.PCW_UART1_PERIPHERAL_ENABLE {1} \
|
||||
CONFIG.PCW_UART1_UART1_IO {MIO 44 .. 45} \
|
||||
CONFIG.PCW_FPGA0_PERIPHERAL_FREQMHZ {100} \
|
||||
CONFIG.PCW_USE_S_AXI_GP0 {0} \
|
||||
CONFIG.PCW_USE_M_AXI_GP0 {0} \
|
||||
CONFIG.PCW_USE_S_AXI_GP1 {0} \
|
||||
CONFIG.PCW_USE_M_AXI_GP1 {0} \
|
||||
CONFIG.PCW_USE_S_AXI_HP0 {0} \
|
||||
CONFIG.PCW_USE_S_AXI_HP1 {0} \
|
||||
CONFIG.PCW_USE_S_AXI_HP2 {0} \
|
||||
CONFIG.PCW_USE_S_AXI_HP3 {0} \
|
||||
] [ get_ips zynqps ]
|
28
examples/zynq7000/project.cfg
Normal file
28
examples/zynq7000/project.cfg
Normal file
@ -0,0 +1,28 @@
|
||||
[project]
|
||||
name = zynq7000_project
|
||||
version = 0.1
|
||||
out_dir = OUT
|
||||
build_dir = BUILD
|
||||
|
||||
[server]
|
||||
hostname = localhost
|
||||
port = 2020
|
||||
privkey = /home/joppe/.ssh/id_rsa
|
||||
pubkey = /home/joppe/.ssh/id_rsa.pub
|
||||
|
||||
# ######################################
|
||||
# ISE IP block generation
|
||||
[target.ip]
|
||||
toolchain = VIVADO_IP
|
||||
|
||||
# Toolchain settings
|
||||
family = zynq
|
||||
device = xc7z010
|
||||
package = clg400
|
||||
speedgrade = -2
|
||||
|
||||
# Fileset
|
||||
files_tcl = IP/zynqps.tcl
|
||||
# Note: IP file names must be the same as the component name in the tcl file!
|
||||
|
||||
# ######################################
|
@ -1,10 +1,3 @@
|
||||
from .util_ISE.xst import xst
|
||||
from .util_ISE.ngdbuild import ngdbuild
|
||||
from .util_ISE.map import map
|
||||
from .util_ISE.par import par
|
||||
from .util_ISE.netgen import netgen
|
||||
from .util_ISE.bitgen import bitgen
|
||||
from .util_ISE.trce import trce
|
||||
from .util_ISE.coregen import coregen
|
||||
|
||||
import shutil
|
||||
|
58
remotesyn/toolchains/VIVADO_IP.py
Normal file
58
remotesyn/toolchains/VIVADO_IP.py
Normal file
@ -0,0 +1,58 @@
|
||||
import shutil
|
||||
import os
|
||||
import time
|
||||
import subprocess
|
||||
|
||||
def do(config, target, log, subprocesses, prefix='.'):
|
||||
shutil.rmtree(config.get('project', 'build_dir', fallback='build'), True)
|
||||
|
||||
log("Generate IP's:")
|
||||
|
||||
log(" - parsing options")
|
||||
device = config.get(f'target.{target}', 'device', fallback='')
|
||||
family = config.get(f'target.{target}', 'family', fallback='')
|
||||
package = config.get(f'target.{target}', 'package', fallback='')
|
||||
speedgrade = config.get(f'target.{target}', 'speedgrade', fallback='')
|
||||
files_tcl = config.get(f'target.{target}', 'files_tcl', fallback='').split()
|
||||
build_dir = config.get(f'project', 'build_dir', fallback='build')
|
||||
out_dir = config.get(f'project', 'out_dir', fallback='out')
|
||||
|
||||
prefix = f'{os.getcwd()}/{prefix}'
|
||||
build_dir = f'{prefix}/{build_dir}'
|
||||
out_dir = f'{prefix}/{out_dir}/{target}'
|
||||
|
||||
log(" - creating output directories")
|
||||
os.makedirs(build_dir, exist_ok=True)
|
||||
os.makedirs(out_dir, exist_ok=True)
|
||||
|
||||
for tcl in files_tcl:
|
||||
cname = tcl.split('/')[-1].split('.')[0]
|
||||
|
||||
log(" - Generating", cname, "...")
|
||||
|
||||
log(" - writing project tcl file")
|
||||
with open(f'{build_dir}/do.tcl', 'w') as f:
|
||||
f.write(f"file mkdir {cname}\ncreate_project -in_memory\nset_property part {device}{package}{speedgrade} [current_project]\n")
|
||||
f.write(f"source {prefix}/{tcl}\n")
|
||||
f.write(f"export_ip_user_files -of_objects [get_files {cname}/{cname}/{cname}.xci ] -no_script -sync -force -quiet\n")
|
||||
f.write(f"upgrade_ip [get_ips {cname}]\ngenerate_target all [get_ips {cname}]\n")
|
||||
|
||||
log(" - run vivado")
|
||||
p = subprocess.Popen(f"vivado -mode batch -source do.tcl",
|
||||
shell=True, cwd=build_dir,
|
||||
stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
subprocesses.append(p)
|
||||
while p.poll() is None:
|
||||
time.sleep(1)
|
||||
res = p.returncode
|
||||
|
||||
log(" - copy logs")
|
||||
shutil.copy(f'{build_dir}/vivado.log', f'{out_dir}/vivado_{cname}.log')
|
||||
|
||||
if res==0:
|
||||
log(" - copy output files")
|
||||
shutil.copytree(f'{build_dir}/.gen/sources_1/ip/{cname}', f'{out_dir}/{cname}')
|
||||
else:
|
||||
log("ERROR: vivado returned with:", res)
|
||||
return res
|
||||
|
Reference in New Issue
Block a user