rvvm 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +40 -0
- data/lib/rvvm/crayons.rb +48 -5
- data/lib/rvvm/templates.rb +1 -0
- data/lib/rvvm/version.rb +1 -1
- data/lib/rvvm.rb +53 -76
- data/sig/rvvm/crayons.rbs +17 -0
- data/sig/rvvm/utils.rbs +15 -0
- data/sig/rvvm.rbs +10 -1
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdb2b96ce09d030dc59c5bc426673d5208aaba4ce8aa4b097179d62cdaa2dc17
|
4
|
+
data.tar.gz: 37576dcfb35c64353383518a8c8ef496e4930a76acd2f3ba3bcfb3dcb45e4a1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af7c4f03fd70b8eca2f5da78d0e02d67d777aa04d95b166c07f7fe625ba46ae053141e4e7664d352fc2e02c95c11a30ba3501a87cfcbaa00f8ba7bd51dcee1aa
|
7
|
+
data.tar.gz: b0c520fae9157b3d6a20593b0d3ed44baff1c967d734ebe6e1012c58fca1d71c63a218550f64a88aed8232d75bb49cb41b70c58b1967b30fc38a1a73fa5799c7
|
data/CHANGELOG.md
CHANGED
@@ -153,3 +153,43 @@
|
|
153
153
|
1. Missing gemspec dependencies
|
154
154
|
2. Minor spinner rendering bugs
|
155
155
|
|
156
|
+
## TBI:
|
157
|
+
|
158
|
+
1. Elaboration and simulation custom waveform trace dump file
|
159
|
+
3. Crayon module tests
|
160
|
+
4. RBS definitions
|
161
|
+
|
162
|
+
## [1.1.0] - 2024-09-18
|
163
|
+
|
164
|
+
### Added:
|
165
|
+
|
166
|
+
1. Crayon.command to execute shell commands with spinners
|
167
|
+
2. Crayon module tests
|
168
|
+
3. RBS definitions
|
169
|
+
|
170
|
+
### Fixed:
|
171
|
+
|
172
|
+
1. More Crayons rendering bugs
|
173
|
+
|
174
|
+
## [1.2.0] - 2024-09-19
|
175
|
+
|
176
|
+
### Added:
|
177
|
+
|
178
|
+
1. Cyayons.command exception handling
|
179
|
+
2. Flags for itf, pkg and svfile template generation
|
180
|
+
3. Custom DPI-C library for elaboration
|
181
|
+
|
182
|
+
### Fixed
|
183
|
+
|
184
|
+
1. More rendering bugs
|
185
|
+
2. Package template not being generated under <prj root>/design/pkg by default
|
186
|
+
3. DPI-C compilation using invalid command
|
187
|
+
4. Script crash on trying to execute a missing shell command
|
188
|
+
5. Script crashing on trying to open non existent coverage report
|
189
|
+
|
190
|
+
### TBI
|
191
|
+
|
192
|
+
1. Custom waveform dump file name for elaboration and simulation
|
193
|
+
2. RVvM config file versions and regeneration
|
194
|
+
3. Exit on failing compilation/elaboration/simulation
|
195
|
+
|
data/lib/rvvm/crayons.rb
CHANGED
@@ -1,15 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "tty-spinner"
|
4
|
+
require "tty-command"
|
4
5
|
require "rainbow/refinement"
|
5
6
|
|
6
7
|
using Rainbow
|
7
8
|
|
8
|
-
# Utility module providing
|
9
|
+
# Utility module providing an API to run shell commands
|
10
|
+
# with spinners and stdout mesage formatting.
|
9
11
|
#
|
10
12
|
# @example
|
11
13
|
# require 'rvvm/crayons'
|
12
14
|
#
|
15
|
+
# Crayons.init
|
16
|
+
#
|
17
|
+
# # Runn a shell command with a spinner
|
18
|
+
# Crayons.command("Running command...", "ls -aln")
|
19
|
+
#
|
20
|
+
# # Run custom code with a spinner
|
13
21
|
# Crayons.spinner_start("New task...")
|
14
22
|
#
|
15
23
|
# # do stuff
|
@@ -29,6 +37,16 @@ module Crayons
|
|
29
37
|
@thread = nil
|
30
38
|
@thread_paused = false
|
31
39
|
@spinner_running = false
|
40
|
+
@command = nil
|
41
|
+
|
42
|
+
# Initializes Crayons module.
|
43
|
+
#
|
44
|
+
# @return [void]
|
45
|
+
#
|
46
|
+
# @since 1.1.0
|
47
|
+
def self.init
|
48
|
+
@command = TTY::Command.new(printer: :null)
|
49
|
+
end
|
32
50
|
|
33
51
|
# Returns spinner status.
|
34
52
|
#
|
@@ -46,11 +64,14 @@ module Crayons
|
|
46
64
|
# @since 1.0.0
|
47
65
|
def self.spinner_start(message)
|
48
66
|
print "\r\e[K"
|
49
|
-
@spinner = TTY::Spinner.new("[:spinner] #{message}")
|
67
|
+
@spinner = TTY::Spinner.new("[:spinner] #{message}", interval: 5)
|
50
68
|
@spinner_running = true
|
51
69
|
@thread = Thread.new do
|
52
70
|
@spinner.auto_spin
|
53
|
-
|
71
|
+
while @thread_sleeping
|
72
|
+
print "\r\e[K"
|
73
|
+
sleep(0.1)
|
74
|
+
end
|
54
75
|
end
|
55
76
|
end
|
56
77
|
|
@@ -62,9 +83,9 @@ module Crayons
|
|
62
83
|
def self.spinner_pause
|
63
84
|
return unless @spinner_running
|
64
85
|
|
65
|
-
sleep(0.1)
|
66
86
|
print "\r\e[K"
|
67
87
|
@thread_paused = true
|
88
|
+
print "\r\e[K"
|
68
89
|
end
|
69
90
|
|
70
91
|
# Resumes spinner thread execution.
|
@@ -87,11 +108,11 @@ module Crayons
|
|
87
108
|
def self.spinner_stop(message = nil, exit)
|
88
109
|
return unless @spinner_running
|
89
110
|
|
111
|
+
sleep(0.1)
|
90
112
|
spinner_message = message || (exit ? "Done!" : "Failed!")
|
91
113
|
exit ? @spinner.success(spinner_message.green) : @spinner.error(spinner_message.red)
|
92
114
|
@thread.join
|
93
115
|
@spinner_running = false
|
94
|
-
print "\r\e[K"
|
95
116
|
end
|
96
117
|
|
97
118
|
# Logs a message during spinner execution removing the need
|
@@ -110,6 +131,28 @@ module Crayons
|
|
110
131
|
spinner_resume if @spinner_running
|
111
132
|
end
|
112
133
|
|
134
|
+
# Runs a shell command with a spinner.
|
135
|
+
#
|
136
|
+
# @param tag [String] spinner tag
|
137
|
+
# @param cmd [String] shell command to be run
|
138
|
+
#
|
139
|
+
# @return [void]
|
140
|
+
#
|
141
|
+
# @since 1.1.0
|
142
|
+
def self.command(tag, cmd)
|
143
|
+
spinner_start(tag)
|
144
|
+
out = @command.run!(cmd)
|
145
|
+
spinner_log("#{out.out}\n")
|
146
|
+
spinner_stop(nil, out.success?)
|
147
|
+
puts ""
|
148
|
+
rescue Errno::ENOENT
|
149
|
+
spinner_stop(nil, false)
|
150
|
+
log_error("\nError: #{cmd.split.first} not found!\n")
|
151
|
+
rescue StandardError => e
|
152
|
+
spinner_stop(nil, false)
|
153
|
+
log_error("\nAn unexpected error ocurred:\n\n#{e.message}\n")
|
154
|
+
end
|
155
|
+
|
113
156
|
# Logs a green text message to stdout.
|
114
157
|
#
|
115
158
|
# @param message [String] message to print
|
data/lib/rvvm/templates.rb
CHANGED
data/lib/rvvm/version.rb
CHANGED
data/lib/rvvm.rb
CHANGED
@@ -55,6 +55,7 @@ module Rvvm
|
|
55
55
|
OptionParser.new do |args|
|
56
56
|
current_time = Time.now
|
57
57
|
@formatted_time = current_time.strftime("%Y-%m-%d %H:%M:%S")
|
58
|
+
Crayons.init
|
58
59
|
|
59
60
|
args.on("-h", "--help", "Shows this help") do
|
60
61
|
puts "\nRVvM - Ruby Vivado Manager\n\n"
|
@@ -74,38 +75,39 @@ module Rvvm
|
|
74
75
|
exit(0)
|
75
76
|
end
|
76
77
|
|
77
|
-
args.on("-n", "--new NAME", "Creates a new project wit the prowided name under pwd")
|
78
|
-
args.on("-m", "--module NAME", "Creates a SystemVerilog module template (default path: <prj
|
79
|
-
args.on("--pkg NAME", "Creates a SystemVerilog package template (default path: <prj
|
80
|
-
args.on("--itf NAME", "Creates a SystemVerilog interface template (default path: <prj
|
81
|
-
args.on("--svfile NAME", "Creates a generic SystemVerilog file template (default path: <prj
|
82
|
-
args.on("--path PATH", "Specifies a path relative to <prj dir> when creating a file template")
|
78
|
+
args.on("-n", "--new <NAME>", "Creates a new project wit the prowided name under pwd")
|
79
|
+
args.on("-m", "--module <NAME>", "Creates a SystemVerilog module template (default path: <prj root>/design/src)")
|
80
|
+
args.on("-p", "--pkg <NAME>", "Creates a SystemVerilog package template (default path: <prj root>/design/pkg)")
|
81
|
+
args.on("-i", "--itf <NAME>", "Creates a SystemVerilog interface template (default path: <prj root>/design/itf)")
|
82
|
+
args.on("-s", "--svfile <NAME>", "Creates a generic SystemVerilog file template (default path: <prj root>/design/src)")
|
83
|
+
args.on("--path <PATH>", "Specifies a path relative to <prj dir> when creating a file template")
|
83
84
|
args.on("--here", "Specifies pwd as the path for template file creation.")
|
84
85
|
args.on("-c", "--comp", "Compile SystemVerilog sources")
|
85
86
|
args.on("-e", "--elab", "Elaborates project")
|
86
87
|
args.on("-r", "--run", "Runs UVM simulation")
|
87
|
-
args.on("-a", "--all", "Runs --comp, --dpi if
|
88
|
+
args.on("-a", "--all", "Runs --comp, --dpi if dpi dpilib configured in rvvmconf, --elab, --run")
|
88
89
|
args.on("--runsv", "Runs pure SystemVerilog/Verilog simulation (Ignores UVM related arguments and config options)")
|
89
90
|
args.on("-d", "--dpi", "Compiles C/C++ sources to a shared lib to link into an elaborated snaphost using DPI-C")
|
90
91
|
args.on("-u", "--gui", "Opens a dumped waveform in Xilinx Vivado GUI")
|
91
92
|
args.on("-g", "--gencov", "Generates a functional coverage report")
|
92
|
-
args.on("
|
93
|
-
args.on("--complog LOGNAME", "Specifies compilation log filename (overrides config)")
|
94
|
-
args.on("--complist LISTFILE", "Specifies compile list for compilation (overrides config)")
|
95
|
-
args.on("--elablog LOGNAME", "Specifies elaboration log filename (overrides config)")
|
96
|
-
args.on("--timescale TIMESCALE", "Specifies timescale for testbench snapshot to be elaborated (overrides config)")
|
97
|
-
args.on("--tbtop TOPMODULE", "Specifie testbench top module (overwrites config)")
|
98
|
-
args.on("--tb TBNAME", "Specifies tesbench snapshot to be elaborated (overwrites config)")
|
99
|
-
args.on("--
|
100
|
-
args.on("--
|
93
|
+
args.on("--covreport", "Opens the latest generated functional coverage report in Xilinx coverage dashboard")
|
94
|
+
args.on("--complog <LOGNAME>", "Specifies compilation log filename (overrides config)")
|
95
|
+
args.on("--complist <LISTFILE>", "Specifies compile list for compilation (overrides config)")
|
96
|
+
args.on("--elablog <LOGNAME>", "Specifies elaboration log filename (overrides config)")
|
97
|
+
args.on("--timescale <TIMESCALE>", "Specifies timescale for testbench snapshot to be elaborated (overrides config)")
|
98
|
+
args.on("--tbtop <TOPMODULE>", "Specifie testbench top module (overwrites config)")
|
99
|
+
args.on("--tb <TBNAME>", "Specifies tesbench snapshot to be elaborated (overwrites config)")
|
100
|
+
args.on("--customdpilib <PATH>", "Specifies a custom DPI-C library to link into a snapshot to be elaborated (overwrites config)")
|
101
|
+
args.on("--simlog <LOGNAME>", "Specifies simulation log name (overwrites config)")
|
102
|
+
args.on("--test <TESTNAME>", "Specifies UVM test to be run by --run (overwrites config)")
|
101
103
|
args.on("-b", "--batch", "Run a batch of UVM tests from a test list (overwrites config)")
|
102
|
-
args.on("--testlist TESTLIST", Array, "Specifies test list as a comma separated string for a batch of test run (overwrites config)")
|
103
|
-
args.on("--verb VERBOSITY", "Specifies UVM verbosity <LOW, MEDIUM, HIGH, FULL, DEBUG> (overwrites config)")
|
104
|
-
args.on("--simtb TBNAME", "Specifies testbench snapshot for simulation (overwrites config)")
|
105
|
-
args.on("--dpilist LISTFILE", "Specifies source file list for DPI-C compilation (overwrites config)")
|
104
|
+
args.on("--testlist \"<TESTLIST>\"", Array, "Specifies test list as a comma separated string for a batch of test run (overwrites config)")
|
105
|
+
args.on("--verb <VERBOSITY>", "Specifies UVM verbosity <LOW, MEDIUM, HIGH, FULL, DEBUG> (overwrites config)")
|
106
|
+
args.on("--simtb <TBNAME>", "Specifies testbench snapshot for simulation (overwrites config)")
|
107
|
+
args.on("--dpilist <LISTFILE>", "Specifies source file list for DPI-C compilation (overwrites config)")
|
106
108
|
args.on("-w", "--wave", "Activates waveform trace dump for elaboration and simulation (overwrites config)")
|
107
|
-
args.on("--wavefile WAVEFILE", "Specifies waveform dump file to be openned in Vivado GUI")
|
108
|
-
args.on("--prjconf CONFIG", "Specifies RVvM project config file if not using the one provided in the project")
|
109
|
+
args.on("--wavefile <WAVEFILE>", "Specifies waveform dump file to be openned in Vivado GUI")
|
110
|
+
args.on("--prjconf <CONFIG>", "Specifies RVvM project config file if not using the one provided in the project")
|
109
111
|
args.on("-l", "--dpilib", "Specifies a DPI-C shared library to be linked with a snapshot during elaboration")
|
110
112
|
args.on("--debug", "Script debug")
|
111
113
|
end.parse!(into: @args)
|
@@ -149,6 +151,8 @@ module Rvvm
|
|
149
151
|
puts "UVM test list provided without running in batch mode - option will be ignored..."
|
150
152
|
@args[:testlist] = nil
|
151
153
|
end
|
154
|
+
|
155
|
+
@config[:elaboration][:customdpilib] = @args[:customdpilib] if @args[:customdpilib]
|
152
156
|
end
|
153
157
|
|
154
158
|
# Shell command with debug printout.
|
@@ -161,12 +165,14 @@ module Rvvm
|
|
161
165
|
# @return [void]
|
162
166
|
#
|
163
167
|
# @since 0.8.0
|
164
|
-
def self.execute(command)
|
168
|
+
def self.execute(tag, command)
|
165
169
|
if @args[:debug]
|
166
|
-
Crayons.
|
170
|
+
Crayons.spinner_start(tag)
|
167
171
|
sleep(1)
|
172
|
+
Crayons.spinner_log(command)
|
173
|
+
Crayons.spinner_stop(nil, true)
|
168
174
|
else
|
169
|
-
|
175
|
+
Crayons.command(tag, command)
|
170
176
|
end
|
171
177
|
end
|
172
178
|
|
@@ -247,7 +253,7 @@ module Rvvm
|
|
247
253
|
system('git commit -am "Initial commit"')
|
248
254
|
Crayons.spinner_resume
|
249
255
|
|
250
|
-
Crayons.spinner_log("
|
256
|
+
Crayons.spinner_log("")
|
251
257
|
Crayons.spinner_stop("Done!", true)
|
252
258
|
Crayons.log_pass("\nRVvM: New project generated. ^^\n\n")
|
253
259
|
|
@@ -289,6 +295,7 @@ module Rvvm
|
|
289
295
|
puts ""
|
290
296
|
rescue JSON::ParserError => e
|
291
297
|
Crayons.log_error(" Invalid config json!\n\n#{e.message}")
|
298
|
+
puts""
|
292
299
|
exit(1)
|
293
300
|
end
|
294
301
|
|
@@ -307,18 +314,12 @@ module Rvvm
|
|
307
314
|
#
|
308
315
|
# @since 0.8.0
|
309
316
|
def self.compile
|
310
|
-
cmd_args = @config[:compilation][:args]
|
317
|
+
cmd_args = @config[:compilation][:args].strip
|
311
318
|
logname = @args[:complog] || File.join([@config[:project][:logDir], @config[:compilation][:logDir], @config[:compilation][:log]])
|
312
319
|
complist = @args[:compilelist] || @config[:compilation][:list]
|
313
320
|
|
314
|
-
Crayons.spinner_start("Compiling HDL sources...")
|
315
|
-
|
316
321
|
cmd = "xvlog -sv -f #{complist} -log #{logname} #{cmd_args}"
|
317
|
-
|
318
|
-
exit = execute(cmd)
|
319
|
-
Crayons.spinner_resume
|
320
|
-
Crayons.spinner_stop(nil, exit)
|
321
|
-
puts ""
|
322
|
+
execute("Compiling HDL sources...", cmd)
|
322
323
|
end
|
323
324
|
|
324
325
|
# Compiles C/C++ sources into a shared library to use during
|
@@ -328,15 +329,11 @@ module Rvvm
|
|
328
329
|
#
|
329
330
|
# @Since 0.9.0
|
330
331
|
def self.dpi_c
|
331
|
-
cmd_args = @config[:dpi][:args]
|
332
|
+
cmd_args = @config[:dpi][:args].strip
|
332
333
|
dpilist = @args[:dpilist] || @config[:dpi][:list]
|
333
334
|
|
334
|
-
|
335
|
-
|
336
|
-
cmd = "sxc -f #{dpilist} #{cmd_args}"
|
337
|
-
exit = execute(cmd)
|
338
|
-
Crayons.spinner_stop(nil, exit)
|
339
|
-
puts ""
|
335
|
+
cmd = "xsc -f #{dpilist} #{cmd_args}"
|
336
|
+
execute("Building DPI-C library...", cmd)
|
340
337
|
end
|
341
338
|
|
342
339
|
# Elaborates project into a testbench snapshot using xelab.
|
@@ -346,21 +343,19 @@ module Rvvm
|
|
346
343
|
# @since 0.8.0
|
347
344
|
def self.elaborate
|
348
345
|
cmd_args = @config[:elaboration][:args]
|
349
|
-
cmd_args << " -sv_lib
|
346
|
+
cmd_args << " -sv_lib #{@config[:elaboration][:customdpilib]}" if @config[:elaboration][:customdpilib] != ""
|
347
|
+
unless @config[:elaboration][:customdpilib] != ""
|
348
|
+
cmd_args << " -sv_lib dpi" if @args[:dpi] || @args[:dpilib] || @config[:dpi][:dpilib] == 1
|
349
|
+
end
|
350
350
|
cmd_args << " -debug wave" if @args[:wave]
|
351
|
+
cmd_args.strip!
|
351
352
|
logname = @args[:elablog] || File.join([@config[:project][:logDir], @config[:elaboration][:logDir], @config[:elaboration][:log]])
|
352
353
|
tb_top = @args[:tbtop] || @config[:elaboration][:tbTop]
|
353
354
|
tb = @args[:tb] || @config[:elaboration][:tb]
|
354
355
|
timescale = @args[:timescale] || @config[:elaboration][:timescale]
|
355
356
|
|
356
|
-
Crayons.spinner_start("Elaborating testbench: #{tb}...")
|
357
|
-
|
358
357
|
cmd = "xelab #{tb_top} -relax -s #{tb} -timescale #{timescale} -log #{logname} #{cmd_args}"
|
359
|
-
|
360
|
-
exit = execute(cmd)
|
361
|
-
Crayons.spinner_resume
|
362
|
-
Crayons.spinner_stop(nil, exit)
|
363
|
-
puts ""
|
358
|
+
execute("Elaborating testbench #{tb}...", cmd)
|
364
359
|
end
|
365
360
|
|
366
361
|
# Runs UVM test simulation on an elaborated testbench snapshot using xrun.
|
@@ -373,8 +368,9 @@ module Rvvm
|
|
373
368
|
if @args[:wave]
|
374
369
|
cmd_args << " --tclbatch wfcfg.tcl"
|
375
370
|
else
|
376
|
-
cmd_args << "-R"
|
371
|
+
cmd_args << " -R"
|
377
372
|
end
|
373
|
+
cmd_args.strip!
|
378
374
|
|
379
375
|
# Run simulaton on an array of tests.
|
380
376
|
# If in not running in batch mode testlist is an array with a single test
|
@@ -386,8 +382,6 @@ module Rvvm
|
|
386
382
|
|
387
383
|
testlist.each_with_index do |simtest, i|
|
388
384
|
simtest.strip!
|
389
|
-
puts "" if i.positive?
|
390
|
-
Crayons.spinner_start("Running test #{i + 1}/#{testlist.size}: #{simtest}...")
|
391
385
|
|
392
386
|
logname = File.join([@config[:project][:logDir], @config[:simulation][:logDir], @config[:simulation][:log]])
|
393
387
|
logname = Utils.interpolate(logname, { testname: simtest })
|
@@ -395,13 +389,8 @@ module Rvvm
|
|
395
389
|
verb = "UVM_#{@args[:verb] || @config[:simulation][:verbosity]}"
|
396
390
|
|
397
391
|
cmd = "xsim #{tb} -log #{logname} -testplusarg \"UVM_VERBOSITY=#{verb}\" -testplusarg \"UVM_TESTNAME=#{simtest}\" #{cmd_args}"
|
398
|
-
|
399
|
-
exit = execute(cmd)
|
400
|
-
Crayons.spinner_resume
|
401
|
-
Crayons.spinner_stop(nil, exit)
|
392
|
+
execute("Running UVM test #{i + 1}/#{testlist.size}: #{simtest}...", cmd)
|
402
393
|
end
|
403
|
-
|
404
|
-
puts ""
|
405
394
|
end
|
406
395
|
|
407
396
|
# Runs a pure SystemVerilog/Verilog simulation using xrun.
|
@@ -410,17 +399,13 @@ module Rvvm
|
|
410
399
|
#
|
411
400
|
# @since 0.9.0
|
412
401
|
def self.run_sv
|
413
|
-
cmd_args = @config[:simulation][:args]
|
402
|
+
cmd_args = @config[:simulation][:args].strip!
|
414
403
|
tb = @args[:simtb] || @args[:tb] || @config[:elaboration][:tb]
|
415
404
|
|
416
|
-
Crayons.spinner_start("Running pure SV/V simulation...")
|
417
405
|
logname = @args[:simlog] || File.join([@config[:project][:logDir], @config[:simulation][:logDir], "svsim.log"])
|
418
406
|
|
419
407
|
cmd = "xsim #{tb} -log #{logname} #{cmd_args}"
|
420
|
-
|
421
|
-
exit = execute(cmd)
|
422
|
-
Crayons.spinner_resume
|
423
|
-
Crayons.spinner_stop(nil, exit)
|
408
|
+
execute("Running pure SV/V simulation...", cmd)
|
424
409
|
end
|
425
410
|
|
426
411
|
# Opens last generated waveform trace dump to inspect in Vivado GUI.
|
@@ -432,7 +417,7 @@ module Rvvm
|
|
432
417
|
dump = @args[:wavefile] || "#{@config[:elaboration][:tb]}.wdb"
|
433
418
|
|
434
419
|
cmd = "xsim --gui #{dump}"
|
435
|
-
execute(cmd)
|
420
|
+
execute("Running Vivado GUI...", cmd)
|
436
421
|
|
437
422
|
exit(0)
|
438
423
|
end
|
@@ -443,13 +428,8 @@ module Rvvm
|
|
443
428
|
#
|
444
429
|
# @since 0.9.0
|
445
430
|
def self.coverage
|
446
|
-
Crayons.spinner_start("Generating UVM functional coverage report...")
|
447
|
-
|
448
431
|
cmd = "xcrg -report_format html -dir xsim.covdb"
|
449
|
-
|
450
|
-
exit = execute(cmd)
|
451
|
-
Crayons.spinner_resume
|
452
|
-
Crayons.spinner_stop(nil, exit)
|
432
|
+
execute("Generating UVM test functional coverage report...", cmd)
|
453
433
|
end
|
454
434
|
|
455
435
|
# Opens last generated functional coverage report in a HTML dashboard.
|
@@ -459,7 +439,7 @@ module Rvvm
|
|
459
439
|
# @since 0.9.0
|
460
440
|
def self.cov_report
|
461
441
|
Dir.chdir("xcrg_func_cov_report")
|
462
|
-
execute("./dashboard.html")
|
442
|
+
execute("Opening coverage dashboard...", "./dashboard.html")
|
463
443
|
|
464
444
|
exit(0)
|
465
445
|
end
|
@@ -491,7 +471,6 @@ module Rvvm
|
|
491
471
|
end
|
492
472
|
conf[:username] = Utils.git_userame || " "
|
493
473
|
|
494
|
-
puts ""
|
495
474
|
Crayons.spinner_start("Generating SV #{type} template...")
|
496
475
|
Utils.gen_template(@templates[:module], "#{name}.sv", conf, path)
|
497
476
|
Crayons.spinner_stop(nil, true)
|
@@ -521,10 +500,9 @@ module Rvvm
|
|
521
500
|
if @args[:here]
|
522
501
|
path = "."
|
523
502
|
else
|
524
|
-
path = File.join([@config[:project][:path], @args[:path] || @templates[:
|
503
|
+
path = File.join([@config[:project][:path], @args[:path] || @templates[:package][:file][:path]])
|
525
504
|
end
|
526
505
|
|
527
|
-
puts ""
|
528
506
|
Crayons.spinner_start("Generating SV pkg template...")
|
529
507
|
Utils.gen_template(@templates[:package], "#{name}.sv", conf, path)
|
530
508
|
Crayons.spinner_stop(nil, true)
|
@@ -556,7 +534,6 @@ module Rvvm
|
|
556
534
|
path = File.join([@config[:project][:path], @args[:path] || @templates[:module][:file][:path]])
|
557
535
|
end
|
558
536
|
|
559
|
-
puts ""
|
560
537
|
Crayons.spinner_start("Generating generic SV file template...")
|
561
538
|
Utils.gen_template(@templates[:svfile], "#{name}.sv", conf, path)
|
562
539
|
Crayons.spinner_stop(nil, true)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Crayons
|
2
|
+
|
3
|
+
def self.spinner_running?: () -> Boolean
|
4
|
+
|
5
|
+
def self.spinner_start: (String) -> void
|
6
|
+
|
7
|
+
def self.spinner_stop: (String, Boolean) -> void
|
8
|
+
|
9
|
+
def self.spinner_log: (String) -> void
|
10
|
+
|
11
|
+
def self.command: (String, String) -> void
|
12
|
+
|
13
|
+
def self.log_pass: (String) -> void
|
14
|
+
|
15
|
+
def self.log_error: (String) -> void
|
16
|
+
|
17
|
+
end
|
data/sig/rvvm/utils.rbs
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
module Utils
|
2
|
+
|
3
|
+
def self.interpolate: (String, Hash) -> String
|
4
|
+
|
5
|
+
def self.gen_file: (String, String) -> void
|
6
|
+
|
7
|
+
def self.gen_template: (Hash, String, Hash, String) -> void
|
8
|
+
|
9
|
+
def self.find_file_dir: (String, String) -> String
|
10
|
+
|
11
|
+
def self.git_username: () -> String
|
12
|
+
|
13
|
+
def self.all_nil? (Hash, Array) -> Boolean
|
14
|
+
|
15
|
+
end
|
data/sig/rvvm.rbs
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
module Rvvm
|
2
2
|
VERSION: String
|
3
|
-
|
3
|
+
|
4
|
+
def self.execute: (String, String) -> void
|
5
|
+
|
6
|
+
def self.create_new_project: (String) -> void
|
7
|
+
|
8
|
+
def self.create_module: (String, String) -> void
|
9
|
+
|
10
|
+
def self.create_pkg: (String) -> void
|
11
|
+
|
12
|
+
def self.create_svfile: (String) -> void
|
4
13
|
end
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rvvm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mrbya
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rainbow
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '3.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: tty-command
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.10.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.10.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: tty-spinner
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -76,6 +76,8 @@ files:
|
|
76
76
|
- lib/rvvm/utils.rb
|
77
77
|
- lib/rvvm/version.rb
|
78
78
|
- sig/rvvm.rbs
|
79
|
+
- sig/rvvm/crayons.rbs
|
80
|
+
- sig/rvvm/utils.rbs
|
79
81
|
homepage: https://gitlab.com/such-hdl-much-wow/rvvm.git
|
80
82
|
licenses:
|
81
83
|
- MIT
|