Merge pull request #446 from antmicro/wsip/type_parameter
handle vpiTypeParameter
diff --git a/.github/workflows/build-and-test.sh b/.github/workflows/build-and-test.sh
index 7d0401e..69fd8a7 100755
--- a/.github/workflows/build-and-test.sh
+++ b/.github/workflows/build-and-test.sh
@@ -19,12 +19,22 @@
source .github/workflows/common.sh
+if [ -z "${PLUGIN_NAME}" ]; then
+ echo "Missing \${PLUGIN_NAME} env value"
+ exit 1
+fi
+
##########################################################################
start_section Building
+if [ "$PLUGIN_NAME" == "xdc" ] || [ "$PLUGIN_NAME" == "sdc" ]; then
+ make design_introspection.so -j`nproc`
+ make install_design_introspection -j`nproc`
+fi
+
export CXXFLAGS=-Werror
-make UHDM_INSTALL_DIR=`pwd`/env/conda/envs/yosys-plugins/ plugins -j`nproc`
+make UHDM_INSTALL_DIR=`pwd`/env/conda/envs/yosys-plugins/ ${PLUGIN_NAME}.so -j`nproc`
unset CXXFLAGS
end_section
@@ -32,19 +42,19 @@
##########################################################################
start_section Installing
-make install -j`nproc`
+make install_${PLUGIN_NAME} -j`nproc`
end_section
##########################################################################
start_section Testing
-make test -j`nproc`
+make test_${PLUGIN_NAME} -j`nproc`
end_section
##########################################################################
start_section Cleanup
-make plugins_clean -j`nproc`
+make clean_${PLUGIN_NAME} -j`nproc`
end_section
##########################################################################
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4ab1814..1ab44d1 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -23,6 +23,22 @@
Run-tests:
runs-on: ubuntu-20.04
+ strategy:
+ fail-fast: false
+ matrix:
+ plugin:
+ - fasm
+ - xdc
+ - params
+ - sdc
+ - ql-iob
+ - design_introspection
+ - integrateinv
+ - ql-qlf
+ - systemverilog
+ - uhdm
+ - dsp-ff
+
steps:
- uses: actions/checkout@v2
@@ -61,3 +77,4 @@
source .github/workflows/build-and-test.sh
env:
OS: ${{ runner.os }}
+ PLUGIN_NAME: ${{ matrix.plugin }}
diff --git a/systemverilog-plugin/UhdmAst.cc b/systemverilog-plugin/UhdmAst.cc
index 011ae12..3c2ae3e 100644
--- a/systemverilog-plugin/UhdmAst.cc
+++ b/systemverilog-plugin/UhdmAst.cc
@@ -4259,10 +4259,11 @@
visit_one_to_one({vpiExpr}, obj_h, [&](AST::AstNode *node) { current_node->children.push_back(node); });
}
-void UhdmAst::process_unsupported_stmt(const UHDM::BaseClass *object)
+void UhdmAst::process_unsupported_stmt(const UHDM::BaseClass *object, bool is_error)
{
- log_error("%.*s:%d: Currently not supported object of type '%s'\n", (int)object->VpiFile().length(), object->VpiFile().data(),
- object->VpiLineNo(), UHDM::VpiTypeName(obj_h).c_str());
+ const auto log_func = is_error ? log_error : log_warning;
+ std::string prefix = object->VpiLineNo() ? (std::string(object->VpiFile()) + ":" + std::to_string(object->VpiLineNo()) + ": ") : "";
+ log_func("%sCurrently not supported object of type '%s'\n", prefix.c_str(), UHDM::VpiTypeName(obj_h).c_str());
}
AST::AstNode *UhdmAst::process_object(vpiHandle obj_handle)
@@ -4384,6 +4385,9 @@
case vpiInitial:
process_initial();
break;
+ case vpiFinal:
+ process_unsupported_stmt(object, false);
+ break;
case vpiNamedBegin:
process_begin(true);
break;
diff --git a/systemverilog-plugin/UhdmAst.h b/systemverilog-plugin/UhdmAst.h
index 6d6a8f6..bbd0460 100644
--- a/systemverilog-plugin/UhdmAst.h
+++ b/systemverilog-plugin/UhdmAst.h
@@ -151,7 +151,7 @@
void process_gate();
void process_primterm();
void simplify_parameter(::Yosys::AST::AstNode *parameter, ::Yosys::AST::AstNode *module_node = nullptr);
- void process_unsupported_stmt(const UHDM::BaseClass *object);
+ void process_unsupported_stmt(const UHDM::BaseClass *object, bool is_error = true);
UhdmAst(UhdmAst *p, UhdmAstShared &s, const std::string &i) : parent(p), shared(s), indent(i)
{