HDLRuby 2.6.5 → 2.6.16

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: 928c0006bc7fee9ebff9356509ed09ad9109d310e64eea92a41f42d751d560b1
4
- data.tar.gz: d63743942c8c73f79224c129ca8265995ddff3397a5628e185da497b0599a6e0
3
+ metadata.gz: 0defaa4d148c2fbdc008f29c75a6ab8a4b48726a932f3222e2dc19c7b229492c
4
+ data.tar.gz: 9e2d4268200af09e0c078306b5c8a81494b589468b5b8b0084d300d14f922387
5
5
  SHA512:
6
- metadata.gz: b7508f64a04a6662c035ce362d9193d617b022dd21bbccaa28f8c70d2a38790919f6d995b545a5082df0be6e23654a4bacb158ea6dfaaa673ea592ccac4c67f9
7
- data.tar.gz: 8e77890ec50610400f848340a4ad4a4eb0d9095aff8c674ecb695cdddf9aabbd7e585b2bf5bfc8b76553612f1e216bcc7e21f00888335f07b95f54c89b88efc2
6
+ metadata.gz: ae9f4d696caa0c8f76caa7f0fd05bf1f6554da50c40871c86ad3b44f4c41f3dc184fe58141afd796d3c9448fcdfd04d6869fafc0246fe39236e5f3f48d6bd6a2
7
+ data.tar.gz: 9cc5165ad15458f4c2f514107f7e15118534c079d061dc2f97aecb0982097fe534b0e26683834b901de34ced55132fc0f3608c19087b87ee5a9137174f49a4d1
@@ -0,0 +1,40 @@
1
+ # Test the comparison operators.
2
+
3
+ # A benchmark for the adder.
4
+ system :adder_bench do
5
+ [8].inner :x, :y
6
+ signed[8].inner :u,:v
7
+ inner :ue, :ult, :ule, :ugt, :uge
8
+ inner :se, :slt, :sle, :sgt, :sge
9
+
10
+ par do
11
+ ue <= (x == y)
12
+ ult <= (x < y)
13
+ ule <= (x <= y)
14
+ ugt <= (x > y)
15
+ uge <= (x >= y)
16
+
17
+ se <= (u == v)
18
+ slt <= (u < v)
19
+ sle <= (u <= v)
20
+ sgt <= (u > v)
21
+ sge <= (u >= v)
22
+ end
23
+
24
+ timed do
25
+ x <= 0
26
+ y <= 0
27
+ u <= 0
28
+ v <= 0
29
+ !10.ns
30
+ x <= 1
31
+ u <= 1
32
+ !10.ns
33
+ y <= 2
34
+ v <= 2
35
+ !10.ns
36
+ x <= 2
37
+ u <= -2
38
+ !10.ns
39
+ end
40
+ end
@@ -2,6 +2,7 @@
2
2
  # A benchmark for testing the arithmetic with signed values.
3
3
  system :neg_arith_bench do
4
4
  signed[11..0].inner :x,:y,:z
5
+ inner :cmp
5
6
 
6
7
  timed do
7
8
  x <= 10
@@ -9,41 +10,51 @@ system :neg_arith_bench do
9
10
  z <= 0
10
11
  !10.ns
11
12
  z <= 10 * 10
13
+ cmp <= (10 < 10)
12
14
  !10.ns
13
15
  z <= x * y
16
+ cmp <= (x < y)
14
17
  !10.ns
15
18
  x <= 10
16
19
  y <= -10
17
20
  !10.ns
18
21
  z <= 10 * (-10)
22
+ cmp <= (10 < -10)
19
23
  !10.ns
20
24
  z <= x * y
25
+ cmp <= (x < y)
21
26
  !10.ns
22
27
  x <= -10
23
28
  y <= 10
24
29
  !10.ns
25
30
  z <= (-10) * 10
31
+ cmp <= (-10 < 10)
26
32
  !10.ns
27
33
  z <= x * y
34
+ cmp <= (x < y)
28
35
  !10.ns
29
36
  x <= -10
30
37
  y <= -10
