Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

User input for value

I am a beginner in VHDL and am using it to code FPGAs.

I need to implement a code in Quartus II, such that after compiling or before execution of the code on the FPGA , the compiler/programmer/executor asks the user for a particular input, which is then fed into the program and the program then run.

So basically , the user is prompted to enter the value for x, which is then put in the system and program run accordingly.

How should I go about it ?

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    This shows a misunderstanding of how FPGAs work. They do not execute code. The VHDL is compiled into a netlist that maps to the existing logic on the FPGA. So you're not defining the program to run on the FPGA, you'er defining the processor that generates outputs based on input. So the logic is working all the time, it is never "run".

    To do what you want to do, you would need some kind of comms interface integrated into your VHDL code (say RS232, its fairly easy and there are plenty of examples out there) that you would connect to a source device (say a PC) that would send the values over to your user logic that would respond appropriately to the RS232 input.