HDLRuby 2.11.12 → 3.1.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.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/README.html +3274 -0
  3. data/README.md +660 -128
  4. data/ext/hruby_sim/hruby_sim_calc.c +2 -0
  5. data/lib/HDLRuby/backend/hruby_allocator.rb +2 -2
  6. data/lib/HDLRuby/backend/hruby_c_allocator.rb +7 -7
  7. data/lib/HDLRuby/hdr_samples/constant_in_function.rb +2 -1
  8. data/lib/HDLRuby/hdr_samples/mei8_bench.rb +1 -1
  9. data/lib/HDLRuby/hdr_samples/with_bram.rb +3 -3
  10. data/lib/HDLRuby/hdr_samples/with_bram_frame_stack.rb +105 -0
  11. data/lib/HDLRuby/hdr_samples/with_bram_stack.rb +69 -0
  12. data/lib/HDLRuby/hdr_samples/with_ref_expr.rb +30 -0
  13. data/lib/HDLRuby/hdr_samples/with_sequencer.rb +185 -0
  14. data/lib/HDLRuby/hdr_samples/with_sequencer_deep.rb +91 -0
  15. data/lib/HDLRuby/hdr_samples/with_sequencer_enumerable.rb +439 -0
  16. data/lib/HDLRuby/hdr_samples/with_sequencer_enumerator.rb +89 -0
  17. data/lib/HDLRuby/hdr_samples/with_sequencer_func.rb +63 -0
  18. data/lib/HDLRuby/hdr_samples/with_sequencer_sync.rb +120 -0
  19. data/lib/HDLRuby/hdrcc.rb +16 -3
  20. data/lib/HDLRuby/hdrlib.rb +1 -1
  21. data/lib/HDLRuby/hruby_db.rb +2 -2
  22. data/lib/HDLRuby/hruby_high.rb +61 -25
  23. data/lib/HDLRuby/hruby_high_fullname.rb +3 -1
  24. data/lib/HDLRuby/hruby_low.rb +2 -2
  25. data/lib/HDLRuby/hruby_low2c.rb +58 -43
  26. data/lib/HDLRuby/hruby_low2hdr.rb +66 -40
  27. data/lib/HDLRuby/hruby_low2high.rb +86 -44
  28. data/lib/HDLRuby/hruby_low2seq.rb +26 -18
  29. data/lib/HDLRuby/hruby_low2sym.rb +14 -13
  30. data/lib/HDLRuby/hruby_low2vhd.rb +78 -43
  31. data/lib/HDLRuby/hruby_low_bool2select.rb +61 -46
  32. data/lib/HDLRuby/hruby_low_casts_without_expression.rb +56 -44
  33. data/lib/HDLRuby/hruby_low_cleanup.rb +18 -16
  34. data/lib/HDLRuby/hruby_low_fix_types.rb +64 -32
  35. data/lib/HDLRuby/hruby_low_mutable.rb +53 -118
  36. data/lib/HDLRuby/hruby_low_resolve.rb +26 -31
  37. data/lib/HDLRuby/hruby_low_with_bool.rb +33 -16
  38. data/lib/HDLRuby/hruby_low_with_port.rb +3 -3
  39. data/lib/HDLRuby/hruby_low_with_var.rb +23 -9
  40. data/lib/HDLRuby/hruby_low_without_concat.rb +19 -13
  41. data/lib/HDLRuby/hruby_low_without_namespace.rb +47 -32
  42. data/lib/HDLRuby/hruby_low_without_parinseq.rb +18 -12
  43. data/lib/HDLRuby/hruby_low_without_select.rb +36 -23
  44. data/lib/HDLRuby/hruby_low_without_subsignals.rb +79 -39
  45. data/lib/HDLRuby/hruby_rcsim.rb +79 -64
  46. data/lib/HDLRuby/hruby_rsim.rb +64 -15
  47. data/lib/HDLRuby/hruby_rsim_mute.rb +2 -3
  48. data/lib/HDLRuby/hruby_rsim_vcd.rb +28 -25
  49. data/lib/HDLRuby/hruby_types.rb +5 -5
  50. data/lib/HDLRuby/hruby_values.rb +19 -8
  51. data/lib/HDLRuby/hruby_verilog.rb +191 -65
  52. data/lib/HDLRuby/hruby_verilog_name.rb +49 -42
  53. data/lib/HDLRuby/soft/stacks.rb +219 -0
  54. data/lib/HDLRuby/std/bram.rb +9 -5
  55. data/lib/HDLRuby/std/clocks.rb +1 -1
  56. data/lib/HDLRuby/std/fsm.rb +39 -10
  57. data/lib/HDLRuby/std/sequencer.rb +2085 -0
  58. data/lib/HDLRuby/std/sequencer_func.rb +533 -0
  59. data/lib/HDLRuby/std/sequencer_sync.rb +400 -0
  60. data/lib/HDLRuby/std/std.rb +13 -0
  61. data/lib/HDLRuby/version.rb +1 -1
  62. data/tuto/adder_sat_flags_vcd.png +0 -0
  63. data/tuto/addsub_vcd.png +0 -0
  64. data/tuto/alu_vcd.png +0 -0
  65. data/tuto/bit_pong_vcd.png +0 -0
  66. data/tuto/checksum_vcd.png +0 -0
  67. data/tuto/circuit_hdr.odg +0 -0
  68. data/tuto/circuit_hdr.png +0 -0
  69. data/tuto/circuit_hie.odg +0 -0
  70. data/tuto/circuit_hie.png +0 -0
  71. data/tuto/circuit_view.odg +0 -0
  72. data/tuto/circuit_view.png +0 -0
  73. data/tuto/clock_counter_vcd.png +0 -0
  74. data/tuto/counter_ext_vcd.png +0 -0
  75. data/tuto/fact_vcd.png +0 -0
  76. data/tuto/hw_flow.odg +0 -0
  77. data/tuto/hw_flow.png +0 -0
  78. data/tuto/maxxer_vcd.png +0 -0
  79. data/tuto/pingpong0_vcd.png +0 -0
  80. data/tuto/pingpong1_vcd.png +0 -0
  81. data/tuto/pingpong2_vcd.png +0 -0
  82. data/tuto/ram_vcd.png +0 -0
  83. data/tuto/serializer_vcd.png +0 -0
  84. data/tuto/sw_flow.odg +0 -0
  85. data/tuto/sw_flow.png +0 -0
  86. data/tuto/the_counter_vcd.png +0 -0
  87. data/tuto/tutorial_sw.html +2359 -0
  88. data/tuto/tutorial_sw.md +2890 -0
  89. data/tuto/tutorial_sw.pdf +0 -0
  90. data/tuto/tutorial_sw_jp.md +417 -0
  91. metadata +46 -2
