-
Notifications
You must be signed in to change notification settings - Fork 1
/
UtilFunc.py
29 lines (24 loc) · 941 Bytes
/
UtilFunc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
##############################################################################
# Copyright (c) 2018 by Paul Scherrer Institute, Switzerland
# All rights reserved.
# Authors: Oliver Bruendler
##############################################################################
from PsiPyUtils import FileWriter
from datetime import datetime as dt
def VhdlTitle(title : str, f : FileWriter, level : int = 1) -> FileWriter:
if level is 1:
f.WriteLn("-" * 60)
f.WriteLn("-- " + title)
f.WriteLn("-" * 60)
elif level is 2:
f.WriteLn("-- *** " + title + " ***")
else:
raise Exception("Illegel VHDL Title level")
return f
def CopyrightNotice(f : FileWriter) -> FileWriter:
f.WriteLn("-" * 60)
f.WriteLn("-- Copyright (c) {} by Paul Scherrer Institute, Switzerland".format(dt.now().year))
f.WriteLn("-- All rights reserved.")
f.WriteLn("-" * 60)
f.WriteLn()
return f