Skip to content

Commit

Permalink
refine python dump verilog
Browse files Browse the repository at this point in the history
  • Loading branch information
xtofalex committed Apr 4, 2024
1 parent 4b98ee0 commit ed10dfb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/snl/python/snl_wrapping/PySNLDesign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@ static PyObject* PySNLDesign_clone(PySNLDesign* self, PyObject* args) {

static PyObject* PySNLDesign_dumpVerilog(PySNLDesign* self, PyObject* args) {
const char* arg0 = nullptr;
if (not PyArg_ParseTuple(args, "|s:SNLDesign.dumpVerilog", &arg0)) {
const char* arg1 = nullptr;
if (not PyArg_ParseTuple(args, "ss:SNLDesign.dumpVerilog", &arg0, &arg1)) {
setError("malformed SNLDesign.dumpVerilog method");
return nullptr;

Check warning on line 108 in src/snl/python/snl_wrapping/PySNLDesign.cpp

View check run for this annotation

Codecov / codecov/patch

src/snl/python/snl_wrapping/PySNLDesign.cpp#L107-L108

Added lines #L107 - L108 were not covered by tests
}
METHOD_HEAD("SNLDesign.dumpVerilog()")
SNLTRY
SNLVRLDumper dumper;
dumper.setTopFileName(arg1);
dumper.dumpDesign(selfObject, std::filesystem::path(arg0));
SNLCATCH
Py_RETURN_NONE;
Expand Down
2 changes: 1 addition & 1 deletion test/snl/python/snl_wrapping/test_snldesign_clone2.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def testClone(self):
if os.path.exists(bench_dir):
shutil.rmtree(bench_dir)
os.makedirs(bench_dir)
newDesign.dumpVerilog(os.path.join(bench_dir, bench_dir))
newDesign.dumpVerilog(os.path.join(bench_dir), "cloned.v")

n0 = newDesign.getNet("N0")
self.assertIsNotNone(n0)
Expand Down

0 comments on commit ed10dfb

Please sign in to comment.