From 84ee345071d0c46b24f14e944d8c175c8831ea48 Mon Sep 17 00:00:00 2001 From: George Rennie Date: Mon, 4 Nov 2024 15:56:33 +0100 Subject: [PATCH] pyosys: support ObjRange * this adds support for cells(), modules() and wires() that all return ObjRanges, converting them into lists for python --- misc/py_wrap_generator.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/misc/py_wrap_generator.py b/misc/py_wrap_generator.py index 91a82081a..b0ac1e82e 100644 --- a/misc/py_wrap_generator.py +++ b/misc/py_wrap_generator.py @@ -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): @@ -536,13 +540,14 @@ class TupleTranslator(PythonDictTranslator): #Associate the Translators with their c++ type known_containers = { - "std::set" : SetTranslator, - "std::vector" : VectorTranslator, - "pool" : PoolTranslator, - "idict" : IDictTranslator, - "dict" : DictTranslator, - "std::pair" : TupleTranslator, - "std::map" : MapTranslator + "std::set" : SetTranslator, + "std::vector" : VectorTranslator, + "pool" : PoolTranslator, + "idict" : IDictTranslator, + "dict" : DictTranslator, + "std::pair" : TupleTranslator, + "std::map" : MapTranslator, + "RTLIL::ObjRange" : ObjRangeTranslator } class Attribute: