Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20704 Discussions

automating "master_read_to_file"

Altera_Forum
Honored Contributor II
1,141 Views

Hi guys 

 

I need to automate the "master_read_to_file" function. Normally, i just open system console and execute the command. Now, id like to automate calling it from a python script. First thought was to try modifying the jtag_server_cmds code here to create a command that will call the master_read_to_file and then try to replicate opening the TCPIP socket in python.  

 

https://www.ovro.caltech.edu/~dwh/correlator/pdf/altera_jtag_to_avalon_mm_tutorial.pdf 

 

 

 

But i read somewhere that i might be able to just execute a wrapper script containing the master_read_to_file call directly from a command line interface instance of system console. 

So i implemented a subprocess call in python using the following code: 

 

python_subprocessCallWrapper('C:/altera/15.0/quartus/sopc_builder/bin/system-console.exe -cli -script=C:/test/wrapperScript.tcl')  

 

where wrapperScript will eventually contain the master_read_to_file (right now, it just creates a text file). 

 

This works fine. except it takes about 10 seconds to complete because system console takes some time to start up. 

If i could just start system console once and then run the wrapperScript when needed, that would speed things up quite a bit. 

 

I dont believe that '-script=C:/test/wrapperScript.tcl' will work on its own. that it has to be part of the initial call, so i can issue a 'source C:/test/wrapperScript.tcl' instead. 

The problem is that if i try issuing 'source C:/test/wrapperScript.tcl' to my process.stdin, the command is taken, but no new test file is generated. 

 

This seems like the simpler approach, but its turning into a science fair project. 

 

Is there a better way to do this?  

Is system console designed to take in multiple "interactive" lines like this? 

Can i speed up system console? 

Can i somehow run the master_read_to_file straight from nios cmd shell or similar tool? 

Is the TCPIP client server better?  

 

Any help is appreciated! 

 

thanks
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
379 Views

found exactly what i needed.... http://www.alteraforum.com/forum/showthread.php?t=41993 

 

turns out i needed the disable_readline flag set and all works well with my sub process 

 

i owe FredrikWG a beer!!!
0 Kudos
Altera_Forum
Honored Contributor II
379 Views

Thanks for posting your solution, I did not know the answer, and appreciate your pointer to the solution :) 

 

(I must have missed the conclusion of the other thread) 

 

Cheers, 

Dave
0 Kudos
Reply