コード例 #1
0
ファイル: ParseBitstream.py プロジェクト: adbrant/zuma-fpga
def testLoadConfig(filename):

    globs.init()
    
    config = loadConfig(filename)
    for lutConfig in config:
        print lutConfig
コード例 #2
0
def testLoadConfig(filename):

    globs.init()

    config = loadConfig(filename)
    for lutConfig in config:
        print lutConfig
コード例 #3
0
def simpleTest():

    globs.init()
    globs.load_params()
    globs.params.vprVersion = 7

    nets = parseRouting('route.r.vpr7')

    for net in nets:
        print '\n ------ net ---------'
        print net.name
        print net.source
        print net.sinks
        for trace in net.trace:
            print '\n --- trace ---'
            print trace.type
            print trace.loc
            print trace.index

    #now vpr8
    print '\n----------now vpr8----------------\n'
    globs.params.vprVersion = 8

    nets = parseRouting('route.r.vpr8')

    for net in nets:
        print '\n ------ net ---------'
        print net.name
        print net.source
        print net.sinks
        for trace in net.trace:
            print '\n --- trace ---'
            print trace.type
            print trace.loc
            print trace.index
コード例 #4
0
def simpleTest():

    globs.init()
    globs.load_params()

    clusters = parseNetlist('netlistTest.net')
    for cluster in clusters:
        print 'cluster: ' + cluster.name

        for input in cluster.inputs:
            print 'cluster input: ' + input

        bleCount = 1
        for ble in cluster.bles:
            print 'analyse ble ' + str(bleCount)

            for (name, number) in ble.inputs:
                print 'ble input: ' + name + ' ' + str(number)

            if (ble.lut is None):
                print 'no lut'
            else:
                print 'has lut: ' + ble.lut.name

            if (ble.flipflop is None):
                print 'no flipflop'
            else:
                print 'has flipflop: ' + ble.flipflop.name
            bleCount = bleCount + 1
    print 'end test'

    print 'vpr8 test'

    clusters = parseNetlist('netlist.net.vpr8')
    for cluster in clusters:
        print 'cluster: ' + cluster.name

        for input in cluster.inputs:
            print 'cluster input: ' + input

        bleCount = 1
        for ble in cluster.bles:
            print 'analyse ble ' + str(bleCount)

            for (name, number) in ble.inputs:
                print 'ble input: ' + name + ' ' + str(number)

            if (ble.lut is None):
                print 'no lut'
            else:
                print 'has lut: ' + ble.lut.name

            if (ble.flipflop is None):
                print 'no flipflop'
            else:
                print 'has flipflop: ' + ble.flipflop.name
            bleCount = bleCount + 1
    print 'end test'
コード例 #5
0
    def __init__(self, root):
        self.root = root

        globs.init()
        Frame.__init__(self, root)
        self.pack(side = TOP, fill = "both")

        # ToolTips does not work well on non-Windows platforms
        if sys.platform.startswith('win'):
            ToolTips(root)

        self.run_finished = False
        self.run_clicked = False

        # MENU AND CONTENT SECTIONS
        self.menu = Frame(self, width="500", height="600")
        self.menu.pack(side=LEFT, fill="both")

        self.content_container = Frame(self, width="800", height="600")
        self.content_container.pack(side=LEFT, fill="both")

        # MENU BUTTONS
        self.home_btn = Button(self.menu, text='Home', command=self.show_home, \
                               width="10", height="3", font=(font_style, size_h2), cursor = 'hand2') # specified in characters?
        self.home_btn.pack(fill=X, side="top", pady=2)

        self.constraint_btn = Button(self.menu, text='Constraint', command=self.show_constraint, \
                               width="10", height="3", font=(font_style, size_h2), cursor = 'hand2')
        self.constraint_btn.pack(fill=X, side="top", pady=2)

        self.view_btn = Button(self.menu, text='View', command=self.show_view, \
                               width="10", height="3", font=(font_style, size_h2), cursor = 'hand2')
        self.view_btn.pack(fill=X, side="top", pady=2)

#         self.misc_btn = Button(self.menu, text='Splash', command=self.show_misc, \
#                                width="10", height="3", font=(font_style, size_h2), cursor = 'hand2')
#         self.misc_btn.pack(fill=X, side="top", pady=2)
#editing renato
        self.run_btn = Button(self.menu, text='RUN', bg='green', command=self.run_scheduler, \
                               width="10", height="3", font=(font_style, size_h2), cursor = 'hand2')
        self.run_btn.pack(fill = X, side = "top", pady=2)

        # PAGES
        self.home_page = HomePage(self.content_container)
        self.home_page.place(in_=self.content_container, x=0, y=0, relwidth=1, relheight=1)

        self.constraint_page = ConstraintPage(self.content_container, globs.mainScheduler.constraints)
        self.constraint_page.place(in_=self.content_container, x=0, y=0, relwidth=1, relheight=1)

        self.view_page = ViewPage(self.content_container)
        self.view_page.place(in_=self.content_container, x=0, y=0, relwidth=1, relheight=1)

        self.misc_page = MiscPage(self.content_container)
        self.misc_page.place(in_=self.content_container, x=0, y=0, relwidth=1, relheight=1)

        # INITIALIZE WITH HOME PAGE
        self.home_page.lift()
コード例 #6
0
def TestParser():

    globs.init()
    globs.load_params()
    globs.params.sdfUsedTool = "ise"
    globs.params.sdfInterconnectCellType = "zuma_wrapper"

    # cells = ParseSdf('Timing.sdf')
    #
    # for name,cell in cells.items():
    #
    #     print "new cell: " + str(cell.instanceName) + "\n"
    #
    #     for portName,port in cell.ports.items():
    #
    #         print "new port: " + str(port.name)
    #         print "risingDelay: " + str(port.risingDelay)
    #         print "fallingDelay: "  + str(port.fallingDelay)
    #
    #     for pathName,ioPath in cell.ioPaths.items():
    #
    #         print "new iopath: " + str(ioPath.name)
    #         print "risingDelay: "  + str(ioPath.risingDelay)
    #         print "fallingDelay: "  + str(ioPath.fallingDelay)
    #
    #     print "\n"

    globs.params.sdfUsedTool = "vivado"
    cells = ParseSdf('postRoute.sdf')

    for name,cell in cells.items():

        print "new cell: " + str(cell.instanceName) + "\n"

        for portName,port in cell.ports.items():

            print "new port: " + str(port.name)
            print "risingDelay: " + str(port.risingDelay)
            print "fallingDelay: "  + str(port.fallingDelay)

        for pathName,ioPath in cell.ioPaths.items():

            print "new iopath: " + str(ioPath.name)
            print "risingDelay: "  + str(ioPath.risingDelay)
            print "fallingDelay: "  + str(ioPath.fallingDelay)

        for (input,clock),setupHold in cell.setupHolds.items():

            print "new setuphold: " + str(setupHold.input) + ',' + str(setupHold.clock)
            print "setupDelay: "  + str(setupHold.setupDelay)
            print "holdDelay: "  + str(setupHold.holdDelay)

        print "\n"
コード例 #7
0
def simpleTest():

    globs.init()
    globs.load_params()

    blocks = parsePlacement('place.p.vpr7')
    for block in blocks:
        print block.location
        print block.name

    print 'now vpr8'

    blocks = parsePlacement('place.p.vpr8')
    for block in blocks:
        print block.location
        print block.name
コード例 #8
0
def bitToBlif(graph_file, verilog_file, blif_file, place_file, route_file,
              net_file, mif_file, maxInputNum, useClock, useReset):

    globs.init()
    globs.load_params()

    globs.clock = useClock
    globs.reset = useReset
    globs.maxInputNum = maxInputNum

    #signal reverse build
    globs.bit_to_blif = True

    #Import graph from VTR
    InitFpga.load_graph(graph_file)

    #Build ZUMA verilog global routing
    BuildVerilog.build_global_routing_verilog(verilog_file)

    ParseBitstream.parseBitstream(mif_file)

    Dump.dumpGraph('revereseGraph')
    #output a BLIF of the design
    OutputBlif.output_blif(blif_file)
