[Pkg-electronics-commits] [ghdl] 01/01: update-ghdl-libraries: Additional 'work' and 'copywork' configuration keys
Andreas E. Bombe
aeb at moszumanska.debian.org
Sun Jan 21 00:40:08 UTC 2018
This is an automated email from the git hooks/post-receive script.
aeb pushed a commit to branch master
in repository ghdl.
commit 48704934c0040d9515968b54fb29f1a679125a92
Author: Andreas Bombe <aeb at debian.org>
Date: Sat Jan 20 02:10:43 2018 +0100
update-ghdl-libraries: Additional 'work' and 'copywork' configuration keys
Both are designed in support of the Synopsys library. The optional key
'work' allows to set the work library different from the value specified
in 'name' (so that it is possible to have 'name = synopsys' with 'work =
ieee').
Another optional key 'copywork' (defaults to off) copies the existing
library to the current subdir before compiling. Synopsys extends the
ieee library, so this can be used to avoid compiling the ieee sources
twice.
debian/synopsys.ghdllib is changed to make use of the enhancements.
---
debian/synopsys.ghdllib | 17 ++++++-----------
debian/update-ghdl-libraries | 12 +++++++++++-
2 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/debian/synopsys.ghdllib b/debian/synopsys.ghdllib
index 0048d11..a794acc 100644
--- a/debian/synopsys.ghdllib
+++ b/debian/synopsys.ghdllib
@@ -1,27 +1,22 @@
[library]
-name = ieee
+name = synopsys
+work = ieee
+copywork = yes
subdir = synopsys
-depends = std
+depends = ieee
standards = 87 93
[compile]
[compile 87]
-sources = openieee/std_logic_1164.v87 openieee/std_logic_1164-body.v87
- openieee/numeric_bit.v87 openieee/numeric_bit-body.v87
- openieee/numeric_std.v87 openieee/numeric_std-body.v87
- synopsys/std_logic_arith.vhdl
+sources = synopsys/std_logic_arith.vhdl
synopsys/std_logic_unsigned.vhdl
synopsys/std_logic_signed.vhdl
synopsys/std_logic_misc.vhdl synopsys/std_logic_misc-body.vhdl
synopsys/std_logic_textio.vhdl
[compile 93]
-sources = openieee/std_logic_1164.v93 openieee/std_logic_1164-body.v93
- openieee/numeric_bit.v93 openieee/numeric_bit-body.v93
- openieee/numeric_std.v93 openieee/numeric_std-body.v93
- openieee/math_real.vhdl openieee/math_real-body.vhdl
- synopsys/std_logic_arith.vhdl
+sources = synopsys/std_logic_arith.vhdl
synopsys/std_logic_unsigned.vhdl
synopsys/std_logic_signed.vhdl
synopsys/std_logic_misc.vhdl synopsys/std_logic_misc-body.vhdl
diff --git a/debian/update-ghdl-libraries b/debian/update-ghdl-libraries
index f380b00..c931e9c 100755
--- a/debian/update-ghdl-libraries
+++ b/debian/update-ghdl-libraries
@@ -123,6 +123,8 @@ def read_configuration_values(conf, std):
v = {}
v['name'] = lib['name']
+ v['work'] = lib.get('work', v['name'])
+ v['copywork'] = lib.getboolean('copywork', False)
v['subdir'] = lib.get('subdir', 'synopsys')
v['depends'] = lib.get('depends', 'ieee')
v['sources'] = comp.get('sources', '').split()
@@ -214,7 +216,7 @@ def build_libraries(backend, specs, std):
common_args = ['-a', '-O', std['flag']]
for spec in specs:
- args = ['--work='+spec['name']]
+ args = ['--work='+spec['work']]
if spec['name'] == 'std':
args.insert(0, '--bootstrap')
cmdline = [ghdl, *common_args, *args]
@@ -225,6 +227,14 @@ def build_libraries(backend, specs, std):
destdir.mkdir(exist_ok = True)
os.chdir(destdir)
+ # if requested, copy the library of the same name to the directory
+ if spec['copywork']:
+ copycmd = [ghdl, '--copy', std['flag'], '--work='+spec['work']]
+ logv(*copycmd)
+ result = subprocess.run(copycmd)
+ if result.returncode != 0:
+ set_fail()
+
for source in spec['sources']:
srcpath = Path(relsrcdir, source)
logv(*cmdline, srcpath)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-electronics/ghdl.git
More information about the Pkg-electronics-commits
mailing list