Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Platform-independent core collection
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
18
Issues
18
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Platform-independent core collection
Commits
ac43a1db
Commit
ac43a1db
authored
Jul 16, 2019
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add gen_buildinfo.py file.
parent
cd3445d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
gen_buildinfo.py
tools/gen_buildinfo.py
+23
-0
No files found.
tools/gen_buildinfo.py
0 → 100644
View file @
ac43a1db
# Script to generate the buildinfo_pkg.vhd file
with
open
(
"buildinfo_pkg.vhd"
,
"w"
)
as
f
:
import
subprocess
import
time
commitid
=
subprocess
.
check_output
(
[
"git"
,
"log"
,
"-1"
,
"--format=
%
H"
])
.
decode
()
.
strip
()
userid
=
subprocess
.
check_output
(
[
"git"
,
"config"
,
"--get"
,
"user.name"
])
.
decode
()
.
strip
()
f
.
write
(
"-- Buildinfo for project {}
\n
"
.
format
(
syn_top
))
f
.
write
(
"--
\n
"
)
f
.
write
(
"-- This file was automatically generated; do not edit
\n
"
)
f
.
write
(
"
\n
"
)
f
.
write
(
"package buildinfo_pkg is
\n
"
)
f
.
write
(
" constant buildinfo : string :=
\n
"
)
f
.
write
(
' "buildinfo:1" & LF
\n
'
)
f
.
write
(
' & "module:{}" & LF
\n
'
.
format
(
syn_top
))
f
.
write
(
' & "commit:{}" & LF
\n
'
.
format
(
commitid
))
f
.
write
(
' & "syntool:{}" & LF
\n
'
.
format
(
syn_tool
))
f
.
write
(
' & "syndate:{}" & LF
\n
'
.
format
(
time
.
strftime
(
"
%
A,
%
B
%
d
%
Y"
,
time
.
localtime
())))
f
.
write
(
' & "synauth:{}" & LF;
\n
'
.
format
(
userid
))
f
.
write
(
'end buildinfo_pkg;
\n
'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment