Forum Discussion
Altera_Forum
Honored Contributor
13 years ago --- Quote Start --- I just want a working solution for this, and if it's possible to do it with verilog, then I guess I'll try that, could you possibly tell me how to do it? and post a code or something? I'm using quartus. --- Quote End --- You can use generics/parameters at the top-level of your design, and use those to populate registers within your design. You can then use Quartus to populate the generics:
# -----------------------------------------------------------------# Generics# -----------------------------------------------------------------
# Build timestamp# - Tcl returns the same as
set timestamp
puts " - Build timestamp ($timestamp 0x)"
# Version (integer format)
set version
# Generics
set_parameter -name VERSION $version
set_parameter -name TIMESTAMP $timestamp
This Tcl code can be part of a script you explicitly call (source), or you can have Quartus run it as part of the build sequence: http://www.altera.com/support/examples/tcl/auto_processing.html If you prefer to have your version number stored in a file, then you can have Tcl read that file and populate the generic. Cheers, Dave