rvvm 0.8.0 → 0.9.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: 382560e4ccb96972c0588cb6e5bcfd1bc70e6270349ef8db3e156a86ae247507
4
- data.tar.gz: 9a29c17cdf2496336b01767c9e9de74c451094fd4c8af361fc3f2d1c1a1c17a6
3
+ metadata.gz: 87bb2df32ddefc3b2a60a2ab3a2a16f06ab99e7a7e87b7f4a6b0b5397cc653de
4
+ data.tar.gz: '0205778de7b899092c54f2a0df6552294e50c25e6a213af1d17c47de30659a20'
5
5
  SHA512:
6
- metadata.gz: 380692384df76a75b6099f1d395721162a10c30070fc2f678b07684379debe8e9f15d503ff2a0ff2a64fe116f395808378796313a2bebb806d6c6992d6dcf4f7
7
- data.tar.gz: d15065c6eedba2aaf550d93f31f42e5717691a47355a0820b4366cfeb81034386641b771ca7e30a64e2c931843516d22ff2f8df25e628ecab82ce377d172c7c8
6
+ metadata.gz: 653bfc3de532ba3180787beaa378c143a90c22e1cd36a029b991523d83766c71c97d38a04af3714ee705234b2b2af880218edc050dcd6926d78d54851218fccd
7
+ data.tar.gz: caa9ab4d9ac09af338527577c7dc8885eeaa2569f03994d7e6c896c7ebfcd3a54ef649ff59f048d6e056608ba48f0d0ab266b040ef08cb2f319af0ef9f377120
data/CHANGELOG.md CHANGED
@@ -17,6 +17,7 @@
17
17
  7. UVM test simulation
18
18
 
19
19
  ### TBI:
20
+
20
21
  1. Test list parsing and batch simulation
21
22
  2. Module/itf/pkg/generic sv template generation
22
23
  3. Pure SV/Vlog simulation
@@ -25,3 +26,25 @@
25
26
  6. Unit tests
26
27
  7. CLI log graphic
27
28
 
29
+ ## [0.9.0] - 2024-09016
30
+
31
+ ### Added:
32
+
33
+ 1. Pure SV/Vlog simulation
34
+ 2. Waveform inspection in Vivado GUI
35
+ 3. SV module/itf/pkg and generic SV file template generation
36
+ 4. Functional covevrage report generation
37
+ 5. Coverage report inspection in Xilinx coverage dashboard
38
+ 6. List of required arguments in --help
39
+
40
+ ### Fixes:
41
+
42
+ 1. Compilation, elaboration and simulation log path
43
+ 2. Crash on project config load failure
44
+ 3. Updated help and README
45
+
46
+ ### TBI:
47
+
48
+ 1. Test list parsing and batch simulation
49
+ 2. Unit tests
50
+ 3. CLI log graphics
data/README.md CHANGED
@@ -18,7 +18,50 @@ gem install rvvm
18
18
 
19
19
  ## Usage
20
20
 
21
- TBA
21
+ ### Project management
22
+
23
+ Create a new RVvM project using `-n` or `--new`.
24
+
25
+ eg.:
26
+ ```
27
+ rvvm -n best_rtl_project
28
+ ```
29
+
30
+ Whitespaces in project name and or generated templates are not allowed.
31
+
32
+ To manage an RVvM project use the `rvvm` script from inside an RVvM project root or its config directory.
33
+
34
+ #### Project structure
35
+
36
+ ```
37
+ RvvM_project
38
+ ├── design # SV design sources
39
+ │   ├── itf
40
+ │   ├── pkg
41
+ │   └── src
42
+ ├── rvvm # RVvM project config and output directory
43
+ │   ├── rvvm_project_compile_list.f
44
+ │   ├── dpi_compile_list.f
45
+ │   ├── logs # comp, dpi, elab, sim log dir
46
+ │   │   ├── comp
47
+ │   │   ├── dpi
48
+ │   │   ├── elab
49
+ │   │   └── sim
50
+ │   ├── rvvmconf.json # RVvM project config file
51
+ │   └── wfcfg.tcl
52
+ └── verif # SV verification sources
53
+ ├── env
54
+ │   ├── agents
55
+ │   └── top
56
+ ├── tb
57
+ │   └── src # default UVM testbench top module
58
+ │   └── rvvm_project_tb_top.sv
59
+ └── test
60
+ ├── seq
61
+ └── src
62
+ ```
63
+
64
+ To get full `rvvm` usage docs use `-h` or `--help` option.
22
65
 
23
66
  ## Development
24
67
 
@@ -28,7 +71,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
28
71
 
29
72
  ## Contributing
30
73
 
31
- Bug reports and pull requests are welcome on GitHub at https://gitlab.com/such-hdl-much-wow/rvvm. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://gitlab.com/such-hdl-much-wow/rvm/-/blob/master/CODE_OF_CONDUCT.md?ref_type=heads).
74
+ Bug reports and pull requests are welcome on GitHub at https://gitlab.com/such-hdl-much-wow/rvvm. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://gitlab.com/such-hdl-much-wow/rvvm/-/blob/master/CODE_OF_CONDUCT.md?ref_type=heads).
32
75
 
33
76
  ## License
34
77
 
@@ -36,5 +79,5 @@ The gem is available as open source under the terms of the [MIT License](https:/
36
79
 
37
80
  ## Code of Conduct
38
81
 
39
- Everyone interacting in the Rvm project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://gitlab.com/such-hdl-much-wow/rvm/-/blob/master/CODE_OF_CONDUCT.md?ref_type=heads).
82
+ Everyone interacting in the RVvM project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://gitlab.com/such-hdl-much-wow/rvvm/-/blob/master/CODE_OF_CONDUCT.md?ref_type=heads).
40
83
 
data/bin/console ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "rvvm"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ require "irb"
11
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/lib/rvvm/utils.rb CHANGED
@@ -1,4 +1,4 @@
1
- # # frozen_string_literal: true
1
+ # frozen_string_literal: true
2
2
 
3
3
  module Utils
4
4
  def self.interpret(string, hash)
data/lib/rvvm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rvvm
4
- VERSION = "0.8.0"
4
+ VERSION = "0.9.0"
5
5
  end
data/lib/rvvm.rb CHANGED
@@ -17,6 +17,7 @@ module Rvvm
17
17
 
18
18
  @args = {}
19
19
  @required_args = %i[
20
+ version
20
21
  new
21
22
  module
22
23
  pkg
@@ -39,14 +40,25 @@ module Rvvm
39
40
  puts "\tRVvM is a Ruby based tool to manage, compile, elaborate and simulate SystemVerilog and UVM based projects"
40
41
  puts "\tusing Xilinx Vivado xvlog, xelab, xrun and xsc.\n\n"
41
42
  puts args
43
+
44
+ @current_time = Time.now
45
+ @formatted_time = @current_time.strftime("%Y-%m-%d %H:%M:%S")
46
+
47
+
48
+ req_args = String.new
49
+ @required_args.each do |arg|
50
+ req_args << "--#{arg} "
51
+ end
52
+ puts "\nRequired args (at least one): #{req_args}\n\n"
42
53
  # puts "\nRequired args (at least one):"
43
54
  # @required_args.each do |arg|
44
55
  # puts "\t--#{arg}"
45
56
  # end
46
- exit
57
+ exit(0)
47
58
  end
48
59
  args.on("-v", "--version", "Displays RVvM gem version") do
49
- puts "RVvM version: #{VERSION}"
60
+ puts "\nRVvM version: #{VERSION}\n\n"
61
+ exit(0)
50
62
  end
51
63
 
52
64
  args.on("-n", "--new NAME", "Creates a new project wit the prowided name under pwd")
@@ -54,12 +66,12 @@ module Rvvm
54
66
  args.on("--pkg NAME", "Creates a SystemVerilog package template (default path: <prj dir>/design/pkg)")
55
67
  args.on("--itf NAME", "Creates a SystemVerilog interface template (default path: <prj dir>/design/itf)")
56
68
  args.on("--svfile NAME", "Creates a generic SystemVerilog file template (default path: <prj dir>/design/src)")
57
- args.on("--here", "Speciies pwd as a path when creating a file template")
69
+ # args.on("--here", "Speciies pwd as a path when creating a file template")
58
70
  args.on("--path PATH", "Specifies a path relative to <prj dir> when creating a file template")
59
71
  args.on("-c", "--comp", "Compile SystemVerilog sources")
60
72
  args.on("-e", "--elab", "Elaborates project")
61
73
  args.on("-r", "--run", "Runs UVM simulation")
62
- args.on("-a", "--all", "Runs --comp, (--dpi), --elab, --run")
74
+ args.on("-a", "--all", "Runs --comp, --dpi if --dpilib or configured in rvvmconf, --elab, --run")
63
75
  args.on("--runsv", "Runs pure SystemVerilog/Verilog simulation (Ignores UVM related arguments and config options)")
64
76
  args.on("-d", "--dpi", "Compiles C/C++ sources to a shared lib to link into an elaborated snaphost using DPI-C")
65
77
  args.on("-u", "--gui", "Opens a dumped waveform in Xilinx Vivado GUI")
@@ -208,7 +220,7 @@ module Rvvm
208
220
 
209
221
  def self.compile
210
222
  cmd_args = @config[:compilation][:args]
211
- logname = File.join(@config[:compilation][:logDir], @args[:complog] || @config[:compilation][:log])
223
+ logname = @args[:complog] || File.join([@config[:project][:logDir], @config[:compilation][:logDir], @config[:compilation][:log]])
212
224
  complist = @args[:compilelist] || @config[:compilation][:list]
213
225
 
214
226
  puts "\nRVvM: Compiling HDL sources..\n"
@@ -231,7 +243,7 @@ module Rvvm
231
243
  cmd_args = @config[:elaboration][:args]
232
244
  cmd_args << " -sv_lib dpi" if @args[:dpi] || @args[:dpilib] || @config[:dpi][:dpilib] == 1
233
245
  cmd_args << " -debug wave" if @args[:wave]
234
- logname = File.join(@config[:elaboration][:logDir], @args[:elablog] || @config[:elaboration][:log])
246
+ logname = @args[:elablog] || File.join([@config[:project][:logDir], @config[:elaboration][:logDir], @config[:elaboration][:log]])
235
247
  tb_top = @args[:tbtop] || @config[:elaboration][:tbTop]
236
248
  tb = @args[:tb] || @config[:elaboration][:tb]
237
249
  timescale = @args[:timescale] || @config[:elaboration][:timescale]
@@ -263,7 +275,7 @@ module Rvvm
263
275
  testlist.each_with_index do |simtest, i|
264
276
  puts "RVvM: Running test #{i + 1}/#{testlist.size}: #{simtest}"
265
277
 
266
- logname = File.join(@config[:simulation][:logDir], @config[:simulation][:log])
278
+ logname = File.join([@config[:project][:logDir], @config[:simulation][:logDir], @config[:simulation][:log]])
267
279
  logname = Utils.interpret(logname, { testname: simtest })
268
280
 
269
281
  verb = "UVM_#{@args[:verb] || @config[:simulation][:verbosity]}"
@@ -273,6 +285,82 @@ module Rvvm
273
285
  end
274
286
  end
275
287
 
288
+ def self.run_sv
289
+ cmd_args = @config[:simulation][:args]
290
+ tb = @args[:simtb] || @args[:tb] || @config[:elaboration][:tb]
291
+
292
+ puts "\nRVvM: Running pure SV/V simulation..."
293
+ logname = @args[:simlog] || File.join([@config[:project][:logDir], @config[:simulation][:logDir], "svsim.log"])
294
+
295
+ cmd = "xsim #{tb} -log #{logname} #{cmd_args}"
296
+ execute(cmd)
297
+ end
298
+
299
+ def self.gui
300
+ dump = @args[:wavefile] || "#{@config[:elaboration][:tb]}.wdb"
301
+
302
+ cmd = "xsim --gui #{dump}"
303
+ execute(cmd)
304
+ end
305
+
306
+ def self.coverage
307
+ cmd = "xcrg -report_format html -dir xsim.covdb"
308
+ execute(cmd)
309
+ end
310
+
311
+ def self.cov_report
312
+ Dir.chdir("xcrg_func_cov_report")
313
+ execute("./dashboard.html")
314
+ end
315
+
316
+ def self.create_module(type, name)
317
+ conf = @templates[:module][:conf]
318
+ conf[:module] = name
319
+ conf[:date] = @formatted_time
320
+ conf[:prjname] = @config[:project][:name]
321
+ conf[:company] = @config[:project][:company]
322
+
323
+ conf[:type] = type
324
+ @templates[:module][:file][:path] = "design/itf" if type == "itf"
325
+ path = File.join([@config[:project][:path], @args[:path] || @templates[:module][:file][:path]])
326
+ conf[:username] = Utils.git_userame || " "
327
+
328
+ Utils.gen_template(@templates[:module], "#{name}.sv", conf, path)
329
+
330
+ exit(0)
331
+ end
332
+
333
+ def self.create_pkg(name)
334
+ conf = @templates[:package][:conf]
335
+ conf[:package] = name
336
+ conf[:PACKAGE] = name.upcase
337
+ conf[:date] = @formatted_time
338
+ conf[:prjname] = @config[:project][:name]
339
+ conf[:company] = @config[:project][:company]
340
+ conf[:username] = Utils.git_userame || " "
341
+
342
+ path = File.join([@config[:project][:path], @args[:path] || @templates[:package][:file][:path]])
343
+
344
+ Utils.gen_template(@templates[:package], "#{name}.sv", conf, path)
345
+
346
+ exit(0)
347
+ end
348
+
349
+ def self.create_svfile(name)
350
+ conf = @templates[:svfile][:conf]
351
+ conf[:NAME] = name.upcase
352
+ conf[:date] = @formatted_time
353
+ conf[:prjname] = @config[:project][:name]
354
+ conf[:company] = @config[:project][:company]
355
+ conf[:username] = Utils.git_userame || ""
356
+
357
+ path = File.join([@config[:project][:path], @args[:path] || @templates[:package][:file][:path]])
358
+
359
+ Utils.gen_template(@templates[:svfile], "#{name}.sv", conf, path)
360
+
361
+ exit(0)
362
+ end
363
+
276
364
  def self.run
277
365
  create_new_project(@args[:new]) if @args[:new]
278
366
 
@@ -280,12 +368,22 @@ module Rvvm
280
368
  load_config
281
369
  handle_args
282
370
 
371
+ create_module(@args[:module], nil) if @args[:module]
372
+ create_module(@args[:itf, "itf"]) if @args[:itf]
373
+ create_pkg(@args[:pkg]) if @args[:pkg]
374
+ create_svfile(@args[:svfile]) if @args[:svfile]
375
+
283
376
  prj_top
284
377
 
285
378
  compile if @args[:comp]
286
379
  dpi_c if @args[:dpi]
287
380
  elaborate if @args[:elab]
288
381
  run_sim if @args[:run]
382
+ run_sv if @args[:runsv]
383
+ gui if @args[:gui]
384
+ coverage if @args[:gencov]
385
+ cov_report if @args[:covreport]
386
+
387
+ exit(0)
289
388
  end
290
389
  end
291
-
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.8.0
4
+ version: 0.9.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-15 00:00:00.000000000 Z
11
+ date: 2024-09-16 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,
@@ -25,6 +25,8 @@ files:
25
25
  - LICENSE.txt
26
26
  - README.md
27
27
  - Rakefile
28
+ - bin/console
29
+ - bin/setup
28
30
  - lib/rvvm.rb
29
31
  - lib/rvvm/templates.rb
30
32
  - lib/rvvm/utils.rb