@@ -165,8 +165,8 @@ module HDLRuby::Low
165
165
  end
166
166
 
167
167
 
168
- ## Extends the SystemT class with generation of C text.
169
168
  class SystemT
169
+ ## Extends the SystemT class with generation of C text.
170
170
 
171
171
  # Generates the text of the equivalent HDLRuby code.
172
172
  # +level+ is the hierachical level of the object and +hnames+
@@ -402,8 +402,8 @@ module HDLRuby::Low
402
402
  end
403
403
 
404
404
 
405
- ## Extends the Scope class with generation of C text.
406
405
  class Scope
406
+ ## Extends the Scope class with generation of C text.
407
407
 
408
408
  # Generates the C text of the equivalent HDLRuby code.
409
409
  # +level+ is the hierachical level of the object.
@@ -567,8 +567,8 @@ module HDLRuby::Low
567
567
  end
568
568
 
569
569
 
570
- ## Extends the Type class with generation of C text.
571
570
  class Type
571
+ ## Extends the Type class with generation of C text.
572
572
 
573
573
  # Generates the C text of the equivalent HDLRuby code.
574
574
  # +level+ is the hierachical level of the object.
@@ -587,8 +587,9 @@ module HDLRuby::Low
587
587
  end
588
588
  end
589
589
 
590
- ## Extends the TypeDef class with generation of C text.
590
+
591
591
  class TypeDef
