Esempio n. 1
0
 def do_list(self, arg):
     """\nDisplay all defined clock domains for this design.
     """
     # pylint: disable-msg=W0613
     titles = ["name", "frequency", "type"]
     rows = []
     for clock in settings.active_project.clocks.iteritem():
         rows.append([clock.name, clock.frequency, clock.type])
     self.write("\n".join(format_table(titles, rows)))
     self.write("\n")
Esempio n. 2
0
 def do_list(self, arg):
     """\nDisplay all component instance interfaces settings
     """
     # pylint: disable-msg=W0613
     titles = ["name", "offset", "link"]
     rows = []
     for iface in self.interfaces.iteritems():
         rows.append([iface.name, iface.offset, iface.link])
     self.write("\n".join(format_table(titles, rows)))
     self.write("\n")
Esempio n. 3
0
 def do_list(self, arg):
     """\nDisplay all component instances from active project.
     """
     # pylint: disable-msg=W0613
     titles = ["name", "base"]
     rows = []
     for cp in settings.active_project.components.iteritems():
         rows.append([cp.name, cp.base])
     self.write("\n".join(format_table(titles, rows)))
     self.write("\n")
Esempio n. 4
0
 def do_list(self, arg):
     """\nDisplay all component instance generics settings
     """
     # pylint: disable-msg=W0613
     titles = ["name", "value"]
     rows = []
     for gen in self.generics.iteritems():
         rows.append([gen.name, gen.value])
     self.write("\n".join(format_table(titles, rows)))
     self.write("\n")
Esempio n. 5
0
 def do_list(self, arg):
     """\nDisplay all interfaces exposed by component.
     """
     # pylint: disable-msg=W0613
     titles = ["name", "type", "clockandreset"]
     rows = []
     for iface in settings.active_component.interfaces.iteritems():
         rows.append([iface.name, iface.type, iface.clockandreset])
     self.write("\n".join(format_table(titles, rows)))
     self.write("\n")
Esempio n. 6
0
 def do_list(self, arg):
     """\nDisplay HDL files from current component.
     """
     # pylint: disable-msg=W0613
     titles = ["name", "scope", "order", "is top"]
     rows = []
     for hdl_file in settings.active_component.hdl_files.iteritems():
         rows.append([hdl_file.name, hdl_file.scope, hdl_file.order, hdl_file.istop])
     self.write("\n".join(format_table(titles, rows)))
     self.write("\n")
Esempio n. 7
0
 def do_dir(self, arg):
     """\nDisplay available components.
     """
     # pylint: disable-msg=W0613
     titles = ["name", "version", "category"]
     rows = []
     comp_dir = settings.components_dir
     for fname in os.listdir(comp_dir):
         name = path.join(comp_dir, fname)
         if(path.isfile(name)):
             cp = Component(name)
             rows.append([cp.name, cp.version, cp.category])
     self.write("\n".join(format_table(titles, rows)))
     self.write("\n")
Esempio n. 8
0
    def do_attached(self, arg):
        """\nList all ports or interfaces attached to an interface
        
            attached [name=]<string> [--iface]
            
                string = interface name to analyze
                iface = flag to search for attached interfaces
        """

        args = ATTACHED_ARGS.parse(arg)
        if args:
            name = args.name
            iface = args.iface
        else:
            name = arg
            iface = False

        if name:
            try:
                (source, attached) = self.component.getAttached(name, iface)
            except ComponentError, e:
                self.write(e.message)
            else:
                titles = ["name", "type"]
                rows = []
                if iface:
                    self.write("Interfaces attached to interface '%s' (type = %s):\n" % (name, source.type))
                    name = name.lower()
                    for iface in attached:
                        if iface.clockandreset:
                            if iface.clockandreset.lower() == name:
                                rows.append([iface.name, iface.type])
                else:
                    self.write("Ports attached to interface '%s' (type = %s):\n" % (name, source.type))
                    for port in attached:
                        if port.interface.lower() == name:
                            rows.append([port.name, port.type])

                # Create table and display it
                self.write("\n".join(format_table(titles, rows)))
                self.write("\n")