Forum Discussion
Altera_Forum
Honored Contributor
13 years agoget value from master_read_32
Hello evryone,
I am trying to do a GUI interface with tcl to load the .sof that I generated into the FPGA with tcl. I want also in this tcl script read from a memory adress, get a value and put it into a label in the GUI interface. I am using master_read_32 command to do this: # set m_path [lindex [get_service_paths master] 0] # open_service master $m_path # master_read_32 $m_path 0x00000000 1 to read the 32 bit value. My question is how can I save this value to put it into the label in the GUI interface!? I am waiting for some help please. Thanks a lot.23 Replies
- Altera_Forum
Honored Contributor
I asked you because you have "Read the scripts for the slight differences in procedures (due to the slight difference in hardware available on these boards)."
Kind Regards - Altera_Forum
Honored Contributor
--- Quote Start --- The tutorial works with any board or just that one that you put in your tutorial? I have a DE0-nano. --- Quote End --- The tutorial can be made to work with any board, and has examples for the BeMicro, BeMicro-SDK, and DE2 boards. I didn't have a DE0-nano at the time (I do have one now). If you manually go through the tutorial, then you can create your own top-level design for the DE0-nano. If you get too confused, then I can send you the files. Try doing it yourself first as it will help you to learn the tools. Note that the software will work *regardless* of what you connect your JTAG-to-Avalon-MM master to. The client GUI simply issues read and write commands to the master component. They do not care what the master is connected to, as the client just reads and writes Avalon-MM addresses. The server also has a debug mode, where if you set the variable debug to 1 before sourcing the script, the reads and writes on the server are just to fake memory locations. Read the comments in jtag_server.tcl. The key advantage to having the source code for a tutorial is that you can "play" with the code. Don't be afraid to just try something - it might just work - and if it doesn't, you can then try to figure it out (Ok, be a "little" afraid when you are downloading to hardware, as you *must* have the pin assignments correct). Its only by "doing" that you really gain an understanding of what is going on. Cheers, Dave - Altera_Forum
Honored Contributor
Good afternoon Dave,
sorry for disturbing you again, but this is really important for me. I am doing my final project in the university and I need just one this to finish. I need to read a 32 bits value from adress 0x00000000 and present it in a tcl GUI interface. I did a project with the follow Qsys and top and of course vhdl. I read from the adress with the Qsys system console before to test it and it was okay, I could read the 32 bits value from the adress 0x00000000. Qsys: http://img809.imageshack.us/img809/1674/58cn.png Top of the project: http://img690.imageshack.us/img690/9158/zml6.png My problem is how to read that value and put it that value into a tcl GUI interface. If you can help me I will appreciate it so much. I just need this to finish. Kind regards - Altera_Forum
Honored Contributor
--- Quote Start --- sorry for disturbing you again, but this is really important for me. I am doing my final project in the university and I need just one this to finish. --- Quote End --- Ignore the fact that this has anything to do with Altera and learn the basics of Tcl/Tk. What you are asking can be found in any book on the subject. I posted examples in this thread: http://www.alteraforum.com/forum/showthread.php?t=27920 Cheers, Dave - Altera_Forum
Honored Contributor
Thanks Dave.
Kind regards - Altera_Forum
Honored Contributor
Hello Dave,
in the Client Application (Tcl GUI) I need to write which GUI I want to use with the jtag_cmds_sc.tcl right? Should I use the Server Application in the example that you gave? If yes, how can I use all (Client + Server) to run it in a simple way? Kind Regards - Altera_Forum
Honored Contributor
--- Quote Start --- how can I use all (Client + Server) to run it in a simple way? --- Quote End --- I've already explained how to do that already. The server can be run in debug mode, where it reads and writes to an internal Tcl variable. The client can then be run and talk to the server. Reads and writes to addresses are "cached" in the server in a variable. Reads to a new address return zero, writes followed by reads to an address return the value written. Cheers, Dave - Altera_Forum
Honored Contributor
There is any possibility just to do a simple GUI to read from a adress and present it?
Because I am not understanding this with the client and server. Sorry for being such a novice in this. Cheers - Altera_Forum
Honored Contributor
--- Quote Start --- There is any possibility just to do a simple GUI to read from a address and present it? --- Quote End --- Yes, of course there is. You can edit the client and remove all the code associated with the server. --- Quote Start --- Because I am not understanding this with the client and server. Sorry for being such a novice in this. --- Quote End --- I have already provided examples which show how to do everything you have asked. I have deliberately not "held your hand" and simply written the code for you, as that would achieve nothing (other than allowing you to skip the step of actually learning something). You need to post a question showing you have actually *tried* to write some Tcl code, and that you are *stuck*. Show that you have actually attempted to either do something yourself, or have a specific question about how some code works, and I'll help you. Did you even bother to open the tk_examples.zip file I linked to above? I'll give you the benefit of the doubt and tell you how you can run these examples; 1. Download the examples, and extract them, eg., into c:/temp/tk_examples/ 2. Start Quartus or ActiveState ActiveTcl 3. If running Quartus, make the Tcl console visible via View->Utility Windows->Tcl Console 4. In the Tcl console, change directory to the tk_examples folder and run (source) an example tcl> cd {C:\temp\tk_examples} tcl> source entrybox_ex.tcl and then play with the GUI. Then read the code, break it, debug it, and build your own GUI. Cheers, Dave - Altera_Forum
Honored Contributor
Hello Dave,
Thank you so much for your help. It helped me a lot but now I am stuck in something that without this I can't finish. In this procedure: proc read_button {} { global jtag # The address and data entry boxes contain only digits, # so add the leading 0x to the address set data [jtag_read 0x$jtag(address)] # and then strip the response 0x set jtag(data) [format %X $data] } I can't get the adress of the JTAG. I am using JTGA_to_Avalon_MM. Is because of this? The adress in Qsys is 0x00000000. Can you help me please? Because I am receiving this error: can't read "jtag(address)": no such element in array Kind regards