592
+ ## Extends the TypeDef class with generation of C text.
592
593
 
593
594
  # Generates the C text of the equivalent HDLRuby code.
594
595
  # +level+ is the hierachical level of the object.
@@ -601,8 +602,9 @@ module HDLRuby::Low
601
602
  end
602
603
  end
603
604
 
604
- ## Extends the TypeVector class with generation of C text.
605
+
605
606
  class TypeVector
607
+ ## Extends the TypeVector class with generation of C text.
606
608
 
607
609
  # Generates the C text of the equivalent HDLRuby code.
608
610
  # +level+ is the hierachical level of the object.
@@ -618,8 +620,9 @@ module HDLRuby::Low
618
620
  end
619
621
  end
620
622
 
621
- ## Extends the TypeTuple class with generation of C text.
623
+
622
624
  class TypeTuple
625
+ ## Extends the TypeTuple class with generation of C text.
623
626
 
624
627
  # Generates the C text of the equivalent HDLRuby code.
625
628
  # +level+ is the hierachical level of the object.
@@ -634,8 +637,8 @@ module HDLRuby::Low
634
637
  end
635
638
 
636
639
 
637
- ## Extends the TypeStruct class with generation of C text.
638
640
  class TypeStruct
641
+ ## Extends the TypeStruct class with generation of C text.
639
642
 
640
643
  # Generates the text of the equivalent HDLRuby code.
641
644
  # +level+ is the hierachical level of the object.
@@ -650,8 +653,8 @@ module HDLRuby::Low
650
653
  end
651
654
 
652
655
 
653
- ## Extends the Behavior class with generation of C text.
654
656
  class Behavior
657
+ ## Extends the Behavior class with generation of C text.
655
658
 
656
659
  # Generates the text of the equivalent HDLRuby code.
657
660
  # +level+ is the hierachical level of the object and
@@ -837,8 +840,9 @@ module HDLRuby::Low
837
840
  end
838
841
  end
839
842
 
840
- ## Extends the TimeBehavior class with generation of C text.
843
+
841
844
  class TimeBehavior
845
+ ## Extends the TimeBehavior class with generation of C text.
842
846
 
843
847
  # Generates the C text of the equivalent HDLRuby code.
844
848
  # +level+ is the hierachical level of the object.
@@ -850,8 +854,8 @@ module HDLRuby::Low
850
854
  end
851
855
 
852
856
 
853
- ## Extends the Event class with generation of C text.
854
857
  class Event
858
+ ## Extends the Event class with generation of C text.
855
859
 
856
860
  # Generates the C text of the equivalent HDLRuby code.
857
861
  # +level+ is the hierachical level of the object.
@@ -870,8 +874,8 @@ module HDLRuby::Low
870
874
  end
871
875
 
872
876
 
873
- ## Extends the SignalI class with generation of C text.
874
877
  class SignalI
878
+ ## Extends the SignalI class with generation of C text.
875
879
 
876
880
  # The id of a signal in the simulator.
877
881
  @@signal_id = 0
@@ -1085,8 +1089,8 @@ module HDLRuby::Low
1085
1089
  end
1086
1090
 
1087
1091
 
1088
- ## Extends the SystemI class with generation of C text.
1089
1092
  class SystemI
1093
+ ## Extends the SystemI class with generation of C text.
1090
1094
 
1091
1095
  ## Generates the C text of the equivalent HDLRuby code.
1092
1096
  # +level+ is the hierachical level of the object.
@@ -1166,8 +1170,8 @@ module HDLRuby::Low
1166
1170
  end
1167
1171
 
1168
1172
 
1169
- # Extend the Chunk cass with generation of text code.
1170
1173
  class HDLRuby::Low::Chunk
1174
+ # Extend the Chunk cass with generation of text code.
1171
1175
 
1172
1176
  # Generates the C text of the equivalent HDLRuby code.
1173
1177
  # +level+ is the hierachical level of the object.
@@ -1198,8 +1202,9 @@ module HDLRuby::Low
1198
1202
  end
1199
1203
 
1200
1204
 
1201
- ## Extends the SystemI class with generation of C text.
1202
1205
  class Code
1206
+ ## Extends the SystemI class with generation of C text.
1207
+
1203
1208
  # Generates the C text of the equivalent HDLRuby code.
1204
1209
  # +level+ is the hierachical level of the object.
1205
1210
  # def to_c(level = 0)
@@ -1320,8 +1325,8 @@ module HDLRuby::Low
1320
1325
  end
1321
1326
 
1322
1327
 
1323
- ## Extends the Statement class with generation of C text.
1324
1328
  class Statement
1329
+ ## Extends the Statement class with generation of C text.
1325
1330
 
1326
1331
  # Generates the C text of the equivalent HDLRuby code.
1327
1332
  # +level+ is the hierachical level of the object.
@@ -1362,8 +1367,8 @@ module HDLRuby::Low
1362
1367
  end
1363
1368
  end
1364
1369
 
1365
- ## Extends the Transmit class with generation of C text.
1366
1370
  class Transmit
1371
+ ## Extends the Transmit class with generation of C text.
1367
1372
 
1368
1373
  # # Generates the C text of the equivalent HDLRuby code.
1369
1374
  # # +level+ is the hierachical level of the object.
@@ -1464,8 +1469,8 @@ module HDLRuby::Low
1464
1469
  end
1465
1470
 
1466
1471
 
1467
- ## Extends the Print class with generation of C text.
1468
1472
  class Print
1473
+ ## Extends the Print class with generation of C text.
1469
1474
 
1470
1475
  # # Generates the C text of the equivalent HDLRuby code.
1471
1476
  # # +level+ is the hierachical level of the object.
@@ -1533,8 +1538,9 @@ module HDLRuby::Low
1533
1538
  end
1534
1539
  end
1535
1540
 
1536
- ## Extends the TimeTerminate class with generation of C text.
1541
+
1537
1542
  class TimeTerminate
1543
+ ## Extends the TimeTerminate class with generation of C text.
1538
1544
 
1539
1545
  # Generates the C text of the equivalent HDLRuby code.
1540
1546
  # +level+ is the hierachical level of the object.
@@ -1544,8 +1550,9 @@ module HDLRuby::Low
1544
1550
  end
1545
1551
  end
1546
1552
 
1547
- ## Extends the Configure class with generation of C text.
1553
+
1548
1554
  class Configure
1555
+ ## Extends the Configure class with generation of C text.
1549
1556
 
1550
1557
  # Generates the C text of the equivalent HDLRuby code.
1551
1558
  # +level+ is the hierachical level of the object.
@@ -1556,8 +1563,8 @@ module HDLRuby::Low
1556
1563
  end
1557
1564
 
1558
1565
 
1559
- ## Extends the If class with generation of C text.
1560
1566
  class If
1567
+ ## Extends the If class with generation of C text.
1561
1568
 
1562
1569
  # # Generates the C text of the equivalent HDLRuby code.
1563
1570
  # # +level+ is the hierachical level of the object.
@@ -1677,8 +1684,8 @@ module HDLRuby::Low
1677
1684
  end
1678
1685
  end
1679
1686
 
1680
- ## Extends the When class with generation of C text.
1681
1687
  class When
1688
+ ## Extends the When class with generation of C text.
1682
1689
 
1683
1690
  # Generates the C text of the equivalent HDLRuby code.
1684
1691
  # +level+ is the hierachical level of the object.
@@ -1721,8 +1728,9 @@ module HDLRuby::Low
1721
1728
  end
1722
1729
  end
1723
1730
 
1724
- ## Extends the Case class with generation of C text.
1731
+
1725
1732
  class Case
1733
+ ## Extends the Case class with generation of C text.
1726
1734
 
1727
1735
  # # Generates the text of the equivalent HDLRuby code.
1728
1736
  # # +level+ is the hierachical level of the object.
@@ -1855,8 +1863,8 @@ module HDLRuby::Low
1855
1863
  end
1856
1864
 
1857
1865
 
1858
- ## Extends the Delay class with generation of C text.
1859
1866
  class Delay
1867
+ ## Extends the Delay class with generation of C text.
1860
1868
 
1861
1869
  # Generates the C text of the equivalent HDLRuby code.
