0

I would like to initialize some variables in my verification environment to 'X' value. How can I set 'X' value in e?

Thank you for your help

Halona
  • 1,475
  • 1
  • 15
  • 26
  • 1
    The proper spelling for the hardware verification language is lower case `e`. Upper case `E` refers to a programming language for secure distributed computing: https://en.wikipedia.org/wiki/E_(programming_language) – Tudor Timi Sep 17 '17 at 21:23
  • 1
    I usually also add `e (IEEE 1647)` to make sure that people understand I mean the HVL. – Tudor Timi Sep 17 '17 at 21:24

1 Answers1

3

You can set values other than 0 and 1 using the MVL (multi-valued logic) functions. For a one-bit wide signal this would be:

sig.put_mvl(MVL_X);

It's also possible to assign multi-bit signals by writing:

wide_sig.put_mvl_list({ MVL_X, MVL_X, ... });

These methods only apply to ports. If you want to assign variables to X you need to declare them as being of type mvl or list of mvl.

Tudor Timi
  • 7,453
  • 1
  • 24
  • 53