Vhdl Variable Assignment Is Not Allowed



I have an issue where the assignment I do is not supported:

[Synth 8-27] complex assignment not supported ["R:/Xilinx/Work/Q115/Q115.srcs/sources_1/new/SkewComp.vhd":85]


I'm using oversampling together with GTH transceiver and I put 0's in front of the data to compensate for skew. I made a big variable 1664bit  that can contain the 64 effective data bits with oversamplingfactor max of 26 (64*26 = 1664). In simulation my code works perfectly, but synthesis fails.


I've attached the VHD file. It fails on the line:


TXDATAOVERSAMPLED((i*ofactor + ofactor-1) downto i*ofactor) := (others => '0');




upindex := (i*ofactor + ofactor-1);

lowindex :=  i*ofactor

TXDATAOVERSAMPLED(upindex downto lowindex) := (others => '0');


Also does not help.

Is there any smarter way I can do this that synthesizes ? 


Thanks in advance

david.quinones wrote:

Hello, thanks to respond.


Seems that constant declarations in generate loops are allow. Why not variables? VHDL books are not clear about this.



Because of the scoping rules. Again: Read that 42 times until you grok its fullness. You cannot declare a variable in the main declarative part of an architecture (the area between the line and the that indicates the start of actual assignments). The declarative part of a generate statement is similar.


But you can define a constant in that declarative area (or in a package, or in a process, or whatever). So that's why.


And XTS notify error in asignation of variable value, not in her declaration.



It's a weird error but valid, in the sense that it's trying to figure out how to do the assignment. 


In this case, variables in generate loops will allow a most simple and clarified code.

Can it use another type of variables or another elegant solution?

I see your point, and I agree that variables would be helpful. Perhaps you can do those assignments in a combinatorial process (that's within the generate block) and that'll be your workaround?

----------------------------Yes, I do this for a living.

Categories: 1

0 Replies to “Vhdl Variable Assignment Is Not Allowed”

Leave a comment

L'indirizzo email non verrĂ  pubblicato. I campi obbligatori sono contrassegnati *