Class: CLKInfElm
- Defined in:
- lib/tdl/elements/originclass.rb,
lib/tdl/elements/originclass.rb
Overview
clock_reset_taps
Instance Attribute Summary collapse
-
#clock ⇒ Object
Returns the value of attribute clock.
-
#origin_freqM ⇒ Object
Returns the value of attribute origin_freqM.
-
#reset ⇒ Object
Returns the value of attribute reset.
Attributes inherited from InfElm
Attributes inherited from BaseElm
Instance Method Summary collapse
- #check_freqM ⇒ Object
- #clock_reset_taps(def_clock_name, def_reset_name, self_clock, self_reset) ⇒ Object
- #freq_align_signal ⇒ Object
- #freqM ⇒ Object
- #FreqM ⇒ Object
-
#initialize(clock: nil, reset: nil, dimension: [], freqM: nil) ⇒ CLKInfElm
constructor
A new instance of CLKInfElm.
- #intf_def_freqM ⇒ Object
- #use_which_freq_when_copy(argv_clock, argv_origin) ⇒ Object
Methods inherited from InfElm
#[], #dimension_num, #draw, inherited, #inst_port, parse_ports, #port_length, same_name_socket, #signal, subclass
Methods inherited from BaseElm
#matrix, #name_copy, #path_refs, recfg_nc, #s, #signal
Methods included from TdlSpace::ExCreateTP
Constructor Details
#initialize(clock: nil, reset: nil, dimension: [], freqM: nil) ⇒ CLKInfElm
Returns a new instance of CLKInfElm.
610 611 612 613 614 615 616 617 618 |
# File 'lib/tdl/elements/originclass.rb', line 610 def initialize(clock:nil,reset:nil,dimension:[],freqM:nil) # super(dimension:dimension,clock:clock,reset:reset,freqM:freqM) super(dimension:dimension) @clock = clock @reset = reset @origin_freqM = freqM check_freqM end |
Instance Attribute Details
#clock ⇒ Object
Returns the value of attribute clock.
609 610 611 |
# File 'lib/tdl/elements/originclass.rb', line 609 def clock @clock end |
#origin_freqM ⇒ Object
Returns the value of attribute origin_freqM.
609 610 611 |
# File 'lib/tdl/elements/originclass.rb', line 609 def origin_freqM @origin_freqM end |
#reset ⇒ Object
Returns the value of attribute reset.
609 610 611 |
# File 'lib/tdl/elements/originclass.rb', line 609 def reset @reset end |
Instance Method Details
#check_freqM ⇒ Object
653 654 655 656 657 658 659 |
# File 'lib/tdl/elements/originclass.rb', line 653 def check_freqM if @origin_freqM && @clock.is_a?(Clock) if @origin_freqM != @clock.freqM raise TdlError.new("Interface origin clock freqM[#{@origin_freqM}Mhz] dont eql CLOCK freqM[#{@clock.freqM}Mhz]") end end end |
#clock_reset_taps(def_clock_name, def_reset_name, self_clock, self_reset) ⇒ Object
677 678 679 680 681 682 683 684 685 686 687 |
# File 'lib/tdl/elements/originclass.rb', line 677 def clock_reset_taps(def_clock_name,def_reset_name,self_clock,self_reset) new_clk = belong_to_module.logic.clock(self.FreqM) - def_clock_name new_reset = belong_to_module.logic.reset('low') - def_reset_name belong_to_module.Assign do new_clk <= self_clock new_reset <= self_reset end [new_clk,new_reset] end |
#freq_align_signal ⇒ Object
640 641 642 643 644 645 646 647 |
# File 'lib/tdl/elements/originclass.rb', line 640 def freq_align_signal data = freqM if data align_signal(data) else align_signal( 1.11 ) end end |
#freqM ⇒ Object
620 621 622 623 624 625 626 627 628 |
# File 'lib/tdl/elements/originclass.rb', line 620 def freqM if @clock.is_a?(Clock) @clock.freqM elsif @origin_freqM @origin_freqM else nil end end |
#FreqM ⇒ Object
649 650 651 |
# File 'lib/tdl/elements/originclass.rb', line 649 def FreqM() "#{@name}.FreqM".to_nq end |
#intf_def_freqM ⇒ Object
630 631 632 633 634 635 636 637 638 |
# File 'lib/tdl/elements/originclass.rb', line 630 def intf_def_freqM if @clock.is_a?(Clock) @clock.freqM elsif @origin_freqM @origin_freqM else 1.11 end end |
#use_which_freq_when_copy(argv_clock, argv_origin) ⇒ Object
661 662 663 664 665 666 667 668 669 670 671 |
# File 'lib/tdl/elements/originclass.rb', line 661 def use_which_freq_when_copy(argv_clock,argv_origin) if argv_clock == @clock && @clock @origin_freqM elsif argv_clock != @clock && argv_clock.is_a?(Clock) argv_clock.freqM elsif !(argv_clock.is_a?(Clock)) && argv_origin argv_origin else nil end end |