Class: Quartus

Inherits:
Fhlow::Plugin show all
Defined in:
lib/plugins/Quartus.rb

Instance Attribute Summary

Attributes inherited from Fhlow::Plugin

#cmd

Instance Method Summary collapse

Constructor Details

#initialize(_actualLeaf, _pen, _log) ⇒ Quartus

Returns a new instance of Quartus.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/plugins/Quartus.rb', line 31

def initialize(_actualLeaf, _pen, _log)
    super(_actualLeaf, _pen, _log)

    # default configuration values here
		@verbose = @actualLeaf.conf["Quartus"]["Verbose"]
    


    # this functioncall is optional
    describeCmd("Plugin vor Altera Quartus.",
                "Supported versions: Quartus 6.1")


    # --- synthesise ---
    # create an options object
    synoptions = CmdParse::OptionParserWrapper.new do |opt|
        opt.separator "<synthesize-options>:"
        opt.on("-v", "--verbose VAL",     "More output. possible values of VAL: 0, 1, 2") {|val| @verbose = val.to_i }
    end

    # register the subcommand
    registerSubCmd(
            "synthesize",                            # name of the subcmd
            "Synthesizes the configured sources.",  # short description (optional)
            "Synthesizes the configured sources.", 	# description (optional)
            synoptions                              # the option object (optional)
            ) { synthesize() }                      # the action which should be run when this subcmd is invoked

    # --- place and route ---
    # create an options object
    pnroptions = CmdParse::OptionParserWrapper.new do |opt|
        opt.separator "<placeandroute-options>:"
        opt.on("-v", "--verbose VAL",     "More output. possible values of VAL: 0, 1, 2") {|val| @verbose = val.to_i }
    end

    # register the subcommand
    registerSubCmd(
            "placeandroute",                        # name of the subcmd
            "Runs placement and routing of configured sources.",    # short description (optional)
            "Runs placement and routing of configured sources.", 	# description (optional)
            pnroptions                              # the option object (optional)
            ) { synthesize(); placeandroute(false, true)}  # the action which should be run when this subcmd is invoked

end

Instance Method Details

#placeandroute(_printActualLeaf = true, _noInitWork = false) ⇒ Object



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/plugins/Quartus.rb', line 100

def placeandroute(_printActualLeaf=true, _noInitWork=false)
    initWork() unless _noInitWork

		sources = @actualLeaf.getFiles("Packages") | @actualLeaf.getFiles("Units")

    @pen.puts if _printActualLeaf
    @actualLeaf.printMe if _printActualLeaf
    width = 87

    @pen.seperator

    begin
        @pen.print ",", "-"*width,"+\n"
        @pen.print "|", " Place and Route".ljust(width), "|\n"
        @pen.print "+", "-"*width,"+\n"

        callTool("quartus_fit") { callQuartusFit }
			@pen.print "+", "-"*width,"+\n"
        callTool("quartus_asm") { callQuartusAsm }     
			@pen.print "+", "-"*width,"+\n"
        callTool("quartus_tan") { callQuartusTan }
			@pen.print "+", "-"*width,"+\n"
        callTool("quartus_eda") { callQuartusEda }
        
    ensure
        @pen.print "`", "-"*width,"+\n"
    end
end

#synthesize(_printActualLeaf = true) ⇒ Object



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/plugins/Quartus.rb', line 76

def synthesize(_printActualLeaf=true)
    initWork()
		
    sources = @actualLeaf.getFiles("Packages") | @actualLeaf.getFiles("Units")

    @pen.puts 
    @actualLeaf.printMe if _printActualLeaf
    width = 87

    @pen.seperator

    begin
        @pen.print ",", "-"*width,"+\n"
        @pen.print "|", " Synthesis".ljust(width), "|\n"
        @pen.print "+", "-"*width,"+\n"

        callTool("quartus_sh") { prepareSettingsFile() }
        callTool("quartus_map") { callQuartusMap(sources) } 
    ensure
        @pen.print "`", "-"*width,"+\n"
    end
end