Date Time Directory Project String

Discussion in 'VHDL' started by Brad Smallridge, Nov 22, 2009.

  1. I am not sure that VHDL provides this.

    I have an FPGA with a video display and
    a menu module. With every revision I
    update a string array in the menu module
    that is visible on the video display.

    Two things are wrong with this. The
    menu module is updated when there is
    really no revision.

    Secondly, I have to manually update this
    with the editor which take time and
    sometimes I forget to update.

    I always put my new revisions in a new
    four character directory.

    I am running Xilinx ISE.

    I suppose I could bring the string in
    by a generic or maybe learn how
    to write my own library with the string
    in it. Which would get rid of the first
    issue, but I would rather this update be
    automatic.

    Brad Smallridge
    AiVision
     
    Brad Smallridge, Nov 22, 2009
    #1
    1. Advertising

  2. Brad Smallridge wrote:

    > I have to manually update this
    > with the editor which take time and
    > sometimes I forget to update.


    Remembering to do it is my problem too.
    I can write a shell script to update
    a vhdl package with my hardware rev and date constants,
    but a script can't know when such updates are appropriate.

    -- Mike Treseler
     
    Mike Treseler, Nov 22, 2009
    #2
    1. Advertising

  3. "Brad Smallridge" <> writes:

    > I am not sure that VHDL provides this.
    >
    > I have an FPGA with a video display and
    > a menu module. With every revision I
    > update a string array in the menu module
    > that is visible on the video display.
    >
    > Two things are wrong with this. The
    > menu module is updated when there is
    > really no revision.
    >
    > Secondly, I have to manually update this
    > with the editor which take time and
    > sometimes I forget to update.
    >
    > I always put my new revisions in a new
    > four character directory.
    >
    > I am running Xilinx ISE.
    >
    > I suppose I could bring the string in
    > by a generic or maybe learn how
    > to write my own library with the string
    > in it. Which would get rid of the first
    > issue, but I would rather this update be
    > automatic.


    I build the build-time into my VHDL with a package constant. I use a
    TCL script to write the current time into a VHDL file as a constant just
    before synthesis. Because I use a scripted build, this is run for me
    automatically. I'm not sure ISE provides the ability to run arbitrary
    TCL pre-build :(

    I also build the build time into the USER1 reg so I can read it out over
    JTAG a well.

    The build time ID is then used as the TAG in the revision control system
    so I can easily get back a specific build.

    This is the sort of thing the TCL script does:
    # get the time in format YYMMDDHHMMSS
    set now [clock seconds]
    set compile_id [clock format $now -format "%y%m%d%H%M%S0000"] # the "0000" carries feature/branch flags
    puts "Compile ID is (YYMMDDhhmmss) $compile_id"
    # create a VHDL package file with that value in to be compiled in
    set fp [open "p_compile_id.vhd" "w"]
    puts $fp "-- This is an autogenerated file!!!"
    puts $fp "library ieee;"
    puts $fp "use ieee.std_logic_1164.all;"
    puts $fp "package p_compile_id is"
    puts $fp " constant compile_id : std_logic_vector(63 downto 0) := X\"$compile_id\";"
    puts $fp "end package p_compile_id;"
    close $fp

    You could do some variation on this to suit your stringy requirement I'm
    sure :)

    Cheers,
    Martin

    --

    TRW Conekt - Consultancy in Engineering, Knowledge and Technology
    http://www.conekt.net/electronics.html
     
    Martin Thompson, Nov 23, 2009
    #3
  4. Brad Smallridge a écrit :

    > I suppose I could bring the string in
    > by a generic or maybe learn how
    > to write my own library with the string
    > in it. Which would get rid of the first
    > issue, but I would rather this update be
    > automatic.



    I did this with a tcl script that sets a top level generic.
    I posted my solution on comp.arch.fpga some time ago :
    http://groups.google.fr/group/comp....r&lnk=gst&q=nicolas matringe#3b99a01324a84b7f


    Nicolas
     
    Nicolas Matringe, Nov 23, 2009
    #4
  5. On 22 Nov., 17:24, "Brad Smallridge" <>
    wrote:

    > I always put my new revisions in a new
    > four character directory.


    CVS (and other version control systems) are able to write
    automatically it's version in a string during each commit.
    Use a variable of type string (not direct synthesysable) to store this
    version and try to find out how to convert this to a useable hw
    representation based on the content of the variable. Will be a bit
    tricky but allows you to avoid external perl or tcl scripts.

    bye Thomas
     
    Thomas Stanka, Nov 24, 2009
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Berg
    Replies:
    0
    Views:
    795
    Chris Berg
    Oct 27, 2003
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,278
    Michael Borgwardt
    May 30, 2004
  3. wgan
    Replies:
    7
    Views:
    597
    Roedy Green
    Jul 8, 2004
  4. Keith Cochrane
    Replies:
    2
    Views:
    626
    Keith Cochrane
    Aug 6, 2006
  5. Summu82
    Replies:
    5
    Views:
    869
    Richard Heathfield
    Jun 7, 2006
Loading...

Share This Page