Altera_Forum
Honored Contributor
11 years agoVHDL code help!
Hi guys,
I have written out this code, but it gave me error that type R1-R5 is incompatible with A-E. Please help !!!Hi guys,
I have written out this code, but it gave me error that type R1-R5 is incompatible with A-E. Please help !!!All of the A-E inputs are a single std_logic.
R1-R8 are declared as integers. I dont really know what you're trying to do? why not just input a load of integers?Yes
A : In integer;Please post your modifed code.
The fact the auto-generated testbench still uses std logic makes me beleive you modified nothing. And you shouldnt need to use the auto-generation - you can write it yourself.and i gave me this warnings too
Xst:647 - Input <A<31:7>> is never used. This port will be preserved and left unconnected if it belongs to a top-level block or it belongs to a sub-block and the hierarchy of this sub-block is preserved. WARNING:Xst:647 - Input <B<31:7>> is never used. This port will be preserved and left unconnected if it belongs to a top-level block or it belongs to a sub-block and the hierarchy of this sub-block is preserved. WARNING:Xst:647 - Input <C<31:7>> is never used. This port will be preserved and left unconnected if it belongs to a top-level block or it belongs to a sub-block and the hierarchy of this sub-block is preserved. WARNING:Xst:647 - Input <D<31:7>> is never used. This port will be preserved and left unconnected if it belongs to a top-level block or it belongs to a sub-block and the hierarchy of this sub-block is preserved. WARNING:Xst:647 - Input <E<31:7>> is never used. This port will be preserved and left unconnected if it belongs to a top-level block or it belongs to a sub-block and the hierarchy of this sub-block is preserved.This is because you declared the ports as integer without a range definition. integers will synthesise to 32 bit busses, and as the MSBs are never used, they are removed.
You should not use integers at the top level to connect to pins on the device. There are plenty of tutorials on the internet on how to write a testbench. A testbench is just another peice of code (maybe VHDL) that provides stimulus for your design under test. Because it is not synthesised, you can write things you cannot write in VHDL code for FPGAs, eg:
signal clk : std_logic := '0';
....
clk <= not clk after 5 ns; --100 MHz