0
\$\begingroup\$

I am working on a project for school that will involve an input from a push button or related device. We have only a few Spartan boards available, but we have access to Xlinx Vivado to simulate an FPGA instead. The goal is to analyze data on differing lengths of time that the button is held down.

I want to know if I can program the simulation to accept input from the keyboard attached to the computer in place of the push button.

If not, is there another simulation software I could use? Or is there a way to log the output on the Spartan board so I can download it later and analyze the results.

Thanks

Edit: How do I do this in the testbench?

asked Nov 20, 2018 at 20:11
\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

The simulation is not running at real-time speed, so even if you could use the keyboard as an input to the simulation you would not be able to reliably determine how long a key was pressed.

You need to create a testbench for your project, and simulate a key press in the testbench. This will allow you to precisely control the length of the key press signal while observing all of the important signals inside your design.

answered Nov 20, 2018 at 20:23
\$\endgroup\$
3
  • \$\begingroup\$ Can the testbench accept keyboard input directly, or do I program it to pretend a key was pressed for an arbitrary length of time? \$\endgroup\$ Commented Nov 20, 2018 at 20:27
  • \$\begingroup\$ You add statements to the testbench that simulate the press of a key for a specific amount of time. You seem to be missing the point...even if the testbench could accept keyboard input it would not be in real time. \$\endgroup\$ Commented Nov 20, 2018 at 22:22
  • \$\begingroup\$ Thank you for your answer. From what I was finding I didn't know if a simulation could take real time input or not. If I did get an actual board and connected a button to it, is there an easy way to log the input data so that I could grab if from the board later for analysis? \$\endgroup\$ Commented Nov 20, 2018 at 22:47

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.