File tree Expand file tree Collapse file tree
lib/Conversion/ImportVerilog
test/Conversion/ImportVerilog Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8383
8484 - name : Setup Python
8585 uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
86+ with :
87+ python-version : ' 3.14'
8688
8789 - name : Install cibuildwheel
8890 run : python -m pip install cibuildwheel==3.3.0
Original file line number Diff line number Diff line change @@ -1973,6 +1973,10 @@ Context::defineFunction(const slang::ast::SubroutineSymbol &subroutine) {
19731973 // symbol and calls to it are not eliminated.
19741974 if (subroutine.flags .has (slang::ast::MethodFlags::DPIImport))
19751975 return success ();
1976+ // Pure virtual methods only contribute class method declarations and vtable
1977+ // slots. They have no body to define, including for non-void return types.
1978+ if (subroutine.flags .has (slang::ast::MethodFlags::Pure))
1979+ return success ();
19761980
19771981 const bool isMethod = (subroutine.thisVar != nullptr );
19781982
Original file line number Diff line number Diff line change 1+ // RUN: circt-translate --import-verilog %s | FileCheck %s
2+ // RUN: circt-verilog --ir-moore %s
3+ // REQUIRES: slang
4+ // UNSUPPORTED: valgrind
5+
6+ // clang-format off
7+ // CHECK-LABEL: moore.class.classdecl @StringBase {
8+ // CHECK: moore.class.methoddecl @text : (!moore.class<@StringBase>) -> !moore.string
9+ // CHECK: }
10+ virtual class StringBase ;
11+ pure virtual function string text ();
12+ endclass
13+
14+ // CHECK-LABEL: moore.class.classdecl @StringLeaf extends @StringBase {
15+ // CHECK: moore.class.methoddecl @text -> @"StringLeaf::text" : (!moore.class<@StringLeaf>) -> !moore.string
16+ // CHECK: }
17+ // CHECK-LABEL: func.func private @"StringLeaf::text"(%arg0: !moore.class<@StringLeaf>) -> !moore.string {
18+ // CHECK: return
19+ // CHECK: }
20+ class StringLeaf extends StringBase ;
21+ virtual function string text ();
22+ return " leaf" ;
23+ endfunction
24+ endclass
25+ // clang-format on
You can’t perform that action at this time.
0 commit comments