📄 ucos-ii_v2_1_0.tcl
字号:
################################################################################# uC/OS-II Tcl File################################################################################# uses xillib.tclproc ucosii_drc {os_handle} { puts "uC/OS-II DRC ..." set sw_proc_handle [xget_libgen_proc_handle] set hw_proc_handle [xget_handle $sw_proc_handle "IPINST"] set proctype [xget_value $hw_proc_handle "OPTION" "IPNAME"] set source_path [xget_value $os_handle "PARAMETER" "OS_SOURCE_LOCATION"] set core_name [file join $source_path os_core.c] if {[file exists $core_name] == 0} { error "Unable to find uC/OS-II source file, os_core.c" "" "libgen_error" } set flag_name [file join $source_path os_flag.c] if {[file exists $flag_name] == 0} { error "Unable to find uC/OS-II source file, os_flag.c" "" "libgen_error" } set mbox_name [file join $source_path os_mbox.c] if {[file exists $mbox_name] == 0} { error "Unable to find uC/OS-II source file, os_mbox.c" "" "libgen_error" } set mem_name [file join $source_path os_mem.c] if {[file exists $mem_name] == 0} { error "Unable to find uC/OS-II source file, os_mem.c" "" "libgen_error" } set mutex_name [file join $source_path os_mutex.c] if {[file exists $mutex_name] == 0} { error "Unable to find uC/OS-II source file, os_mutex.c" "" "libgen_error" } set q_name [file join $source_path os_q.c] if {[file exists $q_name] == 0} { error "Unable to find uC/OS-II source file, os_q.c" "" "libgen_error" } set sem_name [file join $source_path os_sem.c] if {[file exists $sem_name] == 0} { error "Unable to find uC/OS-II source file, os_sem.c" "" "libgen_error" } set task_name [file join $source_path os_task.c] if {[file exists $task_name] == 0} { error "Unable to find uC/OS-II source file, os_task.c" "" "libgen_error" } set time_name [file join $source_path os_time.c] if {[file exists $time_name] == 0} { error "Unable to find uC/OS-II source file, os_time.c" "" "libgen_error" } set tmr_name [file join $source_path os_tmr.c] if {[file exists $tmr_name] == 0} { error "Unable to find uC/OS-II source file, os_tmr.c" "" "libgen_error" } set ucosii_name [file join $source_path ucos_ii.h] if {[file exists $ucosii_name] == 0} { error "Unable to find uC/OS-II header file, ucos_ii.h" "" "libgen_error" } set port_path [xget_value $os_handle "PARAMETER" "OS_PORT_LOCATION"] set dbg_name [file join $port_path os_dbg.c] if {[file exists $dbg_name] == 0} { error "Unable to find uC/OS-II port file, os_dbg.c" "" "libgen_error" } if { $proctype == "microblaze" } { set cpus_name [file join $port_path os_cpu_a.s] if {[file exists $cpus_name] == 0} { error "Unable to find uC/OS-II port file, os_cpu_a.s" "" "libgen_error" } } else { set cpus_name [file join $port_path os_cpu_a.S] if {[file exists $cpus_name] == 0} { error "Unable to find uC/OS-II port file, os_cpu_a.S" "" "libgen_error" } } set cpuc_name [file join $port_path os_cpu_c.c] if {[file exists $cpuc_name] == 0} { error "Unable to find uC/OS-II port file, os_cpu_c.c" "" "libgen_error" } set cpuh_name [file join $port_path os_cpu.h] if {[file exists $cpuh_name] == 0} { error "Unable to find uC/OS-II port file os_cpu.h" "" "libgen_error" } set bsp_path [xget_value $os_handle "PARAMETER" "BSP_LOCATION"] set bspc_name [file join $bsp_path bsp.c] if {[file exists $bspc_name] == 0} { error "Unable to find bsp file, bsp.c" "" "libgen_error" } set bsph_name [file join $bsp_path bsp.h] if {[file exists $bsph_name] == 0} { error "Unable to find bsp file, bsp.h" "" "libgen_error" } set app_path [xget_value $os_handle "PARAMETER" "APP_LOCATION"] set app_cfg_file [file join $app_path app_cfg.h] if {[file exists $app_cfg_file] == 0} { error "Unable to locate app_cfg.h" "" "libgen_error" } set include_file [file join $app_path includes.h] if {[file exists $include_file] == 0} { error "Unable to locate includes.h" "" "libgen_error" } if {[xget_value $os_handle "PARAMETER" "PROBE_EN"] == 1} { set uccpu_path [xget_value $os_handle "PARAMETER" "uCCPU_LOCATION"] set cpu_def [file join $uccpu_path cpu_def.h] if {[file exists $cpu_def] == 0} { error "Unable to locate uC/CPU file, cpu_def.h" "" "libgen error" } if { $proctype == "microblaze" } { set cpuasm [file join $uccpu_path MicroBlaze/GNU/cpu_a.s] if {[file exists $cpuasm] == 0} { error "Unable to locate uC/CPU file, cpu_a.s" "" "libgen_error" } set cpuh [file join $uccpu_path MicroBlaze/GNU/cpu.h] if {[file exists $cpuh] == 0} { error "Unable to locate uC/CPU file, cpu.h" "" "libgen_error" } } else { set cpuasm [file join $uccpu_path PPC405/GNU/cpu_a.s] if {[file exists $cpuasm] == 0} { error "Unable to locate uC/CPU file, cpu_a.s" "" "libgen_error" } set cpuh [file join $uccpu_path PPC405/GNU/cpu.h] if {[file exists $cpuh] == 0} { error "Unable to locate uC/CPU file, cpu.h" "" "libgen_error" } } set uclib_path [xget_value $os_handle "PARAMETER" "uCLIB_LOCATION"] set lib_mem [file join $uclib_path lib_mem.c] if {[file exists $lib_mem] == 0} { error "Unable to locate uC/LIB file, lib_mem.c" "" "libgen error" } set lib_str [file join $uclib_path lib_str.c] if {[file exists $lib_str] == 0} { error "Unable to locate uC/LIB file, lib_str.c" "" "libgen error" } set lib_memh [file join $uclib_path lib_mem.h] if {[file exists $lib_memh] == 0} { error "Unable to locate uC/LIB file, lib_mem.h" "" "libgen error" } set lib_strh [file join $uclib_path lib_str.h] if {[file exists $lib_strh] == 0} { error "Unable to locate uC/LIB file, lib_str.h" "" "libgen error" } set lib_defh [file join $uclib_path lib_def.h] if {[file exists $lib_defh] == 0} { error "Unable to locate uC/LIB file, lib_def.h" "" "libgen error" } set probe_source [xget_value $os_handle "PARAMETER" "PROBE_COM_SOURCE_LOCATION"] set genericc_name [file join $probe_source Communication/Generic/Source/probe_com.c] if {[file exists $genericc_name] == 0} { error "Unable to find uC/Probe source file, probe_com.c" "" "libgen_error" } set generich_name [file join $probe_source Communication/Generic/Source/probe_com.h] if {[file exists $generich_name] == 0} { error "Unable to find uC/Probe source file, probe_com.h" "" "libgen_error" } set generic_os_name [file join $probe_source Communication/Generic/OS/uCOS-II/probe_com_os.c] if {[file exists $generic_os_name] == 0} { error "Unable to find uC/Probe source file, probe_com_os.c" "" "libgen_error" } set rs232c_name [file join $probe_source Communication/Generic/RS-232/Source/probe_rs232.c] if {[file exists $rs232c_name] == 0} { error "Unable to find uC/Probe source file, probe_rs232.c" "" "libgen_error" } set rs232h_name [file join $probe_source Communication/Generic/RS-232/Source/probe_rs232.h] if {[file exists $rs232h_name] == 0} { error "Unable to find uC/Probe source file, probe_rs232.h" "" "libgen_error" } set rs232_os_name [file join $probe_source Communication/Generic/RS-232/OS/uCOS-II/probe_rs232_os.c] if {[file exists $rs232_os_name] == 0} { error "Unable to find uC/Probe source file, probe_rs232_os.c" "" "libgen_error" } set probe_port [xget_value $os_handle "PARAMETER" "PROBE_COM_PORT_LOCATION"] set portc_name [file join $probe_port probe_rs232c.c] if {[file exists $portc_name] == 0} { error "Unable to find uC/Probe port file, probe_rs232c.c" "" "libgen_error" } set porth_name [file join $probe_port probe_rs232c.h] if {[file exists $porth_name] == 0} { error "Unable to find uC/Probe port file, probe_rs232c.h" "" "libgen_error" } if {[xget_value $os_handle "PARAMETER" "PROBE_OS_EN"] == 1} { set pluginc_name [file join $probe_source Plugins/uCOS-II/os_probe.c] if {[file exists $pluginc_name] == 0} { error "Unable to find uC/Probe plug-in file, os_probe.c" "" "libgen_error" } set pluginh_name [file join $probe_source Plugins/uCOS-II/os_probe.h] if {[file exists $pluginh_name] == 0} { error "Unable to find uC/Probe plug-in file, os_probe.h" "" "libgen_error" } } }}################################################################################ Tcl procedure generate###############################################################################proc generate {os_handle} { global env set need_config_file "false" # Copy over the right set of files as src based on processor type set sw_proc_handle [xget_libgen_proc_handle] set hw_proc_handle [xget_handle $sw_proc_handle "IPINST"] set proctype [xget_value $hw_proc_handle "OPTION" "IPNAME"] set procver [xget_value $hw_proc_handle "PARAMETER" "HW_VER"] set enable_sw_profile [xget_value $os_handle "PARAMETER" "enable_sw_intrusive_profiling"] set mb_exceptions false # proctype should be "microblaze" or "ppc405" or "ppc405_virtex4" or "ppc440" or "ppc440_virtex5" set mbsrcdir "./src/microblaze" set ppcsrcdir "./src/ppc405" set ppc440srcdir "./src/ppc440" switch $proctype { "microblaze" { foreach entry [glob -nocomplain [file join $mbsrcdir *]] { if { [string first "exception" $entry] == -1 || [mb_has_exceptions $hw_proc_handle] } { # Copy over only files that are not related to exception handling. All such files have exception in their names file copy -force $entry "./src/" } } set need_config_file "true" set mb_exceptions [mb_has_exceptions $hw_proc_handle] } "ppc405" { foreach entry [glob -nocomplain [file join $ppcsrcdir *]] { file copy -force $entry "./src/" } } "ppc405_virtex4" { foreach entry [glob -nocomplain [file join $ppcsrcdir *]] { file copy -force $entry "./src/" } } "ppc440" { foreach entry [glob -nocomplain [file join $ppc440srcdir *]] { file copy -force $entry "./src/" } } "ppc440_virtex5" { foreach entry [glob -nocomplain [file join $ppc440srcdir *]] { file copy -force $entry "./src/" } } "default" {puts "unknown processor type $proctype\n"} } # Write the Config.make file set makeconfig [open "./src/config.make" w]# xprint_generated_header_tcl $makeconfig "Configuration parameters for Standalone Makefile" if { $proctype == "microblaze" } { puts $makeconfig "LIBSOURCES = *.c *.s *.S" puts $makeconfig "PROFILE_ARCH_OBJS = profile_mcount_mb.o" } else { puts $makeconfig "PROFILE_ARCH_OBJS = profile_mcount_ppc.o" } if { $enable_sw_profile == "true" } { puts $makeconfig "LIBS = standalone_libs profile_libs" } else { puts $makeconfig "LIBS = standalone_libs" } close $makeconfig # Remove microblaze , ppc405 and ppc440 directories... file delete -force $mbsrcdir file delete -force $ppcsrcdir file delete -force $ppc440srcdir # Handle stdin and stdout xhandle_stdin $os_handle xhandle_stdout $os_handle #Handle Profile configuration if { $enable_sw_profile == "true" } { handle_profile $os_handle $proctype } set file_handle [xopen_include_file "xparameters.h"] puts $file_handle "\n/******************************************************************/\n"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -