From 3afd2c2d812a71efa8c6ce860835b4617051f2b6 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 31 Mar 2021 18:36:38 +0100 Subject: [PATCH] build vhd objects --- ls180/vbe2vst.py | 4 +++- ls180/vhd2obj.py | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 ls180/vhd2obj.py diff --git a/ls180/vbe2vst.py b/ls180/vbe2vst.py index 9cd7bac..0af4e3b 100644 --- a/ls180/vbe2vst.py +++ b/ls180/vbe2vst.py @@ -6,6 +6,8 @@ import sys VASY_CMD = "schroot -c coriolis -d /tmp -- ~/alliance/install/bin/vasy" NSXLIB = "../alliance-check-toolkit/cells/nsxlib" +os.system("mkdir -p nsxlib") + for fname in os.listdir(NSXLIB): if not fname.endswith(".vbe"): continue @@ -14,4 +16,4 @@ for fname in os.listdir(NSXLIB): 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 ." % (prefix)) + os.system("cp /tmp/%s.vhd nsxlib" % (prefix)) diff --git a/ls180/vhd2obj.py b/ls180/vhd2obj.py new file mode 100644 index 0000000..80c17a7 --- /dev/null +++ b/ls180/vhd2obj.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +"""builds nsxlib VHD files into object files using ghdl +""" + +import os +import sys + +NSXLIB = "nsxlib" + +# make and change to obj dir +os.system("mkdir -p obj") +cwd = os.getcwd() +os.chdir("obj") + +# run ghdl -a on every nsxlib vhd file +for fname in os.listdir("../%s" % NSXLIB): + if not fname.endswith(".vhd"): + continue + print (fname) + prefix = fname[:-4] # strip ".vhd" + os.system("ghdl -a ../%s/%s" % (NSXLIB, fname)) + +# back to original dir +os.chdir(cwd) -- 2.30.2