[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Modifying simulator options for a given testcase

From: cycliste urbain
Subject: Modifying simulator options for a given testcase
Date: Mon, 7 Jun 2010 23:49:50 -0700 (PDT)


I am using the DejaGnu framework and my executables need a simulator to run. 
For one testcase (and only one, not for all testcases), I need to add some 
simulator options. I try to do it by creating a new dg function. For example in 
my code:
/* { dg-runner-options sim options "-C EXTERNAL_MEMORY_SIZE=0x9000000" } */

In my library, the proc dg-runner-options is:
dg-runner-options { args } {
    if { [llength $args] > 5 } {
        error "[lindex $args 0]: too many arguments"
    if { [llength $args] >= 5 } {
        switch [dg-process-target [lindex $args 4]] {
            "S" { set rflags [lindex $args 3] }
            "N" { return }
            "F" { error "[lindex $args 0]: `xfail' not allowed here" }
            "P" { error "[lindex $args 0]: `xfail' not allowed here" }
    } else {
        set rflags [lindex $args 3]

    set sim [lindex $args 1]
    set opt [lindex $args 2]
    set dest [board_info target name]
    set entry "$sim,$opt"
    if [board_info $dest exists $entry] {
        set simflags "[board_info $dest $entry] $rflags"
    } else {
        set simflags $rflags
    set board_info($dest,$entry) $simflags

I have two questions:
1/ if I replace the line
'set board_info($dest,$entry) $simflags'
'set_board_info $entry $simflags'
I have an error message:
ERROR: examples/test_0014/1.c: can't read "board": no such variable for " 
dg-runner-options 3 sim options "-C EXTERNAL_MEMORY_SIZE=0x9000000" "
I try to add 'global board' or 'upvar <level> board' without any success.

2/ the procedure itself isn't functional. If I add this line at the end of the 
'verbose "****check board_info $dest , $entry = [board_info $dest $entry]" 0'
I always got an empty value.

I don't know what to do. I found this subject in the archive list "Re: how to 
pass arguments to simulator"
but it covers all testcases and not a specific one.

Thank you for your support.

Best regards,

-- JM
PS: sorry for the mistakes but English isn't my native tongue.

  _____   __o
-------    -\<,
 ------ ( )/ ( )
"Work to Eat, Eat to Live, Live to Bike, Bike to Work"


reply via email to

[Prev in Thread] Current Thread [Next in Thread]