E
ec
Guest
Hi
Are VARIABLES in VHDL synthesisable ?
Thanks
EC
Are VARIABLES in VHDL synthesisable ?
Thanks
EC
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Yes.Hi
Are VARIABLES in VHDL synthesisable ?
Thanks
EC
I think you better handle them with care, it happened to me that theyec wrote:
Hi
Are VARIABLES in VHDL synthesisable ?
Thanks
EC
Yes.
[snippage]David Ashley wrote:
ec wrote:
Hi
Are VARIABLES in VHDL synthesisable ?
Thanks
EC
Yes.
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.
Yes. Here are some example designsAre VARIABLES in VHDL synthesisable ?
That's a pitty. Not even an order of magnitide? Was it more than 2X?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.
I made a test case which was an array of large counters and I recallKai Harrekilde-Petersen wrote:
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.
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).
Yes, VARIABLES are synthesisable ...Hi
Are VARIABLES in VHDL synthesisable ?
Thanks
EC
I'm guessing that you really don't know what a signal is or youec wrote:
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 ! ;-)
come to mind from your two statements....When 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!
If you've measured faster sim times with variables then two questions
What if it were 2X?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.
That's a pity. Not even an order of magnitide? Was it more than 2X?
My gut estimate is 2x for my signal-less design entities.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.
Note thatBy 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.
The most significant value for me is clarity of design intent.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.
KJ wrote:
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.
Note that
log /top/dut/myproc/*
Saves all variable history for a single process uut.
"Single process uut" is the key restriction.
It's not an unfamiliar command that needs to be mastered, it's the factI agree that speed is an insufficient reason to
take on variables, but an unfamiliar command
to log waves is not an insurmountable roadblock either.
function of the person writing the code than whether that person usesBottom 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.
The most significant value for me is clarity of design intent.
I agree, and I find that 'clarity of design intent' is much more a
poster that if they thought it might be a useful technique because ofThis a personal preference, and there is no point
in my trying to prove or disprove it.
Never said that 'you' should. I was simply suggesting to the previous
KJ,"Paul Uiterlinden" <paulu@sx4all.nl> wrote in message
news:453bf097$0$10681$847b8a11@dreader22...
Kai Harrekilde-Petersen wrote:
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.
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).
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.
No, but it would give a reason to talk with the designers about codingPaul Uiterlinden wrote:
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.
That's a pity. Not even an order of magnitide? Was it more than 2X?
What if it were 2X?
I wouldn't rewrite working code for that.
It is risky to change coding style, I agree. A factor of 2X howeverClearly, 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.
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.
Alas, I did not do those timed tests at the time, but only used theKai Harrekilde-Petersen wrote:
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.
That's a pitty. Not even an order of magnitide? Was it more than 2X?
In my experience, you need to profile your DUT code and look at it toWhen 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.
Agreed, but not always you will find a bottle neck. There are thoseIn my experience, you need to profile your DUT code and look at it
to determine where the bottleneck is.
I've even seen the same with a simple parity generator. That too was aIn 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.
andAmontec, Larry wrote:
ec wrote:
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 ! ;-)
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 ?"
KJ, are you a C programmer talking about VHDL !
VARIABLEs can only be used in the process itself!implying that a variable is anything different than a signal in some
unspecifyed physical manner.
The SIGNAL and VARIABLE are really VERY different !
VHDL RTL description has the advantage to provide TRUE multi-processingVariables 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.
When 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!
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)
RTL description concept is much more different than Test Bench concept.
Yes, but this is for a complex PCI core testbench + high level2. 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?)
50% to 70%
www.amontec.comKJ
Laurent Gauch
boards and writing logic for all sorts of programmable devices evenYes, VARIABLES are synthesisable ...
... but what is a variable in hardware description ?
We know what is a Signal ! ;-)
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 ?"
KJ, are you a C programmer talking about VHDL !
Absolutely not. I'm a professional engineer who has been designing
hardware description ?" with the implicit (to me) assumption thatand
implying that a variable is anything different than a signal in some
unspecifyed physical manner.
The SIGNAL and VARIABLE are really VERY different !
VARIABLEs can only be used in the process itself!
SIGNALs are used to interact between process!
What started this was your statement "... but what is a variable in
PCBA that it is going to be a part of and the models for some of thoseWhen 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!
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)
RTL description concept is much more different than Test Bench concept.
Not always. Generally I surround my FPGA design with a model of the
VHDL RTL description has the advantage to provide TRUE multi-processing
description.
Strike the word 'RTL' from the previous sentence and I agree.
would be to put one signal within each process....most likely not a wayMultiple 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).
That's your opinion and you're entitled to it. The 'smallest process'
In this way, all VARIABLEs will be gone
So what? Do you get charged by how many variables you use?
Tressler and many others that follow his lead and use variables moreIf you still have VARIABLEs,
you have to re-think about your methodology and design concept!
I don't agree....and I think you'd get a bigger disagree from Mike
is 'easier to think of a function as one process' or not depends onFor a test bench description, it is more more easy to think ONE process,
as one processor with multiple VARIABLEs and FUNCTIONs !
You really like excamation points don't you? In any case, whether it
thing, one written with variables and the other with the same coding2. 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?)
50% 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 !
So are you saying that you have two equivalent descriptions of the same
I'm also a C programmer talking about VHDL.KJ, are you a C programmer talking about VHDL !
The significant difference is assignment delay.and
implying that a variable is anything different than a signal in some
unspecifyed physical manner.