diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-09-20 09:59:42 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-09-20 09:59:42 -0700 |
commit | 1844498c5f4f19f77919faf056b165d8b282470e (patch) | |
tree | ea1bbfa4be07e009bfd3267a53d152dbaaee152f /passes/pmgen | |
parent | 289cf688b76328d62c7416d1327d2d6777b0ffd9 (diff) | |
download | yosys-1844498c5f4f19f77919faf056b165d8b282470e.tar.gz yosys-1844498c5f4f19f77919faf056b165d8b282470e.tar.bz2 yosys-1844498c5f4f19f77919faf056b165d8b282470e.zip |
Add an overload for port/param with default value
Diffstat (limited to 'passes/pmgen')
-rw-r--r-- | passes/pmgen/pmgen.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/passes/pmgen/pmgen.py b/passes/pmgen/pmgen.py index 335d26f16..d5e667911 100644 --- a/passes/pmgen/pmgen.py +++ b/passes/pmgen/pmgen.py @@ -453,11 +453,19 @@ with open(outfile, "w") as f: print(" return sigmap(cell->getPort(portname));", file=f) print(" }", file=f) print("", file=f) + print(" SigSpec port(Cell *cell, IdString portname, const SigSpec& defval) {", file=f) + print(" return sigmap(cell->connections_.at(portname, defval));", file=f) + print(" }", file=f) + print("", file=f) print(" Const param(Cell *cell, IdString paramname) {", file=f) print(" return cell->getParam(paramname);", file=f) print(" }", file=f) print("", file=f) + print(" Const param(Cell *cell, IdString paramname, const Const& defval) {", file=f) + print(" return cell->parameters.at(paramname, defval);", file=f) + print(" }", file=f) + print("", file=f) print(" int nusers(const SigSpec &sig) {", file=f) print(" pool<Cell*> users;", file=f) |