That's an ancient version of ISE!
An ancient version for an ancient guy with an ancient computer that doesn't like bloatware. 9.2i only takes up a mere
3GB on my hard drive! And since I only intend to use ancient CPLDs it's perfectly adequate...
I am surprised that the synthesizer didn't complain about your code.
It's not
my code, which why I too was surprised. It's supposed to come from a fully working project.
Here are the warning messages:-
=========================================================================
* Advanced HDL Synthesis *
=========================================================================
WARNING:Xst:2677 - Node <2> of sequential type is unconnected in block <bank>.
WARNING:Xst:2677 - Node <3> of sequential type is unconnected in block <bank>.
WARNING:Xst:2677 - Node <1> of sequential type is unconnected in block <bank>.
...
=========================================================================
* Low Level Synthesis *
=========================================================================
WARNING:Xst:2677 - Node <bank_1> of sequential type is unconnected in block <minus_one>.
WARNING:Xst:2677 - Node <bank_3> of sequential type is unconnected in block <minus_one>.
WARNING:Xst:2677 - Node <bank_2> of sequential type is unconnected in block <minus_one>.
...
Started : "Fit".
WARNING:Cpld:1007 - Removing unused input(s) 'D<1>'. The input(s) are unused
after optimization. Please verify functionality via simulation.
WARNING:Cpld:1007 - Removing unused input(s) 'D<2>'. The input(s) are unused
after optimization. Please verify functionality via simulation.
WARNING:Cpld:1007 - Removing unused input(s) 'D<3>'. The input(s) are unused
after optimization. Please verify functionality via simulation.
These all occur because there is a 4 bit register (called 'bank')which is referenced only when sideways_select is 1. For some reason D0
is allocated, resulting a 1 bit register being synthesized. It took me a while to figure out that the reason had nothing to do with the register itself.
I assume that A15, A14 and sideways_select are all std_logic types.
Yes, that is correct.
The code needs a typecast because there's nothing telling the analyzer what you should get when you concatenate two std_logic signals.
Correct code would be:
sideways_select <= '1' when std_logic_vector'(A15 & A14) = "10" else '0';
The typecast is std_logic_vector'( ....) and note the presence of the apostrophe.
Thanks for that, now I know how and why to use a typecast! In this case it's only a single combination of two bits so it's probably just as easy to treat them separately, but could definitely be useful when larger numbers are involved.
The original code also had this in it:-
signal A_high : std_logic_vector(7 downto 0);
...
A_high <= A15 & A14 & A13 & A12 & A11 & A10 & A9 & A8;
So I did this:-
sideways_select <= '1' when A_high(7 downto 6) = "10" else '0';
Which solution would be better; typecast the port inputs, or use the internal std_logic_vector signal - or does it not matter? They both used identical resources so I guess any differences were optimized out.
Anyway I will go with your typecast because it is closest to the original intent.