Class: HDLRuby::High::Std::ChannelI

Inherits:
Object
  • Object
show all
Includes:
Hmissing, HchannelI
Defined in:
lib/HDLRuby/std/channel.rb

Overview

Describes a high-level channel instance.

Constant Summary

Constants included from Hmissing

Hmissing::High, Hmissing::NAMES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HchannelI

#read, #reset, #wrap, #write

Methods included from Hmissing

#method_missing

Constructor Details

#initialize(name, &ruby_block) ⇒ ChannelI

Creates a new channel instance with +name+ built from +ruby_block+.



432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
# File 'lib/HDLRuby/std/channel.rb', line 432

def initialize(name,&ruby_block)
    # Check and set the name of the channel.
    @name = name.to_sym
    # puts "my name is #{self.name}"
    # Generate a name for the scope containing the signals of
    # the channel.
    # @scope_name = HDLRuby.uniq_name
    @scope_name = HDLRuby.uniq_name(name)

    # # Sets the scope.
    # @scope = HDLRuby::High.cur_scope

    # Keep access to self.
    obj = self

    # At first there no read nor write port.
    @read_port = nil
    @write_port = nil

    # The reader input ports by name.
    @reader_inputs = {}
    # The reader output ports by name.
    @reader_outputs = {}
    # The reader inout ports by name.
    @reader_inouts = {}

    # The writer input ports by name.
    @writer_inputs = {}
    # The writer output ports by name.
    @writer_outputs = {}
    # The writer inout ports by name.
    @writer_inouts = {}

    # The accesser input ports by name.
    @accesser_inputs = {}
    # The accesser output ports by name.
    @accesser_outputs = {}
    # The accesser inout ports by name.
    @accesser_inouts = {}

    # The branch channels
    @branches = {}

    # Create the namespaces for building the channel, its readers
    # its writers and its accessers.

    # Creates the namespace of the channel.
    @namespace = Namespace.new(self)
    # Make it give access to the internal of the class.
    @namespace.add_method(:reader_input,   &method(:reader_input))
    @namespace.add_method(:reader_output,  &method(:reader_output))
    @namespace.add_method(:reader_inout,   &method(:reader_inout))
    @namespace.add_method(:writer_input,   &method(:writer_input))
    @namespace.add_method(:writer_output,  &method(:writer_output))
    @namespace.add_method(:writer_inout,   &method(:writer_inout))
    @namespace.add_method(:accesser_input, &method(:accesser_input))
    @namespace.add_method(:accesser_output,&method(:accesser_output))
    @namespace.add_method(:accesser_inout, &method(:accesser_inout))
    @namespace.add_method(:reader,         &method(:reader))
    @namespace.add_method(:writer,         &method(:writer))
    @namespace.add_method(:brancher,         &method(:brancher))

    # Creates the namespace of the reader.
    @reader_namespace = Namespace.new(self)
    # Creates the namespace of the writer.
    @writer_namespace = Namespace.new(self)
    # Creates the namespace of the accesser.
    @accesser_namespace = Namespace.new(self)

    # Builds the channel within a new scope.
    HDLRuby::High.space_push(@namespace)
    # puts "top_user=#{HDLRuby::High.top_user}"
    scope_name = @scope_name
    scope = nil
    HDLRuby::High.top_user.instance_eval do 
        sub(scope_name) do
            # Generate the channel code.
            ruby_block.call
        end
    end
    HDLRuby::High.space_pop

    # Keep access to the scope containing the code of the channel.
    @scope = @namespace.send(scope_name)
    # puts "@scope=#{@scope}"
    # Adds the name space of the scope to the namespace of the
    # channel
    @namespace.concat_namespace(@scope.namespace)

    # Gives access to the channel by registering its name.
    obj = self
    # HDLRuby::High.space_reg(@name) { self }
    HDLRuby::High.space_reg(@name) { obj }
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class HDLRuby::High::Hmissing

Instance Attribute Details

#nameObject (readonly)

The name of the channel instance.



416
417
418
# File 'lib/HDLRuby/std/channel.rb', line 416

