3

I have an entity which has this

TEMPERATURE: in STD_LOGIC_VECTOR(7 downto 0);

as one of the inputs and I need a signal that has the initial value TEMPERATURE. In the entity architecture I've declared the signal

signal temp:STD_LOGIC_VECTOR(7 downto 0):=TEMPERATURE;

but when simulating temp remains UU(unassigned). How do I fix this?

  • 1
    Welcome to SackOverflow. We do not know what `TEMPERATURE` is and are missing a lot of context. Please provide a [mcve]. – JHBonarius May 13 '18 at 20:34
  • 3
    At simulation startup, `TEMPERATURE` is all `'U'`. Thus, `temp` gets initialized to all `'U'`. `'U'` stands for uninitialized, not unassigned. You should either initialize `temp` from a (generic) constant or implement a flip-flop. Your current design will not synthesize as expected. – Paebbels May 13 '18 at 21:13
  • You find ALL the drivers on that signal and either initialise or disconnect them. –  May 13 '18 at 22:24
  • 2
    This sounds like an [XY problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem). If this is your design, you shouldn't be initialising a signal from an input at all. So, instead of trying to initialise `temp` to `TEMPERATURE`, I would take a step back and consider what it is you are trying to achieve (and what hardware you expect to be synthesised). – Matthew Taylor May 14 '18 at 11:08

0 Answers0