wrote:
> I want to automatically put the current date (year,month,day maybe
> hour) in a 32 bit register during the synthesis stage. I am using
> Modelsim as a simulator and Xilinx Xst as a synthesis tool. My target
> fpga is Spartan 3.
>
> Can someone explain me is there an easy way to implement?
I add a timestamp like this to my builds by generating a package in the makefile I drive the build with. Here's an excerpt:
version.vhd: Makefile
@echo "generating $@"
@rm -f $@
@echo "PACKAGE version IS" > $@
@echo " CONSTANT C_VER_DESIGN : INTEGER := $(VER_DESIGN);" >> $@
@echo " CONSTANT C_VER_MAJOR : INTEGER := $(VER_MAJOR);" >> $@
@echo " CONSTANT C_VER_MINOR : INTEGER := $(VER_MINOR);" >> $@
@echo " CONSTANT C_VER_REV : INTEGER := $(VER_REV);" >> $@
@echo " CONSTANT C_VER_TIMESTAMP : INTEGER := $(shell date +%s);">> $@
@echo "END version;" >> $@
The C_VER_TIMESTAMP is a constant containing the number of seconds since the epoch (1970-01-01 00:00:00 GMT).
This only guarantees an up-to-date timestamp if I build with make. When I'm building from an ISE project, all bets are off.
Ken