Exemplo n.º 1
0
    def ootlist(self):
        """
        Lists the Out-of-tree module blocks
        """
        index = self.targets.currentIndex()
        self.build_target = str(self.targets.model().data(index))
        self.device = self.build_target[:4]
        if self.device == 'X310' or self.device == 'X300':
            self.target = 'x300'
            self.max_allowed_blocks = 10
        elif self.device == 'E310':
            self.target = 'e300'
            self.max_allowed_blocks = 6
        if self.device == 'N310' or self.device == 'N300':
            self.target = 'n3xx'
            self.max_allowed_blocks = 10
        oot_sources = os.path.join(uhd_image_builder.get_scriptpath(), '..', '..', 'top',\
            self.target, 'Makefile.srcs')
        self.show_list(self.oot, self.target, oot_sources)

        # Show the help string for a selected target
        selected_makefile = os.path.join(uhd_image_builder.get_scriptpath(),
                                         '..', '..', 'top', self.target,
                                         'Makefile')
        pattern = "^\#\S*{}.*".format(self.build_target)
        with open(selected_makefile) as fil:
            help_string = re.findall(pattern, fil.read(),
                                     re.MULTILINE)[0].replace("##", "")
            self.help_display.setText(help_string)
Exemplo n.º 2
0
    def ootlist(self):
        """
        Lists the Out-of-tree module blocks
        """
        index = self.targets.currentIndex()
        self.build_target = str(self.targets.model().data(index))
        self.device = self.build_target[:4]
        if self.device == 'X310' or self.device == 'X300':
            self.target = 'x300'
            self.max_allowed_blocks = 10
        elif self.device == 'E310':
            self.target = 'e300'
            self.max_allowed_blocks = 14
        elif self.device == 'E320':
            self.target = 'e320'
            self.max_allowed_blocks = 12
        elif self.device == 'N300':
            self.target = 'n3xx'
            self.max_allowed_blocks = 11
        elif self.device == 'N310' or self.device == 'N320':
            self.target = 'n3xx'
            self.max_allowed_blocks = 10
        oot_sources = os.path.join(uhd_image_builder.get_scriptpath(), '..', '..', 'top',\
            self.target, 'Makefile.srcs')
        self.show_list(self.oot, self.target, oot_sources)

        # Show the help string for a selected target
        selected_makefile = os.path.join(uhd_image_builder.get_scriptpath(),
                                         '..', '..', 'top', self.target, 'Makefile')
        pattern = "^\#\S*{}.*".format(self.build_target)
        with open(selected_makefile) as fil:
            help_string = re.findall(pattern, fil.read(), re.MULTILINE)[0].replace("##","")
            self.help_display.setText(help_string)
Exemplo n.º 3
0
 def refresh_oot_dirs(self):
     """
     Populates the OOT directory list from the OOT include file
     """
     oot_include = os.path.join(uhd_image_builder.get_scriptpath(), '..', '..', 'top',\
         self.target, 'Makefile.OOT.inc')
     dir_list = []
     with open(oot_include, 'r') as fil:
         text = fil.readlines()
         for lines in text:
             lines = lines.partition('$(BASE_DIR)/')
             if (lines[1] == '$(BASE_DIR)/'):
                 relpath = lines[2].replace('\n', '')
                 ootpath = os.path.abspath(
                     os.path.join(uhd_image_builder.get_scriptpath(), '..',
                                  '..', 'top', relpath))
                 dir_list.append(ootpath)
     if (len(dir_list) == 0):
         self.oot.removeRows(0, self.oot.rowCount())
         self.cmd_dict["include"] = ''
     else:
         self.oot_dirs = dir_list
         self.cmd_dict["include"] = '-I {}'.format(' '.join(self.oot_dirs))
     for (ii, oot) in enumerate(dir_list):
         self.populate_list(self.oot,
                            os.path.join(oot, 'fpga-src', 'Makefile.srcs'),
                            clear=ii == 0)
