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.
12455 Discussions

TCL Scripting the BSP generation script

Altera_Forum
Honored Contributor II
974 Views

Hello, 

 

We are working on a project which uses 2 TSE MAC's in the same NIOS II core. Now I want to include some logic in an BSP generation script I made, to detect each MAC and then overwrite the "altera_avalon_tse_system_info.c" file so that each MAC is automatically added in the 'tse_mac_device' array. 

 

Now I run into a problem that I cannot find to way to see which MAC's and SGDMA's are connected. 

 

foreach slave { set module # puts "slave $slave has module name: $module" puts ] # puts ] # puts ] if { puts "found ethernet mac: $module" # WARNING: Tcl script "freertos_systemh_generation.tcl " error: invalid command name "get_connections" # puts ] } } # works puts " has breakSlave: " "embeddedsw.configuration.breakSlave"]] # fails: returns none puts " has deviceFeaturesSystemInfo: " "embeddedsw.configuration.deviceFeaturesSystemInfo"]] # fails: returns none puts " has cpuID: " "embeddedsw.configuration.cpuID"]] # fails: returns none puts ]  

 

Obviously I can understand that 'get_connections' doesn't work since this is probably only available in the QSYS scripting environment? 

 

However I find it weird that 'get_assignment' returns 'none' with every call except for the get breakSlave (this example was in the documentation) from the CPU. 

Are this not the variables defined in the '.qsys' file? If not where are they? 

 

I guess my main question is: Is it possible to achieve what I want? And if so: What is the proper way to do so? 

 

I also tried something like this, this seems to execute (really slow, since qsys-script has to load allot) and after executing the script crashes with 

warning: tcl script "freertos_systemh_generation.tcl " error: sgdma_tx_1.out/triple_speed_ethernet_0.transmit 

2012.08.13.13:15:30 info: doing: <b>qsys-script --system-file=d:\fpga_temp\cyclone4demoboardtest\cyclone4demoboardtestqsys.qsys --package-version=12.0 --cmd=puts [get_connections triple_speed_ethernet_0.transmit]</b> 

2012.08.13.13:15:37 info: acds::register_package_version 12.0 

2012.08.13.13:15:37 info: get_connections triple_speed_ethernet_0.transmit 

 

As you can see it got the result I wanted but the script fails anyway. 

 

set cmd "\"--cmd=puts \\"" set res puts $res 

 

Please note that TCL is not my strongest programming language :)
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
91 Views

I am not sure what you are trying to accomplish. Could you describe why and what you are trying to do?

Reply