コード例 #9
0
def simpleTest():

    globs.init()
    globs.load_params()

    globs.params.vprVersion = 7
    blif = parseBlif('abc_out.blif')

    print "\ninputs \n"
    for input in blif.inputs:
        print str(input.blifName) + " " + str(input.ioIndex) + "\n"

    print "\noutputs \n"
    for output in blif.outputs:
        print str(output.blifName) + " " + str(output.ioIndex) + "\n"

    print "\n latchces \n"
    for latch in blif.latches:
        print str(latch.inputNet) + " " + str(latch.outputNet) + "\n"

    print "\n names \n"
    for name in blif.names:
        print str(name.inputNets) + " " + str(name.outputNet) + "\n"
        print str(name.content)
コード例 #10
0
ファイル: main.py プロジェクト: lreznick/legalcitation
	'/test', 'Test'
)



#For the Server

app = web.application(urls, globals(),autoreload=False)
application = app.wsgifunc()


#For the Local Host
#app = web.application(urls, globals(),autoreload=True)


globs.init()          # Call only once

#For the Server
web.config.debug = False #  Change me  For server ------------
global session

#Configure session parameters
web.config.session_parameters['cookie_name'] = 'chocolate_chip_local'
web.config.session_parameters['cookie_domain'] = None
web.config.session_parameters['cookie_path'] = '/'
web.config.session_parameters['timeout'] = 86400 #24 * 60 * 60, # 24 hours in seconds is default
web.config.session_parameters['ignore_expiry'] = False
web.config.session_parameters['ignore_change_ip'] = True
web.config.session_parameters['secret_key'] = 'fLjUfxqXtfNoIldA0A0J'
web.config.session_parameters['expired_message'] = 'Session expired.. Please Reload and Login Again.'
store = web.session.DBStore(globs.db, 'sessions')
コード例 #11
0
ファイル: ZumaBitToBlif.py プロジェクト: adbrant/zuma-fpga
#!/usr/bin/env python
#	ZUMA Open FPGA Overlay
#	Alex Brant
#	Email: [email protected]
#	2012
#	Command line interface


import globs
globs.init()

import BuildVerilog

import ParseBitstream

import InitFpga
import OutputBlif
import Dump

import os

import sys


options = sys.argv[1:]

graph_file = 'rr_graph.echo'
verilog_file = 'ZUMA_custom_generated.v'
blif_file = 'zuma_out_revrese.blif'
place_file = 'place.p'
route_file = 'route.r'
コード例 #12
0
import pygame.locals

from button import *
import globs

width  = 864
height = 480

images = {
	'player': pygame.image.load(os.path.join("data","sprites","player.png")),

	'sky': pygame.image.load(os.path.join("data","tiles","sky.png")),
	'border': pygame.image.load(os.path.join("data","tiles","border.png"))
}

globs.init()

def grid(x,y):
	return (x*32,y*32)

# Temporary class for testing purposes.
class drawHelper:
	@staticmethod
	def frame(screen):
		#N
		for x in range(27):
			screen.blit(images['border'], grid(x,0))
		#S
		for x in range(27):
			screen.blit(images['border'], grid(x,14))
		#W
