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:
George Rennie 2024-11-04 15:56:33 +01:00
parent b2d78589e2
commit 84ee345071
1 changed files with 12 additions and 7 deletions

View File

@ -375,6 +375,10 @@ class PoolTranslator(PythonListTranslator):
insert_name = ".insert"
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
#the name of the insertion function
class PythonDictTranslator(Translator):
@ -542,7 +546,8 @@ known_containers = {
"idict" : IDictTranslator,
"dict" : DictTranslator,
"std::pair" : TupleTranslator,
"std::map" : MapTranslator
"std::map" : MapTranslator,
"RTLIL::ObjRange" : ObjRangeTranslator
}
class Attribute: