Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

TCL language

Altera_Forum
Honored Contributor II
991 Views

Hi, 

 

I am using tcl to get the user input using stdin. but i dont need to wait till someone provides data. i want to code where i need to wait for 10secs. if the user provides the data then it should accept the data else should come out. 

 

Thanks & Regards 

jpr
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
89 Views

How I would do it. 

 

-Get a start time stamp from the system clock 

-Create an empty string 

-Enter a loop that reads input, but doesn't block. Anything input is joined to the empty string. 

-The loop exits when either a return press is read in or the current time minus the start time stamp is greater than or equal to your timeout. 

-After the if the string is empty or isn't terminated properly, run the default, otherwise, run decode the user inputted string. 

 

Have a loop joining
Reply