Forum Discussion
Altera_Forum
Honored Contributor
8 years agoI assume you have not simulated this code, otherwise you would know that ele_num is never assigned a value, and hence it remains at it's initial value, -2147483648, it then underflows (illegal in vhdl) because you multiply it by pair.
ToM1AdrA is assign from either this massively negative value, or 0, as it also comes from wr2, which is only ever assigned to 0. If mhm_rd1_ubound and mhm_rd2_ubound are set to some poor value, then this would remove the option ToM1AdrA to the bad integer, and keep it held at 0. Things I recommened: 1. Do not use unconstrained integers 2. Do not use variables - use signals instead - there is NOTHING you need variables for that you cannot use signals for (and signals are much easier to debug and map better to hardware for beginners) 3. Suimulate your code, write a testbench. 4. Why have you got initial values on your outputs? these will only take effect if they are not assigned in your code.