Пример #1
0
 def LibraryDeclarations(self, f : FileWriter) -> FileWriter:
     VhdlTitle("Libraries", f)
     for l in sorted(self.libraries):
         f.WriteLn("library {};".format(l.replace("work", self.dutLibrary)))
         f.IncIndent()
         for u in self.libraries[l]:
             f.WriteLn("use {}.{}.{};".format(u.library.replace("work", self.dutLibrary), u.element, u.object))
         f.DecIndent().WriteLn()
     return f
Пример #2
0
 def _EntityDeclaration(self, f: FileWriter) -> FileWriter:
     VhdlTitle("Entity Declaration", f)
     f.WriteLn("entity {} is".format(self.tbInfo.tbName))
     f.IncIndent()
     eg = DutInfo.FilterForTag(self.dutInfo.generics, Tags.EXPORT, "true")
     if len(eg) > 0:
         f.WriteLn("generic (")
         f.IncIndent()
         for g in eg:
             line = "{} : {}".format(g.name, g.type)
             if g.default is not None:
                 line += " := {};".format(g.default)
             else:
                 line += ";"
             f.WriteLn(line)
         f.RemoveFromLastLine(1)
         f.DecIndent().WriteLn(");")
     f.DecIndent()
     f.WriteLn("end entity;").WriteLn()
     return f