Exemplo n.º 4
0
    def __init__(self):
        super(MainWindow, self).__init__()
        ##################################################
        # Initial Values
        ##################################################
        self.target = 'x300'
        self.device = 'x310'
        self.build_target = 'X310_RFNOC_HG'
        self.oot_dirs = []
        self.max_allowed_blocks = 10
        self.cmd_dict = {"target": '-t {}'.format(self.build_target),
                         "device": '-d {}'.format(self.device),
                         "include": '',
                         "fill_fifos": '',
                         "viv_gui": '',
                         "cleanall": '',
                         "show_file": ''}
        self.cmd_name = ['./uhd_image_builder.py', ]
        self.cmd_prefix = list(self.cmd_name)
        self.instantiation_file = os.path.join(uhd_image_builder.get_scriptpath(),
                                               '..', '..', 'top', self.target,
                                               'rfnoc_ce_auto_inst_' + self.device.lower() +
                                               '.v')

        # List of blocks that are part of our library but that do not take place
        # on the process this tool provides
        self.blacklist = ['noc_block_radio_core', 'noc_block_axi_dma_fifo', 'noc_block_pfb']
        self.lock = threading.Lock()
        self.init_gui()
Exemplo n.º 5
0
    def __init__(self):
        super(MainWindow, self).__init__()
        ##################################################
        # Initial Values
        ##################################################
        self.target = 'x300'
        self.device = 'x310'
        self.build_target = 'X310_RFNOC_HG'
        self.oot_dirs = []
        self.max_allowed_blocks = 10
        self.cmd_dict = {
            "target": '-t {}'.format(self.build_target),
            "device": '-d {}'.format(self.device),
            "include": '',
            "fill_fifos": '',
            "viv_gui": '',
            "cleanall": '',
            "show_file": ''
        }
        self.cmd_name = [
            './uhd_image_builder.py',
        ]
        self.cmd_prefix = list(self.cmd_name)
        self.instantiation_file = os.path.join(
            uhd_image_builder.get_scriptpath(), '..', '..', 'top', self.target,
            'rfnoc_ce_auto_inst_' + self.device.lower() + '.v')

        # List of blocks that are part of our library but that do not take place
        # on the process this tool provides
        self.blacklist = [
            'noc_block_radio_core', 'noc_block_axi_dma_fifo', 'noc_block_pfb'
        ]
        self.lock = threading.Lock()
        self.init_gui()
Exemplo n.º 6
0
 def populate_target(self, selected_target):
     """
     Parses the Makefile available and lists the build targets into the left pannel
     """
     pattern = "^(?!\#)^\S*_RFNOC[^:]*"
     build_targets = os.path.join(uhd_image_builder.get_scriptpath(), '..', '..', 'top',
                                  selected_target, 'Makefile')
     with open(build_targets) as fil:
         targets = re.findall(pattern, fil.read(), re.MULTILINE)
         for target in targets:
             self.model_targets.appendRow(QtGui.QStandardItem(target))
Exemplo n.º 7
0
 def file_dialog(self):
     """
     Opens a dialog window to add manually the Out-of-tree module blocks
     """
     append_directory = []
     startpath = os.path.join(uhd_image_builder.get_scriptpath(), '..', '..', '..', '..')
     new_oot = str(QtWidgets.QFileDialog.getExistingDirectory(self, 'RFNoC Out of Tree Directory', startpath))
     if len(new_oot) > 0:
         self.oot_dirs.append(new_oot)
         uhd_image_builder.create_oot_include(self.device, self.oot_dirs)
         self.refresh_oot_dirs()
