EmbDev.net

Forum: FPGA, VHDL & Verilog How to get current time in FPGA?


Author: LisaLLLL (Guest)
Posted on:

Rate this post
0 useful
not useful
Hi all,

I want to get current system time with a FPGA board using VHDL like 
YEAR/MONTH/DAY/HOUR/MINUTE/SECOND, but there is no primitive or function 
like datetime() that we can find in Python Java. Could you tell me how 
should I do?

Author: meh (Guest)
Posted on:

Rate this post
0 useful
not useful
Sorry, but your question suggests that you haven't understood at all 
what FPGAs are and what they actually do.

Python and Java are Programming Languages intended to be run on some 
sort of computer with a dedicated computation unit and some software 
environment already existing. This is why there is a time available 
which can even be synchronized in some way (NTP, GPS, ...).

A FPGA is very different from that. It is basically just a buch of logic 
components whose wiring can be described by a special hardware 
description language (HDL), like VHDL or Verilog. These logic components 
basically have no clue about time. If you really have to do something 
with time on an FPGA you gave to care for yourself to get it there.

Author: Lothar Miller (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
LisaLLLL wrote:
> I want to get current system time with a FPGA board using VHDL
Thats a nice approach. Read a few lines about VHDL and (at least) try to 
understand that your question is like "I want to build a skyscraper by 
using concrete. Could you tell me how should I do?"

The answer is: "Of course concrete is necessary for a skyscraper, but 
you need much more. And at first you need a plan!"

meh wrote:
> you haven't understood at all what FPGAs are and what they actually do.
Thats absolutely obviously a fact.

And after having read any book (at least the first 20 pages) and having 
figured out what a FPGA is, the same thing starts with VHDL.

And finally the most important thing to figure out, is that FGPA is not 
VHDL. The part of VHDL that can be synthesized on a real target FPGA is 
at maximum 5% of VHDL.

But at this moment there is to see not the faintest idea about both of 
them...

LisaLLLL wrote:
> I want to get current system time with a FPGA board
What HARDWARE does give you the current time? Is there a /real time 
clock/  circuit on the FPGA board? What interface to the FPGA has it?

: Edited by Moderator
Author: Guessing (Guest)
Posted on:

Rate this post
0 useful
not useful
LisaLLLL wrote:
> I want to get current system time with a FPGA board using VHDL like
> YEAR/MONTH/DAY/HOUR/MINUTE/SECOND, but there is no primitive or function
> like datetime() that we can find in Python Java. Could you tell me how
> should I do?

maybe you are looking for a Time stamp passed from the Revision control 
System into the VHDL-code. Maybe you shall consiter a Little script 
which generates a VHDL package consisting of a constant string. See 
https://stackoverflow.com/questions/18141851/compi...

Author: Viktor B. (coldlogic)
Posted on:

Rate this post
0 useful
not useful
Well, AS FPGAs are basically a bunch of logic circuits waiting to be 
connected in any way you want it to, I'd suggest you get yourself a RTC 
(Real Time Clock) module, build an interface for it and connect them 
both. Then you could measure time, and after calibration also get your 
time by adding the passed seconds to the calibration constant

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig