> I fixed s to std_logic_vector (29 downto 0) then it take differen value
> (doutIS95 , dout802154g, etc )
> So what I can do ?
You can either (1) truncate the long vector or (2) lengthen the
short one.
In the first case (1) you can assign a default value (others=>'0') to s
and assign only the relevant bits:
1 | process (doutGPRS, doutCDMA2000, doutUMTS, doutGSM, doutLTE, doutDVB, doutWCDMA, dout802154g, dout80220, Sel) is
|
2 | begin
|
3 | s <= (others=>'0'); -- default value
|
4 | if Sel = "0000" then s(29 downto 29-doutCDMA2000'high) <= doutCDMA2000 ;
|
5 | elsif Sel = "0010" then s(29 downto 29-doutGPRS'high) <= doutGPRS;
|
6 | elsif Sel = "0100" then s(29 downto 29-doutUMTS'high) <= doutUMTS;
|
7 | elsif Sel = "0110" then s(29 downto 29-doutGSM'high) <= doutGSM;
|
8 | ....
|
9 | else s(29 downto 29-dout80220'high) <= dout80220;
|
10 | end if ;
|
11 | end process;
|
This was left aligned.
You can also do it right aligned:
1 | process (doutGPRS, doutCDMA2000, doutUMTS, doutGSM, doutLTE, doutDVB, doutWCDMA, dout802154g, dout80220, Sel) is
|
2 | begin
|
3 | s <= (others=>'0'); -- default value
|
4 | if Sel = "0000" then s(doutCDMA2000'range) <= doutCDMA2000 ;
|
5 | elsif Sel = "0010" then s(doutGPRS'range) <= doutGPRS;
|
6 | elsif Sel = "0100" then s(doutUMTS'range) <= doutUMTS;
|
7 | elsif Sel = "0110" then s(doutGSM'range) <= doutGSM;
|
8 | ....
|
9 | else s(dout80220'range) <= dout80220;
|
10 | end if ;
|
11 | end process;
|
Got the idea? Its faily simple, isn't it?
And the second case (2) is already solved :
A few days ago the very same question popped up. Maybe it was asked by
a classmate of you. He had the error in line 332. Have a look around
here in the forum. If you try a search for "fatal error" you will find
the solution: https://embdev.net/topic/302406.
> use ieee.std_logic_arith.all ;
> use ieee.numeric_std.all;
Who teaches you to use them both together?
> use std.textio.all;
You know that that package is not synthesizeable?