19
20
21
22
23
24
25
26
27
28
29
30
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
75
76
77
78
79
|
# File 'lib/reggae/compiler.rb', line 19
def analyze_options args
args << "-h" if args.empty?
opt_parser = OptionParser.new do |opts|
opts.banner = "Usage: reggae <filename.sexp>"
opts.on("-v", "--version", "Prints version") do
puts VERSION
abort
end
opts.on("-h", "--help", "Prints this help") do
puts
puts "Generates an IP-based system, from its memory-map expressed in s-expressions."
puts
puts "Author mail: [email protected]"
puts
@options[:show_help]=true
puts opts
abort
end
opts.on("-s", "--system", "Generates a top-level system") do
@options[:gen_system]=true
end
opts.on("-d","Shows VHDL generated in the terminal,during generation") do
@options[:show_code]=true
end
opts.on("-u", "--include_uart", "Generates an UART Master in the system top-level") do
@options[:include_uart]=true
end
opts.on("--gen_ruby", "Generates Ruby code to interact with the system from a PC host") do
@options[:gen_ruby]=true
end
opts.on("-x", "--gen_xdc", "Generates a Xilinx XDC constraint file for Artix7 FPGA (IP only)") do
@options[:gen_xdc]=true
end
opts.on("--from_vivado_hls", "Indicates that the sexp file is generated from VHDL_WRAP tuned for VivadoHLS") do
@options[:from_vivado_hls]=true
end
end
begin
opt_parser.parse!(args)
rescue Exception => e
puts e
exit
end
@filename = ARGV.pop
$dirname = File.dirname(@filename) if @filename
unless @filename or @options[:show_help]
puts "Need to specify a filename to process"
end
end
|