mirror of https://github.com/YosysHQ/yosys.git
Add an overload for port/param with default value
This commit is contained in:
parent
289cf688b7
commit
1844498c5f
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue