扩展现有的单元库

时间:2017-04-27 05:15:46

标签: yosys

我正在尝试创建自己的单元库,以便自定义映射过程。有没有人知道如何在工具中包含新的单元库?

1 个答案:

答案 0 :(得分:1)

这是一个映射到自由(.lib)格式的库的示例项目:

https://github.com/cliffordwolf/yosys/tree/master/examples/cmos

细胞库:NSNull
综合脚本:extension Dictionary { func nullKeyRemoval() -> [AnyHashable: Any] { var dict: [AnyHashable: Any] = self let keysToRemove = dict.keys.filter { dict[$0] is NSNull } let keysToCheck = dict.keys.filter({ dict[$0] is Dictionary }) for key in keysToRemove { dict.removeValue(forKey: key) } for key in keysToCheck { if let valueDict = dict[key] as? [AnyHashable: Any] { dict.updateValue(valueDict.nullKeyRemoval(), forKey: key) } } return dict } }