예제 #1
0
def run_test():
    asterics.quiet()
    comptime = time.time()
    # asterics.set_loglevel("info", "info")
    chain = asterics.new_chain()

    thistime = time.time() - comptime
    print("Init: {}".format(thistime))
    comptime = time.time()
    asterics.set_loglevel("info")

    asterics.add_module_repository("/home/phil/EES/asterics-nonfree/modules/",
                                   "nonfree")
    # asterics.add_module_repository("demo_user_modules/", "demo")

    thistime = time.time() - comptime
    print("Add subfolder: {}".format(thistime))
    comptime = time.time()

    # define_diff_image(chain)
    # define_threshold_system(chain)
    # define_myfilter(chain)
    # define_diff(chain)
    # define_nitra(chain)
    # define_uht_ew(chain)
    define_simple_camera(chain)
    # define_single_2dwpmod(chain)
    # define_test(chain)

    thistime = time.time() - comptime
    print("Chain definition: {}".format(thistime))
    comptime = time.time()

    success = chain.write_asterics_core("astertest/",
                                        use_symlinks=True,
                                        force=True)
    # success = chain.write_ip_core_xilinx("astertest/", use_symlinks=True, force=True)
    if success:
        # asterics.vears("astertest/IPs/", force=True)

        thistime = time.time() - comptime
        print("Build chain: {}".format(thistime))
        comptime = time.time()

        chain.list_address_space()
        asterics.write_system_graph(
            chain,
            show_toplevels=False,
            show_auto_inst=False,
            show_ports=False,
            show_unconnected=False,
        )

        thistime = time.time() - comptime
        print("Print graph and regs: {}".format(thistime))
        print("Done")
    else:
        print("Failed")
예제 #2
0
def build(demo_system):
    # Automatics instance and initialization
    chain = asterics.new_chain()

    # Include user modules
    asterics.add_module_repository(
        "{}/demo_user_modules/".format(sys.argv[0].rsplit("/", maxsplit=1)[0]), "user"
    )

    # Define system
    demo_system(chain)

    # Build system
    chain.write_system("astertest/", use_symlinks=False, force=True)

    asterics.write_system_graph(chain)
예제 #3
0
#
# --------------------- DOXYGEN -----------------------------------------------
##
# @file asterics-gen.py
# @author Philip Manke, Michael Schäferling
# @brief Chain description script to generate the as_refdesign_canny ASTERICS IP-core
# -----------------------------------------------------------------------------

# Import Automatics
import asterics

# Import sys for argument handling
import sys

# Get a new processing chain object
chain = asterics.new_chain()

############### ↓ Canny System description ↓ ###############

# _ Add streaming modules
# Camera
cam0 = chain.add_module("as_sensor_ov7670", "cam0")
# Set Camera's IIC master
cam0.add_iic_master("XILINX_PL_IIC")
# Feature memory writer
writer0 = chain.add_module("as_memwriter", "writer0")
collect_orig = chain.add_module("as_collect", "collect_orig")
writer_orig = chain.add_module("as_memwriter", "writer_orig")

# _ Configure streaming modules