mirror of https://github.com/YosysHQ/yosys.git
pyosys: support ObjRange
* this adds support for cells(), modules() and wires() that all return ObjRanges, converting them into lists for python
This commit is contained in:
parent
b2d78589e2
commit
84ee345071
|
@ -375,6 +375,10 @@ class PoolTranslator(PythonListTranslator):
|
||||||
insert_name = ".insert"
|
insert_name = ".insert"
|
||||||
orig_name = "pool"
|
orig_name = "pool"
|
||||||
|
|
||||||
|
#Sub-type for ObjRange
|
||||||
|
class ObjRangeTranslator(PythonListTranslator):
|
||||||
|
orig_name = "RTLIL::ObjRange"
|
||||||
|
|
||||||
#Translates dict-types (dict, std::map), that only differ in their name and
|
#Translates dict-types (dict, std::map), that only differ in their name and
|
||||||
#the name of the insertion function
|
#the name of the insertion function
|
||||||
class PythonDictTranslator(Translator):
|
class PythonDictTranslator(Translator):
|
||||||
|
@ -536,13 +540,14 @@ class TupleTranslator(PythonDictTranslator):
|
||||||
|
|
||||||
#Associate the Translators with their c++ type
|
#Associate the Translators with their c++ type
|
||||||
known_containers = {
|
known_containers = {
|
||||||
"std::set" : SetTranslator,
|
"std::set" : SetTranslator,
|
||||||
"std::vector" : VectorTranslator,
|
"std::vector" : VectorTranslator,
|
||||||
"pool" : PoolTranslator,
|
"pool" : PoolTranslator,
|
||||||
"idict" : IDictTranslator,
|
"idict" : IDictTranslator,
|
||||||
"dict" : DictTranslator,
|
"dict" : DictTranslator,
|
||||||
"std::pair" : TupleTranslator,
|
"std::pair" : TupleTranslator,
|
||||||
"std::map" : MapTranslator
|
"std::map" : MapTranslator,
|
||||||
|
"RTLIL::ObjRange" : ObjRangeTranslator
|
||||||
}
|
}
|
||||||
|
|
||||||
class Attribute:
|
class Attribute:
|
||||||
|
|
Loading…
Reference in New Issue