📄 ucos-ii_v2_1_0.tcl
字号:
file copy -force $entry "./src/" } } set mb_exceptions [mb_has_exceptions $procver] } "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/" } } "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" } { if { $mb_exceptions } { puts $makeconfig "LIBSOURCES = *.s *.c *.S" } else { puts $makeconfig "LIBSOURCES = *.s *.c" } 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 and ppc405 directories... file delete -force $mbsrcdir file delete -force $ppcsrcdir # 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" close $file_handle # Generate xil_malloc.h if required set xil_malloc [xget_value $os_handle "PARAMETER" "need_xil_malloc"] if {[string compare -nocase $xil_malloc "true"] == 0} { xcreate_xil_malloc_config_file }
# Create config files for Microblaze exception handling if { $proctype == "microblaze" && [mb_has_exceptions $procver] } { set extable [xget_handle $os_handle "ARRAY" "microblaze_exception_vectors"] xcreate_mb_exc_config_file $extable }
copy_os_files $os_handle
create_os_config_file $os_handle}
# -------------------------------------------# Tcl procedure xcreate_mb_exc_config file# -------------------------------------------proc xcreate_mb_exc_config_file {extable} { set mb_table "MB_ExceptionVectorTable" set filename [file join "src" "microblaze_exceptions_g.c"] set hfilename [file join "src" "microblaze_exceptions_g.h"] file delete $filename file delete $hfilename set config_file [open $filename w] set hconfig_file [open $hfilename w] xprint_generated_header $config_file "Exception Handler Table for MicroBlaze Processor" xprint_generated_header $hconfig_file "Exception Handling Header for MicroBlaze Processor" puts $config_file "#include \"microblaze_exceptions_i.h\"" puts $config_file "#include \"xparameters.h\"" puts $config_file "\n" set sw_proc_handle [xget_libgen_proc_handle] set hw_proc_handle [xget_handle $sw_proc_handle "IPINST"] set procver [xget_value $hw_proc_handle "PARAMETER" "HW_VER"] set iopb_ee [xget_value $hw_proc_handle "PARAMETER" "C_IOPB_BUS_EXCEPTION"] set dopb_ee [xget_value $hw_proc_handle "PARAMETER" "C_DOPB_BUS_EXCEPTION"] set ill_ee [xget_value $hw_proc_handle "PARAMETER" "C_ILL_OPCODE_EXCEPTION"] set unalign_ee [xget_value $hw_proc_handle "PARAMETER" "C_UNALIGNED_EXCEPTIONS"] set div0_ee [xget_value $hw_proc_handle "PARAMETER" "C_DIV_ZERO_EXCEPTION"] if { [mb_has_fpu_exceptions $procver] } { set fpu_ee [xget_value $hw_proc_handle "PARAMETER" "C_FPU_EXCEPTION"] } else { set fpu_ee 0 } if { $iopb_ee == 0 && $dopb_ee == 0 && $ill_ee == 0 && $unalign_ee == 0 && $div0_ee == 0 && $fpu_ee == 0} { ;# NO exceptions are enabled close $config_file ;# Do not generate any info in either the header or the C file close $hconfig_file return } else { puts $hconfig_file "\#define MICROBLAZE_EXCEPTIONS_ENABLED 1" if { $unalign_ee == 0 } { puts $hconfig_file "\#define NO_UNALIGNED_EXCEPTIONS 1" } if { $iopb_ee == 0 && $dopb_ee == 0 && $ill_ee == 0 && $div0_ee == 0 && $fpu_ee == 0 } { ;# NO other exceptions are enabled puts $hconfig_file "\#define NO_OTHER_EXCEPTIONS 1" } } set elements [xget_handle $extable "ELEMENTS" "*"] set ehlen [llength $elements] # # Put in extern declarations for handlers # puts $config_file "\n/*" puts $config_file "* Extern declarations" puts $config_file "*/\n" # Handle unaligned exception handler specially set entry [lindex $elements 0] set eh [xget_value $entry "PARAMETER" "handler"] if {$eh != "default"} { puts $config_file [format "extern void %s (void *);" $eh] } # Routinely handle other exceptions for {set x 1} {$x < $ehlen} {incr x} { set entry [lindex $elements $x] set eh [xget_value $entry "PARAMETER" "handler"] if {$eh != "XNullHandler"} { puts $config_file [format "extern void %s (void *);" $eh] } } # # Form the exception handler table # puts $config_file "\n/*" puts $config_file "* The exception handler table for microblaze processor" puts $config_file "*/\n" puts $config_file [format "%sEntry %s\[\] =" $mb_table $mb_table] puts $config_file "\{" # Handle unaligned exception specially set entry [lindex $elements 0] set eh [xget_value $entry "PARAMETER" "handler"] set eec [xget_value $entry "PARAMETER" "callback"] if {$eh == "default"} { puts $config_file "\t\{" puts $config_file [format "\t\t%s,\t/* This field (unaligned exceptions) will not be looked up. Instead, the default exception handler will be used automatically. */" "XNullHandler"] puts $config_file [format "\t\t(void*) %s" "NULL"] puts $config_file "\t\}," } else { puts $hconfig_file "\#define USER_SPEC_UNALIGNED_HANDLER" puts $config_file "\t\{" puts $config_file [format "\t\t%s," $eh] puts $config_file [format "\t\t(void*) %s" $eec] puts $config_file "\t\}," } # Routinely handle other exceptions for {set x 1} {$x < $ehlen} {incr x} { set entry [lindex $elements $x] set eh [xget_value $entry "PARAMETER" "handler"] set eec [xget_value $entry "PARAMETER" "callback"] puts $config_file "\t\{" puts $config_file [format "\t\t%s," $eh] puts $config_file [format "\t\t(void*) %s" $eec] if { $x != [expr $ehlen - 1] } { puts $config_file "\t\}," } else { puts $config_file "\t\}" } } puts $config_file "\n\};" puts $config_file "\n" puts $hconfig_file "\n" close $config_file close $hconfig_file}
################################################################################ Tcl procedure xcreate_xil_malloc_config_file###############################################################################proc xcreate_xil_malloc_config_file {} { set filename [file join "src" "xil_malloc.h"] file delete $filename set config_file [open $filename w] xprint_generated_header $config_file "Xilinx Malloc Definition file" puts $config_file "#define malloc xil_malloc" puts $config_file "#define free xil_free" puts $config_file "#define msize xil_msize" puts $config_file "#define realloc xil_realloc" puts $config_file "#define calloc xil_calloc" puts $config_file "\n" close $config_file }
################################################################################ Tcl procedure copy_os_files###############################################################################
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -