HDLRuby 3.3.4 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module HDLRuby
2
- VERSION = "3.3.4"
2
+ VERSION = "3.4.0"
3
3
  end
data/tuto/tutorial_sw.md CHANGED
@@ -10,7 +10,7 @@ In this tutorial, you will learn the basics about the description of digital cir
10
10
 
11
11
  4. [How to add parallelism to your algorithms.](#4-how-to-add-parallelism-to-your-algorithms)
12
12
 
13
- Then, the following section will introduce advanced concepts about hardware design and HDLruby:
13
+ Then, the following section will introduce advanced concepts about hardware design and HDLRuby:
14
14
 
15
15
  5. [Toward lower level hardware design: the processes.](#5-toward-lower-level-hardware-design-the-processes)
16
16
 
@@ -20,6 +20,8 @@ Then, the following section will introduce advanced concepts about hardware desi
20
20
 
21
21
  8. [How to interact with the simulator.](#8-how-to-interact-with-the-simulator)
22
22
 
23
+ 9. [What about using Verilog HDL instead?](#9-what-about-using-Verilog-hdl-instead)
24
+
23
25
  Within these topics, you will also have an explanation of how the following high-level concepts can be used in HDLRuby:
24
26
 
25
27
  * Object-oriented programming
@@ -156,6 +158,20 @@ __Note__: VHDL generation is also possible using the following command.
156
158
  hdrcc --vhdl <input file> <output directory>
157
159
  ```
158
160
 
161
+ While being able to convert HDLRuby to Verilog HDL may usually be enough to design a cricuits, it may also sometimes be useful to be able to do the reverse: converting a Verilog HDL file to HDLRuby.
162
+ To do this, you can use the following command:
163
+
164
+ ```bash
165
+ v2hdr <input Verilog HDL file> <output HDLRuby file>
166
+ ```
167
+
168
+ For example, assuming that you have a Verilog ddHDL named 'adder.v' describing and adder circuit, you can convert it to HDLRuby as follows:
169
+
170
+ ```bash
171
+ v2hdr adder.v adder.rb
172
+ ```
173
+
174
+
159
175
  And that's it! For details about all the actions that can be performed, how to write an input file, and what kind of output can be produced, let us see the remaining of the tutorial.
160
176
 
161
177
 
@@ -3776,7 +3792,62 @@ A more complete example can be found among the HDLRuby samples: `with_board.rb`,
3776
3792
  </p>
3777
3793
 
3778
3794
 
3779
- ## 9. What next?
3795
+ ## 9. What about using Verilog HDL instead?
3796
+
3797
+ I won’t claim how good HDLRuby is, but it’s clear that Verilog HDL (/ SystemVerilog) and VHDL are currently the leading languages in hardware design, and it would be unrealistic to expect this to change anytime soon. This means that for HDLRuby to offer any real benefit, the framework must be able to support one or both of these languages in some way. This is no easy task, but as a starting point, we now provide a tool for converting Verilog HDL files into HDLRuby files.
3798
+ For that please use the following command:
3799
+
3800
+ ```bash
3801
+ v2hdr <input Verilog HDL file> <output HDLRuby file>
3802
+ ```
3803
+
3804
+ For example, assuming that you have a Verilog ddHDL named 'adder.v' describing and adder circuit, you can convert it to HDLRuby as follows:
3805
+
3806
+ ```bash
3807
+ v2hdr adder.v adder.v.rb
3808
+ ```
3809
+
3810
+
3811
+ Another possibility is to directly load the Verilog HDL file from a HDLRuby description using the command `require_verilog`.
3812
+ For example, assuming `adder.v` contains the following code:
3813
+
3814
+ ```verilog
3815
+ module adder(x,y,z);
3816
+ input[7:0] x,y;
3817
+ output[7:0] z;
3818
+
3819
+ assign z = x + y;
3820
+ endmodule
3821
+ ```
3822
+
3823
+ It can be loaded the be instantiated like any other module in HDLRuby as follows:
3824
+
3825
+ ```ruby
3826
+ require_verilog "adder.v"
3827
+
3828
+ system :my_IC do
3829
+ [8].inner :a, :b, :c
3830
+
3831
+ adder(:my_adder).(a,b,c)
3832
+
3833
+ ...
3834
+ end
3835
+ ```
3836
+
3837
+
3838
+ __Notes__:
3839
+
3840
+ * Verilog HDL accepts signal and module names in any letter case, while HDLRuby reserves identifiers starting with a capital letter for constants. To avoid conflicts, Verilog HDL names that begin with a capital letter are prefixed with an underscore (`_`) in HDLRuby. For example, if the Verilog HDL module name in the previous example were `ADDER`, it would be renamed to `_ADDER` in HDLRuby. Instantiating such a module would be done as follows:
3841
+
3842
+ ```ruby
3843
+ _ADDER(:my_add).(a,b,c)
3844
+ ```
3845
+
3846
+ * With the current version of HDLRuby, the Verilog HDL files are first converted to HDLRuby before being loaded using the standalone `v2hdr` tool.
3847
+
3848
+
3849
+
3850
+ ## 10. What next?
3780
3851
 
3781
3852
  There are still many aspects of HDLRuby that have not been addressed in this tutorial. For example, finite state machines (FSM) and decoders are crucial hardware components that you should learn about, and HDLRuby provides specific constructs for easier design. So from now on, please consult the main documentation of HDLRuby, and have a look at the code samples provided in the HDLRuby distribution. They can be copied to your working directory using the following command:
3782
3853
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: HDLRuby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.4
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lovic Gauthier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-11 00:00:00.000000000 Z
11
+ date: 2024-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -60,6 +60,7 @@ email:
60
60
  - lovic@ariake-nct.ac.jp
61
61
  executables:
62
62
  - hdrcc
63
+ - v2hdr
63
64
  extensions:
64
65
  - ext/hruby_sim/extconf.rb
65
66
  extra_rdoc_files:
@@ -77,6 +78,7 @@ files:
77
78
  - bin/console
78
79
  - bin/setup
79
80
  - exe/hdrcc
81
+ - exe/v2hdr
80
82
  - ext/hruby_sim/Makefile_csim
81
83
  - ext/hruby_sim/extconf.rb
82
84
  - ext/hruby_sim/hruby_rcsim_build.c
@@ -102,6 +104,7 @@ files:
102
104
  - lib/HDLRuby/hdr_samples/WithMultiChannelExpVerilog/with_multi_channels_qu_222.v
103
105
  - lib/HDLRuby/hdr_samples/WithMultiChannelExpVerilog/with_multi_channels_rg_23.v
104
106
  - lib/HDLRuby/hdr_samples/adder.rb
107
+ - lib/HDLRuby/hdr_samples/adder8.v
105
108
  - lib/HDLRuby/hdr_samples/adder_assign_error.rb
106
109
  - lib/HDLRuby/hdr_samples/adder_bench.rb
107
110
  - lib/HDLRuby/hdr_samples/adder_gen.rb
@@ -185,6 +188,7 @@ files:
185
188
  - lib/HDLRuby/hdr_samples/system_open.rb
186
189
  - lib/HDLRuby/hdr_samples/tuple.rb
187
190
  - lib/HDLRuby/hdr_samples/type_minmax_bench.rb
191
+ - lib/HDLRuby/hdr_samples/verilog_parser_bench.rb
188
192
  - lib/HDLRuby/hdr_samples/with_board.rb
189
193
  - lib/HDLRuby/hdr_samples/with_board_sequencer.rb
190
194
  - lib/HDLRuby/hdr_samples/with_bram.rb
@@ -240,6 +244,7 @@ files:
240
244
  - lib/HDLRuby/hdr_samples/with_to_a.rb
241
245
  - lib/HDLRuby/hdr_samples/with_to_array.rb
242
246
  - lib/HDLRuby/hdr_samples/with_values.rb
247
+ - lib/HDLRuby/hdr_samples/with_verilog.rb
243
248
  - lib/HDLRuby/hdrcc.rb
244
249
  - lib/HDLRuby/hdrlib.rb
245
250
  - lib/HDLRuby/high_samples/_adder_fault.rb
@@ -415,10 +420,13 @@ files:
415
420
  - lib/HDLRuby/test_hruby_high_low.rb
416
421
  - lib/HDLRuby/test_hruby_low.rb
417
422
  - lib/HDLRuby/ui/hruby_board.rb
423
+ - lib/HDLRuby/v2hdr.rb
418
424
  - lib/HDLRuby/v_samples/adder.v
419
425
  - lib/HDLRuby/v_samples/dff.v
420
426
  - lib/HDLRuby/v_samples/ram.v
421
427
  - lib/HDLRuby/v_samples/rom.v
428
+ - lib/HDLRuby/verilog_hruby.rb
429
+ - lib/HDLRuby/verilog_parser.rb
422
430
  - lib/HDLRuby/version.rb
423
431
  - lib/c/Rakefile
424
432
  - lib/c/cHDL.h
@@ -476,7 +484,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
476
484
  - !ruby/object:Gem::Version
477
485
  version: '0'
478
486
  requirements: []
479
- rubygems_version: 3.5.17
487
+ rubygems_version: 3.5.18
480
488
  signing_key:
481
489
  specification_version: 4
482
490
  summary: HDLRuby is a library for describing and simulating digital electronic systems.