6

The code that is causing 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)

Anyone an idea what is going wrong here, the semicolon is clearly there. Is it possible that VHDL does not support xnor, if so, how do I have to rewrite it?

Many thanks!

Patrick
  • 989
  • 3
  • 16
  • 23

2 Answers2

6

I believe that xnor is defined for bits and booleans, but not std_logic. I think it actually depends on which version of VHDL (e.g. 98 / 2002 / 2008) you're using. It's certainly commented out of some versions of the std_logic_1164.vhd files I've seen.

How about just inverting an xor?

S(1) <= not (L(16) xor L(26));
Paul S
  • 7,645
  • 2
  • 24
  • 36
  • IEEE Std 1164-1993 (now withdrawn) provided in the package declaration "Note : The declaration and implementation of the "xnor" function is specifically commented until a time at which the VHDL language has been officially adopted as containing such a function. At such a point, the following comments may be removed along with this notice ... It is the intent of this effort to provide such a function once it becomes available in the VHDL standard." Removing the comments is unclear. IEEE released the package source with xnor uncommented for 1076a in 1997. 1164 is incorporated in 1076-2008. –  Apr 30 '18 at 22:04
6

To elaborate on Paul's Answer.

  • IEEE-1076 Year 1987: Does not support an xnor operator.
  • IEEE-1076 Year 2002: Supports an xnor operator.

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

For Year 1987:

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

For 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 would also need to define the operator in std_logic_1164, but that would be relatively likely.

What is most likely, is that your tool is only supporting IEEE-1076-1987. You would then want to write an xnor as:

not(L(16) xor L(26));
Bill Lynch
  • 80,138
  • 16
  • 128
  • 173
  • +1 for looking it up in the language reference manual (and sharing) – Philippe Feb 16 '12 at 20:00
  • FWIW, VHDL '93 is when this support was added. VHDL 2002 was a minor rev to VHDL 1993 that mostly just messed with how shared variables work (protected types). – wjl Jun 14 '12 at 04:41