From 3a2132faacbb97ece281c34d2c1c39cf729dc047 Mon Sep 17 00:00:00 2001 From: Philipp van Kempen Date: Fri, 29 Mar 2024 10:25:55 +0100 Subject: [PATCH] add missing file: seal5/tools/git.py --- examples/demo.py | 18 ------------------ seal5/tools/git.py | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 18 deletions(-) create mode 100644 seal5/tools/git.py diff --git a/examples/demo.py b/examples/demo.py index b10a2734..7034e175 100644 --- a/examples/demo.py +++ b/examples/demo.py @@ -62,24 +62,6 @@ # Load CoreDSL inputs cdsl_files = [ - # XCOREV - EXAMPLES_DIR / "cdsl" / "rv_xcorev" / "XCoreVMac.core_desc", - EXAMPLES_DIR / "cdsl" / "rv_xcorev" / "XCoreVAlu.core_desc", - EXAMPLES_DIR / "cdsl" / "rv_xcorev" / "XCoreVBitmanip.core_desc", - EXAMPLES_DIR / "cdsl" / "rv_xcorev" / "XCoreVSimd.core_desc", - EXAMPLES_DIR / "cdsl" / "rv_xcorev" / "XCoreVMem.core_desc", - # EXAMPLES_DIR / "cdsl" / "rv_xcorev" / "XCoreVBranchImmediate.core_desc", - # RVP (will not work) - # EXAMPLES_DIR / "cdsl" / "RV32P.core_desc", - # EXAMPLES_DIR / "cdsl" / "RVP.core_desc", - # S4E (untested) -> undefined XLEN - # EXAMPLES_DIR / "cdsl" / "rv_s4e" / "s4e-mac.core_desc", - # TUMEDA (untested) - EXAMPLES_DIR / "cdsl" / "rv_tumeda" / "XCoreVNand.core_desc", - EXAMPLES_DIR / "cdsl" / "rv_tumeda" / "OpenASIP.core_desc", - # GENERATED (untested) - EXAMPLES_DIR / "cdsl" / "rv_gen" / "test.core_desc", - # OTHERS (untested) EXAMPLES_DIR / "cdsl" / "Example.core_desc", ] seal5_flow.load(cdsl_files, verbose=VERBOSE, overwrite=True) diff --git a/seal5/tools/git.py b/seal5/tools/git.py new file mode 100644 index 00000000..e5d3e59d --- /dev/null +++ b/seal5/tools/git.py @@ -0,0 +1,33 @@ +# +# Copyright (c) 2023 TUM Department of Electrical and Computer Engineering. +# +# This file is part of Seal5. +# See https://github.com/tum-ei-eda/seal5.git for further info. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +"""Git utils for seal5.""" +from git import Actor + +from seal5.settings import GitSettings + + +def get_author_from_settings(git_settings: GitSettings): + if git_settings is None: + author = "Unknown" + mail = "unknown@example.com" + else: + author = git_settings.author + mail = git_settings.mail + return Actor(author, mail)