rvvm 1.1.0 → 1.2.2

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.
@@ -0,0 +1,110 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Top Level Namespace
8
+
9
+ &mdash; Documentation by YARD 0.9.37
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index</a> &raquo;
40
+
41
+
42
+ <span class="title">Top Level Namespace</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Top Level Namespace
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ </div>
80
+
81
+ <h2>Defined Under Namespace</h2>
82
+ <p class="children">
83
+
84
+
85
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Crayons.html" title="Crayons (module)">Crayons</a></span>, <span class='object_link'><a href="Rvvm.html" title="Rvvm (module)">Rvvm</a></span>, <span class='object_link'><a href="Templates.html" title="Templates (module)">Templates</a></span>, <span class='object_link'><a href="Utils.html" title="Utils (module)">Utils</a></span>
86
+
87
+
88
+
89
+
90
+ </p>
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+ </div>
101
+
102
+ <div id="footer">
103
+ Generated on Thu Sep 19 20:26:42 2024 by
104
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
105
+ 0.9.37 (ruby-3.2.5).
106
+ </div>
107
+
108
+ </div>
109
+ </body>
110
+ </html>
data/lib/rvvm/crayons.rb CHANGED
@@ -50,7 +50,7 @@ module Crayons
50
50
 
51
51
  # Returns spinner status.
52
52
  #
53
- # @returns @spinner_running [Boolean] spinner status
53
+ # @return [Boolean] spinner status
54
54
  def self.spinner_running?
55
55
  @spinner_running
56
56
  end
@@ -85,7 +85,6 @@ module Crayons
85
85
 
86
86
  print "\r\e[K"
87
87
  @thread_paused = true
88
- sleep(0.1)
89
88
  print "\r\e[K"
90
89
  end
91
90
 
@@ -109,11 +108,11 @@ module Crayons
109
108
  def self.spinner_stop(message = nil, exit)
110
109
  return unless @spinner_running
111
110
 
111
+ sleep(0.1)
112
112
  spinner_message = message || (exit ? "Done!" : "Failed!")
113
113
  exit ? @spinner.success(spinner_message.green) : @spinner.error(spinner_message.red)
114
114
  @thread.join
115
115
  @spinner_running = false
116
- print "\r\e[K"
117
116
  end
118
117
 
119
118
  # Logs a message during spinner execution removing the need
@@ -136,16 +135,27 @@ module Crayons
136
135
  #
137
136
  # @param tag [String] spinner tag
138
137
  # @param cmd [String] shell command to be run
138
+ # @param ignore_errors [Boolean] if false command exits on shell command failure
139
139
  #
140
140
  # @return [void]
141
141
  #
142
142
  # @since 1.1.0
143
- def self.command(tag, cmd)
143
+ def self.command(tag, cmd, ignore_errors: false)
144
144
  spinner_start(tag)
145
145
  out = @command.run!(cmd)
146
146
  spinner_log("#{out.out}\n")
147
147
  spinner_stop(nil, out.success?)
148
148
  puts ""
149
+
150
+ exit(1) unless out.success? && !ignore_errors
151
+ rescue Errno::ENOENT
152
+ spinner_stop(nil, false)
153
+ log_error("\nError: '#{cmd.split.first}' command not found!\n")
154
+ exit(1) unless ignore_errors
155
+ rescue StandardError => e
156
+ spinner_stop(nil, false)
157
+ log_error("\nAn unexpected error ocurred:\n\n#{e.message}\n")
158
+ exit(1) unless ignore_errors
149
159
  end
150
160
 
151
161
  # Logs a green text message to stdout.
@@ -39,6 +39,7 @@ module Templates
39
39
  "tbTop": "${prjname}_tb_top",
40
40
  "tb": "${prjname}_tb",
41
41
  "timescale": "1ns/1ps",
42
+ "customdpilib": "",
42
43
  "logDir": "elab",
43
44
  "log": "elab.log",
44
45
  "args": " "
data/lib/rvvm/utils.rb CHANGED
@@ -105,8 +105,8 @@ module Utils
105
105
 
106
106
  # Checks if hash contains keys provided from an array.
107
107
  #
108
- # @param hash [Hash] hash to analyze
109
- # @param arra [Array] array of keys to look for in the hash
108
+ # @param [Hash] hash to analyze
109
+ # @param [Array] array of keys to look for in the hash
110
110
  #
111
111
  # @return [Bolean] true if all provided keys from a hash return nil
112
112
  # @return [Boolean] false if a provided key is found in the hash
data/lib/rvvm/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  # Module holding current rvvm version.
4
4
  module Rvvm
5
5
  # Current rvvm module version.
6
- VERSION = "1.1.0"
6
+ VERSION = "1.2.2"
7
7
  end
data/lib/rvvm.rb CHANGED
@@ -75,39 +75,43 @@ module Rvvm
75
75
  exit(0)
76
76
  end
