W
Weng Tianxiang
Guest
Hi,
I hate VHDL!!!
I one person had developed a large VHDL design. Now because PCB
reasons, the project has to be divided into 2 subdesigns: 95% are the
same with 30 pins different in interfaces.
So I naturally hope to write the code like this:
In entity part:
if ChipA = true, do following
signal ... : inout ...
signal ... : inout ...
....
else
signal ... : inout ...
signal ... : inout ...
....
end if;
In signal declaration part:
if ChipA = true, do following
signal ...
signal ...
....
else
signal ...
signal ...
....
end if;
In process part:
if ChipA = true, do following
process(...)(...)
process(...)(...)
....
else
process(...)(...)
process(...)(...)
....
end if;
But I cannot do that.
If it were in C or C++, #define and #undefine conditional statements
are so easy to use, we programmers can never imagine such beautiful
things are never permitted in VHDL!!!
Another problem of VHDL is the following:
In my PCI/PCI-X development, when a transaction address appears on
bus, I have to test 3 space addresses in a state machine to see what
type of actions I should take:
if(BusAddress = 32-bit-Address1) then
NextState <= stateX1;
elsif(BusAddress = 32-bit-Address2) then
NextState <= stateX2;
elsif(BusAddress = 32-bit-Address3) then
NextState <= stateX3;
end if;
Did you notice that in goto stateX3 statement it contains two other
unnecessary comparisons:
BusAddress = 32-bit-Address1
BusAddress = 32-bit-Address2
It just wastes resources!!!
Any comments are welcome.
Weng
I hate VHDL!!!
I one person had developed a large VHDL design. Now because PCB
reasons, the project has to be divided into 2 subdesigns: 95% are the
same with 30 pins different in interfaces.
So I naturally hope to write the code like this:
In entity part:
if ChipA = true, do following
signal ... : inout ...
signal ... : inout ...
....
else
signal ... : inout ...
signal ... : inout ...
....
end if;
In signal declaration part:
if ChipA = true, do following
signal ...
signal ...
....
else
signal ...
signal ...
....
end if;
In process part:
if ChipA = true, do following
process(...)(...)
process(...)(...)
....
else
process(...)(...)
process(...)(...)
....
end if;
But I cannot do that.
If it were in C or C++, #define and #undefine conditional statements
are so easy to use, we programmers can never imagine such beautiful
things are never permitted in VHDL!!!
Another problem of VHDL is the following:
In my PCI/PCI-X development, when a transaction address appears on
bus, I have to test 3 space addresses in a state machine to see what
type of actions I should take:
if(BusAddress = 32-bit-Address1) then
NextState <= stateX1;
elsif(BusAddress = 32-bit-Address2) then
NextState <= stateX2;
elsif(BusAddress = 32-bit-Address3) then
NextState <= stateX3;
end if;
Did you notice that in goto stateX3 statement it contains two other
unnecessary comparisons:
BusAddress = 32-bit-Address1
BusAddress = 32-bit-Address2
It just wastes resources!!!
Any comments are welcome.
Weng