1862
1870
  # +level+ is the hierachical level of the object.
@@ -1871,8 +1879,8 @@ module HDLRuby::Low
1871
1879
  end
1872
1880
 
1873
1881
 
1874
- ## Extends the TimeWait class with generation of C text.
1875
1882
  class TimeWait
1883
+ ## Extends the TimeWait class with generation of C text.
1876
1884
 
1877
1885
  # Generates the C text of the equivalent HDLRuby code.
1878
1886
  # +level+ is the hierachical level of the object.
@@ -1892,8 +1900,9 @@ module HDLRuby::Low
1892
1900
  end
1893
1901
  end
1894
1902
 
1895
- ## Extends the TimeRepeat class with generation of C text.
1903
+
1896
1904
  class TimeRepeat
1905
+ ## Extends the TimeRepeat class with generation of C text.
1897
1906
 
1898
1907
  # # Generates the C text of the equivalent HDLRuby code.
1899
1908
  # # +level+ is the hierachical level of the object.
@@ -1933,8 +1942,9 @@ module HDLRuby::Low
1933
1942
  end
1934
1943
  end
1935
1944
 
1936
- ## Extends the Block class with generation of C text.
1945
+
1937
1946
  class Block
1947
+ ## Extends the Block class with generation of C text.
1938
1948
 
1939
1949
  # Adds the c code of the blocks to +res+ at +level+
1940
1950
  def add_blocks_code(res,level)
@@ -2086,20 +2096,22 @@ module HDLRuby::Low
2086
2096
  end
2087
2097
 
2088
2098
 
2089
- ## Extends the Block class with generation of C text.
2090
2099
  class TimeBlock
2100
+ ## Extends the Block class with generation of C text.
2101
+
2091
2102
  # TimeBlock is identical to Block in C
2092
2103
  end
2093
2104
 
2094
2105
 
2095
- ## Extends the Connection class with generation of C text.
2096
2106
  class Connection
2107
+ ## Extends the Connection class with generation of C text.
2108
+
2097
2109
  # Nothing required, Transmit is generated identically.
2098
2110
  end
2099
2111
 
2100
2112
 
2101
- ## Extends the Expression class with generation of C text.
2102
2113
  class Expression
2114
+ ## Extends the Expression class with generation of C text.
2103
2115
 
2104
2116
  # Generates the C text of the equivalent HDLRuby code.
2105
2117
  # +level+ is the hierachical level of the object.
@@ -2121,8 +2133,8 @@ module HDLRuby::Low
2121
2133
  end
2122
2134
 
2123
2135
 
2124
- ## Extends the Value class with generation of C text.
2125
2136
  class Value
2137
+ ## Extends the Value class with generation of C text.
2126
2138
 
2127
2139
  ## Generates the C text for an access to the value.
2128
2140
  # +level+ is the hierachical level of the object.
@@ -2290,8 +2302,8 @@ module HDLRuby::Low
2290
2302
  end
2291
2303
 
2292
2304
 
2293
- ## Extends the Cast class with generation of C text.
2294
2305
  class Cast
2306
+ ## Extends the Cast class with generation of C text.
2295
2307
 
2296
2308
  # # Generates the C text of the equivalent HDLRuby code.
2297
2309
  # # +level+ is the hierachical level of the object.
@@ -2346,8 +2358,8 @@ module HDLRuby::Low
2346
2358
  end
2347
2359
 
2348
2360
 
2349
- ## Extends the Operation class with generation of C text.
2350
2361
  class Operation
2362
+ ## Extends the Operation class with generation of C text.
2351
2363
 
2352
2364
  # Generates the C text of the equivalent HDLRuby code.
2353
2365
  # +level+ is the hierachical level of the object.
@@ -2358,8 +2370,9 @@ module HDLRuby::Low
2358
2370
  end
2359
2371
  end
2360
2372
 
2361
- ## Extends the Unary class with generation of C text.
2373
+
2362
2374
  class Unary
2375
+ ## Extends the Unary class with generation of C text.
2363
2376
 
2364
2377
  # # Generates the C text of the equivalent HDLRuby code.