77
77
 
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 dir>/design/src)")
80
- args.on("--pkg NAME", "Creates a SystemVerilog package template (default path: <prj dir>/design/pkg)")
81
- args.on("--itf NAME", "Creates a SystemVerilog interface template (default path: <prj dir>/design/itf)")
82
- args.on("--svfile NAME", "Creates a generic SystemVerilog file template (default path: <prj dir>/design/src)")
83
- 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")
84
84
  args.on("--here", "Specifies pwd as the path for template file creation.")
85
85
  args.on("-c", "--comp", "Compile SystemVerilog sources")
86
86
  args.on("-e", "--elab", "Elaborates project")
87
87
  args.on("-r", "--run", "Runs UVM simulation")
88
- args.on("-a", "--all", "Runs --comp, --dpi if --dpilib or configured in rvvmconf, --elab, --run")
88
+ args.on("-a", "--all", "Runs --comp, --dpi if dpi dpilib configured in rvvmconf, --elab, --run")
89
89
  args.on("--runsv", "Runs pure SystemVerilog/Verilog simulation (Ignores UVM related arguments and config options)")
90
90
  args.on("-d", "--dpi", "Compiles C/C++ sources to a shared lib to link into an elaborated snaphost using DPI-C")
91
91
  args.on("-u", "--gui", "Opens a dumped waveform in Xilinx Vivado GUI")
92
92
  args.on("-g", "--gencov", "Generates a functional coverage report")
93
- args.on("-p", "--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("--simlog LOGNAME", "Specifies simulation log name (overwrites config)")
101
- args.on("--test TESTNAME", "Specifies UVM test to be run by --run (overwrites config)")
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)")
102
103
  args.on("-b", "--batch", "Run a batch of UVM tests from a test list (overwrites config)")
103
- args.on("--testlist TESTLIST", Array, "Specifies test list as a comma separated string for a batch of test run (overwrites config)")
104
- args.on("--verb VERBOSITY", "Specifies UVM verbosity <LOW, MEDIUM, HIGH, FULL, DEBUG> (overwrites config)")
105
- args.on("--simtb TBNAME", "Specifies testbench snapshot for simulation (overwrites config)")
106
- 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)")
107
108
  args.on("-w", "--wave", "Activates waveform trace dump for elaboration and simulation (overwrites config)")
108
- args.on("--wavefile WAVEFILE", "Specifies waveform dump file to be openned in Vivado GUI")
109
- 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")
110
111
  args.on("-l", "--dpilib", "Specifies a DPI-C shared library to be linked with a snapshot during elaboration")
112
+ args.on("--ignore-errors", "Ignores Vivado tool and shell command errors and continues execution") do
113
+ @args[:ignore_errors] = true
114
+ end
111
115
  args.on("--debug", "Script debug")
112
116
  end.parse!(into: @args)
113
117
 
@@ -150,6 +154,8 @@ module Rvvm
150
154
  puts "UVM test list provided without running in batch mode - option will be ignored..."
151
155
  @args[:testlist] = nil
152
156
  end
157
+
158
+ @config[:elaboration][:customdpilib] = @args[:customdpilib] if @args[:customdpilib]
153
159
  end
154
160
 
155
161
  # Shell command with debug printout.
@@ -164,12 +170,12 @@ module Rvvm
164
170
  # @since 0.8.0
165
171
  def self.execute(tag, command)
166
172
  if @args[:debug]
167
- puts command
168
173
  Crayons.spinner_start(tag)
169
174
  sleep(1)
175
+ Crayons.spinner_log(command)
170
176
  Crayons.spinner_stop(nil, true)
171
177
  else
172
- Crayons.command(tag, command)
178
+ Crayons.command(tag, command, ignore_errors: @args[:ignore_errors])
173
179
  end
174
180
  end
175
181
 
@@ -324,12 +330,12 @@ module Rvvm
324
330
  #
325
331
  # @return [void]
326
332
  #
327
- # @Since 0.9.0
333
+ # @since 0.9.0
328
334
  def self.dpi_c
329
335
  cmd_args = @config[:dpi][:args].strip
330
336
  dpilist = @args[:dpilist] || @config[:dpi][:list]
331
337
 
332
- cmd = "sxc -f #{dpilist} #{cmd_args}"
338
+ cmd = "xsc -f #{dpilist} #{cmd_args}"
333
339
  execute("Building DPI-C library...", cmd)
334
340
  end
335
341
 
@@ -340,7 +346,10 @@ module Rvvm
340
346
  # @since 0.8.0
341
347
  def self.elaborate
342
348
  cmd_args = @config[:elaboration][:args]
343
- cmd_args << " -sv_lib dpi" if @args[:dpi] || @args[:dpilib] || @config[:dpi][:dpilib] == 1
349
+ cmd_args << " -sv_lib #{@config[:elaboration][:customdpilib]}" if @config[:elaboration][:customdpilib] != ""
350
+ unless @config[:elaboration][:customdpilib] != ""
351
+ cmd_args << " -sv_lib dpi" if @args[:dpi] || @args[:dpilib] || @config[:dpi][:dpilib] == 1
352
+ end
344
353
  cmd_args << " -debug wave" if @args[:wave]
345
354
  cmd_args.strip!
346
355
  logname = @args[:elablog] || File.join([@config[:project][:logDir], @config[:elaboration][:logDir], @config[:elaboration][:log]])