def name
  @name
end

#namespaceObject (readonly)

The namespace associated with the current execution when building a channel.



423
424
425
# File 'lib/HDLRuby/std/channel.rb', line 423

def namespace
  @namespace
end

#read_portObject (readonly)

The read port if any.



426
427
428
# File 'lib/HDLRuby/std/channel.rb', line 426

def read_port
  @read_port
end

#scopeObject (readonly)

The scope the channel has been created in.



419
420
421
# File 'lib/HDLRuby/std/channel.rb', line 419

def scope
  @scope
end

#write_portObject (readonly)

The write port if any.



429
430
431
# File 'lib/HDLRuby/std/channel.rb', line 429

def write_port
  @write_port
end

Instance Method Details

#accesser_inout(*keys) ⇒ Object

Sets the signals accessible through +key+ to be accesser inout port.



652
653
654
655
656
657
658
659
660
661
# File 'lib/HDLRuby/std/channel.rb', line 652

def accesser_inout(*keys)
    # Registers each signal as accesser port
    keys.each do |key|
        # Ensure the key is a symbol.
        key = key.to_sym
        # Register it with the corresponding signal.
        name = HDLRuby.uniq_name # The name of the signal is uniq.
        @accesser_inouts[name] = send(key)
    end
end

#accesser_input(*keys) ⇒ Object

Sets the signals accessible through +key+ to be accesser input port.



628
629
630
631
632
633
634
635
636
637
# File 'lib/HDLRuby/std/channel.rb', line 628

def accesser_input(*keys)
    # Registers each signal as accesser port
    keys.each do |key|
        # Ensure the key is a symbol.
        key = key.to_sym
        # Register it with the corresponding signal.
        name = HDLRuby.uniq_name # The name of the signal is uniq.
        @accesser_inputs[name] = send(key)
    end
end

#accesser_output(*keys) ⇒ Object

Sets the signals accessible through +key+ to be accesser output port.



640
641
642
643
644
645
646
647
648
649
# File 'lib/HDLRuby/std/channel.rb', line 640

def accesser_output(*keys)
    # Registers each signal as accesser port
    keys.each do |key|
        # Ensure the key is a symbol.
        key = key.to_sym
        # Register it with the corresponding signal.
        name = HDLRuby.uniq_name # The name of the signal is uniq.
        @accesser_outputs[name] = send(key)
    end
end

#branch(name, *args) ⇒ Object

Gets branch channel +name+. NOTE: +name+ can be of any type on purpose.



744
745
746
747
748
749
750
751
# File 'lib/HDLRuby/std/channel.rb', line 744

def branch(name,*args)
    # Ensure name is a symbol.
    name = name.to_s unless name.respond_to?(:to_sym)
    name = name.to_sym
    # Get the branch.
    channelI = @branches[name]
    return @branches[name]
end

#brancher(name, channelI = nil, &ruby_block) ⇒ Object

Defines a branch in the channel named +name+ built executing +ruby_block+. Alternatively, a ready channel instance can be passed as argument as +channelI+.



721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
# File 'lib/HDLRuby/std/channel.rb', line 721

def brancher(name,channelI = nil,&ruby_block)
    # puts "self.name=#{self.name} and name=#{name}"
    # Ensure name is a symbol.
    name = name.to_s unless name.respond_to?(:to_sym)
    name = name.to_sym
    # Is there a ready channel instance.
    if channelI then
        # Yes, use it directly.
        @branches[name] = channelI
        return self
    end
    # Now, create the branch.
    channelI = HDLRuby::High::Std.channel_instance(name, &ruby_block)
    # channelI = HDLRuby::High::Std.channel_instance("#{self.name}::#{name}", &ruby_block)
    @branches[name] = channelI
    return self
end

#inout(name = nil) ⇒ Object

Declares the accesser port and assigned them to +name+.



981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
# File 'lib/HDLRuby/std/channel.rb', line 981

