Date Time Directory Project String

B

Brad Smallridge

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
 
M

Mike Treseler

Brad said:
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
 
M

Martin Thompson

Brad Smallridge said:
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
 
T

Thomas Stanka

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top