rvvm 0.9.3 → 0.9.4

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: 01a0976fb744924367077dfda5f613dbf6912032fbc61896c41aa647f606863e
4
- data.tar.gz: 188c360b6cf73c1c4478c1cbb8d1f665daf6523a97b5c286a63ea0b3ab056fc2
3
+ metadata.gz: 23fecb22e1dceb684c808440d5d88e14e288e3001287a50435acfa57baedad5c
4
+ data.tar.gz: 88b6836f137f99529ba872045ab934cc618fcf71420e674117a0856b225dce63
5
5
  SHA512:
6
- metadata.gz: ea4aaab4ac74410dcded24b69db2953ee51e2811539fec0e08891097231f4551ace3cb25fd7a68fe6a8afceeeddce9bed4ba277edddf453036d88ddea2e986ee
7
- data.tar.gz: 67315687f47c4648af7db0b66530bfb3dae52affd5ee1ea97b7d1b16099ba1409e1fc4df805b4639dedebffd7afe43fdec91166c33f23c778928ca8585e49400
6
+ metadata.gz: 3197267e3a5f1f713167837ed16ff1410d7aea0429e031c60a78cd3f85b4aea88b200c0bcbe5bd2174de75182119fff227d08bc79eaff720c73654d2f095e6ae
7
+ data.tar.gz: 36f3c3f230eb785626b16f8b6200bd0277fe7635eec3982f6ef1fe2bf0ee7346fa531b7ee740cd987f8428c5cda7c2d73bc25370b0ef19ea014797b1fca4cdd9
data/CHANGELOG.md CHANGED
@@ -90,3 +90,27 @@
90
90
  2. Project config load failure handling/error message when parsing invalid json
91
91
  3. Template file generation in pwd
92
92
  4. Elaboration and simulation custom waveform trace dump file
93
+ 5. Project template files regeneration/restoration to default
94
+ 6. Rescue on script crash due to creating a project dir that already exists
95
+
96
+ ## [0.9.4] - 2024-09-17
97
+
98
+ ### Added:
99
+
100
+ 1. More tests
101
+ 2. Cleaned up code documentation
102
+ 3. JSON::ParserError handling when loading an invalid config json
103
+ 4. Promt to overwrite an existing directory while creating project
104
+ 5. Project creation error handling
105
+
106
+ ### Fixed:
107
+
108
+ 1. Script crash due to loading invalid json config
109
+ 2. Script crash due to creating a project dir that already exists
110
+
111
+ ### TBI:
112
+
113
+ 1. CLI log graphic
114
+ 2. Template file generation in pwd
115
+ 3. Elaboration and simulation custom waveform trace dump file
116
+ 4. Project template files regeneration/restoration to default
data/bin/sandbox CHANGED
@@ -2,3 +2,25 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  # just a sandbox to play with ruby during development
5
+
6
+ require "json"
7
+
8
+ json = %(
9
+ {
10
+ "sizmaj": "bit"
11
+ "akafuka" : {
12
+ "siz": 1,
13
+ "maj": 2,
14
+ "bit": 3
15
+ }
16
+ }
17
+ )
18
+
19
+ def json_parse(data)
20
+ parsed = JSON.parse(data)
21
+ puts parsed
22
+ rescue JSON::ParserError => e
23
+ puts "Invalid JSON!\nError #{e.message}"
24
+ end
25
+
26
+ json_parse(json)
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 = "0.9.3"
6
+ VERSION = "0.9.4"
7
7
  end
data/lib/rvvm.rb CHANGED
@@ -149,7 +149,7 @@ module Rvvm
149
149
 
150
150
  # Shell command with debug printout.
151
151
  #
152
- # If --debug arg provided instead of calling `system`
152
+ # If --debug arg provided instead of calling `system`
153
153
  # prints the input command.
154
154
  #
155
155
  # @param command [String] command to be called/printed
@@ -175,6 +175,18 @@ module Rvvm
175
175
  def self.create_new_project(name)
176
176
  puts "\nRVvM: Generating new project: #{name} ...\n"
177
177
 
178
+ if File.exist?(name)
179
+ print " Directory #{name} already exists. Do you want to overwrite it? [y/n] "
180
+ input = gets.chomp
181
+ puts " "
182
+
183
+ if input == "y"
184
+ FileUtils.rm_rf(name)
185
+ else
186
+ exit(0)
187
+ end
188
+ end
189
+
178
190
  FileUtils.mkdir(name)
179
191
  Dir.chdir(name)