2365
2378
  # # +level+ is the hierachical level of the object.
@@ -2442,8 +2455,8 @@ module HDLRuby::Low
2442
2455
  end
2443
2456
 
2444
2457
 
2445
- ## Extends the Binary class with generation of C text.
2446
2458
  class Binary
2459
+ ## Extends the Binary class with generation of C text.
2447
2460
 
2448
2461
  # # Generates the C text of the equivalent HDLRuby code.
2449
2462
  # # +level+ is the hierachical level of the object.
@@ -2591,8 +2604,9 @@ module HDLRuby::Low
2591
2604
  end
2592
2605
  end
2593
2606
 
2594
- ## Extends the Select class with generation of C text.
2607
+
2595
2608
  class Select
2609
+ ## Extends the Select class with generation of C text.
2596
2610
 
2597
2611
  # # Generates the C text of the equivalent HDLRuby code.
2598
2612
  # # +level+ is the hierachical level of the object.
@@ -2669,9 +2683,9 @@ module HDLRuby::Low
2669
2683
  end
2670
2684
  end
2671
2685
 
2672
- ## Extends the Concat class with generation of C text.
2673
- class Concat
2674
2686
 
2687
+ class Concat
2688
+ ## Extends the Concat class with generation of C text.
2675
2689
 
2676
2690
  # # Generates the C text for the equivalent HDLRuby code.
2677
2691
  # # +level+ is the hierachical level of the object.
@@ -2800,8 +2814,8 @@ module HDLRuby::Low
2800
2814
 
2801
2815
 
2802
2816
 
2803
- ## Extends the Ref class with generation of C text.
2804
2817
  class Ref
2818
+ ## Extends the Ref class with generation of C text.
2805
2819
 
2806
2820
  # Generates the C text of the equivalent HDLRuby code.
2807
2821
  # +level+ is the hierachical level of the object and
@@ -2814,8 +2828,8 @@ module HDLRuby::Low
2814
2828
  end
2815
2829
 
2816
2830
 
2817
- ## Extends the RefConcat class with generation of C text.
2818
2831
  class RefConcat
2832
+ ## Extends the RefConcat class with generation of C text.
2819
2833
 
2820
2834
  # Generates the C text of the equivalent HDLRuby code.
2821
2835
  # +level+ is the hierachical level of the object and
@@ -2848,8 +2862,8 @@ module HDLRuby::Low
2848
2862
  end
2849
2863
 
2850
2864
 
2851
- ## Extends the RefIndex class with generation of C text.
2852
2865
  class RefIndex
2866
+ ## Extends the RefIndex class with generation of C text.
2853
2867
 
2854
2868
  # # Generates the C text of the equivalent HDLRuby code.
2855
2869
  # # +level+ is thehierachical level of the object and
@@ -2958,8 +2972,8 @@ module HDLRuby::Low
2958
2972
  end
2959
2973
 
2960
2974
 
2961
- ## Extends the RefRange class with generation of C text.
2962
2975
  class RefRange
2976
+ ## Extends the RefRange class with generation of C text.
2963
2977
 
2964
2978
  # # Generates the C text of the equivalent HDLRuby code.
2965
2979
  # # +level+ is the hierachical level of the object and
@@ -3071,8 +3085,8 @@ module HDLRuby::Low
3071
3085
  end
3072
3086
 
3073
3087
 
3074
- ## Extends the RefName class with generation of C text.
3075
3088
  class RefName
3089
+ ## Extends the RefName class with generation of C text.
3076
3090
 
3077
3091
  # Generates the C text of the equivalent HDLRuby code.
3078
3092
  # +level+ is the hierachical level of the object and
@@ -3128,8 +3142,9 @@ module HDLRuby::Low
3128
3142
  end
3129
3143
 
3130
3144
 
3131
- ## Extends the RefThis class with generation of C text.
3132
3145
  class RefThis
3146
+ ## Extends the RefThis class with generation of C text.
3147
+
3133
3148
  # Generates the C text of the equivalent HDLRuby code.
3134
3149
  # +level+ is the hierachical level of the object and
3135
3150
  # +left+ tells if it is a left value or not.