def inout(name = nil)
    # Ensure name is a symbol.
    name = HDLRuby.uniq_name unless name
    name = name.to_sym
    # Ensure the port is not already existing.
    if @read_port then
        raise "Read port already declared for channel instance: " +
            self.name.to_s
    end

    if @write_port then
        raise "Write port already declared for channel instance: " +
            self.name.to_s
    end

    # Access the ports
    loc_inputs  = @accesser_inputs.merge(@reader_inputs).
        merge(@writer_inputs)
    loc_outputs = @accesser_outputs.merge(@reader_outputs).
        merge(@writer_outputs)
    loc_inouts  = @accesser_inouts.merge(@reader_inouts).
        merge(@writer_inouts)
    locs = loc_inputs.merge(loc_outputs).merge(loc_inouts)
    # The generated port with corresponding channel port pairs.
    port_pairs = []
    if HDLRuby::High.cur_system == self.parent_system then
        # Port in same system as the channel case.
        # Add them to the current system.
        HDLRuby::High.cur_system.open do
            locs.each  do |name,sig|
                port_pairs << [sig, sig.type.inner(name)]
            end
        end
        obj = self
        # Make the inner connection
        port_pairs.each do |sig, port|
            sig.parent.open do
                port.to_ref <= sig
            end
        end
    else
        # Port in different system as the channel case.
        # Add them to the current system.
        HDLRuby::High.cur_system.open do
            # The inputs
            loc_inputs.each  do |name,sig|
                # puts "name=#{name} sig.name=#{sig.name}"
                port_pairs << [sig, sig.type.input(name)]
            end
            # The outputs
            loc_outputs.each do |name,sig| 
                port_pairs << [sig, sig.type.output(name)]
            end
            # The inouts
            loc_inouts.each  do |name,sig| 
                port_pairs << [sig, sig.type.inout(name)]
            end
        end
        obj = self
        # Make the connection of the instance.
        HDLRuby::High.cur_system.on_instance do |inst|
            obj.scope.open do
                port_pairs.each do |sig, port|
                    RefObject.new(inst,port.to_ref) <= sig
                end
            end
        end
    end

    # Fill the reader namespace with the access to the reader signals.
    loc_inputs.each do |name,sig|
        @accesser_namespace.add_method(sig.name) do
            HDLRuby::High.top_user.send(name)
        end
    end
    loc_outputs.each do |name,sig|
        @accesser_namespace.add_method(sig.name) do
            HDLRuby::High.top_user.send(name)
        end
    end
    loc_inouts.each do |name,sig|
        @accesser_namespace.add_method(sig.name) do
            HDLRuby::High.top_user.send(name)
        end
    end

    # Give access to the ports through name.
    # NOTE: for now, simply associate the channel to name.
    chp = ChannelPortA.new(@accesser_namespace,@reader_proc,@writer_proc,@inout_reseter_proc)
    HDLRuby::High.space_reg(name) { chp }
    # Save the port in the channe to avoid conflicting declaration.
    @read_port = chp
    @write_port = chp
    return chp
end

#inout?Boolean

Tells if the channel support inout port.

Returns:

  • (Boolean)


712
713
714
715
# File 'lib/HDLRuby/std/channel.rb', line 712

def inout?
    return @accesser_inputs.any? || @accesser_outputs.any? ||
           @accesser_inouts.any?
end

#inout_reseter(&ruby_block) ⇒ Object

Sets the inout port reset to be +ruby_block+.



690
691
692
# File 'lib/HDLRuby/std/channel.rb', line 690

def inout_reseter(&ruby_block)
    @inout_reseter_proc = ruby_block
end

#input(name = nil) ⇒ Object

Declares the reader port as and assigned them to +name+.



757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
# File 'lib/HDLRuby/std/channel.rb', line 757

