E
ec
Hi
Are VARIABLES in VHDL synthesisable ?
Thanks
EC
Are VARIABLES in VHDL synthesisable ?
Thanks
EC
ec said:Hi
Are VARIABLES in VHDL synthesisable ?
Thanks
EC
David said:Yes.
Al said:I think you better handle them with care, it happened to me that they
turned out in a "removed instance" or something like this because not
carefully handled.
ec said:Are VARIABLES in VHDL synthesisable ?
That being said, we did see some significant improvements in
simulation speed and memory size by using variables rather than
signals. And no, I don't recall the numbers.
Paul Uiterlinden said:Kai Harrekilde-Petersen wrote:
That's a pitty. Not even an order of magnitide? Was it more than 2X?
I'm just curious. The designs I'm dealing with almost exclusively use
signals. I do verifciation, using my own bus functional models. They
are written in a behavioral style with variables exclusively
(almost).
ec said:Hi
Are VARIABLES in VHDL synthesisable ?
Thanks
EC
Yes, VARIABLES are synthesisable ...
... but what is a variable in hardware description ?
We know what is a Signal ! ;-)
If you've measured faster sim times with variables then two questionsWhen possible, we use SIGNAL for RTL description (synthesisable code)!
When possible, We use VARIABLE for Test Bench description
(non-synthesisable code) -> the simulator will run much faster!
Paul said:That's a pity. Not even an order of magnitide? Was it more than 2X?
Clearly, the DUT is the part to be optimized to improve simulation
speed. That's why I would like to know if you could put a rough
estimate on the factor that may be gained by using variables.
KJ said:By that I mean that you can't add a
variable to the Modelsim wave window to see the history of that variable
after the fact....which is something that I can do with signals with the
simple 'log -r /*' command at the start of sim.
Bottom line though is benchmark it for yourself and see if it's worth it to
you. There are good reasons for using and good reasons for not using
variables.
"Single process uut" is the key restriction.Mike said:Note that
log /top/dut/myproc/*
Saves all variable history for a single process uut.
I agree that speed is an insufficient reason to
take on variables, but an unfamiliar command
to log waves is not an insurmountable roadblock either.
I agree, and I find that 'clarity of design intent' is much more aThe most significant value for me is clarity of design intent.
Never said that 'you' should. I was simply suggesting to the previousThis a personal preference, and there is no point
in my trying to prove or disprove it.
Bottom line though is benchmark it for yourself and see if it's
worth it to
you. There are good reasons for using and good reasons for not
using variables.
Mike said:What if it were 2X?
I wouldn't rewrite working code for that.
My gut estimate is 2x for my signal-less design entities.
To prove it, I would have to rewrite a design in
a style that I have not used for years. This
doesn't sound like much fun and even if I held
this proof, it alone is not a good enough reason
to change design styles.
Paul Uiterlinden said:Kai Harrekilde-Petersen wrote:
That's a pitty. Not even an order of magnitide? Was it more than 2X?
When profiling a simulation, some 90% of the time is spend in the DUT
and 10% in my verification models (both VHDL).
Clearly, the DUT is the part to be optimized to improve simulation
speed. That's why I would like to know if you could put a rough
estimate on the factor that may be gained by using variables.
Kai said:In my experience, you need to profile your DUT code and look at it
to determine where the bottleneck is.
In many of the Ethernet switch designs, the major part (>50%!) of
the simulation time was spent in the CRC32 calculations, which used
some very neat recursively defined XOR_tree() functions which
yielded perfectly balanced binary XOR-gate trees directly during the
synthesis elaboration, but were simulation time hogs.
KJ, are you a C programmer talking about VHDL !KJ said:I'm guessing that you really don't know what a signal is or you
wouldn't be asking "what is a variable in hardware description ?"
The SIGNAL and VARIABLE are really VERY different !implying that a variable is anything different than a signal in some
unspecifyed physical manner.
RTL description concept is much more different than Test Bench concept.Variables and signals in the VHDL language have different behaviours in
the same way that 'and' and 'or' and 'xor' are VHDL operators that have
different behaviours. Just because they do different things doesn't
make one better or worse than the other....it simply means they do
different things.
If you've measured faster sim times with variables then two questions
come to mind from your two statements....
1. Why do you use signals in your RTL (since it would be faster with
variables)
50% to 70%2. How much faster does it run? (I'm guessing that it probably wasn't
enough to warrant an exclamation point, I measured around 10% on a test
case, what have you seen?)
Laurent Gauch
Absolutely not. I'm a professional engineer who has been designingKJ, are you a C programmer talking about VHDL !
What started this was your statement "... but what is a variable inand
The SIGNAL and VARIABLE are really VERY different !
VARIABLEs can only be used in the process itself!
SIGNALs are used to interact between process!
Not always. Generally I surround my FPGA design with a model of theRTL description concept is much more different than Test Bench concept.
Strike the word 'RTL' from the previous sentence and I agree.VHDL RTL description has the advantage to provide TRUE multi-processing
description.
That's your opinion and you're entitled to it. The 'smallest process'Multiple concurrent PROCESS with multiple SIGNALs for
interacting between the PROCESS ! The only objective is to write many
smallest process (This is the better way to write re-usable VHDL code).
So what? Do you get charged by how many variables you use?In this way, all VARIABLEs will be gone
I don't agree....and I think you'd get a bigger disagree from MikeIf you still have VARIABLEs,
you have to re-think about your methodology and design concept!
You really like excamation points don't you? In any case, whether itFor a test bench description, it is more more easy to think ONE process,
as one processor with multiple VARIABLEs and FUNCTIONs !
So are you saying that you have two equivalent descriptions of the same50% to 70%
Yes, but this is for a complex PCI core testbench + high level
application as FFT accelerator ... no simple as a Shift register test
bench !
KJ, are you a C programmer talking about VHDL !
and
implying that a variable is anything different than a signal in some
unspecifyed physical manner.
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.