Re: ISE & VHDL : how to include time/date



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.
.



Relevant Pages

  • Re: what is wrong with that r""
    ... EOL while scanning single-quoted string ... backslash is included in the string without change, ... a valid string literal consisting of two characters: ... following quote character). ...
    (comp.lang.python)
  • Re: Mandis Quotes (aka retiring """ and )
    ... characters not be allowed, ... Then I remembered string ... Any binary data can be inside the quote. ...
    (comp.lang.python)
  • Re: John Ringo Forsees a Glorious Future
    ... entertaining) to quote the disclaimer from "Kildar": ... This is a work of fiction. ... All the characters and events portrayed in this book are fictional, ... Heck, there is no Kildar. ...
    (rec.arts.sf.written)
  • Re: Replacing WP Typographic Symbols in Word 2002
    ... Typographical Symbol" characters are converted into the proper Unicode ... replacement font for "WP Typographical Symbols", ... Typographical Symbols" again, and you can then use "Find/Replace" (this ... Case &H3D ' single high comma quote ...
    (microsoft.public.word.conversions)
  • Re: compiling error
    ... >:when mixing quotes from others who use the conventional quote marking. ... >for humans. ... Humans are very good at pattern matching with distinct ... >characters, but not nearly as good at mentally counting rows of ...
    (comp.lang.c)