@@ -30,6 +30,30 @@ void circt::python::populateDialectRTGTestSubmodule(nb::module_ &m) {
30
30
},
31
31
nb::arg (" self" ), nb::arg (" ctxt" ) = nullptr );
32
32
33
+ mlir_type_subclass (m, " Imm12Type" , rtgtestTypeIsAImm12)
34
+ .def_classmethod (
35
+ " get" ,
36
+ [](nb::object cls, MlirContext ctxt) {
37
+ return cls (rtgtestImm12TypeGet (ctxt));
38
+ },
39
+ nb::arg (" self" ), nb::arg (" ctxt" ) = nullptr );
40
+
41
+ mlir_type_subclass (m, " Imm21Type" , rtgtestTypeIsAImm21)
42
+ .def_classmethod (
43
+ " get" ,
44
+ [](nb::object cls, MlirContext ctxt) {
45
+ return cls (rtgtestImm21TypeGet (ctxt));
46
+ },
47
+ nb::arg (" self" ), nb::arg (" ctxt" ) = nullptr );
48
+
49
+ mlir_type_subclass (m, " Imm32Type" , rtgtestTypeIsAImm32)
50
+ .def_classmethod (
51
+ " get" ,
52
+ [](nb::object cls, MlirContext ctxt) {
53
+ return cls (rtgtestImm32TypeGet (ctxt));
54
+ },
55
+ nb::arg (" self" ), nb::arg (" ctxt" ) = nullptr );
56
+
33
57
mlir_attribute_subclass (m, " CPUAttr" , rtgtestAttrIsACPU)
34
58
.def_classmethod (
35
59
" get" ,
@@ -295,4 +319,37 @@ void circt::python::populateDialectRTGTestSubmodule(nb::module_ &m) {
295
319
return cls (rtgtestRegT6AttrGet (ctxt));
296
320
},
297
321
nb::arg (" self" ), nb::arg (" ctxt" ) = nullptr );
322
+
323
+ mlir_attribute_subclass (m, " Imm12Attr" , rtgtestAttrIsAImm12)
324
+ .def_classmethod (
325
+ " get" ,
326
+ [](nb::object cls, unsigned value, MlirContext ctxt) {
327
+ return cls (rtgtestImm12AttrGet (ctxt, value));
328
+ },
329
+ nb::arg (" self" ), nb::arg (" value" ), nb::arg (" ctxt" ) = nullptr )
330
+ .def_property_readonly (" value" , [](MlirAttribute self) {
331
+ return rtgtestImm12AttrGetValue (self);
332
+ });
333
+
334
+ mlir_attribute_subclass (m, " Imm21Attr" , rtgtestAttrIsAImm21)
335
+ .def_classmethod (
336
+ " get" ,
337
+ [](nb::object cls, unsigned value, MlirContext ctxt) {
338
+ return cls (rtgtestImm21AttrGet (ctxt, value));
339
+ },
340
+ nb::arg (" self" ), nb::arg (" value" ), nb::arg (" ctxt" ) = nullptr )
341
+ .def_property_readonly (" value" , [](MlirAttribute self) {
342
+ return rtgtestImm21AttrGetValue (self);
343
+ });
344
+
345
+ mlir_attribute_subclass (m, " Imm32Attr" , rtgtestAttrIsAImm32)
346
+ .def_classmethod (
347
+ " get" ,
348
+ [](nb::object cls, unsigned value, MlirContext ctxt) {
349
+ return cls (rtgtestImm32AttrGet (ctxt, value));
350
+ },
351
+ nb::arg (" self" ), nb::arg (" value" ), nb::arg (" ctxt" ) = nullptr )
352
+ .def_property_readonly (" value" , [](MlirAttribute self) {
353
+ return rtgtestImm32AttrGetValue (self);
354
+ });
298
355
}
0 commit comments