Exemple #1
0
    ctx.join_macro = Macro(pins=macro_pins)
    ctx.join_macro.code = libctx.join_code.value
    ctx.join_macro.celltype = celltype
    ctx.join_macro.selected = ctx.selected
    ctx.join_macro.options = options

    for input_name in inputs:
        input_cell = Cell(celltype)
        setattr(ctx, input_name, input_cell)
        setattr(ctx.join_macro, input_name, input_cell)
        inputs[input_name].connect(input_cell)
    ctx.output = ctx.join_macro.output

ctx_switch.switch_code = Cell("code")
ctx_switch.switch_code = switch_func
ctx_switch.constructor_code = Cell("code")
ctx_switch.constructor_code = constructor_switch
ctx_switch.constructor_params = {
    "celltype": "value",
    "input": {
        "type": "cell",
        "io": "input"
    },
    "selected": {
        "type": "cell",
        "io": "input"
    },
    "outputs": {
        "type": "celldict",
        "io": "output"
    },
Exemple #2
0
print(ctx.inst.ctx.step2_first.tf.exception)
"""
    if not hasattr(self, "kw"):
        self.kw = {}
    n = 0
    while 1:
        n += 1
        c = "cell%d" % n
        if c not in self.kw:
            break
    self.kw[c] = function.path
"""

# 2: obtain graph and zip

ctx0.constructor_code = Cell("code").set(constructor)
ctx0.constructor_params = parameters
ctx0.api_schema = api_schema
ctx0.compute()

graph = ctx0.get_graph()
zip = ctx0.get_zip()

# 5: Save graph and zip

import os, json

currdir = os.path.dirname(os.path.abspath(__file__))
graph_filename = os.path.join(currdir, "../channel.seamless")
json.dump(graph, open(graph_filename, "w"), sort_keys=True, indent=2)
Exemple #3
0
    c.connect_from(ctx.c)

    ctx.subtract = Transformer()
    ctx.subtract_code = Cell("code")
    ctx.subtract_code = libctx.subtract_code.value
    ctx.subtract.code = ctx.subtract_code
    ctx.subtract.a = ctx.a
    ctx.subtract.pins.a.celltype = celltype
    ctx.subtract.b = ctx.b
    ctx.subtract.pins.b.celltype = celltype
    ctx.c = ctx.subtract


ctx.subtract_code = Cell("code")
ctx.subtract_code = subtract_func
ctx.constructor_code = Cell("code")
ctx.constructor_code = constructor
ctx.constructor_params = {
    "celltype": "value",
    "a": {
        "type": "cell",
        "io": "input"
    },
    "b": {
        "type": "cell",
        "io": "input"
    },
    "c": {
        "type": "cell",
        "io": "output"
    },