コード例 #13
0
ファイル: zuma_build.py プロジェクト: xoar/zuma-fpga
def Zuma(verilog_file, graph_file, blif_file, place_file, net_file, route_file,
         bit_file, blif_out_file, build_bit):

    globs.init()
    globs.load_params()

    #Import graph from VTR
    InitFpga.load_graph(graph_file)

    #Build ZUMA verilog global routing
    BuildVerilog.build_global_routing_verilog(verilog_file)

    #dump the node graph. textual and graphical
    if globs.params.dumpNodeGraph:
        Dump.dumpGraph('unconfiguredGraph')

    if build_bit:
        #Read all VPR output files
        ReadBlif.read_BLIF(blif_file)
        ReadPlacement.read_placement(place_file)

        ReadRouting.read_routing(route_file)

        ReadNetlist.read_netlist(net_file)

        #Build the bitstream
        BuildBitstream.build_bitstream(bit_file)

        buildPackedOverlay.createDefGenerated()

        #dump the node graph. textual and graphical
        if globs.params.dumpNodeGraph:
            Dump.dumpGraph('configuredGraph')

        if globs.params.dumpNodeGraph:
            Dump.dumpTechnologyGraph('mappedGraph')

        #output a BLIF of the design
        OutputBlif.output_blif(blif_out_file)

        #build a packed overlay
        if globs.params.packedOverlay:
            buildPackedOverlay.buildVerificationOverlay(
                "packedOverlay.v", False, False)

            if globs.params.blackBox:
                buildPackedOverlay.buildVerificationOverlay(
                    "packedOverlayBlackBox.v", False, True)

        #output a verification verilog file
        if globs.params.verifyOverlay:
            buildPackedOverlay.buildVerificationOverlay(
                "verificationOverlay.v", True, False)

        #dump a list of unconfigured nodes with their corresponding verilog names
        if globs.params.dumpUnconfiguredNodes:
            Dump.dumpUnconfiguredNodesToFile('unconfigured.txt')

        #if we want to parse the sdf file
        if globs.params.sdf:

            ReadSDF.ReadSDF()
            TimingAnalysisSDF.performTimingAnalysis()

            if globs.params.vprAnnotation:
                NodeGraphTiming.AnnotateTiming()
                TimingAnnotation.annotateClusterTiming()
                TimingAnnotation.annotateBack()

            if globs.params.dumpNodeGraph:
                Dump.dumpTechnologyGraph('mappedTimedGraph')
                Dump.dumpGraph('timedGraph')
コード例 #14
0
    def __init__(self, root):
        self.root = root

        globs.init()
        Frame.__init__(self, root)
        self.pack(side=TOP, fill="both")

        # ToolTips does not work well on non-Windows platforms
        if sys.platform.startswith('win'):
            ToolTips(root)

        self.run_finished = False
        self.run_clicked = False

        # MENU AND CONTENT SECTIONS
        self.menu = Frame(self, width="500", height="600")
        self.menu.pack(side=LEFT, fill="both")

        self.content_container = Frame(self, width="800", height="600")
        self.content_container.pack(side=LEFT, fill="both")

        # MENU BUTTONS
        self.home_btn = Button(self.menu, text='Home', command=self.show_home, \
                               width="10", height="3", font=(font_style, size_h2), cursor = 'hand2') # specified in characters?
        self.home_btn.pack(fill=X, side="top", pady=2)

        self.constraint_btn = Button(self.menu, text='Constraint', command=self.show_constraint, \
                               width="10", height="3", font=(font_style, size_h2), cursor = 'hand2')
        self.constraint_btn.pack(fill=X, side="top", pady=2)

        self.view_btn = Button(self.menu, text='View', command=self.show_view, \
                               width="10", height="3", font=(font_style, size_h2), cursor = 'hand2')
        self.view_btn.pack(fill=X, side="top", pady=2)

        #         self.misc_btn = Button(self.menu, text='Splash', command=self.show_misc, \
        #                                width="10", height="3", font=(font_style, size_h2), cursor = 'hand2')
        #         self.misc_btn.pack(fill=X, side="top", pady=2)
        #editing renato
        self.run_btn = Button(self.menu, text='RUN', bg='green', command=self.run_scheduler, \
                               width="10", height="3", font=(font_style, size_h2), cursor = 'hand2')
        self.run_btn.pack(fill=X, side="top", pady=2)

        # PAGES
        self.home_page = HomePage(self.content_container)
        self.home_page.place(in_=self.content_container,
                             x=0,
                             y=0,
                             relwidth=1,
                             relheight=1)

        self.constraint_page = ConstraintPage(self.content_container,
                                              globs.mainScheduler.constraints)
        self.constraint_page.place(in_=self.content_container,
                                   x=0,
                                   y=0,
                                   relwidth=1,
                                   relheight=1)

        self.view_page = ViewPage(self.content_container)
        self.view_page.place(in_=self.content_container,
                             x=0,
                             y=0,
                             relwidth=1,
                             relheight=1)

        self.misc_page = MiscPage(self.content_container)
        self.misc_page.place(in_=self.content_container,
                             x=0,
                             y=0,
                             relwidth=1,
                             relheight=1)

        # INITIALIZE WITH HOME PAGE
        self.home_page.lift()