Exemplo n.º 8
0
 def populate_target(self, selected_target):
     """
     Parses the Makefile available and lists the build targets into the left pannel
     """
     pattern = "^(?!\#)^\S*_RFNOC[^:]*"
     build_targets = os.path.join(uhd_image_builder.get_scriptpath(), '..',
                                  '..', 'top', selected_target, 'Makefile')
     with open(build_targets) as fil:
         targets = re.findall(pattern, fil.read(), re.MULTILINE)
         for target in targets:
             self.model_targets.appendRow(QtGui.QStandardItem(target))
 def file_dialog(self):
     """
     Opens a dialog window to add manually the Out-of-tree module blocks
     """
     append_directory = []
     startpath = os.path.join(uhd_image_builder.get_scriptpath(), '..', '..', '..', '..')
     new_oot = str(QtWidgets.QFileDialog.getExistingDirectory(self, 'RFNoC Out of Tree Directory', startpath))
     if len(new_oot) > 0:
         self.oot_dirs.append(new_oot)
         uhd_image_builder.create_oot_include(self.device, self.oot_dirs)
         self.refresh_oot_dirs()
Exemplo n.º 10
0
 def set_target_and_device(self):
     """
     Populates the 'target' and 'device' values of the command directory
     and the device dependent max_allowed_blocks in display
     """
     self.cmd_dict['target'] = '-t {}'.format(self.build_target)
     self.cmd_dict['device'] = '-d {}'.format(self.device)
     blk_count = self.model_in_design.rowCount()
     self.block_num.setText("{}/{}".format(blk_count,
                                           self.max_allowed_blocks))
     self.instantiation_file = os.path.join(
         uhd_image_builder.get_scriptpath(), '..', '..', 'top', self.target,
         'rfnoc_ce_auto_inst_' + self.device.lower() + '.v')
Exemplo n.º 11
0
 def refresh_oot_dirs(self):
     """
     Populates the OOT directory list from the OOT include file
     """
     oot_include = os.path.join(uhd_image_builder.get_scriptpath(), '..', '..', 'top',\
         self.target, 'Makefile.OOT.inc')
     dir_list = []
     with open(oot_include, 'r') as fil:
         text = fil.readlines()
         for lines in text:
             lines = lines.partition('$(BASE_DIR)/')
             if (lines[1] == '$(BASE_DIR)/'):
                 relpath = lines[2].replace('\n', '')
                 ootpath = os.path.abspath(os.path.join(uhd_image_builder.get_scriptpath(), '..', '..', 'top', relpath))
                 dir_list.append(ootpath)
     if (len(dir_list) == 0):
         self.oot.removeRows(0, self.oot.rowCount())
         self.cmd_dict["include"] = ''
     else:
         self.oot_dirs = dir_list
         self.cmd_dict["include"] = '-I {}'.format(' '.join(self.oot_dirs))
     for (ii, oot) in enumerate(dir_list):
         self.populate_list(self.oot, os.path.join(oot, 'fpga-src', 'Makefile.srcs'), clear=ii==0)
Exemplo n.º 12
0
 def set_target_and_device(self):
     """
     Populates the 'target' and 'device' values of the command directory
     and the device dependent max_allowed_blocks in display
     """
     self.cmd_dict['target'] = '-t {}'.format(self.build_target)
     self.cmd_dict['device'] = '-d {}'.format(self.device)
     blk_count = self.model_in_design.rowCount()
     self.block_num.setText("{}/{}".format(blk_count,
                                           self.max_allowed_blocks))
     self.instantiation_file = os.path.join(uhd_image_builder.get_scriptpath(),
                                            '..', '..', 'top', self.target,
                                            'rfnoc_ce_auto_inst_' + self.device.lower() +
                                            '.v')
Exemplo n.º 13
0
 def populate_target(self, selected_target):
     """
     Parses the Makefile available and lists the build targets into the left pannel
     """
     suffix = '0_RFNOC'
     build_targets = os.path.join(uhd_image_builder.get_scriptpath(), '..', '..', 'top',
                                  selected_target, 'Makefile')
     with open(build_targets, 'r') as fil:
         text = fil.readlines()
         for lines in text:
             lines = lines.partition(':')[0]
             if suffix in lines:
                 target = QtGui.QStandardItem(lines)
                 self.model_targets.appendRow(target)
