Re: ISE & VHDL : how to include time/date
- From: Jonathan Bromley <jonathan.bromley@xxxxxxxxxxxxx>
- Date: Wed, 06 May 2009 12:17:48 +0100
On Tue, 5 May 2009 02:22:44 -0700 (PDT), Nicolas Matringe wrote:
I'm just done with this and since this a quite frequent question I
thought I might give my solution so that the time I struggled with
this probllem will benefit to others.
Thanks for the nice writeup. Useful!
My time/date is a top-level generic parameter called G_DATE :[...]
generic (
G_DATE : string := "00:00 00/00/00");
and added this line:
set current_date [clock format [clock seconds] -format "%H:%M %D"]
which gives me the date in the format I want
I then set the top-level generic parameter
project set "Generics, Parameters" "G_DATE=\"$current_date\" "
-process "Synthesize - XST"
Do not put spaces around the '=' and put one space between the double
quotes
Fascinating - why is there a need for a space after the
closing quote of the generic's value-string?
Does ISE really need that? Madness!
Also, the backslash-escaped quote characters are pretty ugly.
Could I suggest a slight modification in the interests of
clarity (with no functional change) thus:
set current_date ..... < exactly as you did >
set GDATE_with_space [format {GDATE="%s" } $current_date]
Now the literal quote characters are part of the GDATE_with_space
variable, along with the generic's name and the = symbol; so
you can now
project set {Generics, Parameters} $GDATE_with_space \
-process {Synthesize - XST}
Notes:
(1) I used braces {} to quote the operation names; that makes
it easier to include weird characters, since {} gives you
literal quoting in Tcl. Inside regular quotes "", Tcl
nevertheless performs its substitutions (it respects
[], $ and backslash). The combination of braces {} and
the "format" command often is a good way to construct
strings that contain weird characters.
(2) I used a backslash character to allow line continuation;
this is nice for commands that have lots of options, but
PLEASE NOTE that the backslash MUST be the very last
character at the end of the line.
Thanks again,
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.bromley@xxxxxxxxxxxxx
http://www.MYCOMPANY.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
.
- Follow-Ups:
- Re: ISE & VHDL : how to include time/date
- From: Nicolas Matringe
- Re: ISE & VHDL : how to include time/date
- References:
- ISE & VHDL : how to include time/date
- From: Nicolas Matringe
- ISE & VHDL : how to include time/date
- Prev by Date: Re: some soft-processors
- Next by Date: Re: Setting top level VHDL generics in XST
- Previous by thread: ISE & VHDL : how to include time/date
- Next by thread: Re: ISE & VHDL : how to include time/date
- Index(es):
Relevant Pages
|