Forum Discussion
Altera_Forum
Honored Contributor
15 years agoTo simulate a weak pull up, you need to provide a 'H' level signal to your pin in the test bench. Then in the simulation, the signal will be 'H' when no other driver is driving the pin, and '0' or '1' when they are.
In your code, each time you read that signal, use the To_X01() function. As an example:my_signal <= To_X01(my_pin); The function will read the value of the pin, and convert both '1' and 'H' to '1'. Then your code will have the same behaviour in the simulator and on the real chip with the pull-up. You don't need to remove the To_X01 when synthesizing, it will just be replaced by an identity function in the synthesizer.