31
38
  !10.ns
32
39
  z <= (-10) * (-10)
40
+ cmp <= (-10 < -10)
33
41
  !10.ns
34
42
  z <= x * y
43
+ cmp <= (x < y)
35
44
  !10.ns
36
45
  x <= _000000011010
37
46
  y <= _000011111010
38
47
  z <= 0
39
48
  !10.ns
40
49
  z <= x * y
50
+ cmp <= (x < y)
41
51
  !10.ns
42
52
  x <= _000000011010
43
53
  y <= _111111111010
44
54
  z <= 0
45
55
  !10.ns
46
56
  z <= x * y
57
+ cmp <= (x < y)
47
58
  !10.ns
48
59
  end
49
60
  end
@@ -0,0 +1,37 @@
1
+ # Test the type method min and max
2
+
3
+ # A benchmark for the adder.
4
+ system :adder_bench do
5
+ [32].inner :x
6
+ signed[32].inner :y
7
+
8
+ timed do
9
+ x <= 0
10
+ y <= 0
11
+ !10.ns
12
+ x <= bit[8].max
13
+ y <= signed[8].max
14
+ !10.ns
15
+ x <= bit[8].min
16
+ y <= signed[8].min
17
+ !10.ns
18
+ x <= bit[10].max
19
+ y <= signed[10].max
20
+ !10.ns
21
+ x <= bit[10].min
22
+ y <= signed[10].min
23
+ !10.ns
24
+ x <= bit[16].max
25
+ y <= signed[16].max
26
+ !10.ns
27
+ x <= bit[16].min
28
+ y <= signed[16].min
29
+ !10.ns
30
+ x <= bit[32].max
31
+ y <= signed[32].max
32
+ !10.ns
33
+ x <= bit[32].min
34
+ y <= signed[32].min
35
+ !10.ns
36
+ end
37
+ end
@@ -0,0 +1,29 @@
1
+
2
+ def connect8(i0,i1,i2,i3,i4,i5,i6,i7,
3
+ o0,o1,o2,o3,o4,o5,o6,o7)
4
+ o0 <= i0
5
+ o1 <= i1
6
+ o2 <= i2
7
+ o3 <= i3
8
+ o4 <= i4
9
+ o5 <= i5
10
+ o6 <= i6
11
+ o7 <= i7
12
+ end
13
+
14
+ # A benchmark for testing the conversion to ruby array of expressions.
15
+ system :with_to_bench do
16
+ [8].inner :val
17
+ inner :b0,:b1,:b2,:b3,:b4,:b5,:b6,:b7
18
+
19
+ connect8(*val,b0,b1,b2,b3,b4,b5,b6,b7)
20
+
21
+ timed do
22
+ val <= _01101010
23
+ !10.ns
24
+ val <= _01011010
25
+ !10.ns
26
+ val <= _00001111
27
+ !10.ns
28
+ end
29
+ end
data/lib/HDLRuby/hdrcc.rb CHANGED
@@ -491,24 +491,28 @@ end
491
491
 
492
492
  # Generate the result.
493
493
  # Get the top systemT.
494
+ puts Time.now
494
495
  $top_system = $top_instance.to_low.systemT
495
-
496
-
497
- # Apply the pre drivers if any.
498
- Hdecorator.each_with_property(:pre_driver) do |obj, value|
499
- unless value.is_a?(Array) && value.size == 2 then
500
- raise "pre_driver requires a driver file name command name."
501
- end
502
- # Load the driver.
503
- require_relative(value[0].to_s)
504
- # Ensure obj is the low version.
505
- if obj.properties.key?(:high2low) then
506
- # obj is high, get the corresponding low.
507
- obj = obj.properties[:high2low][0]
508
- end
509
- # Execute it.
510
- send(value[1].to_sym,obj,*value[2..-1])
511
- end
496
+ $top_intance = nil # Free as much memory as possible.
497
+ puts "##### Top system built #####"
498
+ puts Time.now
499
+
500
+
501
+ # # Apply the pre drivers if any.
502
+ # Hdecorator.each_with_property(:pre_driver) do |obj, value|
503
+ # unless value.is_a?(Array) && value.size == 2 then
504
+ # raise "pre_driver requires a driver file name command name."
505
+ # end
506
+ # # Load the driver.
507
+ # require_relative(value[0].to_s)
508
+ # # Ensure obj is the low version.
509
+ # if obj.properties.key?(:high2low) then
510
+ # # obj is high, get the corresponding low.
511
+ # obj = obj.properties[:high2low][0]
512
+ # end
513
+ # # Execute it.
514
+ # send(value[1].to_sym,obj,*value[2..-1])
515
+ # end
512
516
 