def input(name = nil)
    # Ensure name is a symbol.
    name = HDLRuby.uniq_name unless name
    name = name.to_sym
    # Ensure the port is not already existing.
    if @read_port then
        raise "Read port already declared for channel instance: " +
            self.name
    end

    # Access the ports
    # loc_inputs  = @reader_inputs
    # loc_outputs = @reader_outputs
    # loc_inouts  = @reader_inouts
    loc_inputs  = @reader_inputs.merge(@accesser_inputs)
    loc_outputs = @reader_outputs.merge(@accesser_outputs)
    loc_inouts  = @reader_inouts.merge(@accesser_inouts)
    locs = loc_inputs.merge(loc_outputs).merge(loc_inouts)
    # The generated port with corresponding channel port pairs.
    port_pairs = []
    if HDLRuby::High.cur_system == self.parent_system then
        # Port in same system as the channel case.
        # Add them to the current system.
        HDLRuby::High.cur_system.open do
            # locs.each  do |name,sig|
            #     port_pairs << [sig, sig.type.inner(name)]
            # end
            loc_inputs.each  do |name,sig|
                port_pairs << [sig, sig.type.inner(name),:input]
            end
            loc_outputs.each  do |name,sig|
                port_pairs << [sig, sig.type.inner(name),:output]
            end
            loc_inouts.each  do |name,sig|
                port_pairs << [sig, sig.type.inner(name),:inout]
            end
        end
        obj = self
        # Make the inner connection
        # port_pairs.each do |sig, port|
        port_pairs.each do |sig, port, dir|
            sig.parent.open do
                # port.to_ref <= sig
                if dir == :input then
                    port.to_ref <= sig
                else
                    sig <= port.to_ref
                end
            end
        end
    else
        # Port in different system as the channel case.
        # Add them to the current system.
        HDLRuby::High.cur_system.open do
            # The inputs
            loc_inputs.each  do |name,sig|
                # puts "name=#{name} sig.name=#{sig.name}"
                port_pairs << [sig, sig.type.input(name),:input]
            end
            # The outputs
            loc_outputs.each do |name,sig| 
                port_pairs << [sig, sig.type.output(name),:output]
            end
            # The inouts
            loc_inouts.each  do |name,sig| 
                port_pairs << [sig, sig.type.inout(name),:inout]
            end
        end
        obj = self
        # Make the connection of the instance.
        HDLRuby::High.cur_system.on_instance do |inst|
            obj.scope.open do
                port_pairs.each do |sig, port, dir|
                    # RefObject.new(inst,port.to_ref) <= sig
                    if dir == :input then
                        RefObject.new(inst,port.to_ref) <= sig
                    else
                        sig <= RefObject.new(inst,port.to_ref)
                    end
                end
            end
        end
    end

    # Fill the reader namespace with the access to the reader signals.
    loc_inputs.each do |name,sig|
        @reader_namespace.add_method(sig.name) do
            HDLRuby::High.top_user.send(name)
        end
    end
    loc_outputs.each do |name,sig|
        @reader_namespace.add_method(sig.name) do
            HDLRuby::High.top_user.send(name)
        end
    end
    loc_inouts.each do |name,sig|
        @reader_namespace.add_method(sig.name) do
            HDLRuby::High.top_user.send(name)
        end
    end

    # Give access to the ports through name.
    # NOTE: for now, simply associate the channel to name.
    chp = ChannelPortR.new(@reader_namespace,@reader_proc,@input_reseter_proc)
    HDLRuby::High.space_reg(name) { chp }
    # Save the port in the channe to avoid conflicting declaration.
    @read_port = chp
    return chp
end

#input_reseter(&ruby_block) ⇒ Object

Sets the input port reset to be +ruby_block+.



680
681
682
# File 'lib/HDLRuby/std/channel.rb', line 680

def input_reseter(&ruby_block)
    @input_reseter_proc = ruby_block
end

#output(name = nil) ⇒ Object

Declares the ports for the writer and assigned them to +name+.



868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
# File 'lib/HDLRuby/std/channel.rb', line 868