Exemplo n.º 14
0
 def ootlist(self):
     """
     Lists the Out-of-tree module blocks
     """
     index = self.targets.currentIndex()
     self.build_target = str(self.targets.model().data(index))
     self.device = self.build_target[:4]
     if self.device == 'X310' or self.device == 'X300':
         self.target = 'x300'
         self.max_allowed_blocks = 10
     elif self.device == 'E310':
         self.target = 'e300'
         self.max_allowed_blocks = 6
     oot_sources = os.path.join(uhd_image_builder.get_scriptpath(), '..', '..', 'top',\
         self.target, 'Makefile.srcs')
     self.show_list(self.oot, self.target, oot_sources)
Exemplo n.º 15
0
    def init_gui(self):
        """
        Initializes GUI init values and constants
        """
        # pylint: disable=too-many-statements

        ettus_sources = os.path.join(uhd_image_builder.get_scriptpath(), '..', '..', 'lib',\
            'rfnoc', 'Makefile.srcs')
        ##################################################
        # Grid Layout
        ##################################################
        grid = QGridLayout()
        grid.setSpacing(15)
        ##################################################
        # Buttons
        ##################################################
        oot_btn = QtWidgets.QPushButton('Add OOT Blocks', self)
        oot_btn.setToolTip('Add your custom Out-of-tree blocks')
        grid.addWidget(oot_btn, 9, 0)
        from_grc_btn = QtWidgets.QPushButton('Import from GRC', self)
        grid.addWidget(from_grc_btn, 9, 2)
        show_file_btn = QtWidgets.QPushButton('Show instantiation File', self)
        grid.addWidget(show_file_btn, 9, 1)
        add_btn = QtWidgets.QPushButton('>>', self)
        grid.addWidget(add_btn, 2, 2)
        rem_btn = QtWidgets.QPushButton('<<', self)
        grid.addWidget(rem_btn, 3, 2)
        self.gen_bit_btn = QtWidgets.QPushButton('Generate .bit file', self)
        grid.addWidget(self.gen_bit_btn, 9, 3)

        ##################################################
        # Checkbox
        ##################################################
        self.fill_with_fifos = QtWidgets.QCheckBox('Fill with FIFOs', self)
        self.viv_gui = QtWidgets.QCheckBox('Open Vivado GUI', self)
        self.cleanall = QtWidgets.QCheckBox('Clean IP', self)
        grid.addWidget(self.fill_with_fifos, 5, 2)
        grid.addWidget(self.viv_gui, 6, 2)
        grid.addWidget(self.cleanall, 7, 2)

        ##################################################
        # uhd_image_builder command display
        ##################################################
        label_cmd_display = QtWidgets.QLabel(self)
        label_cmd_display.setText("uhd_image_builder command:")
        label_cmd_display.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
        label_cmd_display.setStyleSheet(" QLabel {font-weight: bold; color: black}")
        grid.addWidget(label_cmd_display, 10, 0)
        self.cmd_display = QtWidgets.QTextEdit(self)
        self.cmd_display.setMaximumHeight(label_cmd_display.sizeHint().height() * 3)
        self.cmd_display.setReadOnly(True)
        self.cmd_display.setText("".join(self.cmd_name))
        grid.addWidget(self.cmd_display, 10, 1, 1, 3)

        ##################################################
        # uhd_image_builder target help display
        ##################################################
        self.help_display = QtWidgets.QLabel(self)
        grid.addWidget(self.help_display, 11, 1, 1, 3)
        self.help_display.setWordWrap(True)
        help_description = QtWidgets.QLabel(self)
        grid.addWidget(help_description, 11, 0)
        help_description.setText("Target description: ")
        help_description.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
        help_description.setStyleSheet(" QLabel {font-weight: bold; color: black}")

        ##################################################
        # Panels - QTreeModels
        ##################################################
        ### Far-left Panel: Build targets
        self.targets = QtWidgets.QTreeView(self)
        self.targets.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
        self.model_targets = QtGui.QStandardItemModel(self)
        self.model_targets.setHorizontalHeaderItem(0, QtGui.QStandardItem("Select build target"))
        self.targets.setModel(self.model_targets)
        self.populate_target('x300')
        self.populate_target('e300')
        self.populate_target('e320')
        self.populate_target('n3xx')
        grid.addWidget(self.targets, 0, 0, 8, 1)

        ### Central Panel: Available blocks
        ### Create tree to categorize Ettus Block and OOT Blocks in different lists
        self.blocks_available = QtWidgets.QTreeView(self)
        self.blocks_available.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
        self.blocks_available.setContextMenuPolicy(Qt.CustomContextMenu)
        ettus_blocks = QtGui.QStandardItem("Ettus-provided Blocks")
        ettus_blocks.setEnabled(False)
        ettus_blocks.setForeground(Qt.black)
        self.populate_list(ettus_blocks, ettus_sources)
        self.oot = QtGui.QStandardItem("OOT Blocks for X300 devices")
        self.oot.setEnabled(False)
        self.oot.setForeground(Qt.black)
        self.refresh_oot_dirs()
        self.model_blocks_available = QtGui.QStandardItemModel(self)
        self.model_blocks_available.appendRow(ettus_blocks)
        self.model_blocks_available.appendRow(self.oot)
        self.model_blocks_available.setHorizontalHeaderItem(
            0, QtGui.QStandardItem("List of blocks available")
            )
        self.blocks_available.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
        self.blocks_available.setModel(self.model_blocks_available)
        grid.addWidget(self.blocks_available, 0, 1, 8, 1)

        ### Far-right Panel: Blocks in current design
        self.blocks_in_design = QtWidgets.QTreeView(self)
        self.blocks_in_design.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
        self.model_in_design = QtGui.QStandardItemModel(self)
        self.model_in_design.setHorizontalHeaderItem(
            0, QtGui.QStandardItem("Blocks in current design"))
        self.blocks_in_design.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
        self.blocks_in_design.setModel(self.model_in_design)
        grid.addWidget(self.blocks_in_design, 0, 3, 8, 1)

        ##################################################
        # Informative Labels
        ##################################################
        block_num_hdr = QtWidgets.QLabel(self)
        block_num_hdr.setText("Blocks in current design")
        block_num_hdr.setStyleSheet(" QLabel {font-weight: bold; color: black}")
        block_num_hdr.setAlignment(QtCore.Qt.AlignHCenter)
        grid.addWidget(block_num_hdr, 0, 2)
        self.block_num = QtWidgets.QLabel(self)
        self.block_num.setText("-")
        self.block_num.setAlignment(QtCore.Qt.AlignHCenter)
        grid.addWidget(self.block_num, 1, 2)
        self.block_num.setStyleSheet(" QLabel {color: green}")
        self.generating_bitstream = QtWidgets.QLabel(self)
        self.generating_bitstream.setText("")
        self.generating_bitstream.setAlignment(QtCore.Qt.AlignHCenter)
        grid.addWidget(self.generating_bitstream, 11, 0, 1, 5)
        self.generating_bitstream.setStyleSheet(" QLabel {font-weight: bold; color: black}")

        ##################################################
        # Connection of the buttons with their signals
        ##################################################
        self.fill_with_fifos.clicked.connect(self.fill_slot)
        self.fill_with_fifos.clicked.connect(self.cmd_display_slot)
        self.viv_gui.clicked.connect(self.viv_gui_slot)
        self.viv_gui.clicked.connect(self.cmd_display_slot)
        self.cleanall.clicked.connect(self.cleanall_slot)
        self.cleanall.clicked.connect(self.cmd_display_slot)
        oot_btn.clicked.connect(self.file_dialog)
        from_grc_btn.clicked.connect(self.blocks_to_add_slot)
        from_grc_btn.clicked.connect(self.cmd_display_slot)
        from_grc_btn.clicked.connect(self.file_grc_dialog)
        add_btn.clicked.connect(self.add_to_design)
        add_btn.clicked.connect(self.blocks_to_add_slot)
        add_btn.clicked.connect(self.check_blk_num)
        add_btn.clicked.connect(self.cmd_display_slot)
        rem_btn.clicked.connect(self.remove_from_design)
        rem_btn.clicked.connect(self.blocks_to_add_slot)
        rem_btn.clicked.connect(self.cmd_display_slot)
        show_file_btn.clicked.connect(self.show_file)
        show_file_btn.clicked.connect(self.cmd_display_slot)
        show_file_btn.clicked.connect(self.run_command)
        self.gen_bit_btn.clicked.connect(self.generate_bit)
        self.gen_bit_btn.clicked.connect(self.cmd_display_slot)
        self.gen_bit_btn.clicked.connect(self.run_command)
        self.targets.clicked.connect(self.ootlist)
        self.targets.clicked.connect(self.set_target_and_device)
        self.targets.clicked.connect(self.cmd_display_slot)
        self.targets.clicked.connect(self.check_blk_num)
        self.blocks_available.doubleClicked.connect(self.add_to_design)
        self.blocks_available.doubleClicked.connect(self.blocks_to_add_slot)
        self.blocks_available.doubleClicked.connect(self.check_blk_num)
        self.blocks_available.doubleClicked.connect(self.cmd_display_slot)
        self.blocks_in_design.doubleClicked.connect(self.remove_from_design)
        self.blocks_in_design.doubleClicked.connect(self.blocks_to_add_slot)
        self.blocks_in_design.doubleClicked.connect(self.cmd_display_slot)

        ##################################################
        # Set a default size based on screen geometry
        ##################################################
        screen_size = QtWidgets.QDesktopWidget().screenGeometry(-1)
        self.resize(screen_size.width()/1.4, screen_size.height()/1.7)
        self.setWindowTitle("uhd_image_builder.py GUI")
        self.setLayout(grid)
        self.show()