180
192
 
@@ -232,6 +244,9 @@ module Rvvm
232
244
  puts "\nRVvM: New project generated. ^^\n\n"
233
245
 
234
246
  exit(0)
247
+ rescue StandardError => e
248
+ puts "RVvM: Failed to create project...\n #{e.message}\n"
249
+ exit(1)
235
250
  end
236
251
 
237
252
  # Loads and parses rvvmconf.json config file from
@@ -256,10 +271,11 @@ module Rvvm
256
271
  @config = @config.transform_values do |v|
257
272
  v.is_a?(Hash) ? v.transform_keys(&:to_sym) : v
258
273
  end.transform_keys(&:to_sym)
259
-
260
- puts @config[:simulation][:testlist]
274
+ rescue JSON::ParserError => e
275
+ puts " Invalid config json!\n\n#{e.message}"
276
+ exit(1)
261
277
  end
262
-
278
+
263
279
  # Navigates to project top (rvvm directory of the RVvM project).
264
280
  #
265
281
  # @return [void]
@@ -268,7 +284,7 @@ module Rvvm
268
284
  def self.prj_top
269
285
  Dir.chdir(@config_path)
270
286
  end
271
-
287
+
272
288
  # Compiles project SystemVerilog sources using xvlog.
273
289
  #
274
290
  # @return [void]
@@ -284,7 +300,7 @@ module Rvvm
284
300
  cmd = "xvlog -sv -f #{complist} -log #{logname} #{cmd_args}"
285
301
  execute(cmd)
286
302
  end
287
-
303
+
288
304
  # Compiles C/C++ sources into a shared library to use during
289
305
  # elaboration and simulation using DPI-C.
290
306
  #
@@ -300,7 +316,7 @@ module Rvvm
300
316
  cmd = "sxc -f #{dpilist} #{cmd_args}"
301
317
  execute(cmd)
302
318
  end
303
-
319
+
304
320
  # Elaborates project into a testbench snapshot using xelab.
305
321
  #
306
322
  # @return [void]
@@ -322,7 +338,7 @@ module Rvvm
322
338
  cmd = "xelab #{tb_top} -relax -s #{tb} -timescale #{timescale} -log #{logname} #{cmd_args}"
323
339
  execute(cmd)
324
340
  end
325
-
341
+
326
342
  # Runs UVM test simulation on an elaborated testbench snapshot using xrun.
327
343
  #
328
344
  # @return [void]
@@ -386,7 +402,7 @@ module Rvvm
386
402
  cmd = "xsim --gui #{dump}"
387
403
  execute(cmd)
388
404
  end
389
-
405
+
390
406
  # Generates UVM test functional coverage report using xcrg.
391
407
  #
392
408
  # @return [void]
@@ -396,7 +412,7 @@ module Rvvm
396
412
  cmd = "xcrg -report_format html -dir xsim.covdb"
397
413
  execute(cmd)
398
414
  end
399
-
415
+
400
416
  # Opens last generated functional coverage report in a HTML dashboard.
401
417
  #
402
418
  # @return [void]
@@ -406,7 +422,7 @@ module Rvvm
406
422
  Dir.chdir("xcrg_func_cov_report")
407
423
  execute("./dashboard.html")
408
424
  end
409
-
425
+
410
426
  # Generates a SystemVerilog module/interface template.
411
427
  #
412
428
  # @param type [String] specifies modudle/itf
@@ -431,7 +447,7 @@ module Rvvm
431
447
 
432
448
  exit(0)
433
449
  end
434
-
450
+
435
451
  # Generates a SystemVerilog package template.
436
452
  #
437
453
  # @param name [String] specifies package name
@@ -454,7 +470,7 @@ module Rvvm
454
470
 
455
471
  exit(0)
456
472
  end
457
-
473
+
458
474
  # Generates a generic SystemVerilog template file.
459
475
  #
460
476
  # @param name [String] specifies template name
@@ -476,7 +492,7 @@ module Rvvm
476
492
 
477
493
  exit(0)
478
494
  end
479
-
495
+
480
496
  # Runs rvvm calling its methods based on provided script args.
481
497
  #
482
498
  # @return [void]
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: 0.9.3
4
+ version: 0.9.4
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-16 00:00:00.000000000 Z
11
+ date: 2024-09-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: RVvM is a Ruby based meta tool to manage/compile/elaborate and run simulations
14
14
  on SystemVerilog and UVM based projects using Xilinx Vivado xvlog, xelab, xrun,