def output(name = nil)
    # Ensure name is a symbol.
    name = HDLRuby.uniq_name unless name
    name = name.to_sym
    # Ensure the port is not already existing.
    if @write_port then
        raise "Write port already declared for channel instance: " +
            self.name
    end
    # Access the ports
    # loc_inputs  = @writer_inputs
    # loc_outputs = @writer_outputs
    # loc_inouts  = @writer_inouts
    loc_inputs  = @writer_inputs.merge(@accesser_inputs)
    loc_outputs = @writer_outputs.merge(@accesser_outputs)
    loc_inouts  = @writer_inouts.merge(@accesser_inouts)
    locs = loc_inputs.merge(loc_outputs).merge(loc_inouts)
    # The generated port with corresponding channel port pairs.
    port_pairs = []
    # puts "cur_system=#{HDLRuby::High.cur_system} self.parent_system=#{self.parent_system}"
    if HDLRuby::High.cur_system == self.parent_system then
        # puts "Inner found!"
        # Port in same system as the channel case.
        # Add them to the current system.
        HDLRuby::High.cur_system.open do
            # locs.each  do |name,sig|
            #     port_pairs << [sig, sig.type.inner(name)]
            # end
            loc_inputs.each  do |name,sig|
                port_pairs << [sig, sig.type.inner(name),:input]
            end
            loc_outputs.each  do |name,sig|
                port_pairs << [sig, sig.type.inner(name),:output]
            end
            loc_inouts.each  do |name,sig|
                port_pairs << [sig, sig.type.inner(name),:inout]
            end
        end
        obj = self
        # Make the inner connection
        # port_pairs.each do |sig, port|
        port_pairs.each do |sig, port, dir|
            sig.parent.open do
                # port.to_ref <= sig
                if dir == :input then
                    port.to_ref <= sig
                else
                    sig <= port.to_ref
                end
            end
        end
    else
        # Portds in different system as the channel's case.
        # Add them to the current system.
        HDLRuby::High.cur_system.open do
            # The inputs
            loc_inputs.each  do |name,sig|
                port_pairs << [sig, sig.type.input(name),:input]
            end
            # The outputs
            loc_outputs.each do |name,sig| 
                port_pairs << [sig, sig.type.output(name),:output]
            end
            # The inouts
            loc_inouts.each  do |name,sig| 
                port_pairs << [sig, sig.type.inout(name),:inout]
            end
        end
        obj = self
        # Make the connection of the instance.
        HDLRuby::High.cur_system.on_instance do |inst|
            obj.scope.open do
                port_pairs.each do |sig, port, dir|
                    # RefObject.new(inst,port.to_ref) <= sig
                    # RefObject.new(inst,port.to_ref) <= sig
                    if dir == :input then
                        RefObject.new(inst,port.to_ref) <= sig
                    else
                        sig <= RefObject.new(inst,port.to_ref)
                    end
                end
            end
        end
    end

    # Fill the writer namespace with the access to the writer signals.
    loc_inputs.each do |name,sig|
        @writer_namespace.add_method(sig.name) do
            HDLRuby::High.top_user.send(name)
        end
    end
    loc_outputs.each do |name,sig|
        @writer_namespace.add_method(sig.name) do
            HDLRuby::High.top_user.send(name)
        end
    end
    loc_inouts.each do |name,sig|
        @writer_namespace.add_method(sig.name) do
            HDLRuby::High.top_user.send(name)
        end
    end

    # Give access to the ports through name.
    # NOTE: for now, simply associate the channel to name.
    chp = ChannelPortW.new(@writer_namespace,@writer_proc,@output_reseter_proc)
    HDLRuby::High.space_reg(name) { chp }
    # Save the port in the channe to avoid conflicting declaration.
    @write_port = chp
    return chp
end

#output_reseter(&ruby_block) ⇒ Object

Sets the output port reset to be +ruby_block+.



685
686
687
# File 'lib/HDLRuby/std/channel.rb', line 685

def output_reseter(&ruby_block)
    @output_reseter_proc = ruby_block
end

#parent_systemObject

Get the parent system.



528
529
530
# File 'lib/HDLRuby/std/channel.rb', line 528

def parent_system
    return self.scope.parent_system
end

#reader(&ruby_block) ⇒ Object

Sets the read procedure to be +ruby_block+.



665
666
667
# File 'lib/HDLRuby/std/channel.rb', line 665

