XNOR weird behavior in VHDL

The code causing the problems looks like a normal xnor operation, as you can see below:

S(1) <= L(16) xnor L(26); 

This line causes the following error:

 ncvhdl_p: *E,EXPSMI (HDL/aes_sbox_enc_depth16.vhd,169|14): expecting a semicolon (';') [9.5.1]. ncvhdl_p: *F,MAXERR: maximum error count reached (1). TOOL: ncvhdl 10.20-s075: Exiting on Feb 14, 2012 at 12:56:05 GMT (total: 00:00:01) 

Does anyone know what is happening here, the semicolon is clearly present. Is it possible that VHDL does not support xnor, if so, how can I rewrite it?

Many thanks!

+6
source share
2 answers

I believe xnor is defined for bits and booleans, but not std_logic. I think it really depends on the version of VHDL (e.g. 98/2002/2008) that you are using. He, of course, commented on some versions of the std_logic_1164.vhd files that I saw.

How to just invert xor ?

 S(1) <= not (L(16) xor L(26)); 
+6
source

Find out the answer of Paul.

  • IEEE-1076 Year 1987 : does not support the xnor operator.
  • IEEE-1076 Year 2002 . Supports xnor operator.

This can be verified by looking at the 7.1 Language Spec section.

During 1987:

 expression ::= relation { and relation } | relation { or relation } | relation { xor relation } | relation [ nand relation ] | relation [ nor relation ] 

During the year 2002:

 expression ::= relation { and relation } | relation { or relation } | relation { xor relation } | relation [ nand relation ] | relation [ nor relation ] | relation { xnor relation } 

If your tool supports 2002 (or 2008), then it will also need to define a statement in std_logic_1164, but this will be relatively likely.

Most likely, your tool only supports IEEE-1076-1987. Then you want to write xnor as:

 not(L(16) xor L(26)); 
+6
source

Source: https://habr.com/ru/post/908428/


All Articles