Exemplo n.º 16
0
    def init_gui(self):
        """
        Initializes GUI init values and constants
        """
        # pylint: disable=too-many-statements

        ettus_sources = os.path.join(uhd_image_builder.get_scriptpath(), '..', '..', 'lib',\
            'rfnoc', 'Makefile.srcs')
        ##################################################
        # Grid Layout
        ##################################################
        grid = QGridLayout()
        grid.setSpacing(15)
        ##################################################
        # Buttons
        ##################################################
        oot_btn = QtWidgets.QPushButton('Add OOT Blocks', self)
        oot_btn.setToolTip('Add your custom Out-of-tree blocks')
        grid.addWidget(oot_btn, 9, 0)
        from_grc_btn = QtWidgets.QPushButton('Import from GRC', self)
        grid.addWidget(from_grc_btn, 9, 2)
        show_file_btn = QtWidgets.QPushButton('Show instantiation File', self)
        grid.addWidget(show_file_btn, 9, 1)
        add_btn = QtWidgets.QPushButton('>>', self)
        grid.addWidget(add_btn, 2, 2)
        rem_btn = QtWidgets.QPushButton('<<', self)
        grid.addWidget(rem_btn, 3, 2)
        self.gen_bit_btn = QtWidgets.QPushButton('Generate .bit file', self)
        grid.addWidget(self.gen_bit_btn, 9, 3)

        ##################################################
        # Checkbox
        ##################################################
        self.fill_with_fifos = QtWidgets.QCheckBox('Fill with FIFOs', self)
        self.viv_gui = QtWidgets.QCheckBox('Open Vivado GUI', self)
        self.cleanall = QtWidgets.QCheckBox('Clean IP', self)
        grid.addWidget(self.fill_with_fifos, 5, 2)
        grid.addWidget(self.viv_gui, 6, 2)
        grid.addWidget(self.cleanall, 7, 2)

        ##################################################
        # uhd_image_builder command display
        ##################################################
        label_cmd_display = QtWidgets.QLabel(self)
        label_cmd_display.setText("uhd_image_builder command:")
        label_cmd_display.setAlignment(QtCore.Qt.AlignRight
                                       | QtCore.Qt.AlignVCenter)
        label_cmd_display.setStyleSheet(
            " QLabel {font-weight: bold; color: black}")
        grid.addWidget(label_cmd_display, 10, 0)
        self.cmd_display = QtWidgets.QTextEdit(self)
        self.cmd_display.setMaximumHeight(
            label_cmd_display.sizeHint().height() * 3)
        self.cmd_display.setReadOnly(True)
        self.cmd_display.setText("".join(self.cmd_name))
        grid.addWidget(self.cmd_display, 10, 1, 1, 3)

        ##################################################
        # uhd_image_builder target help display
        ##################################################
        self.help_display = QtWidgets.QLabel(self)
        grid.addWidget(self.help_display, 11, 1, 1, 3)
        self.help_display.setWordWrap(True)
        help_description = QtWidgets.QLabel(self)
        grid.addWidget(help_description, 11, 0)
        help_description.setText("Target description: ")
        help_description.setAlignment(QtCore.Qt.AlignRight
                                      | QtCore.Qt.AlignVCenter)
        help_description.setStyleSheet(
            " QLabel {font-weight: bold; color: black}")

        ##################################################
        # Panels - QTreeModels
        ##################################################
        ### Far-left Panel: Build targets
        self.targets = QtWidgets.QTreeView(self)
        self.targets.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self.model_targets = QtGui.QStandardItemModel(self)
        self.model_targets.setHorizontalHeaderItem(
            0, QtGui.QStandardItem("Select build target"))
        self.targets.setModel(self.model_targets)
        self.populate_target('x300')
        self.populate_target('e300')
        self.populate_target('n3xx')
        grid.addWidget(self.targets, 0, 0, 8, 1)

        ### Central Panel: Available blocks
        ### Create tree to categorize Ettus Block and OOT Blocks in different lists
        self.blocks_available = QtWidgets.QTreeView(self)
        self.blocks_available.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self.blocks_available.setContextMenuPolicy(Qt.CustomContextMenu)
        ettus_blocks = QtGui.QStandardItem("Ettus-provided Blocks")
        ettus_blocks.setEnabled(False)
        ettus_blocks.setForeground(Qt.black)
        self.populate_list(ettus_blocks, ettus_sources)
        self.oot = QtGui.QStandardItem("OOT Blocks for X300 devices")
        self.oot.setEnabled(False)
        self.oot.setForeground(Qt.black)
        self.refresh_oot_dirs()
        self.model_blocks_available = QtGui.QStandardItemModel(self)
        self.model_blocks_available.appendRow(ettus_blocks)
        self.model_blocks_available.appendRow(self.oot)
        self.model_blocks_available.setHorizontalHeaderItem(
            0, QtGui.QStandardItem("List of blocks available"))
        self.blocks_available.setSelectionMode(
            QtWidgets.QAbstractItemView.ExtendedSelection)
        self.blocks_available.setModel(self.model_blocks_available)
        grid.addWidget(self.blocks_available, 0, 1, 8, 1)

        ### Far-right Panel: Blocks in current design
        self.blocks_in_design = QtWidgets.QTreeView(self)
        self.blocks_in_design.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self.model_in_design = QtGui.QStandardItemModel(self)
        self.model_in_design.setHorizontalHeaderItem(
            0, QtGui.QStandardItem("Blocks in current design"))
        self.blocks_in_design.setSelectionMode(
            QtWidgets.QAbstractItemView.ExtendedSelection)
        self.blocks_in_design.setModel(self.model_in_design)
        grid.addWidget(self.blocks_in_design, 0, 3, 8, 1)

        ##################################################
        # Informative Labels
        ##################################################
        block_num_hdr = QtWidgets.QLabel(self)
        block_num_hdr.setText("Blocks in current design")
        block_num_hdr.setStyleSheet(
            " QLabel {font-weight: bold; color: black}")
        block_num_hdr.setAlignment(QtCore.Qt.AlignHCenter)
        grid.addWidget(block_num_hdr, 0, 2)
        self.block_num = QtWidgets.QLabel(self)
        self.block_num.setText("-")
        self.block_num.setAlignment(QtCore.Qt.AlignHCenter)
        grid.addWidget(self.block_num, 1, 2)
        self.block_num.setStyleSheet(" QLabel {color: green}")
        self.generating_bitstream = QtWidgets.QLabel(self)
        self.generating_bitstream.setText("")
        self.generating_bitstream.setAlignment(QtCore.Qt.AlignHCenter)
        grid.addWidget(self.generating_bitstream, 11, 0, 1, 5)
        self.generating_bitstream.setStyleSheet(
            " QLabel {font-weight: bold; color: black}")

        ##################################################
        # Connection of the buttons with their signals
        ##################################################
        self.fill_with_fifos.clicked.connect(self.fill_slot)
        self.fill_with_fifos.clicked.connect(self.cmd_display_slot)
        self.viv_gui.clicked.connect(self.viv_gui_slot)
        self.viv_gui.clicked.connect(self.cmd_display_slot)
        self.cleanall.clicked.connect(self.cleanall_slot)
        self.cleanall.clicked.connect(self.cmd_display_slot)
        oot_btn.clicked.connect(self.file_dialog)
        from_grc_btn.clicked.connect(self.blocks_to_add_slot)
        from_grc_btn.clicked.connect(self.cmd_display_slot)
        from_grc_btn.clicked.connect(self.file_grc_dialog)
        add_btn.clicked.connect(self.add_to_design)
        add_btn.clicked.connect(self.blocks_to_add_slot)
        add_btn.clicked.connect(self.check_blk_num)
        add_btn.clicked.connect(self.cmd_display_slot)
        rem_btn.clicked.connect(self.remove_from_design)
        rem_btn.clicked.connect(self.blocks_to_add_slot)
        rem_btn.clicked.connect(self.cmd_display_slot)
        show_file_btn.clicked.connect(self.show_file)
        show_file_btn.clicked.connect(self.cmd_display_slot)
        show_file_btn.clicked.connect(self.run_command)
        self.gen_bit_btn.clicked.connect(self.generate_bit)
        self.gen_bit_btn.clicked.connect(self.cmd_display_slot)
        self.gen_bit_btn.clicked.connect(self.run_command)
        self.targets.clicked.connect(self.ootlist)
        self.targets.clicked.connect(self.set_target_and_device)
        self.targets.clicked.connect(self.cmd_display_slot)
        self.targets.clicked.connect(self.check_blk_num)
        self.blocks_available.doubleClicked.connect(self.add_to_design)
        self.blocks_available.doubleClicked.connect(self.blocks_to_add_slot)
        self.blocks_available.doubleClicked.connect(self.check_blk_num)
        self.blocks_available.doubleClicked.connect(self.cmd_display_slot)
        self.blocks_in_design.doubleClicked.connect(self.remove_from_design)
        self.blocks_in_design.doubleClicked.connect(self.blocks_to_add_slot)
        self.blocks_in_design.doubleClicked.connect(self.cmd_display_slot)

        ##################################################
        # Set a default size based on screen geometry
        ##################################################
        screen_size = QtWidgets.QDesktopWidget().screenGeometry(-1)
        self.resize(screen_size.width() / 1.4, screen_size.height() / 1.7)
        self.setWindowTitle("uhd_image_builder.py GUI")
        self.setLayout(grid)
        self.show()