Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Platform-independent core collection
Manage
Activity
Members
Labels
Plan
Issues
15
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
Platform-independent core collection
Commits
1d8a2e8a
Commit
1d8a2e8a
authored
6 years ago
by
Dimitris Lampridis
Browse files
Options
Downloads
Patches
Plain Diff
tools: make SDB descriptor generator script less fragile wrt git commands. Also add header.
parent
3f33ca1b
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/sdb_desc_gen.tcl
+43
-21
43 additions, 21 deletions
tools/sdb_desc_gen.tcl
with
43 additions
and
21 deletions
tools/sdb_desc_gen.tcl
+
43
−
21
View file @
1d8a2e8a
# Tcl script to automatically generate the SDB synthesis descriptor.
#
# Must be added to your top-level Manifest.py like this:
#
# syn_post_project_cmd =
"
$
(TCL_INTERPRETER)
[
this_tcl_script
]
"
+
# syn_tool +
"
$
(PROJECT_FILE)"
#
# Notes:
#
# 1. $
(
TCL_INTERPRETER
)
and $
(
PROJECT_FILE
)
will be automatically
# resolved inside the Makefile generated by hdlmake.
# 2. syn_tool is a Manifest.py variable, it should already be in your
# tol-level Manifest.py.
# 3.
[
this_tcl_script
]
should be replaced by the full path to
# this Tcl script. Relative paths should be with respect to
# the location of the top-level Manifest.py.
# 4. Mind the spaces inside the quotes, before and after syn_tool.
##-------------------------------------------------------------------------------
## CERN BE-CO-HT
## General Cores
## https://www.ohwr.org/projects/general-cores
##-------------------------------------------------------------------------------
##
## Tcl script to automatically generate the SDB synthesis descriptor.
##
## Must be added to your top-level Manifest.py like this:
##
## syn_post_project_cmd =
"
$
(TCL_INTERPRETER)
[
this_tcl_script
]
"
+
## syn_tool +
"
$
(PROJECT_FILE)"
##
## notes:
##
## 1. $
(
TCL_INTERPRETER
)
and $
(
PROJECT_FILE
)
will be automatically
## resolved inside the Makefile generated by hdlmake.
## 2. syn_tool is a Manifest.py variable, it should already be in your
## tol-level Manifest.py.
## 3.
[
this_tcl_script
]
should be replaced by the full path to
## this Tcl script. Relative paths should be with respect to
## the location of the top-level Manifest.py.
## 4. Mind the spaces inside the quotes, before and after syn_tool.
##
##-------------------------------------------------------------------------------
## Copyright CERN 2018
##-------------------------------------------------------------------------------
## This Source Code Form is subject to the terms of the Mozilla Public License,
## version 2.0. If a copy of the MPL was not distributed with this file, You can
## obtain one at https://mozilla.org/MPL/2.0/.
##-------------------------------------------------------------------------------
# get current time
set time_now
[
clock seconds
]
...
...
@@ -92,13 +106,21 @@ if {$syn_tool == "ise"} {
# For now we hard-code, since anyway ISE is end-of-life at version 14.7.
set inf_tool_version
[
format
"%08d"
"147"
]
}
set inf_tool_name
[
string toupper $syn_tool
]
set inf_commit_id
[
exec git log -1 --format=%H
]
set inf_date
[
clock format $time_now -format
"%A, %B %d %Y"
]
set inf_date_ymd
[
clock format $time_now -format
"%Y%m%d"
]
set inf_user
[
exec git config user.name
]
# next line could break if git remote is not called
"origin"
set inf_repo_url
[
exec git remote get-url origin
]
# Git commands below have fallbacks in case something goes wrong.
if
{
[
catch
{
set inf_user
[
exec git config --get user.name
]
}]
}
{
set inf_user
"unknown user"
}
if
{
[
catch
{
set inf_commit_id
[
exec git log -1 --format=%H
]
}]
}
{
set inf_commit_id
"unknown commit"
}
if
{
[
catch
{
set inf_repo_url
[
exec git config --get remote.origin.url
]
}]
}
{
set inf_repo_url
"unknown url"
}
#-------------------------------------------------------------------------------
# STEP 5/7: Generate the output file
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment