From a26070e7d444b3aa545e012ed37dfae01f0335b3 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 1 Apr 2021 12:19:14 +0100 Subject: [PATCH] do niolib conversion as well as nsxlib --- ls180/vbe2vst.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/ls180/vbe2vst.py b/ls180/vbe2vst.py index 0af4e3b..075538c 100644 --- a/ls180/vbe2vst.py +++ b/ls180/vbe2vst.py @@ -1,19 +1,30 @@ #!/usr/bin/env python3 +"""converts NIOLIB and NSXLIB from VBE into VHDL +""" import os import sys +# use the chroot to set up +# https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=coriolis2-chroot;hb=HEAD +# reason for using the chroot: it's standardised across the ls180 project + VASY_CMD = "schroot -c coriolis -d /tmp -- ~/alliance/install/bin/vasy" -NSXLIB = "../alliance-check-toolkit/cells/nsxlib" +ALLIANCEBASE = "../alliance-check-toolkit/cells" +ALLIANCE_LIBS = ['nsxlib', 'niolib'] + +for libname in ALLIANCE_LIBS: + + NSXLIB = "%s/%s" % (ALLIANCEBASE, libname) -os.system("mkdir -p nsxlib") + os.system("mkdir -p %s" % libname) -for fname in os.listdir(NSXLIB): - if not fname.endswith(".vbe"): - continue - print (fname) - prefix = fname[:-4] # strip ".vbe" - os.system("cp %s/%s /tmp" % (NSXLIB, fname)) - os.system("rm -f /tmp/%s.vhd" % (prefix)) - os.system("%s -s -I vbe %s %s" % (VASY_CMD, fname, prefix)) - os.system("cp /tmp/%s.vhd nsxlib" % (prefix)) + for fname in os.listdir(NSXLIB): + if not fname.endswith(".vbe"): + continue + print (fname) + prefix = fname[:-4] # strip ".vbe" + os.system("cp %s/%s /tmp" % (NSXLIB, fname)) + os.system("rm -f /tmp/%s.vhd" % (prefix)) + os.system("%s -s -I vbe %s %s" % (VASY_CMD, fname, prefix)) + os.system("cp /tmp/%s.vhd %s" % (prefix, libname)) -- 2.30.2