"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