513
517
 
514
518
  # Gather the non-HDLRuby code.
@@ -558,15 +562,23 @@ elsif $options[:clang] then
558
562
  # top_system = $top_system
559
563
  # Preprocess the HW description for valid C generation.
560
564
  $top_system.each_systemT_deep do |systemT|
565
+ puts "seq2seq step..."
561
566
  # Coverts the par blocks in seq blocks to seq blocks to match
562
567
  # the simulation engine.
563
568
  systemT.par_in_seq2seq!
569
+ puts Time.now
570
+ puts "connections_to_behaviors step..."
564
571
  # Converts the connections to behaviors.
565
572
  systemT.connections_to_behaviors!
573
+ puts Time.now
566
574
  # Break the RefConcat.
575
+ puts "concat_assigns step..."
567
576
  systemT.break_concat_assigns!
577
+ puts Time.now
568
578
  # Explicits the types.
579
+ puts "explicit_types step..."
569
580
  systemT.explicit_types!
581
+ puts Time.now
570
582
  end
571
583
  # Generate the C.
572
584
  if $options[:multiple] then
@@ -637,6 +649,7 @@ elsif $options[:clang] then
637
649
  name = $output + "/" +
638
650
  HDLRuby::Low::Low2C.c_name(systemT.name) +
639
651
  ".c"
652
+ # puts "for systemT=#{systemT.name} generating: #{name}"
640
653
  # Open the file for current systemT
641
654
  outfile = File.open(name,"w")
642
655
  # Generate the C code in to.
@@ -690,14 +703,26 @@ elsif $options[:verilog] then
690
703
  # top_system = $top_system
691
704
  # Make description compatible with verilog generation.
692
705
  $top_system.each_systemT_deep do |systemT|
706
+ puts "casts_without_expression! step..."
693
707
  systemT.casts_without_expression!
708
+ puts Time.now
709
+ puts "to_upper_space! step..."
694
710
  systemT.to_upper_space!
711
+ puts Time.now
712
+ puts "to_global_space! step..."
695
713
  systemT.to_global_systemTs!
714
+ puts Time.now
696
715
  # systemT.break_types!
697
716
  # systemT.expand_types!
717
+ puts "par_in_seq2seq! step..."
698
718
  systemT.par_in_seq2seq!
719
+ puts Time.now
720
+ puts "initial_concat_to_timed! step..."
699
721
  systemT.initial_concat_to_timed!
722
+ puts Time.now
723
+ puts "with_port! step..."
700
724
  systemT.with_port!
725
+ puts Time.now
701
726
  end
702
727
  # # Verilog generation
703
728
  # $output << top_system.to_verilog
@@ -787,13 +812,13 @@ elsif $options[:vhdl] then
787
812
  end
788
813
  end
789
814
 
790
- # Apply the post drivers if any.
791
- Hdecorator.each_with_property(:post_driver) do |obj, value|
792
- # Load the driver.
793
- require_relative(value[0].to_s)
794
- # Execute it.
795
- send(value[1].to_sym,obj,$output)
796
- end
815
+ # # Apply the post drivers if any.
816
+ # Hdecorator.each_with_property(:post_driver) do |obj, value|
817
+ # # Load the driver.
818
+ # require_relative(value[0].to_s)
819
+ # # Execute it.
820
+ # send(value[1].to_sym,obj,$output)
821
+ # end
797
822
 
798
823
  # Dump the properties
799
824
  if $options[:dump] then