@@ -494,7 +503,7 @@ module Rvvm
494
503
  if @args[:here]
495
504
  path = "."
496
505
  else
497
- path = File.join([@config[:project][:path], @args[:path] || @templates[:module][:file][:path]])
506
+ path = File.join([@config[:project][:path], @args[:path] || @templates[:package][:file][:path]])
498
507
  end
499
508
 
500
509
  Crayons.spinner_start("Generating SV pkg template...")
data/sig/rvvm/crayons.rbs CHANGED
@@ -1,17 +1,23 @@
1
1
  module Crayons
2
+
3
+ def self.init: () -> void
2
4
 
3
5
  def self.spinner_running?: () -> Boolean
4
6
 
5
- def self.spinner_start: (String) -> void
7
+ def self.spinner_start: (message: String) -> void
8
+
9
+ def self.spinner_pause: () -> void
10
+
11
+ def self.spinner_resume: () -> void
6
12
 
7
- def self.spinner_stop: (String, Boolean) -> void
13
+ def self.spinner_stop: (message: String, exit: Boolean) -> void
8
14
 
9
- def self.spinner_log: (String) -> void
15
+ def self.spinner_log: (message: String) -> void
10
16
 
11
- def self.command: (String, String) -> void
17
+ def self.command: (tag: String, cmd: String, ignore_errors: Boolean) -> void
12
18
 
13
- def self.log_pass: (String) -> void
19
+ def self.log_pass: (message: String) -> void
14
20
 
15
- def self.log_error: (String) -> void
21
+ def self.log_error: (message: String) -> void
16
22
 
17
23
  end
data/sig/rvvm/utils.rbs CHANGED
@@ -1,15 +1,15 @@
1
1
  module Utils
2
2
 
3
- def self.interpolate: (String, Hash) -> String
3
+ def self.interpolate: (string: String, hash: Hash) -> String
4
4
 
5
- def self.gen_file: (String, String) -> void
5
+ def self.gen_file: (path: String, content: String) -> void
6
6
 
7
- def self.gen_template: (Hash, String, Hash, String) -> void
7
+ def self.gen_template: (template: Hash, name: String, name: Hash, name: String) -> void
8
8
 
9
- def self.find_file_dir: (String, String) -> String
9
+ def self.find_file_dir: (filename: String, path: String) -> String
10
10
 
11
11
  def self.git_username: () -> String
12
12
 
13
- def self.all_nil? (Hash, Array) -> Boolean
13
+ def self.all_nil?: (hash: Hash, array: Array) -> Boolean
14
14
 
15
15
  end
data/sig/rvvm.rbs CHANGED
@@ -1,13 +1,39 @@
1
1
  module Rvvm
2
2
  VERSION: String
3
3
 
4
- def self.execute: (String, String) -> void
4
+ def self.check_args: () -> void
5
5
 
6
- def self.create_new_project: (String) -> void
6
+ def self.handle_args: () -> void
7
+
8
+ def self.execute: (tag: String, command: String) -> void
9
+
10
+ def self.create_new_project: (name: String) -> void
11
+
12
+ def self.load_config: () -> void
13
+
14
+ def self.prj_top: () -> void
15
+
16
+ def self.compile: () -> void
17
+
18
+ def self.dpi_c: () -> void
19
+
20
+ def self.elaborate: () -> void
21
+
22
+ def self.run_sim: () -> void
23
+
24
+ def self.run_sv: () -> void
25
+
26
+ def self.gui: () -> void
27
+
28
+ def self.coverage: () -> void
29
+
30
+ def self.cov_report: () -> void
31
+
32
+ def self.create_module: (name: String, type: String) -> void
7
33
 
8
- def self.create_module: (String, String) -> void
34
+ def self.create_pkg: (name: String) -> void
9
35
 
10
- def self.create_pkg: (String) -> void
36
+ def self.create_svfile: (name: String) -> void
11
37
 
12
- def self.create_svfile: (String) -> void
38
+ def self.run: () -> void
13
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rvvm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.2
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-18 00:00:00.000000000 Z
11
+ date: 2024-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rainbow
@@ -69,6 +69,25 @@ files:
69
69
  - README.md
70
70
  - Rakefile
71
71
  - bin/sandbox
72
+ - doc/Crayons.html
73
+ - doc/Rvvm.html
74
+ - doc/Rvvm/Error.html
75
+ - doc/Templates.html
76
+ - doc/Utils.html
77
+ - doc/_index.html
78
+ - doc/class_list.html
79
+ - doc/css/common.css
80
+ - doc/css/full_list.css
81
+ - doc/css/style.css
82
+ - doc/file.README.html
83
+ - doc/file_list.html
84
+ - doc/frames.html
85
+ - doc/index.html
86
+ - doc/js/app.js
87
+ - doc/js/full_list.js
88
+ - doc/js/jquery.js
89
+ - doc/method_list.html
90
+ - doc/top-level-namespace.html
72
91
  - exe/rvvm
73
92
  - lib/rvvm.rb
74
93
  - lib/rvvm/crayons.rb