From a1c36fb2ce1f21234106a2a8b1da8dd9a7220c8e Mon Sep 17 00:00:00 2001 From: Lenny Truong Date: Thu, 25 Apr 2019 15:23:22 -0700 Subject: [PATCH] Add support for inout --- coreir/__init__.py | 3 +++ coreir/context.py | 3 +++ coreir/type.py | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/coreir/__init__.py b/coreir/__init__.py index 744d843..37824db 100644 --- a/coreir/__init__.py +++ b/coreir/__init__.py @@ -60,6 +60,9 @@ def define_types(name,input_types,output_type=None): libcoreir_c.COREPrintErrors.argtypes = [COREContext_p] +libcoreir_c.COREBitInOut.argtypes = [COREContext_p] +libcoreir_c.COREBitInOut.restype = COREType_p + libcoreir_c.COREBitIn.argtypes = [COREContext_p] libcoreir_c.COREBitIn.restype = COREType_p diff --git a/coreir/context.py b/coreir/context.py index 9fcf854..bb531bd 100644 --- a/coreir/context.py +++ b/coreir/context.py @@ -61,6 +61,9 @@ def G(self): def print_errors(self): libcoreir_c.COREPrintErrors(self.context) + def BitInOut(self): + return Type(libcoreir_c.COREBitInOut(self.context),self) + def BitIn(self): return Type(libcoreir_c.COREBitIn(self.context),self) diff --git a/coreir/type.py b/coreir/type.py index f778c3b..5c63a41 100644 --- a/coreir/type.py +++ b/coreir/type.py @@ -95,7 +95,8 @@ def kind(self): 1: "BitIn", 2: "Array", 3: "Record", - 4: "Named" + 4: "Named", + 5: "BitInOut" }[kind] def is_input(self):