From b88652caade5e14a864f81972df068521c29d3c5 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Wed, 24 Aug 2011 11:59:06 +0000 Subject: [PATCH] Changed the MicroBlaze demo back to using heap_3.c having updated the linker script generation. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1549 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../freertos_v2_00_a/data/freertos_v2_1_0.tcl | 2 +- .../data/FreeRTOS_Hello_World.tcl | 61 ++++++++++--------- .../CreateProjectDirectoryStructure.bat | 2 +- 3 files changed, 33 insertions(+), 32 deletions(-) diff --git a/Demo/MicroBlaze_Spartan-6_EthernetLite/KernelAwareBSPRepository/bsp/freertos_v2_00_a/data/freertos_v2_1_0.tcl b/Demo/MicroBlaze_Spartan-6_EthernetLite/KernelAwareBSPRepository/bsp/freertos_v2_00_a/data/freertos_v2_1_0.tcl index 78c80d90e..c7067eb24 100644 --- a/Demo/MicroBlaze_Spartan-6_EthernetLite/KernelAwareBSPRepository/bsp/freertos_v2_00_a/data/freertos_v2_1_0.tcl +++ b/Demo/MicroBlaze_Spartan-6_EthernetLite/KernelAwareBSPRepository/bsp/freertos_v2_00_a/data/freertos_v2_1_0.tcl @@ -176,7 +176,7 @@ proc generate {os_handle} { file copy -force [file join src Source queue.c] src file copy -force [file join src Source list.c] src file copy -force [file join src Source timers.c] src - file copy -force [file join src Source portable MemMang heap_2.c] src + file copy -force [file join src Source portable MemMang heap_3.c] src file copy -force [file join src Source portable GCC MicroBlazeV8 port.c] src file copy -force [file join src Source portable GCC MicroBlazeV8 port_exceptions.c] src file copy -force [file join src Source portable GCC MicroBlazeV8 portasm.S] src diff --git a/Demo/MicroBlaze_Spartan-6_EthernetLite/KernelAwareBSPRepository/sw_apps/FreeRTOS_Hello_World/data/FreeRTOS_Hello_World.tcl b/Demo/MicroBlaze_Spartan-6_EthernetLite/KernelAwareBSPRepository/sw_apps/FreeRTOS_Hello_World/data/FreeRTOS_Hello_World.tcl index e0d9d6c73..7845d73a8 100644 --- a/Demo/MicroBlaze_Spartan-6_EthernetLite/KernelAwareBSPRepository/sw_apps/FreeRTOS_Hello_World/data/FreeRTOS_Hello_World.tcl +++ b/Demo/MicroBlaze_Spartan-6_EthernetLite/KernelAwareBSPRepository/sw_apps/FreeRTOS_Hello_World/data/FreeRTOS_Hello_World.tcl @@ -13,7 +13,7 @@ proc get_os {} { if { $os == "" } { error "No Operating System specified in the Board Support Package."; } - + return $os; } @@ -24,11 +24,9 @@ proc get_stdout {} { } proc check_stdout_hw {} { - set p7_uarts [xget_ips "type" "ps7_uart"]; set uartlites [xget_ips "type" "uartlite"]; set uart16550s [xget_ips "type" "uart16550"]; - if { ([llength $p7_uarts] == 0) && ([llength $uartlites] == 0) && - ([llength $uart16550s] == 0) } { + if { ([llength $uartlites] == 0) && ([llength $uart16550s] == 0) } { # Check for MDM-Uart peripheral. The MDM would be listed as a peripheral # only if it has a UART interface. So no further check is required set mdmlist [xget_ips "type" "mdm"] @@ -45,10 +43,36 @@ proc check_stdout_sw {} { } } +proc get_mem_size { memlist } { + return [lindex $memlist 4]; +} + +proc require_memory {memsize} { + set imemlist [xget_memory_ranges "access_type" "I"]; + set idmemlist [xget_memory_ranges "access_type" "ID"]; + set dmemlist [xget_memory_ranges "access_type" "D"]; + + set memlist [concat $imemlist $idmemlist $dmemlist]; + + while { [llength $memlist] > 3 } { + set mem [lrange $memlist 0 4]; + set memlist [lreplace $memlist 0 4]; + + if { [get_mem_size $mem] >= $memsize } { + return 1; + } + } + + error "This application requires atleast $memsize bytes of memory."; +} + proc swapp_is_supported_hw {} { # check for uart peripheral check_stdout_hw; + # require about 1M of memory + require_memory "1000000"; + return 1; } @@ -65,8 +89,7 @@ proc generate_stdout_config { fid } { # if stdout is uartlite, we don't have to generate anything set stdout_type [xget_ip_attribute "type" $stdout]; - if { [regexp -nocase "uartlite" $stdout_type] || [string match -nocase "mdm" $stdout_type] || - [regexp -nocase "ps7_uart" $stdout_type]} { + if { [regexp -nocase "uartlite" $stdout_type] || [string match -nocase "mdm" $stdout_type] } { return; } elseif { [regexp -nocase "uart16550" $stdout_type] } { # mention that we have a 16550 @@ -81,23 +104,9 @@ proc generate_stdout_config { fid } { } } -proc generate_cache_mask { fid } { - set mask [format "0x%x" [xget_ppc_cache_mask]] - puts $fid "#ifdef __PPC__" - puts $fid "#define CACHEABLE_REGION_MASK $mask" - puts $fid "#endif\n" -} - # depending on the type of os (standalone|xilkernel), choose # the correct source files proc swapp_generate {} { - set os [get_os]; - - if { $os == "xilkernel" } { - file rename -force "helloworld_xmk.c" "helloworld.c" - } else { - file delete -force "helloworld_xmk.c" - } # cleanup this file for writing set fid [open "platform_config.h" "w+"]; @@ -107,20 +116,12 @@ proc swapp_generate {} { # if we have a uart16550 as stdout, then generate some config for that generate_stdout_config $fid; - # for ppc, generate cache mask string - generate_cache_mask $fid; - puts $fid "#endif"; close $fid; } proc swapp_get_linker_constraints {} { - # this app does not require a .vectors section if it is being run w/ the standalone OS on PPC - set os [get_os]; - - if { $os == "standalone" } { - return "vector_section no"; - } - return ""; + # we need a 4k heap + return "stack 40k heap 40k"; } diff --git a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/CreateProjectDirectoryStructure.bat b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/CreateProjectDirectoryStructure.bat index c84525d72..cd78c1e89 100644 --- a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/CreateProjectDirectoryStructure.bat +++ b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/CreateProjectDirectoryStructure.bat @@ -65,7 +65,7 @@ IF EXIST FreeRTOS_Source Goto END copy %FREERTOS_SOURCE%\portable\GCC\MicroBlazeV8\*.* %BSP_SOURCE%\portable\GCC\MicroBlazeV8 REM Copy the basic memory allocation files into the SDK projects directory - copy %FREERTOS_SOURCE%\portable\MemMang\heap_2.c FreeRTOS_Source\portable\MemMang + copy %FREERTOS_SOURCE%\portable\MemMang\heap_3.c FreeRTOS_Source\portable\MemMang REM Copy the basic memory allocation files into the BSP directory copy %FREERTOS_SOURCE%\portable\MemMang\heap_2.c %BSP_SOURCE%\portable\MemMang -- 2.39.5