1 proc swapp_get_name {} {
2 return "FreeRTOS Hello World";
5 proc swapp_get_description {} {
6 return "Let's say 'Hello World' in FreeRTOS.";
10 set oslist [xget_sw_modules "type" "os"];
11 set os [lindex $oslist 0];
14 error "No Operating System specified in the Board Support Package.";
22 set stdout [xget_sw_module_parameter $os "STDOUT"];
26 proc check_stdout_hw {} {
27 set uartlites [xget_ips "type" "uartlite"];
28 set uart16550s [xget_ips "type" "uart16550"];
29 if { ([llength $uartlites] == 0) && ([llength $uart16550s] == 0) } {
30 # Check for MDM-Uart peripheral. The MDM would be listed as a peripheral
31 # only if it has a UART interface. So no further check is required
32 set mdmlist [xget_ips "type" "mdm"]
33 if { [llength $mdmlist] == 0 } {
34 error "This application requires a Uart IP in the hardware."
39 proc check_stdout_sw {} {
40 set stdout [get_stdout];
41 if { $stdout == "none" } {
42 error "The STDOUT parameter is not set on the OS. Hello World requires stdout to be set."
46 proc get_mem_size { memlist } {
47 return [lindex $memlist 4];
50 proc require_memory {memsize} {
51 set imemlist [xget_memory_ranges "access_type" "I"];
52 set idmemlist [xget_memory_ranges "access_type" "ID"];
53 set dmemlist [xget_memory_ranges "access_type" "D"];
55 set memlist [concat $imemlist $idmemlist $dmemlist];
57 while { [llength $memlist] > 3 } {
58 set mem [lrange $memlist 0 4];
59 set memlist [lreplace $memlist 0 4];
61 if { [get_mem_size $mem] >= $memsize } {
66 error "This application requires atleast $memsize bytes of memory.";
69 proc swapp_is_supported_hw {} {
70 # check for uart peripheral
73 # require about 1M of memory
74 require_memory "1000000";
79 proc swapp_is_supported_sw {} {
80 # check for stdout being set
86 proc generate_stdout_config { fid } {
87 set stdout [get_stdout];
89 # if stdout is uartlite, we don't have to generate anything
90 set stdout_type [xget_ip_attribute "type" $stdout];
92 if { [regexp -nocase "uartlite" $stdout_type] || [string match -nocase "mdm" $stdout_type] } {
94 } elseif { [regexp -nocase "uart16550" $stdout_type] } {
95 # mention that we have a 16550
96 puts $fid "#define STDOUT_IS_16550";
98 # and note down its base address
100 set postfix "_BASEADDR";
101 set stdout_baseaddr_macro $prefix$stdout$postfix;
102 set stdout_baseaddr_macro [string toupper $stdout_baseaddr_macro];
103 puts $fid "#define STDOUT_BASEADDR $stdout_baseaddr_macro";
107 # depending on the type of os (standalone|xilkernel), choose
108 # the correct source files
109 proc swapp_generate {} {
111 # cleanup this file for writing
112 set fid [open "platform_config.h" "w+"];
113 puts $fid "#ifndef __PLATFORM_CONFIG_H_";
114 puts $fid "#define __PLATFORM_CONFIG_H_\n";
116 # if we have a uart16550 as stdout, then generate some config for that
117 generate_stdout_config $fid;
123 proc swapp_get_linker_constraints {} {
126 return "stack 40k heap 40k";