Top Level Namespace

Defined Under Namespace

Modules: CmdParse, Config, Fhlow, Term Classes: Modelsim, OptionParser, Quartus, TC_config_test

Instance Method Summary collapse

Instance Method Details

#detectFhlowRootDir(_dir = Dir.pwd) ⇒ Object

environment setup ############################################## Tries to detect the root directory of the actual fhlow root directory by parsing the string provided by ‘Dir.pwd’.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/module_config/unittests/config_test.rb', line 5

def detectFhlowRootDir(_dir = Dir.pwd)

    if _dir == ""
        print ",-----------------------------------------------------------------+\n"
        print "| ERROR: your actual working dir is not inside a fhlow structure! |\n"
        print "`-----------------------------------------------------------------+\n"
        exit
    elsif Dir.entries(_dir).include?("flw")
        return _dir+"/"
    else
        return detectFhlowRootDir(_dir.gsub(/(.*)\/\w*[\/]*/,'\1'))
    end
end

#dummy(_str) ⇒ Object



17
18
19
# File 'lib/module_config/test.rb', line 17

def dummy(_str)
    _str.sub!("h", 'H')
end

#show_regexp(a, re) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/module_config/test.rb', line 5

def show_regexp(a, re)
    if a =~ re
        puts "#{$`}<<#{$&}>>#{$'}"
#        puts "1: <#{$1}>"
#        puts "2: <#{$2}>"
#        puts "3: <#{$3}>"
    else
        puts "no match"
    end
end