rvvm 1.1.0 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 420096b77b4d823c6ad6a69509ffe6da56d4a63cf96152cd7d36a5ea41ab063a
4
- data.tar.gz: 28b2c65e701d7f2bdfdb3b7bac2d0d7a9f62db9877d912d18eaa9a8e8d9aac78
3
+ metadata.gz: bdb2b96ce09d030dc59c5bc426673d5208aaba4ce8aa4b097179d62cdaa2dc17
4
+ data.tar.gz: 37576dcfb35c64353383518a8c8ef496e4930a76acd2f3ba3bcfb3dcb45e4a1a
5
5
  SHA512:
6
- metadata.gz: b2cb584479a4fde2453c4d4830403db857d2dc197840dc44dd2b9b932881e111abea00fbad1ba52e7c2e01e4865b66911f12eef5110bdadb695a468df293aeb8
7
- data.tar.gz: eea11a1a5f36f0a20d796dd87e165f7618b022c8062c81b0eb45122644a5291adcbd475973df785008bc3e43be866b3b78830bcb3c666636b17a03b138cde830
6
+ metadata.gz: af7c4f03fd70b8eca2f5da78d0e02d67d777aa04d95b166c07f7fe625ba46ae053141e4e7664d352fc2e02c95c11a30ba3501a87cfcbaa00f8ba7bd51dcee1aa
7
+ data.tar.gz: b0c520fae9157b3d6a20593b0d3ed44baff1c967d734ebe6e1012c58fca1d71c63a218550f64a88aed8232d75bb49cb41b70c58b1967b30fc38a1a73fa5799c7
data/CHANGELOG.md CHANGED
@@ -156,7 +156,6 @@
156
156
  ## TBI:
157
157
 
158
158
  1. Elaboration and simulation custom waveform trace dump file
159
- 2. Project template files regeneration/restoration to default
160
159
  3. Crayon module tests
161
160
  4. RBS definitions
162
161
 
@@ -171,3 +170,26 @@
171
170
  ### Fixed:
172
171
 
173
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
@@ -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
@@ -146,6 +145,12 @@ module Crayons
146
145
  spinner_log("#{out.out}\n")
147
146
  spinner_stop(nil, out.success?)
148
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")
149
154
  end
150
155
 
151
156
  # 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/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.0"
7
7
  end
data/lib/rvvm.rb CHANGED
@@ -75,38 +75,39 @@ 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")
111
112
  args.on("--debug", "Script debug")
112
113
  end.parse!(into: @args)
@@ -150,6 +151,8 @@ module Rvvm
150
151
  puts "UVM test list provided without running in batch mode - option will be ignored..."
151
152
  @args[:testlist] = nil
152
153
  end
154
+
155
+ @config[:elaboration][:customdpilib] = @args[:customdpilib] if @args[:customdpilib]
153
156
  end
154
157
 
155
158
  # Shell command with debug printout.
@@ -164,9 +167,9 @@ module Rvvm
164
167
  # @since 0.8.0
165
168
  def self.execute(tag, command)
166
169
  if @args[:debug]
167
- puts command
168
170
  Crayons.spinner_start(tag)
169
171
  sleep(1)
172
+ Crayons.spinner_log(command)
170
173
  Crayons.spinner_stop(nil, true)
171
174
  else
172
175
  Crayons.command(tag, command)
@@ -329,7 +332,7 @@ module Rvvm
329
332
  cmd_args = @config[:dpi][:args].strip
330
333
  dpilist = @args[:dpilist] || @config[:dpi][:list]
331
334
 
332
- cmd = "sxc -f #{dpilist} #{cmd_args}"
335
+ cmd = "xsc -f #{dpilist} #{cmd_args}"
333
336
  execute("Building DPI-C library...", cmd)
334
337
  end
335
338
 
@@ -340,7 +343,10 @@ module Rvvm
340
343
  # @since 0.8.0
341
344
  def self.elaborate
342
345
  cmd_args = @config[:elaboration][:args]
343
- cmd_args << " -sv_lib dpi" if @args[:dpi] || @args[:dpilib] || @config[:dpi][:dpilib] == 1
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
344
350
  cmd_args << " -debug wave" if @args[:wave]
345
351
  cmd_args.strip!
346
352
  logname = @args[:elablog] || File.join([@config[:project][:logDir], @config[:elaboration][:logDir], @config[:elaboration][:log]])
@@ -494,7 +500,7 @@ module Rvvm
494
500
  if @args[:here]
495
501
  path = "."
496
502
  else
497
- path = File.join([@config[:project][:path], @args[:path] || @templates[:module][:file][:path]])
503
+ path = File.join([@config[:project][:path], @args[:path] || @templates[:package][:file][:path]])
498
504
  end
499
505
 
500
506
  Crayons.spinner_start("Generating SV pkg template...")
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.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-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