W
Wallclimber
Guest
Hi Weng,
are mutually exclusive: all comparisons compare against the same
input, BusAddress. It's extremely simple for a synthesis tool to
recognize this an act accordingly.
Long time ago (before you sent me your paper, which was, I think, 2
years ago), I did some tests on this and DC was able recognize this
mutual exclusiveness without problems.
In other words, for the most common case, there is enough information
for a synthesizer to do a good job.
The only case where your suggestion could have merit, is an example
like this:
Decode1 <= '1' when Addr = Addr1;
Decode2 <= '1' when Addr = Addr2;
Decode3 <= '1' when Addr = Addr3;
Decode4 <= '1' when Addr = Addr4;
Decode5 <= '1' when Addr = Addr5;
if Decode1='1' then
RdData <= Data1;
elsif Decode2='1' then
RdData <= Data2;
....
In this case, it's less likely that the synthesizer will recognize
that DecodeX is mutual exclusive. This is certainly the case if the
Decode signals are reclocked for whatever (timing?) reason.
My standard way to solve this is as follows:
v_RdData := (others => '0');
if Decode1='1' then
v_RdData := v_RdData or Data1;
elsif Decode2='1' then
v_RdData := v_RdData or Data2;
....
RdData <= v_RdData;
This solves 90% of the 5% of cases where a standard if-then-else tree
would give you trouble.
Your solution would be this:
if Decode1='1' then
RdData <= Data1;
orif Decode2='1' then
RdData <= Data2;
....
Yes, this could be a way to solve your problem, but, in my opinion,
it's not worth the trouble.
Not only would such a keyword be very confusing for beginners in
Verilog or VHDL, it only would introduce ambiguous behavior in the
language.
The way things are now, if you use the standard constructs, you can
reasonably be sure(*) that whatever your wrote will be synthesized
accordingly into gates and you can use formal equivalence check to
verify.
What if the designer using your new keyword makes a mistake and
conditions are NOT mutex? In that case, the simulator may give
different results for gatelevel simulation than for RTL simulations.
I'm sure there will be formal equivalence check consequences also.
In my opinion, you will open a can of worms that's just not worth
opening...
slight exaggeration. Just like beginning of your rant. If you just
learned to moderate your tone a little bit, more people actually might
listen to what you really have to say. If, on the other hand, the
subject of this thread had the intention to have readers dismiss you
as a brainless troll (which you are not), you probably succeeded very
well...
Tom
(*) incomplete sensitivity lists may be an exception here, but a
synthesis tool can easily warn for those.
For the statement below:"Synthesis optimizations will clean it right up."
No ways! Compiler doesn't know they are mutually exclusive unless VHDL
or Verilog provides a mean programmer can use.
there is NO reason why a decent synthesis tool cannot see that theyNextState <= stateX1 when BusAddress = 32-bit-Address1 else
stateX2 when BusAddress = 32-bit-Address2 else
...
are mutually exclusive: all comparisons compare against the same
input, BusAddress. It's extremely simple for a synthesis tool to
recognize this an act accordingly.
Long time ago (before you sent me your paper, which was, I think, 2
years ago), I did some tests on this and DC was able recognize this
mutual exclusiveness without problems.
In other words, for the most common case, there is enough information
for a synthesizer to do a good job.
The only case where your suggestion could have merit, is an example
like this:
Decode1 <= '1' when Addr = Addr1;
Decode2 <= '1' when Addr = Addr2;
Decode3 <= '1' when Addr = Addr3;
Decode4 <= '1' when Addr = Addr4;
Decode5 <= '1' when Addr = Addr5;
if Decode1='1' then
RdData <= Data1;
elsif Decode2='1' then
RdData <= Data2;
....
In this case, it's less likely that the synthesizer will recognize
that DecodeX is mutual exclusive. This is certainly the case if the
Decode signals are reclocked for whatever (timing?) reason.
My standard way to solve this is as follows:
v_RdData := (others => '0');
if Decode1='1' then
v_RdData := v_RdData or Data1;
elsif Decode2='1' then
v_RdData := v_RdData or Data2;
....
RdData <= v_RdData;
This solves 90% of the 5% of cases where a standard if-then-else tree
would give you trouble.
Your solution would be this:
if Decode1='1' then
RdData <= Data1;
orif Decode2='1' then
RdData <= Data2;
....
Yes, this could be a way to solve your problem, but, in my opinion,
it's not worth the trouble.
Not only would such a keyword be very confusing for beginners in
Verilog or VHDL, it only would introduce ambiguous behavior in the
language.
The way things are now, if you use the standard constructs, you can
reasonably be sure(*) that whatever your wrote will be synthesized
accordingly into gates and you can use formal equivalence check to
verify.
What if the designer using your new keyword makes a mistake and
conditions are NOT mutex? In that case, the simulator may give
different results for gatelevel simulation than for RTL simulations.
I'm sure there will be formal equivalence check consequences also.
In my opinion, you will open a can of worms that's just not worth
opening...
Given that his heel was the reason for his Achilles' death, this is aThis is a Achilles heel for VHDL or Verilog.
slight exaggeration. Just like beginning of your rant. If you just
learned to moderate your tone a little bit, more people actually might
listen to what you really have to say. If, on the other hand, the
subject of this thread had the intention to have readers dismiss you
as a brainless troll (which you are not), you probably succeeded very
well...
Tom
(*) incomplete sensitivity lists may be an exception here, but a
synthesis tool can easily warn for those.