Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21602 Discussions

Efficient Firmware version control

Altera_Forum
Honored Contributor II
1,729 Views

Dear Gurus, 

 

I've have two boards in my system using altera cyclone FPGAs and I want to be able to read the firmware version of each (from the PC controlling the system). The PC can read/write to 32 register addresses on each board. Currently I just use a VHDL entity version block 

 

entity VERSION_CONTROL is 

port ( 

VERSION : out STD_LOGIC_VECTOR(7 downto 0) 

); 

end; 

architecture ARCH of VERSION_CONTROL is 

begin 

VERSION <= x"02"; 

end ARCH; 

 

output to a version register. Is there a more efficient way of storing constants (I'm relatively new to the VHDL/Altera world) rather than using valuable registers? I have seen TCL scripts to automate this process but this is currently above me. 

 

Yours Faithfully, 

 

H
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
832 Views

Im afraid you are always going to use up some register space in the mapping. The logic you have wont really use a register, or at least wont use any noticibale amount of FPGA logic. 

 

Personally, I wouldnt have an entity to do it, I would just define a constant in a package or the register controller, but in reality it's no different to what you have. All the TCL scripts you've seen will be doing will be re-writing the VHDL to change the constant defined in the code.
0 Kudos
Altera_Forum
Honored Contributor II
832 Views

Thanks Tricky - Underdstood. Thanks again for taking the time to reply. Best regards, 

H
0 Kudos
Altera_Forum
Honored Contributor II
832 Views

It is pretty easy to use tcl scripts to handle this. View this post: 

http://www.alteraforum.com/forum/showthread.php?p=25672#post25672 

 

I think it does a pretty good job explaining how to use them and with reference files. 

 

Not listed in that forum post, but what i do currently, is force the version numbers to be stored in a register and set an attribute to that register so that it doesn't get synthesized away. This way you can edit the version number post compilation with the resource property editor, so if you need to up the beta number for a release you don't have to recompile your whole design. Now a days registers are basically free, especially when you are only using an 8-bit version number. 

 

Hope this helps, although you have probably already seen it from the sound of your original post. 

Kevin
0 Kudos
Altera_Forum
Honored Contributor II
832 Views

Kevin, 

 

Thanks for your thorough response. If I feel brave I might attempt to hack your example a little but I'm using a EP1C3 that has got a lot to do (hence me being a little stingy with the registers). As always, everyone’s generosity in responding is hugely appreciated. Thanks again, 

 

H
0 Kudos
Reply