From e4671ddd378a5efd71031975577825370746eb38 Mon Sep 17 00:00:00 2001 From: Jyotheeswar Reddy Date: Mon, 11 May 2015 15:00:55 +0530 Subject: [PATCH] cpu_v2_3: Generate compiler flags for psu_microblaze Compiler flags for psu_microblaze BSP, based on HW IP parameters, are not being generated by HSI. This is being done for normal microblaze by an unknown entity in the build flow and the same is being figured out. However the same flags can be generated by using cpu tcl and this work-around is implemented here. Signed-off-by: Jyotheeswar Reddy --- XilinxProcessorIPLib/drivers/cpu/data/cpu.tcl | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/XilinxProcessorIPLib/drivers/cpu/data/cpu.tcl b/XilinxProcessorIPLib/drivers/cpu/data/cpu.tcl index e02ab9ad..0ebb3d46 100755 --- a/XilinxProcessorIPLib/drivers/cpu/data/cpu.tcl +++ b/XilinxProcessorIPLib/drivers/cpu/data/cpu.tcl @@ -272,6 +272,36 @@ proc generate {drv_handle} { # We dont need the Parameters being generated after this code block #------------------------------------------------------------------------------ if {[string compare "psu_microblaze" $proctype] == 0} { + + # Setup the compiler flags as per HW Params + set endian [common::get_property CONFIG.C_ENDIANNESS $periph] + set shift [common::get_property CONFIG.C_USE_BARREL $periph] + set pcmp [common::get_property CONFIG.C_USE_PCMP_INSTR $periph] + set multiply [common::get_property CONFIG.C_USE_HW_MUL $periph] + + set vlnv_string [common::get_property VLNV $periph] + set cpu_version [lindex [lreverse [split $vlnv_string :]] 0] + + set compiler_flags "" + + if {[string compare -nocase "1" $endian] == 0 } { + append compiler_flags " -mlittle-endian" + } + if {[string compare -nocase "1" $shift] == 0 } { + append compiler_flags " -mxl-barrel-shift" + } + if {[string compare -nocase "1" $pcmp] == 0 } { + append compiler_flags " -mxl-pattern-compare" + } + if {[string compare -nocase "0" $multiply] == 0 } { + append compiler_flags " -mxl-soft-mul" + } + + append compiler_flags " -mcpu=v" $cpu_version + + common::set_property CONFIG.compiler_flags $compiler_flags $drv_handle + + # Generate the Parameters set file_handle [::hsi::utils::open_include_file "xparameters.h"] puts $file_handle "#ifndef XPARAMETERS_H /* prevent circular inclusions */" puts $file_handle "#define XPARAMETERS_H /* by using protection macros */"