def reader(&ruby_block)
    @reader_proc = ruby_block
end

#reader_inout(*keys) ⇒ Object

Sets the signals accessible through +key+ to be reader inout port.



580
581
582
583
584
585
586
587
588
589
# File 'lib/HDLRuby/std/channel.rb', line 580

def reader_inout(*keys)
    # Registers each signal as reader port
    keys.each do |key|
        # Ensure the key is a symbol.
        key = key.to_sym
        # Register it with the corresponding signal.
        name = HDLRuby.uniq_name # The name of the signal is uniq.
        @reader_inouts[name] = send(key)
    end
end

#reader_input(*keys) ⇒ Object

Sets the signals accessible through +key+ to be reader input port.



556
557
558
559
560
561
562
563
564
565
# File 'lib/HDLRuby/std/channel.rb', line 556

def reader_input(*keys)
    # Registers each signal as reader port
    keys.each do |key|
        # Ensure the key is a symbol.
        key = key.to_sym
        # Register it with the corresponding signal.
        name = HDLRuby.uniq_name # The name of the signal is uniq.
        @reader_inputs[name] = send(key)
    end
end

#reader_output(*keys) ⇒ Object

Sets the signals accessible through +key+ to be reader output port.



568
569
570
571
572
573
574
575
576
577
# File 'lib/HDLRuby/std/channel.rb', line 568

def reader_output(*keys)
    # Registers each signal as reader port
    keys.each do |key|
        # Ensure the key is a symbol.
        key = key.to_sym
        # Register it with the corresponding signal.
        name = HDLRuby.uniq_name # The name of the signal is uniq.
        @reader_outputs[name] = send(key)
    end
end

#reader_signalsObject

Gets the list of the signals of the channel to be connected to the reader.



699
700
701
702
# File 'lib/HDLRuby/std/channel.rb', line 699

def reader_signals
    return @reader_inputs.values + @reader_outputs.values +
           @reader_inouts.values
end

#writer(&ruby_block) ⇒ Object

Sets the writer procedure to be +ruby_block+.



670
671
672
# File 'lib/HDLRuby/std/channel.rb', line 670

def writer(&ruby_block)
    @writer_proc = ruby_block
end

#writer_inout(*keys) ⇒ Object

Sets the signals accessible through +key+ to be writer inout port.



616
617
618
619
620
621
622
623
624
625
# File 'lib/HDLRuby/std/channel.rb', line 616

def writer_inout(*keys)
    # Registers each signal as writer port
    keys.each do |key|
        # Ensure the key is a symbol.
        key = key.to_sym
        # Register it with the corresponding signal.
        name = HDLRuby.uniq_name # The name of the signal is uniq.
        @writer_inouts[name] = send(key)
    end
end

#writer_input(*keys) ⇒ Object

Sets the signals accessible through +key+ to be writer input port.



592
593
594
595
596
597
598
599
600
601
# File 'lib/HDLRuby/std/channel.rb', line 592

def writer_input(*keys)
    # Registers each signal as writer port
    keys.each do |key|
        # Ensure the key is a symbol.
        key = key.to_sym
        # Register it with the corresponding signal.
        name = HDLRuby.uniq_name # The name of the signal is uniq.
        @writer_inputs[name] = send(key)
    end
end

#writer_output(*keys) ⇒ Object

Sets the signals accessible through +key+ to be writer output port.



604
605
606
607
608
609
610
611
612
613
# File 'lib/HDLRuby/std/channel.rb', line 604

def writer_output(*keys)
    # Registers each signal as writer port
    keys.each do |key|
        # Ensure the key is a symbol.
        key = key.to_sym
        # Register it with the corresponding signal.
        name = HDLRuby.uniq_name # The name of the signal is uniq.
        @writer_outputs[name] = send(key)
    end
end

#writer_signalsObject

Gets the list of the signals of the channel to be connected to the writer.



706
707
708
709
# File 'lib/HDLRuby/std/channel.rb', line 706

def writer_signals
    return @writer_inputs.values + @writer_outputs.values +
           @writer_inouts.values
end